diff --git a/carculator_truck/driving_cycles.py b/carculator_truck/driving_cycles.py index 0050c5b..6e92344 100644 --- a/carculator_truck/driving_cycles.py +++ b/carculator_truck/driving_cycles.py @@ -3,6 +3,13 @@ def get_driving_cycle(size: list, name: str) -> np.ndarray: + """ + Get driving cycle. + + :param size: List of vehicle sizes. + :param name: The name of the driving cycle. + :return: :meth:`ndarray` object + """ return get_standard_driving_cycle_and_gradient( vehicle_type="truck", vehicle_sizes=size, @@ -11,6 +18,13 @@ def get_driving_cycle(size: list, name: str) -> np.ndarray: def get_road_gradient(size: list, name: str) -> np.ndarray: + """ + Get road gradient data. + + :param size: List of vehicle sizes. + :param name: The name of the driving cycle. + :return: :meth:`ndarray` object + """ return get_standard_driving_cycle_and_gradient( vehicle_type="truck", vehicle_sizes=size, diff --git a/docs/_static/resources/examples.zip b/docs/_static/resources/examples.zip index 9528cdd..16a2366 100644 Binary files a/docs/_static/resources/examples.zip and b/docs/_static/resources/examples.zip differ diff --git a/docs/structure.rst b/docs/structure.rst index e0843ee..e67130f 100644 --- a/docs/structure.rst +++ b/docs/structure.rst @@ -1,14 +1,16 @@ +.. _structure: + Structure ========= -.. image:: https://github.com/romainsacchi/carculator/raw/master/docs/coarse.png +.. image:: https://github.com/romainsacchi/carculator/blob/master/docs/_static/img/coarse.png?raw=true :width: 900 :alt: Alternative text Modules ------- -Composed of eight modules to build the car models: +Composed of eight modules to build the truck models: * Driving cycle module * Mass module @@ -24,31 +26,31 @@ Additionally, three modules are used to: * configure energy systems for the background model (background systems module) * build and solve the life cycle inventory of cars (inventory module) * export the life cycle inventory of cars (export module) - + Driving cycle module -------------------- -.. image:: https://github.com/romainsacchi/carculator/raw/master/docs/driving_cycle.png +.. image:: https://github.com/romainsacchi/carculator/blob/master/docs/_static/img/driving_cycle.png?raw=true :width: 400 :alt: Alternative text - + Mass module ----------- -.. image:: https://github.com/romainsacchi/carculator/raw/master/docs/mass_module.png +.. image:: https://github.com/romainsacchi/carculator/blob/master/docs/_static/img/mass_module.png?raw=true :width: 900 :alt: Alternative text - + Auxiliary energy module ----------------------- -.. image:: https://github.com/romainsacchi/carculator/raw/master/docs/aux_energy.png +.. image:: https://github.com/romainsacchi/carculator/blob/master/docs/_static/img/aux_energy.png?raw=true :width: 900 :alt: Alternative text - + Motive energy module -------------------- -.. image:: https://github.com/romainsacchi/carculator/raw/master/docs/motive_energy.png +.. image:: https://github.com/romainsacchi/carculator/blob/master/docs/_static/img/motive_energy.png?raw=true :width: 900 :alt: Alternative text diff --git a/docs/usage.rst b/docs/usage.rst index 07db7eb..b315b5b 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -1,6 +1,6 @@ .. _usage: -Using Carculator truck +Using Carculator Truck ====================== Static vs. Stochastic mode @@ -8,7 +8,8 @@ Static vs. Stochastic mode .. note:: - Many examples are given in this `notebook `_ which you can run directly on your computer. + Many examples are given in this :download:`examples.zip file <_static/resources/examples.zip>` which contains a Jupyter notebook + you can run directly on your computer. The inventories can be calculated using the most likely value of the given input parameters ("static" mode), but also using randomly-generated values based on a probability distribution for those ("stochastic" mode). diff --git a/docs/validity.rst b/docs/validity.rst index a8aa065..ed6a9f8 100644 --- a/docs/validity.rst +++ b/docs/validity.rst @@ -1,3 +1,5 @@ +.. _validity: + Validity tests ============== @@ -46,7 +48,7 @@ Manually, such parameters can be obtained the following way: acceleration = np.zeros_like(velocity) acceleration[1:-1] = (velocity[2:] - velocity[:-2])/2 -Using `carculator`, these parameters can be obtained the following way: +Using ``carculator``, these parameters can be obtained the following way: .. code-block:: python @@ -84,7 +86,9 @@ And the acceleration returned by carculator should equal the values given by the True -Which can be also be verified visually:: +Which can be also be verified visually: + +.. code-block:: python plt.plot(driving_cycle['m/s²'].values, label='UNECE') plt.plot(acceleration, label='Manually calculated') @@ -95,9 +99,10 @@ Which can be also be verified visually:: plt.savefig('comparison_driving_cycle.png') plt.show() -.. image:: https://github.com/romainsacchi/carculator/raw/master/docs/comparison_driving_cycle.png +.. image:: https://github.com/romainsacchi/carculator/blob/master/docs/_static/img/comparison_driving_cycle.png?raw=true :width: 400 - :alt: Alternative text + :alt: Comparison driving cycle + :align: center Car and components masses ------------------------- @@ -142,9 +147,10 @@ However, most of the driving mass is explained by the curb mass: parameter=['total cargo mass', 'curb mass']).values).tolist(), labels=['Total cargo mass', 'Curb mass']) plt.show() -.. image:: https://github.com/romainsacchi/carculator/raw/master/docs/pie_total_mass.png +.. image:: https://github.com/romainsacchi/carculator/blob/master/docs/_static/img/pie_total_mass.png?raw=true :width: 400 - :alt: Alternative text + :alt: Pie Total Mass + :align: center Here is a split between the components making up for the curb mass. One can see that, in the case of a battery electric SUV, most of the weight comes from the glider as well as the battery cells. @@ -204,10 +210,10 @@ On an equivalent diesel powertrain, the mass of the glider base is comparatively plt.subplots_adjust(wspace=1) plt.show() -.. image:: https://github.com/romainsacchi/carculator/raw/master/docs/pie_mass_components.png +.. image:: https://github.com/romainsacchi/carculator/blob/master/docs/_static/img/pie_mass_components.png?raw=true :width: 900 - :alt: Alternative text - + :alt: Pie Mass Components + :align: center The `curb mass` returned by ``carculator`` for the year 2010 and 2020 is further calibrated against manufacturers' data, per vehicle size class and powertrain technology. @@ -215,6 +221,7 @@ For example, we use the car database `Car2db `_ and load al The same exercise is done with vehicles between 2008 and 2012 to calibrate the curb mass of given by carculator for vehicles in 2010. -.. image:: https://github.com/romainsacchi/carculator/raw/master/docs/mass_comparison.png +.. image:: https://github.com/romainsacchi/carculator/blob/master/docs/_static/img/mass_comparison.png?raw=true :width: 900 - :alt: Alternative text \ No newline at end of file + :alt: Mass Comparison + :align: center \ No newline at end of file