Skip to content

Commit

Permalink
make release-ready (#161)
Browse files Browse the repository at this point in the history
* update readme

* renamed package

* replaced all occurences of thesimulator with ridepy

* license updated
  • Loading branch information
fxjung authored May 7, 2021
1 parent d5f8901 commit 49082d5
Show file tree
Hide file tree
Showing 90 changed files with 311 additions and 298 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "thesimulator/util/spaces_cython/lru-cache"]
path = thesimulator/util/spaces_cython/lru-cache
[submodule "ridepy/util/spaces_cython/lru-cache"]
path = ridepy/util/spaces_cython/lru-cache
url = https://github.com/goldsborough/lru-cache.git
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 PhysicsOfMobility
Copyright (c) 2021 Debsankha Manik and Felix Jung

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
19 changes: 16 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
|Code style: black|

theSimulator
ridepy
============

Simulates a dispatching algorithm serving exogeneous transportation
Expand Down Expand Up @@ -29,12 +29,25 @@ Installation

.. code:: sh
git clone git@github.com:PhysicsOfMobility/theSimulator.git
cd theSimulator
git clone git@github.com:PhysicsOfMobility/ridepy.git
cd ridepy
pre-commit install
python setup.py develop
pytest
Building the Documentation
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: sh
pip install -r requirements-doc.txt
cd doc
make html
The documentation can then be found at ``doc/_build/html/index.html``.


First Steps
-----------

Expand Down
12 changes: 6 additions & 6 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
import sys

sys.path.insert(0, os.path.abspath("../"))
import thesimulator
import ridepy

# -- Project information -----------------------------------------------------

project = "theSimulator"
project = "ridepy"
copyright = "2021, Felix Jung and Debsankha Manik"
author = "Felix Jung and Debsankha Manik"

Expand Down Expand Up @@ -71,10 +71,10 @@
add_module_names = False
autodoc_typehints = "description"
autodoc_type_aliases = {
"Event": "thesimulator.events.Event",
"RequestEvent": "thesimulator.events.RequestEvent",
"StopEvent": "thesimulator.events.StopEvent",
"SingleVehicleSolution": "thesimulator.data_structures.SingleVehicleSolution",
"Event": "ridepy.events.Event",
"RequestEvent": "ridepy.events.RequestEvent",
"StopEvent": "ridepy.events.StopEvent",
"SingleVehicleSolution": "ridepy.data_structures.SingleVehicleSolution",
}
autodoc_inherit_docstrings = False

Expand Down
4 changes: 2 additions & 2 deletions doc/cython_data_structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This cython module wraps the struct templates exposed from C++ by
`data_structures_cython.pxd` into extension types. Since an extension type
obviously cannot be templated, we will use the :ref:`desc_runtime_dispatch` approach.

.. py:class:: thesimulator.data_structures_cython.LocType
.. py:class:: ridepy.data_structures_cython.LocType
Representing the kind of location objects the simulator supports. either of:

Expand All @@ -16,7 +16,7 @@ obviously cannot be templated, we will use the :ref:`desc_runtime_dispatch` appr
the python version of this enum i.e. `.data_structures.LocType` has to be used.


.. automodule:: thesimulator.data_structures_cython
.. automodule:: ridepy.data_structures_cython
:members: TransportationRequest, InternalRequest, Stop, Stoplist
:special-members: __len__, __getitem__

Expand Down
4 changes: 2 additions & 2 deletions doc/cython_deepdive.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Cython wrapping internals
=========================
Here we will detail the design decisions we made while implementing the core
components of `theSimulator` in cython. Our goals were
components of `ridepy` in cython. Our goals were

* The calling code would require minimal changes while switching from pure python
components to their cython equivalents.
Expand All @@ -14,7 +14,7 @@ why and explain how to extend these components.

