Skip to content

Commit

Permalink
Merge pull request #1 from IPESE/develop_cedric
Browse files Browse the repository at this point in the history
Develop cedric
  • Loading branch information
cterrier24 authored Sep 20, 2024
2 parents 20bafe8 + 828fef7 commit 4474c9f
Show file tree
Hide file tree
Showing 52 changed files with 122,219 additions and 18,444 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,11 @@ reho/data/QBuildings/*
documentation/_build
documentation/sections/_autosummary

# Test
reho/test/data/*
reho/test/figures/*
reho/test/results/*

# Scripts
scripts/*
!scripts/examples/
!scripts/test/
Binary file removed documentation/_static/ipese-square.png
Binary file not shown.
59 changes: 29 additions & 30 deletions documentation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
'sphinx_design',
'sphinx_copybutton',
'nbsphinx']
source_suffix = [".rst", ".md"]
exclude_patterns = ['LICENSE']
# autosummary_generate = True # Turn on sphinx.ext.autosummary

Expand All @@ -49,7 +50,7 @@
'github_url': 'https://github.com/IPESE/REHO',
'header_links_before_dropdown': 7,
'navbar_align': 'left',
"external_links": [{"name": "REHO-fm", "url": "https://ipese-test.epfl.ch/reho-fm/"}],
# "external_links": [{"name": "REHO-fm", "url": "https://ipese-test.epfl.ch/reho-fm/"}],
"icon_links": [{"name": "IPESE",
"url": "https://ipese-web.epfl.ch/ipese-blog/",
"icon": "https://github.com/IPESE/REHO/blob/documentation/documentation/images/logos/ipese_square.png?raw=true",
Expand All @@ -67,34 +68,32 @@

# ------------ Autodoc ------------------------------------
autodoc_member_order = 'bysource'
autodoc_mock_imports = ['amplpy',
'pandas',
'openpyxl',
'numpy',
'scipy',
'scikit-learn',
'scikit-learn-extra',
'sqlalchemy',
'psycopg2',
'geopandas',
'matplotlib',
'plotly',
'kaleido',
'dotenv',
'requests',
'coloredlogs',
'SALib',
'qmcpy',
'pvlib',
'pyproj',
'shapely',
'pytest']
sys.modules['scikit-learn'] = MagicMock()
sys.modules['sklearn'] = MagicMock()
sys.modules['sklearn.metrics'] = MagicMock()
sys.modules['scikit-learn-extra'] = MagicMock()
sys.modules['sklearn_extra'] = MagicMock()
sys.modules['sklearn_extra.cluster'] = MagicMock()
sys.modules['sqlalchemy'] = MagicMock()
autodoc_mock_imports = [
"amplpy",
"ampl_module_base",
"ampl_module_highs",
"coloredlogs",
"geopandas",
"kaleido",
"matplotlib",
"numpy",
"openpyxl",
"pandas<2.0.0",
"plotly",
"psycopg2",
"pvlib",
"pyclustering"
"pyproj",
"python-dotenv",
"pytest",
"qmcpy",
"requests",
"SALib",
"scipy",
"setuptools",
"shapely",
"sqlalchemy",
"urllib3",
]
sys.modules['sqlalchemy.dialects'] = MagicMock()
sys.modules['sqlalchemy.exc'] = MagicMock()
Binary file added documentation/images/performance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified documentation/images/sankey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion documentation/sections/4_Package_structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ Directory for data-related files.
- ``QBuildings/``
- ``SIA/``
- ``skydome/``
- ``weather/``

**model/**
==================
Expand Down
23 changes: 15 additions & 8 deletions documentation/sections/5_Getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Entry points allow to verify the proper intallation of REHO. Select the desired
reho-examples-test
These commands will download files from the ``scripts/test/`` and ``scripts/examples/`` folders from the `repository <https://github.com/IPESE/REHO/tree/main/scripts/examples>`__, copy them locally and execute them.
These commands will download files from the ``reho/test/`` and ``scripts/examples/`` folders from the `repository <https://github.com/IPESE/REHO/tree/main/scripts/examples>`__, copy them locally and execute them.


If your installation is correct, you should:
Expand All @@ -117,6 +117,13 @@ If your installation is correct, you should:

Sankey diagram resulting from a basic REHO single-optimization.

.. figure:: ../images/performance.png
:width: 1000
:align: center
:name: sankey

Economical performance resulting from a REHO multi-objective optimization (Pareto).

From source
------------------

Expand Down Expand Up @@ -181,7 +188,7 @@ Please include a ``venv`` at the project root folder and install dependencies wi
Checking proper installation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Run ``scripts/test/run.py``, ``scripts/test/plot.py`` or any of the files in ``scripts/examples/``.
Run ``reho/test/test_run.py``, ``reho/test/test_plot.py`` or any of the files in ``scripts/examples/``.

If your installation is correct, each run should end with *“Process finished with exit code 0”*.
Some files will also render some results in your web browser and open different tabs showing the outcome of your optimization.
Expand All @@ -193,7 +200,7 @@ Some files will also render some results in your web browser and open different
Git tracking
~~~~~~~~~~~~~

You will also see some files appear in some newly created subfolders such as ``data/clustering/``, ``results/`` and ``figures/``. These are not git-tracked. But all the other Python files in ``scripts/examples/`` and ``scripts/test/`` are git-tracked.
You will also see some files appear in some newly created subfolders such as ``data/clustering/``, ``results/`` and ``figures/``. These are not git-tracked. But all the other Python files in ``scripts/examples/`` are git-tracked.

You should then be careful to not modify the content of these files.

Expand All @@ -203,12 +210,12 @@ However, for your future work and own case-studies with REHO, you can create any
Running REHO
================

The following paragraphs describe the content of ``scripts/test/run.py`` and ``scripts/test/plot.py``. These latter should allow you to get started with the tool and conduct your first optimizations.
The following paragraphs describe the content of ``reho/test/test_run.py`` and ``reho/test/test_plot.py``. These latter should allow you to get started with the tool and conduct your first optimizations.

.. literalinclude:: ../../scripts/test/run.py
.. literalinclude:: ../../reho/test/test_run.py
:language: python

.. literalinclude:: ../../scripts/test/plot.py
.. literalinclude:: ../../reho/test/test_plot.py
:language: python

Set building parameters
Expand Down Expand Up @@ -574,7 +581,7 @@ These results can be saved as a `.pickle` or `.xlsx` file with:

.. code-block:: python
reho.save_results(format=['pickle', 'xlsx'], filename='my_case_study')
reho.save_results(format=['pickle', 'xlsx'], filename='test_results')
Read results
Expand All @@ -584,7 +591,7 @@ Saved results can be accessed with:

.. code-block:: python
results = pd.read_pickle('my_case_study.pickle')
results = pd.read_pickle('test_results.pickle')
And browsing through ``Scn_ID`` and ``Pareto_ID`` with:

Expand Down
Loading

0 comments on commit 4474c9f

Please sign in to comment.