Skip to content

Typo and partial fixes to Issue 426 #427

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 3 commits into from
Sep 9, 2020
Merged

Conversation

dilawar
Copy link
Contributor

@dilawar dilawar commented Sep 9, 2020

>>> a = moose.Stoich('a')
>>> moose.getFieldNames(a)    # available before
>>> a.getFieldNames()               # added in this PR

Dilawar Singh added 2 commits September 9, 2020 10:52
Both are equivalent

>>> a = moose.Stoich('a')
>>> v1 = moose.getFieldNames(a, 'value')
>>> v2 = a.getFieldNames('value')
>>> assert v1 == v2

If not argument is passed to `getFieldNames`, it returns are field
types.
@hrani
Copy link
Contributor

hrani commented Sep 9, 2020

latest git commit 954f6ea

moose.loadModel('~/moose-examples/genesis/EGFR_MAPK_58.g','/k',"gsl")
Solver is added to model path /k with gsl solver

st = moose.element('/k/kinetics/stoich')
st.getFieldNames()
KeyError Traceback (most recent call last)
in
----> 1 st.getFieldNames()
KeyError: "getFieldNames is not found on '/k[0]/kinetics[0]/stoich[0]'."


moose.getFieldNames(st)
TypeError Traceback (most recent call last)
in
----> 1 moose.getFieldNames(st)

~/MOOSE/moose-core/python/moose/init.py in getFieldNames(classname, fieldtype)
322 Names of the fields of type finfoType in class className.
323 """
--> 324 return _moose.getFieldNames(classname, fieldtype)
TypeError: getFieldNames(): incompatible function arguments. The following argument types are supported:
1. (arg0: str, arg1: str) -> List[str]

Invoked with: <moose.Stoich id=639 dataIndex=0 path=/k[0]/kinetics[0]/stoich[0]>, '*'

moose.getFieldNames(st,'value')


TypeError Traceback (most recent call last)
in
----> 1 moose.getFieldNames(st,'value')

~/MOOSE/moose-core/python/moose/init.py in getFieldNames(classname, fieldtype)
322 Names of the fields of type finfoType in class className.
323 """
--> 324 return _moose.getFieldNames(classname, fieldtype)
325
326

TypeError: getFieldNames(): incompatible function arguments. The following argument types are supported:
1. (arg0: str, arg1: str) -> List[str]

Invoked with: <moose.Stoich id=639 dataIndex=0 path=/k[0]/kinetics[0]/stoich[0]>, 'value'

However with this present PR, getFieldNames are working

@hrani hrani merged commit c286653 into BhallaLab:master Sep 9, 2020
@dilawar dilawar deleted the issue_426 branch September 10, 2020 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants