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

Meta support for model/scenario levels #353

Merged
merged 38 commits into from
Aug 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
8b486c2
Meta: add first dummy methods and tests
fonfon Jul 23, 2020
beecfe6
Meta: rename scenario meta methods
fonfon Jul 23, 2020
e4e5ba1
Meta: add Platform method to get/set meta
fonfon Jul 27, 2020
9f5c59e
Minor changes
zikolach Jul 28, 2020
05e29ee
Update Meta tests
fonfon Jul 29, 2020
24e142c
Update ixmp.jar
zikolach Jul 29, 2020
f602c39
Meta: Implement Platform.remove meta; add tests
fonfon Jul 29, 2020
84d1677
Meta: improve validation of arguments
fonfon Jul 30, 2020
0fc7407
Meta: add tests setting/retrieving booleans
fonfon Jul 30, 2020
41e34ff
Meta: improve implementation, test scenario meta args
fonfon Jul 30, 2020
afe9657
Expose adding model/scenario names
zikolach Jul 30, 2020
db6df29
Meta: add more tests
fonfon Jul 30, 2020
9032806
Create abstract base methods for adding model/scenario
fonfon Jul 30, 2020
3054d37
Add models/scenarios list methods
zikolach Jul 30, 2020
0a48369
Meta: add release notes, update documentation
fonfon Jul 30, 2020
554f5bf
Add wrapping/unwrapping metadata list values + test
zikolach Jul 30, 2020
65b67b2
Remove duplicate set_scenario_meta method
fonfon Jul 30, 2020
5c47c2e
Fix saving mixed metadata + test
zikolach Jul 30, 2020
87681fa
Meta: documentation, release notes, consistent names
fonfon Jul 30, 2020
41e6aec
Meta: parametrize tests; fix Scenario.add_meta bug
fonfon Jul 30, 2020
261efb8
Fix wrapping integer values (in list metadata)
zikolach Jul 31, 2020
c11cdc7
Rename Platform.list_models to .models/.scenarios
fonfon Aug 1, 2020
ce037f3
Meta tests: make constants upper-case
fonfon Aug 1, 2020
f36f77f
Meta: minor doc updates
fonfon Aug 1, 2020
6df062f
Meta: update ixmp.jar, update+add tests
fonfon Aug 6, 2020
9ba12e3
Meta documentation update: valid args
fonfon Aug 6, 2020
7699af5
Updated ixmp.jar
fonfon Aug 6, 2020
832654f
Flake8 fix: unused f-string
fonfon Aug 6, 2020
6205c42
Platform.get_meta: add 'strict' parameter
fonfon Aug 10, 2020
9c03359
Remove calls of get|set|remove_scenario_meta
fonfon Aug 13, 2020
004fa85
Order backend jdbc and base methods.
fonfon Aug 13, 2020
ff03ede
Adapt changed error message.
fonfon Aug 13, 2020
84ffa4a
Rename scenario/model methods
fonfon Aug 13, 2020
1f7cba3
Update documentation.
fonfon Aug 13, 2020
e7c48ee
Fix minor flake8 syntax error.
fonfon Aug 13, 2020
a939e1e
Update release notes and backend test
fonfon Aug 17, 2020
43a45a5
Order backend test methods alphabetically.
fonfon Aug 17, 2020
8f78a8c
Minor release notes adaption.
fonfon Aug 17, 2020
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
12 changes: 12 additions & 0 deletions RELEASE_NOTES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ Next release
All changes
-----------

- :pull:`353`: Add meta functionality.

- :meth:`.Platform.add_model_name` using :meth:`.Backend.add_model_name`
- :meth:`.Platform.add_scenario_name` using :meth:`.Backend.add_scenario_name`
- :meth:`.Platform.get_model_names` using :meth:`.Backend.get_model_names`
- :meth:`.Platform.get_scenario_names` using :meth:`.Backend.get_scenario_names`
- :meth:`.Platform.get_meta` using :meth:`.Backend.get_meta`
- :meth:`.Platform.set_meta` using :meth:`.Backend.set_meta`
- :meth:`.Platform.remove_meta` using :meth:`.Backend.remove_meta`
- :meth:`.Scenario.remove_meta` using :meth:`.Backend.remove_meta`
- deprecate :meth:`.Scenario.delete_meta`

- :pull:`349`: Avoid modifying indexers dictionary in :meth:`.AttrSeries.sel`.
- :pull:`343`: Add region/unit parameters to :meth:`.Platform.export_timeseries_data`.
- :pull:`347`: Preserve dtypes of index columns in :func:`.data_for_quantity`.
Expand Down
3 changes: 2 additions & 1 deletion doc/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ There are a number of guides out there, e.g. on docutils_.
Building the docs locally
-------------------------

Install the dependencies, above.
Install the dependencies, above. Repeat the installation steps to be able to
refer to code that was changed since the initial installation.

From the command line, run::

Expand Down
8 changes: 8 additions & 0 deletions doc/source/api-backend.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,24 @@ Backend API
.. autosummary::
:nosignatures:

add_model_name
add_scenario_name
close_db
get_auth
get_doc
get_log_level
get_meta
get_model_names
get_nodes
get_scenarios
get_scenario_names
get_units
open_db
read_file
remove_meta
set_doc
set_log_level
set_meta
set_node
set_unit
write_file
Expand Down Expand Up @@ -150,6 +157,7 @@ Backend API
item_set_elements
item_index
list_items
remove_meta
set_meta

Methods related to :class:`message_ix.Scenario`:
Expand Down
23 changes: 18 additions & 5 deletions doc/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,24 @@ Platform
set_log_level
units

The methods
:meth:`~.base.Backend.open_db`,
:meth:`~.base.Backend.close_db`,
:meth:`~.base.Backend.get_doc`, and
:meth:`~.base.Backend.set_doc` may also be called via Platform.
The following backend methods are available via Platform too:

.. autosummary::
backend.base.Backend.add_model_name
backend.base.Backend.add_scenario_name
backend.base.Backend.close_db
backend.base.Backend.get_doc
backend.base.Backend.get_meta
backend.base.Backend.get_model_names
backend.base.Backend.get_scenario_names
backend.base.Backend.open_db
backend.base.Backend.remove_meta
backend.base.Backend.set_doc
backend.base.Backend.set_meta

These methods can be called like normal Platform methods, e.g.::

$ platform_instance.close_db()


TimeSeries
Expand Down
Loading