Handling different types of location objects
--------------------------------------------
The pure pythonic parts of `theSimulator` can handle simulation runs in any
The pure pythonic parts of `ridepy` can handle simulation runs in any
`.TransportSpace`, e.g. `Euclidean2D`, where location objects are `Tuple[float,
float]` or a `.Graph` where the nodes are arbitrary python objects. It is not
so easy to expose similar functionalities in a cython-wrapped python module.
Expand Down
8 changes: 4 additions & 4 deletions doc/cython_intro.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Overview of the cythonic components
===================================
As we described in :doc:`overview`, theSimulator enables the users to run a
As we described in :doc:`overview`, ridepy enables the users to run a
simulation using either pure pythonic components, or using cythonic
components. Using a :ref:`dispatcher <desc_dispatcher>` implemented in C++ and
exposed to python using cython can dramatically speed up the simulation runs.

In order to make it happen, theSimulator contains C++ implementations of all
In order to make it happen, ridepy contains C++ implementations of all
its components i.e.

* `data_structures`,
Expand All @@ -19,13 +19,13 @@ just change their import statements from

.. code-block:: python
from thesimulator.data_structures import Stop
from ridepy.data_structures import Stop
to

.. code-block:: python
from thesimulator.data_structures_cython import Stop
from ridepy.data_structures_cython import Stop
A concrete example of how to switch from a pure python simulation to a
cythonic simulation is provided in :doc:`overview`.
Expand Down
6 changes: 3 additions & 3 deletions doc/cython_spaces.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ Cython Spaces
Add text describing the inheritance structure, and the need to hold an
union.

.. automodule:: thesimulator.util.spaces_cython
.. automodule:: ridepy.util.spaces_cython
:members: TransportSpace


.. automodule:: thesimulator.util.spaces_cython
.. automodule:: ridepy.util.spaces_cython
:members: TransportSpace, Euclidean2D, Manhattan2D

.. warning::
Add text describing how the graphs can only hold integers as nodes and how
we automatically relabel the nodes.

.. automodule:: thesimulator.util.spaces_cython
.. automodule:: ridepy.util.spaces_cython
:members: Graph


2 changes: 1 addition & 1 deletion doc/cython_vehicle_states.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ but it is not possible to mix pure-python and cython components: If you want to
:doc:`dispatchers<cython_dispatchers>`, then you need to use cythonic
:doc:`data_structures<cython_data_structures>` and :doc:`spaces<cython_spaces>`.

.. autoclass:: thesimulator.vehicle_state_cython.VehicleState
.. autoclass:: ridepy.vehicle_state_cython.VehicleState
:members: fast_forward_time, sudo ddcutil --display 2 setvcp 10 70 # lenovo


Expand Down
12 changes: 6 additions & 6 deletions doc/data_structures.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Data Structures
---------------
.. currentmodule:: thesimulator
.. currentmodule:: ridepy


The module contains the data structures `.FleetState` and `.VehicleState` depend on.
Expand All @@ -11,32 +11,32 @@ The module contains the data structures `.FleetState` and `.VehicleState` depend
Requests
~~~~~~~~

.. automodule:: thesimulator.data_structures
.. automodule:: ridepy.data_structures
:members: Request, TransportationRequest, InternalRequest


LocType
~~~~~~~
.. automodule:: thesimulator.data_structures
.. automodule:: ridepy.data_structures
:members: LocType

Stop and Stoplist
~~~~~~~~~~~~~~~~~

.. automodule:: thesimulator.data_structures
.. automodule:: ridepy.data_structures
:members: Stop, StopAction

The `TransportSpace` and `Dispatcher` interfaces
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: thesimulator.data_structures.TransportSpace
.. autoclass:: ridepy.data_structures.TransportSpace
:members:

.. note::
This is only the abstract base class specifying the *interface*. Actual
`TransportSpace` classes are available in `.util.spaces`.

.. automodule:: thesimulator.data_structures
.. automodule:: ridepy.data_structures
:members: SingleVehicleSolution, Dispatcher


2 changes: 1 addition & 1 deletion doc/dispatchers.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The dispatchers
---------------

