-
Notifications
You must be signed in to change notification settings - Fork 35
Feat/document pynml #115
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
Merged
Merged
Feat/document pynml #115
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BREAKING CHANGE: changes the signature of the function, but only removes a default argument that wasn't much used anyway.
BREAKING CHANGE: changes function signature, but the argument was a default one and rarely used.
|
@pgleeson : this includes two minor changes to function signatures---I've removed the commit cb3a7e7f504a869ce1929948b818f0ae9e87440d
Author: Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com>
Date: Wed Jul 7 11:55:36 2021 +0100
refactor(pynml): remove unused default argument
BREAKING CHANGE: changes function signature, but the argument was a
default one and rarely used.
diff --git a/pyneuroml/pynml.py b/pyneuroml/pynml.py
index b0e7a4d..50952e1 100644
--- a/pyneuroml/pynml.py
+++ b/pyneuroml/pynml.py
@@ -390,13 +390,12 @@ def convert_to_units(nml2_quantity, unit):
return new_value
-def generate_nmlgraph(nml2_file_name, level=1, engine='dot', verbose_generate=True):
+def generate_nmlgraph(nml2_file_name, level=1, engine='dot'):
"""Generate NeuroML graph.
:nml2_file_name (string): NML file to parse
:level (string): level of graph to generate (default: '1')
:engine (string): graph engine to use (default: 'dot')
- :verbose_generate (boolean): output verbosity
"""
from neuromllite.GraphVizHandler import GraphVizHandler
commit 48e160055f24a46c8f44153eebfdfd2b531ea4a9
Author: Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com>
Date: Wed Jul 7 11:51:19 2021 +0100
refactor(pynml): removes unneeded verbose argument
BREAKING CHANGE: changes the signature of the function, but only removes
a default argument that wasn't much used anyway.
diff --git a/pyneuroml/pynml.py b/pyneuroml/pynml.py
index de152d7..3be8c78 100644
--- a/pyneuroml/pynml.py
+++ b/pyneuroml/pynml.py
@@ -357,8 +357,8 @@ def get_value_in_si(nml2_quantity):
return si_value
-def convert_to_units(nml2_quantity, unit, verbose=DEFAULTS['v']):
- # type: (str, str, bool) -> float
+def convert_to_units(nml2_quantity, unit):
+ # type: (str, str) -> float
"""Convert a NeuroML2 quantity to provided unit.
:param nml2_quantity: NeuroML2 quantity to convert
@@ -382,11 +382,10 @@ def convert_to_units(nml2_quantity, unit, verbose=DEFAULTS['v']):
new_value = si_value / (un.scale * pow(10, un.power)) - un.offset
if not un.dimension == dim:
raise Exception(
- "Cannot convert {} to {}. Dimensions of units ({}/{}) do not match!".format(
- nml2_quantity, unit, dim, un.dimension))
+ "Cannot convert {} to {}. Dimensions of units ({}/{}) do not match!".format(nml2_quantity, unit, dim, un.dimension))
- logger.debug("Converting {} {} to {}: {} ({} in SI units)".format(
- m, u, unit, new_value, si_value), verbose)
+ logger.info("Converting {} {} to {}: {} ({} in SI units)".format(
+ m, u, unit, new_value, si_value))
return new_value
|
Otherwise it doesn't pick up the docs from the source directory---it tries to find the globally installed package etc.
This is necessary for rst to think of these as nested lists. Reference: https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#bullet-lists
Forgot to add a `:` in some places
Let's hope that covers them all.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C: docs
Documentation related
S: ready for review
Status: ready for review
T: enhancement
Type: enhancement
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Documents and adds type annotations to all functions in
pynml.py. Now that we do have rtd set up, the documentation for these was lacking.