SDXorg / pysd

System Dynamics Modeling in Python
http://pysd.readthedocs.org/
MIT License
350 stars 89 forks source link

Skip reality checks during translation #394

Closed rogersamso closed 1 year ago

rogersamso commented 1 year ago

Description

Reality checks may be included in Vensim models, which are NOT executed during simulation.

Currently, PySD is not able to parse these expressions, which have the following form:

With this PR, we prevent PySD from crashing when it finds these expressions.

Reality checks will not be included in the translated model, as they may be run using currently existing PySD functionality.

Type of change

PR verification (to be filled by reviewers)

enekomartinmartinez commented 1 year ago

Hi @rogersamso thank you for opening the PR

Could you please add the # pragma: no cover in the new str methods to avoid counting them for coverage?

Could you also move the new test model to the test-models repo and include it there with the canonical output when running it with Vensim ( in the regular way, not using reality checks)?

enekomartinmartinez commented 1 year ago

@rogersamso can you please create a new What's New section in documentation with the new features? and also update package version to 3.9.0?

rogersamso commented 1 year ago

@enekomartinmartinez I think this one is ready. I will now add more tests for #390. Will you want to make #390 v3.9.1? Or what's your plan?

enekomartinmartinez commented 1 year ago

Hi, thanks @rogersamso No, the idea is to merge both in dev-3.9.0 and be all the new features part of the new release.

As soon as I merge it in the dev branch I would ask you to merge that branch to the other branch where you are working and update the what's new there.

enekomartinmartinez commented 1 year ago

@rogersamso I have made some small fixes, as soon as the tests pass I will merge it! :)