Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion docs/source/python/python_packages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,23 @@ For development of code use this command instead

This command allows you to work on the code without having to reinstall the package after a change. It also installs all additional dependencies required for development and maintenance.

.. dropdown:: :fa:`gears` Build files for skbuild

The simulaion and generation packages use skbuild to compile python bindings or parts of the C++ library.
By default, the cmake build files are put into ``pycode/build/memilio-{package_name}`` to save on time during
package development. If you get unexpected cmake errors, you can try and delete the respective build directory. If
you do not want to store the build files at all, you can remove the ``build_dir`` entry from the section
``[tool.scikit-build]`` in the ``pyproject.toml``. Then skbuild will use a temporary directory instead.

Testing
-------

Each package provides a test suite under ``pycode/memilio-{package_name}/memilio/{package_name}_test``.
Each package provides a test suite under ``pycode/memilio-{package_name}/tests``.
To run the tests, simply use the following command inside the package folder after installation:

.. code-block:: console

cd tests
python -m unittest

Coverage Report
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ def run(self, num_days_sim, num_runs=10, save_graph=True, create_gif=True):
os.makedirs(path_graph)
osecir.write_graph(graph, path_graph)

study = osecir.ParameterStudy(
study = osecir.GraphParameterStudy(
graph, 0., num_days_sim, 0.5, num_runs)
ensemble = study.run()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ def run(self, num_days_sim, num_runs=10, save_graph=True, create_gif=True):
os.makedirs(path_graph)
osecirvvs.write_graph(graph, path_graph)

study = osecirvvs.ParameterStudy(
study = osecirvvs.GraphParameterStudy(
graph, 0., num_days_sim, 0.5, num_runs)
ensemble = study.run(self.high)

Expand Down
2 changes: 1 addition & 1 deletion pycode/examples/simulation/mobility_parameter_study.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def handle_result(graph, run_idx):

t0 = 0
tmax = 50
study = osecir.ParameterStudy(graph, t0, tmax, dt=1.0, num_runs=3)
study = osecir.GraphParameterStudy(graph, t0, tmax, dt=1.0, num_runs=3)
study.run(handle_result)


Expand Down
3 changes: 2 additions & 1 deletion pycode/examples/simulation/ode_secir_parameter_study.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ def handle_result(graph, run_idx):
graph.add_edge(0, 1, mobility_coefficients)
graph.add_edge(1, 0, mobility_coefficients)

study = osecir.ParameterStudy(graph, t0=0, tmax=10, dt=0.5, num_runs=3)
study = osecir.GraphParameterStudy(
Comment thread
reneSchm marked this conversation as resolved.
graph, t0=0, tmax=10, dt=0.5, num_runs=3)
study.run(handle_result)


Expand Down
1 change: 1 addition & 0 deletions pycode/memilio-generation/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Team = "https://memilio.readthedocs.io/en/latest/team.html"
[tool.scikit-build]
cmake.version = ">=3.13"
wheel.packages = ["memilio"]
build-dir = "../build/memilio-generation"
Comment thread
MaxBetzDLR marked this conversation as resolved.

[tool.setuptools]
include-package-data = true
Expand Down
1 change: 1 addition & 0 deletions pycode/memilio-simulation/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ cmake.version = ">=3.13"
cmake.args = ["-DMEMILIO_BUILD_SHARED_LIBS:BOOL=ON"]
wheel.packages = ["memilio"]
wheel.install-dir = "memilio/simulation"
build-dir = "../build/memilio-simulation"