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

Modeling Toolking global method error when placed inside a function #8

Open
nkalauni opened this issue Sep 21, 2023 · 1 comment
Open

Comments

@nkalauni
Copy link
Owner

Attempting to modularize code by placing unique features of model inside a function and returning model equations, variables and parameters. Plan is to do this for all models inside src/models and run them from the src/models/Models.jl file. First attempt done to ColleRiverBasin1.jl gives the following error:

LoadError: syntax: Global method definition around .julia/packages/Symbolics/rvztO/src/register.jl:91 needs to be placed at the top level, or use "eval".
Stacktrace:
[1] top-level scope
@ /src/models/CollieRiverBasin1.jl:7
in expression starting at /src/models/CollieRiverBasin1.jl:7
in expression starting at /src/models/Models.jl:1

@nkalauni
Copy link
Owner Author

Apparently it is possible to use MTK.jl without imploying the macros as mentioned in the docs (Final section: notes and pointers). I could not find the "separate tutorial" mentioned here. If the macros are what are causing the problem, it could be of help.

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

No branches or pull requests

1 participant