Skip to content

Feature/45 reset #47

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
Feb 14, 2020
Merged

Feature/45 reset #47

merged 3 commits into from
Feb 14, 2020

Conversation

markaren
Copy link
Member

@markaren markaren commented Feb 14, 2020

Closes #45

@markaren markaren requested a review from fcollonval February 14, 2020 09:16
@markaren
Copy link
Member Author

markaren commented Feb 14, 2020

We should probably consider changing the function definitions for

    def _get_fmu_state(self) -> Dict[int, Any]:
    def _set_fmu_state(self, state: Dict[int, Any]):

To use str as key, this way users may override _get_fmu_state adding custom properties to it.

@markaren
Copy link
Member Author

Dammit, I went about this in the wrong way. We could just re-instantiate the Python code as a whole. That would guarantee correct behavior..

@markaren
Copy link
Member Author

markaren commented Feb 14, 2020

Good to go. Works with integration test and FMI4j.

Copy link
Collaborator

@fcollonval fcollonval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the Python class definition won't change, I would recommend storing the pClass object instead of pModule as PySlaveInstance member. So initialize will only dismiss the previous instance and create a new one.

@markaren
Copy link
Member Author

That seems to crash both pyfmi and FMI4j

Copy link
Collaborator

@fcollonval fcollonval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so let's stick with your code then. Thanks for trying.

@markaren markaren merged commit 6637bf6 into master Feb 14, 2020
@markaren markaren deleted the feature/45-reset branch February 14, 2020 12:53
@markaren markaren restored the feature/45-reset branch February 14, 2020 12:59
@markaren markaren deleted the feature/45-reset branch February 14, 2020 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Handle reset
2 participants