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

include macros functions in rule._function #451

Merged
merged 3 commits into from Sep 9, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions pysb/core.py
Expand Up @@ -191,11 +191,14 @@ def __init__(self, name, _export=True):
mod_name = frame.f_globals.get('__name__', '__unnamed__')
if mod_name in ['IPython.core.interactiveshell', '__main__']:
break
if mod_name not in ['pysb.core', 'pysb.macros'] and not \
if mod_name not in ['pysb.core'] and not \
ortega2247 marked this conversation as resolved.
Show resolved Hide resolved
mod_name.startswith('importlib.'):
self._modules.append(mod_name)
if self._function is None:
self._function = frame.f_code.co_name
if mod_name == 'pysb.macros':
self._function = frame.f_back.f_code.co_name
else:
self._function = frame.f_code.co_name
frame = frame.f_back

def __getstate__(self):
Expand Down