Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing ci missing api doc #47

Merged
merged 5 commits into from
Jul 18, 2023
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
22 changes: 20 additions & 2 deletions doc/source/api_reference/hdf5_handler.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
.. _api_reference.hdf5_handler:

============
==============
Hdf5 handler
============
==============

.. currentmodule:: smash.tools.hdf5_handler

Some functions to manipulate hdf5 files
***************************************
.. autosummary::
:toctree: smash/

open_hdf5
add_hdf5_sub_group
_dump_object_to_hdf5_from_list_attribute
_dump_object_to_hdf5_from_dict_attribute
_dump_object_to_hdf5_from_str_attribute
_dump_object_to_hdf5_from_iteratable
_dump_dict_to_hdf5
inoelloc marked this conversation as resolved.
Show resolved Hide resolved
save_dict_to_hdf5
save_object_to_hdf5
read_hdf5_as_dict
22 changes: 19 additions & 3 deletions doc/source/api_reference/hdf5_io.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
.. _api_reference.hdf5_io:

=======
Hdf5 io
=======
==============
Smash Hdf5 I/O
==============

.. currentmodule:: smash.io.hdf5_io

Functions to handle input/output hdf5 of smash model
****************************************************
.. autosummary::
:toctree: smash/

save_smash_model_to_hdf5
load_hdf5_file
generate_smash_object_structure
read_hdf5_to_model_object
_generate_light_smash_object_structure
_generate_medium_smash_object_structure
_generate_full_smash_object_structure
_parse_hdf5_to_derived_type
inoelloc marked this conversation as resolved.
Show resolved Hide resolved
10 changes: 10 additions & 0 deletions doc/source/api_reference/object_handler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,13 @@
==============
Object handler
==============

.. currentmodule:: smash.tools.object_handler

Some functions to manipulate python objects
*******************************************
.. autosummary::
:toctree: smash/

generate_object_structure
read_object_as_dict
47 changes: 47 additions & 0 deletions doc/source/release/0.5.1-notes.rst
inoelloc marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.. _release.0.5.1-notes:

.. currentmodule:: smash

=========================
smash 0.5.1 Release Notes
=========================

The smash 0.5.1 fix bugs and clarify the documentation.

------------
Contributors
------------

This release was made possible thanks to the contributions of:

- Maxime Jay-Allemand
- Ngo Nghi Truyen Huynh
- François Colleoni

------------
Deprecations
------------

------------
Improvements
------------

Missing documentation API for functions hdf5_handler, hdf5_io and object_handler
********************************************************************************

The documentation API was missing for the new functions for reading and writting hdf5 files added in release 0.5.0. This has been corrected. `#46 <https://github.com/DassHydro-dev/smash/issues/46`

------------
New Features
------------

-----
Fixes
-----

Missing interception parameters ci in constant parameters
*********************************************************

Ci was missing in the parameter constant list and can't be saved and post processed or retrieved at all. This is fixed now. `#46 <https://github.com/DassHydro-dev/smash/issues/45`


1 change: 1 addition & 0 deletions doc/source/release/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Release notes
.. toctree::
:maxdepth: 3

0.5.1 <0.5.1-notes>
0.5.0 <0.5.0-notes>
0.4.2 <0.4.2-notes>
0.4.1 <0.4.1-notes>
Expand Down
4 changes: 2 additions & 2 deletions smash/core/_constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

STRUCTURE_PARAMETERS = {
"gr-a": ["cp", "cft", "exc", "lr"],
"gr-b": ["cp", "cft", "exc", "lr"],
"gr-c": ["cp", "cft", "cst", "exc", "lr"],
"gr-b": ["ci", "cp", "cft", "exc", "lr"],
"gr-c": ["ci", "cp", "cft", "cst", "exc", "lr"],
"gr-d": ["cp", "cft", "lr"],
"vic-a": ["b", "cusl1", "cusl2", "clsl", "ks", "ds", "dsm", "ws", "lr"],
}
Expand Down
5 changes: 4 additions & 1 deletion smash/core/simulation/_standardize.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
WGAUGE_ALIAS,
STRUCTURE_PARAMETERS,
STRUCTURE_STATES,
STRUCTURE_ADJUST_CI,
JOBS_FUN,
JREG_FUN,
AUTO_WJREG,
Expand Down Expand Up @@ -120,7 +121,9 @@ def _standardize_control_vector(
) -> np.ndarray:
if control_vector is None:
control_vector = np.array(STRUCTURE_PARAMETERS[setup.structure])

if STRUCTURE_ADJUST_CI[setup.structure]:
if "ci" in control_vector:
control_vector.remove("ci")
else:
if isinstance(control_vector, str):
control_vector = np.array(control_vector, ndmin=1)
Expand Down
4 changes: 2 additions & 2 deletions smash/tests/core/test_constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def test_structure_parameters():
assert STRUCTURE_PARAMETERS["gr-a"] == ["cp", "cft", "exc", "lr"]

# % Check parameters gr-b
assert STRUCTURE_PARAMETERS["gr-b"] == ["cp", "cft", "exc", "lr"]
assert STRUCTURE_PARAMETERS["gr-b"] == ["ci", "cp", "cft", "exc", "lr"]

# % Check parameters gr-c
assert STRUCTURE_PARAMETERS["gr-c"] == ["cp", "cft", "cst", "exc", "lr"]
assert STRUCTURE_PARAMETERS["gr-c"] == ["ci", "cp", "cft", "cst", "exc", "lr"]

# % Check parameters gr-d
assert STRUCTURE_PARAMETERS["gr-d"] == ["cp", "cft", "lr"]
Expand Down