Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Commit

Permalink
style(SPELL): fix spelling errors; fix minor doc/indentations
Browse files Browse the repository at this point in the history
  • Loading branch information
ankostis committed Feb 16, 2020
1 parent 6cee4a3 commit 788dd75
Show file tree
Hide file tree
Showing 24 changed files with 155 additions and 159 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
## TravisCI config
#
git:
depth: 3
depth: 3
language: python
python:
- "3.6"
- "3.7"
# - "3.8-dev" # too slow!
- "3.6"
- "3.7"
# - "3.8-dev" # too slow!
# matrix:
# allow_failures:
# - python: "3.8-dev"
Expand Down
14 changes: 2 additions & 12 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@ The typical development procedure is like this:

.. code-block:: console
$ python setup.py nosetests --with-coverage --cover-package wltp.model,wltp.experiment --cover-min-percentage=80
.. Tip:: You can enter just: ``python setup.py test_all`` instead of the above cmd-line
since it has been *aliased* in the :file:`setup.cfg` file.
Check this file for more example commands to use during development.

$ pytest
4. If you made a rather important modification, update also the :doc:`CHANGES` file and/or
other documents (i.e. README.rst). To see the rendered results of the documents,
Expand All @@ -29,8 +23,6 @@ The typical development procedure is like this:
.. code-block:: console
$ python setup.py build_sphinx # Builds html docs
$ python setup.py build_sphinx -b doctest # Checks if python-code embeded in comments runs ok.
5. If there are no problems, commit your changes with a descriptive message.

Expand All @@ -39,7 +31,5 @@ The typical development procedure is like this:
You can check whether your merge-request indeed passed the tests by checking
its build-status |build-status| on the integration-server's site (TravisCI).

.. Hint:: Skim through the small IPython developer's documentantion on the matter:
.. Hint:: Skim through the small IPython developer's documentation on the matter:
`The perfect pull request <https://github.com/ipython/ipython/wiki/Dev:-The-perfect-pull-request>`_


16 changes: 8 additions & 8 deletions Notebooks/CarsDB-compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def load_accdb_and_python_datasets(veh_nums=None):
v_cols = "v v_orig v_cap v_downscale".split()
c1[v_cols] = vround(c1[v_cols])

## accdb does not oofer `n_max`.(?)
## accdb does not offer `n_max`.(?)
p1["n_max"] = nround1(p1["n_max1 n_max2 n_max3".split()].max(axis=1))

return p1, c1, p2, c2
Expand Down Expand Up @@ -227,7 +227,7 @@ def load_accdb_and_python_datasets(veh_nums=None):

# %% [markdown]
# ## Compare a vehicle from AccDB <-->PyAlgo *interactively*
# **TODO:** collect and hide all this comprarison GUI code below into a python module.
# **TODO:** collect and hide all this comparison GUI code below into a python module.

