-
Notifications
You must be signed in to change notification settings - Fork 35
feat(simulators): Add support for running simulations using revisions #2339
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2339 +/- ##
==========================================
+ Coverage 90.68% 90.80% +0.12%
==========================================
Files 169 170 +1
Lines 25186 25685 +499
==========================================
+ Hits 22839 23323 +484
- Misses 2347 2362 +15
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly nitpicks, should be easy to fix
self.model_revision_external_id = model_revision_external_id | ||
|
||
|
||
class SimulationRunWrite(SimulationRunCore): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about making two subclasses here? Something like SimulationRunByRoutineWrite
and SimulationRunByRevisionWrite
. I think that will give a better user experience and you do not have to have a bunch of conditionals. It is also more aligned with the API that has two different objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this approach and IMO the UX doesn't look much cleaner than it is at the moment.
For example: Some time ago we had to do additional imports for filtering https://github.com/cognitedata/cognite-sdk-python/pull/2148/files and we removed them.
In this case, if the user reaches one of the errors based on the conditionals, fixing it would be much faster than looking for the right class to execute a simulation. It was getting confusing just writing the docstrings for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See suggestions, will review the rest when those are addressed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one nitpick
Description
This PR extends the Simulator Runs API to support two modes for running simulations:
routine_external_id
routine_revision_external_id
andmodel_revision_external_id
Co-Authored: @evertoncolling . Ref.
Checklist:
If a new method has been added it should be referenced in cognite.rst in order to generate docs based on its docstring.