-
Notifications
You must be signed in to change notification settings - Fork 111
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
Bulk saving for metadata and exposing documentation API #314
Conversation
Codecov Report
@@ Coverage Diff @@
## master #314 +/- ##
==========================================
- Coverage 97.62% 97.57% -0.05%
==========================================
Files 42 42
Lines 4377 4454 +77
==========================================
+ Hits 4273 4346 +73
- Misses 104 108 +4
Continue to review full report at Codecov.
|
493d3a7
to
250a27d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zikolach thanks for these additions. As a first set of requested changes:
- Documentation of the Backend API goes on the abstract methods in
base.Backend
. The implementations of these methods onjdbc.JDBCBackend
generally have no docstring, unless they have significant differences in behaviour from the general API which need explanation. See the existing code. - Please update
doc/source/api-backend.rst
to refer to the new methods.
ixmp/core.py
Outdated
---------- | ||
name_or_names : str or list | ||
If the argument is list, it used to remove multiple metadata | ||
entries at once. Otherwise, use the argument |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check wrapping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean as wrapping
e943c98
to
6c37514
Compare
6c37514
to
cdc43f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few minor comments on how to name arguments and on docstrings...
@@ -55,6 +55,8 @@ class Platform: | |||
_backend_direct = [ | |||
'open_db', | |||
'close_db', | |||
'get_doc', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused, is there now a top-level function to get or set docstrings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, methods of backend class which are included into _backend_direct
are exposed directly as methods of Platform
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks for the clarification - how is this rendered in the docs? Is there an example where I can see this already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question! I think it is not available on Platform class documentation.
@khaeru what do you think, can we adjust __doc__
attribute to incorporate those backend methods documentation into Platform docs?
- update jar - add test
- rename parameters - fix docstrings
cdc43f6
to
99404d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @zikolach, looks great! I think it's fine to merge this and tackle the question how backend-functions will be displayed in the docs in a subsequent PR.
@khaeru thanks for suggestions. I moved docstrings to backend base class and added new methods to |
Does this mean these functions will not be included in the Platform docs? If that's the case, I don't think that this is a good strategy... |
It depends on what you mean as Platform docs. These methods docstrings are added to Backend documentation, not to Platform class documentation. |
This reference to the new functions is not understandable to anyone who was not part of this discussion.
It's not obvious how to call these functions - |
See the Sphinx docs:
Sphinx renders the sentence as "The methods If that doesn't suit a particular use case/target user/story, other alternatives are:
|
811cd7c
to
129decc
Compare
Allow to update multiple metadata categories at once.
Important: based on PR iiasa/ixmp_source#290
PR checklist