# %%
case_loaded = [None, None]
Expand All @@ -243,7 +243,7 @@ def _load_interactive_case(

cycle = c2.loc[case_name].dropna(how="all", axis=1).copy()

## Scale each flag into a different value, to plot separatly, and
## Scale each flag into a different value, to plot separately, and
# to plot in the same axis as V
# (bc when plotting flags in `secondary_y`, grid is not working)
#
Expand Down Expand Up @@ -295,7 +295,7 @@ def is_velocity(col):
return l1, l2


def define_schenes():
def define_schemes():
"""Predfined case/pan/zooms of the compraison diagram below."""
return [
## (label, caseno, zoom, pan, *other-UNUSED)
Expand Down Expand Up @@ -453,7 +453,7 @@ def refresh_tabs():

AxisScenes.options = [
(f"{caseno}: {label}", (caseno, zoom, pan, *other))
for label, caseno, zoom, pan, *other in define_schenes()
for label, caseno, zoom, pan, *other in define_schemes()
]
needs_retabbing = False
if out_specs and len(out_specs[0]) < 3:
Expand Down Expand Up @@ -542,7 +542,7 @@ def recreate_fig():
for i in range(3):
fig_nums = plt.get_fignums()
fig = plt.figure(
num='Compare AccDB <--> PyAlgo "Inital Gear"', figsize=(20, 12)
num='Compare AccDB <--> PyAlgo "Initial Gear"', figsize=(20, 12)
)
if fig.number in set(fig_nums):
fig.clear()
Expand Down Expand Up @@ -650,7 +650,7 @@ def plot_gear_flags(
# ax2.grid(True, axis="both", which="both")
ax.grid(True, axis="both", which="both")

# Re-tighten if ax3 has (diss)appeared.
# Re-tighten if ax3 has (dis)appeared.
# Had to use `rect` or axis-title half-hidden the first time fig is created!
fig.tight_layout(rect=[0, 0, 1, 0.985])

Expand Down Expand Up @@ -719,7 +719,7 @@ def is_bad_g2_in_decel_to_stop(accdb, cyc, prop):


# %% [markdown]
# ### Insufficient power where more than one gears are N-valid:
# ### Insufficient power where more than one gears are N-valid:

# %%
def is_more_low_powered_gears(cyc):
Expand Down
4 changes: 2 additions & 2 deletions Notebooks/Cycler.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def flag_aggregates(ok_flags):

max_zoom = 48.0

## Scale each flag into a different value, to plot separatly, and
## Scale each flag into a different value, to plot separately, and
# to plot in the same axis as V
# (bc when plotting flags in `secondary_y`, grid is not working)
#
Expand Down Expand Up @@ -298,7 +298,7 @@ def plot_gear(gear="g2", zoom=48, pan=13.8):


def phase(cond):
return pm._identify_conjecutive_truths((cycle.v > 1) & cond, True).astype(int)
return pm._identify_consecutive_truths((cycle.v > 1) & cond, True).astype(int)


A = (-cycle.v.astype(int)).diff(-1) # GTR's acceleration definition
Expand Down
18 changes: 9 additions & 9 deletions Notebooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ Notebooks for processing UNECE's WLTP reference implementations in Python and MS

RunVehicle.ipynb # sample code to run sample vehicle data
Cycler.ipynb # (WIP) run a vehicle from the h5db, step-by-step.
CarsDB-compare.ipynb # compare results stored h5db with AccDb
CarsDB-compare.ipynb # compare results stored h5db with AccDb
CarsDB-msaccess.ipynb # populate h5db with AccDB test-car input & output
CarsDB-pyalgo.ipynb # populate h5db with results from the old python code
HDF5-APIh-help.ipynb # list usefull HDF5 methods
HDF5-APIh-help.ipynb # list useful HDF5 methods
VMax.ipynb # VMax experiments
Rounding.ipynb # showcase ROUNDING across MSAccess, Python, Matlab & C#
../tests/vehdb.py # support code for reading & validating vehicles from HD5 files
Expand All @@ -40,12 +40,12 @@ Notebooks for processing UNECE's WLTP reference implementations in Python and MS

## HDF5

The 2019 reference implementation is written in `WLTP_GS_calculation_15032019_for_prog_code_subgroup.accdb`
The 2019 reference implementation is written in `WLTP_GS_calculation_15032019_for_prog_code_subgroup.accdb`
*MSAccess* MSAccess database, which facilitates the development & execution of the algorithm
by storing any and all data needed during those phases.

To substitute those facilities i used the *pandas*+*HDF5* file-format to store data,
peristently, across code runs.
persistently, across code runs.

- Help on `pandas` HDF5 facilities: https://pandas.pydata.org/pandas-docs/stable/user_guide/io.html#io-hdf5
- Help on the underlying `tables` library: https://www.pytables.org/
Expand All @@ -59,16 +59,16 @@ peristently, across code runs.
Every `VehData/WltpGS-*.h5` has this structure:

vehicles/
+--v001/ the case (not vehicle_num)
+--v001/ the case (not vehicle_num)
| +--prop (INP/OUT, series) all kv-pairs from input-specs & scalar outputs from accdb
| +--wot (INPUT, df) the wot for the vehicle of the case, index by n
| +--cycle (OUTPUT, df) cycle-run generated by AccDB/Python, etc
| +--override (INP, series) pyalgo must also override these kv-pairs
+...

Only the `VehData/WltpGS-msaccess.h5` contains all `/vehicles/001/{prop,wot,override}`;
the rest contain just `/vehicles/001/{cycle,ospec}`, since they reuse `prop` & `wot`
from *msaccess to produce their outputs.
Only the `VehData/WltpGS-msaccess.h5` contains all `/vehicles/001/{prop,wot,override}`;
the rest contain just `/vehicles/001/{cycle,ospec}`, since they reuse `prop` & `wot`
from *msaccess to produce their outputs.


## Install and launch the *notebooks*
Expand Down Expand Up @@ -106,7 +106,7 @@ Reproduce the *exact same* conda-env that will be called *jupyter*::
> pip install blackcellmagic nb-black columnize
>
> **Note (to the maintainer):**
> Maintain the env-file by running this terminal command after any programm (un)install::
> Maintain the env-file by running this terminal command after any program (un)install::
>
> conda env export -n jupyter | grep -vE 'nodejs|m2-' > conda/environment.yaml
Expand Down
34 changes: 17 additions & 17 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Quick-start

Prerequisites:
^^^^^^^^^^^^^^
**Python-3.6+** is required and **Pytrhon-3.7** recommended.
**Python-3.6+** is required and **Python-3.7** recommended.
It requires **numpy/scipy** and **pandas** libraries with native backends.

.. Tip::
Expand Down Expand Up @@ -122,10 +122,10 @@ From within the project directory, run one of these commands to install it:
.. code-block:: bash
$ wltp --version
1.0.0.dev12
...
$ wltp --help
...
...
See: :ref:`wltp-usage`
Expand Down Expand Up @@ -199,10 +199,10 @@ The files and folders of the project are listed below (see also :ref:`architectu
| +--datamodel # schemas & defaults for data of algo
| +--cycler # code for generating the cycle
| +--engine # formulae for engine power & revolutions and gear-box
| +--vehicle # formulae for cyle/vehicle dynamics
| +--vehicle # formulae for cycle/vehicle dynamics
| +--vmax # formulae estimating `v_max` from wot
| +--downscale # formulae downscaling cycles based on pmr/test_mass ratio
| +--invariants # definitions & idenmpotent formulae for physics/engineering
| +--invariants # definitions & idempotent formulae for physics/engineering
| +--io # utilities for starting-up, parsing, naming and spitting data
| +--utils # software utils unrelated to physics or engineering
| +--cli # (OUTDATED) command-line entry-point for launching this wltp tool
Expand All @@ -211,7 +211,7 @@ The files and folders of the project are listed below (see also :ref:`architectu
+--tests/ # (package) Test-TestCases
+--vehdb # Utils for manipulating h5db with accdb & pyalgo cases.
+--docs/ # (folder) documentation
| +--pyplots/ # (DEPRECATED by notebooks) scripts plotting the metric diagrams embeded in the README
| +--pyplots/ # (DEPRECATED by notebooks) scripts plotting the metric diagrams embedded in the README
+--Notebooks/ # Jupyter notebooks for running & comparing results (see `Notebooks/README.md`)
+--AccDB_src/ # AccDB code & queries extracted and stored as text
+--setup.py # (script) The entry point for `setuptools`, installing, testing, etc
Expand Down Expand Up @@ -245,13 +245,13 @@ try to import the project to check its version:


.. Tip:
The use :command:`ipython` is preffered over :command:`python` since it offers various user-friendly
The use :command:`ipython` is preferred over :command:`python` since it offers various user-friendly
facilities, such as pressing :kbd:`Tab` for completions, or allowing you to suffix commands with ``?`` or ``??``
to get help and read their source-code.
Additionally you can <b>copy any python commands starting with ``>>>`` and ``...``</b> and copy paste them directly
into the ipython interpreter; it will remove these prefixes.
But in :command:`python` you have to remove it youself.
But in :command:`python` you have to remove it yourself.
If everything works, create the :term:`datamodel` of the experiment.
You can assemble the model-tree by the use of:
Expand All @@ -277,7 +277,7 @@ For instance:
... "p_rated": 100,
... "n_rated": 5450,
... "n_idle": 950,
... "n_min": None, ## Manufacturers my overridde it
... "n_min": None, ## Manufacturers my override it
... "gear_ratios": [120.5, 75, 50, 43, 37, 32],
... "f0": 100,
... "f1": 0.5,
Expand Down Expand Up @@ -474,7 +474,7 @@ All the above commands creates two files:
:alt: Screenshot of the `wltp_excel_runner.xlsm` file.

After opening it the first tie, enable the macros on the workbook, select the python-code at the left and click
the :menuselection:`Run Selection as Pyhon` button; one sheet per vehicle should be created.
the :menuselection:`Run Selection as Python` button; one sheet per vehicle should be created.

The excel-file contains additionally appropriate *VBA* modules allowing you to invoke *Python code*
present in *selected cells* with a click of a button, and python-functions declared in the python-script, below,
Expand Down Expand Up @@ -531,7 +531,7 @@ Data Structures:
Computations are vectorial, based on `hierarchical dataframes
<https://pandas.pydata.org/pandas-docs/stable/user_guide/advanced.html>`_,
all of them stored in a single structure, the `datamodel`.
In case the computation breaks, you can still retrive all intermediate results
In case the computation breaks, you can still retrieve all intermediate results
till that point.

.. TODO::
Expand Down Expand Up @@ -689,7 +689,7 @@ identified back by :func:`wltp.cycles.identify_cycle_v_crc`:
======= ========= ===== ====== ==== ==== ==== ==== ======== ===========
\ CRC32 SUM
------------------ ------------------------------------- ---------------------
\ by_phase cummulative by_phase cummulative
\ by_phase cumulative by_phase cumulative
------------------ ------------------- ---------------- -------- -----------
*class* *part* *V* *A0* *A1* *V* *A0* *A1* *V* *V*
======= ========= ===== ====== ==== ==== ==== ==== ======== ===========
Expand Down Expand Up @@ -743,7 +743,7 @@ The typical development procedure is like this:
.. code-block:: shell
python setup.py build_sphinx # Builds html docs
python setup.py build_sphinx -b doctest # Checks if python-code embeded in comments runs ok.
python setup.py build_sphinx -b doctest # Checks if python-code embedded in comments runs ok.
5. If there are no problems, commit your changes with a descriptive message.

Expand All @@ -752,7 +752,7 @@ The typical development procedure is like this:
You can check whether your merge-request indeed passed the tests by checking
its build-status |travis-status| on the integration-server's site (TravisCI).

.. Hint:: Skim through the small IPython developer's documentantion on the matter:
.. Hint:: Skim through the small IPython developer's documentation on the matter:
`The perfect pull request <https://github.com/ipython/ipython/wiki/Dev:-The-perfect-pull-request>`_


Expand Down Expand Up @@ -858,7 +858,7 @@ See also :ref:`architecture:Architecture`.

sphinx
The text-oriented language, a superset of `Restructured Text <https://en.wikipedia.org/wiki/ReStructuredText>`_,
used to write the documentation for this project, with simlar capabilities to *LaTeX*,
used to write the documentation for this project, with similar capabilities to *LaTeX*,
but for humans, e.g., the Linux kernel adopted this textual format on 2016.
http://sphinx-doc.org/

Expand All @@ -871,7 +871,7 @@ See also :ref:`architecture:Architecture`.
depending on context.

A *Jupyter Notebook* document is composed of an ordered list of input/output *cells*
which contain code in variou languages, text (using Markdown), mathematics, plots and
which contain code in various languages, text (using Markdown), mathematics, plots and
rich media, usually ending with the ".ipynb" extension.

.. _begin-replacements:
Expand Down Expand Up @@ -904,7 +904,7 @@ See also :ref:`architecture:Architecture`.
:target: https://travis-ci.org/JRCSTU/wltp/builds

.. |appveyor-status| image:: https://ci.appveyor.com/api/projects/status/0e2dcudyuku1w1gd?svg=true
:alt: Apveyor continuous integration testing ok? (Windows)
:alt: Appveyor continuous integration testing ok? (Windows)
:scale: 100%
:target: https://ci.appveyor.com/project/JRCSTU/wltp

Expand Down
2 changes: 1 addition & 1 deletion datatree.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,5 @@
/wot/p_resist
/wot/sign_p_remain_stable
/wot/v
/wot/zero_crosings
/wot/zero_crossings
/wots_vmax
Loading

0 comments on commit 788dd75

Please sign in to comment.