.. automodule:: thesimulator.util.dispatchers
.. automodule:: ridepy.util.dispatchers
:members:
2 changes: 1 addition & 1 deletion doc/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ Events
during the simulation run from these events, and if desired, compute metrics,
e.g. the waiting times for the requests and the detours suffered by them.

.. automodule:: thesimulator.events
.. automodule:: ridepy.events
:members:
16 changes: 8 additions & 8 deletions doc/extras.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ included.
Simulations and Parameter Scans
-------------------------------

.. currentmodule:: thesimulator.extras.simulation_set
.. currentmodule:: ridepy.extras.simulation_set

This module allows to configure and execute a set of simulations while varying specific
parameters, i.e. performing a parameter scan. The typical workflow is as follows:
Expand Down Expand Up @@ -86,19 +86,19 @@ filenames of the resulting JSONL/JSON files are also directly available through
`SimulationSet.param_paths` and `SimulationSet.result_paths`.


.. automodule:: thesimulator.extras.simulation_set
.. automodule:: ridepy.extras.simulation_set
:members: SimulationSet

.. automodule:: thesimulator.extras.simulation_set
.. automodule:: ridepy.extras.simulation_set
:members: perform_single_simulation

.. automodule:: thesimulator.extras.simulation_set
.. automodule:: ridepy.extras.simulation_set
:members: simulate_parameter_combinations

JSON IO
-------

.. currentmodule:: thesimulator.extras.io
.. currentmodule:: ridepy.extras.io

This IO module implements functionality for reading and writing to JSON/`JSON Lines`_
format.
Expand Down Expand Up @@ -131,18 +131,18 @@ Later this can e.g. be used as input for the analytics module:
space=read_params_json("params.json")
)
.. automodule:: thesimulator.extras.io
.. automodule:: ridepy.extras.io
:members:

Spaces
------

.. currentmodule:: thesimulator.extras.spaces
.. currentmodule:: ridepy.extras.spaces

This module implements thin convenience wrappers around ``networkx`` to create common
network topologies to be used as transport spaces.

.. automodule:: thesimulator.extras.spaces
.. automodule:: ridepy.extras.spaces
:members:


Expand Down
4 changes: 2 additions & 2 deletions doc/fleet_state.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FleetState
==========
.. currentmodule:: thesimulator.fleet_state
.. currentmodule:: ridepy.fleet_state

The ``FleetState`` class is the core component that a user needs in order to setting up
and running a simulation using theSimulator, as described in :doc:`overview`. Once the
and running a simulation using ridepy, as described in :doc:`overview`. Once the
user creates a ``FleetState`` with the desired number of vehicles of appropriate
capacities and initial positions, a simulation can be run by calling
`FleetState.simulate()`, supplying iterator or requests. The ``FleetState`` advances the
Expand Down
4 changes: 2 additions & 2 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.. theSimulator documentation master file, created by
.. ridepy documentation master file, created by
sphinx-quickstart on Sun Mar 21 12:40:01 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to theSimulator's documentation!
Welcome to ridepy's documentation!
========================================
.. First include the project README
.. include:: ../README.rst
Expand Down
4 changes: 2 additions & 2 deletions doc/introduction.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Introduction
============

theSimulator lets a user specify a `.FleetState` of :math:`n` vehicles with desired
ridepy lets a user specify a `.FleetState` of :math:`n` vehicles with desired
passenger capacities, as well as an ``iterator`` of `.TransportationRequest`
objects, each containing:

Expand Down Expand Up @@ -90,7 +90,7 @@ When the simulation is run,
The dispatcher
--------------
The dispatcher determines which vehicle should service a certain request, and
in which order it should service the requests assigned to it. theSimulator
in which order it should service the requests assigned to it. ridepy
defines a clean interface enabling the users to create their own dispatchers. A
number of predefined ones are available in `.util.dispatchers`.

Expand Down
Loading

0 comments on commit 49082d5

Please sign in to comment.