-
Notifications
You must be signed in to change notification settings - Fork 50
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
Fix bug in loading previously run Batch and ComponentModeler from file when custom medium present #1817
Conversation
028cc98
to
f3b0bd7
Compare
f3b0bd7
to
0c70f7d
Compare
0c70f7d
to
dbb17b3
Compare
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.
We can get this in for now if it fixes things but it really looks like it needs a rethink... Two things strike me as not good design:
- The existence and difference of both
Job._cached_properties["task_id"]
and aJob.task_id_cached
and the fact that those differ, and the fact that we have to callupdated_copy
on Job just to update this. self = self.updated_copy(batch_cached=batch_cached)
just looks... bad, no?
Yea I'm also not very happy with it. Ultimately, it comes down to (a) our choice of immutability (b) making things like For example, the
Any thoughts? In some sense, we treat |
Also, we never upload
They have to differ because one is a property and one is a field.. in pydantic v2, there are
Yea, because of the immutability, I dont see a good way around this.
It sure does, but I dont see any way. Note that because of how I'm using |
Generally this seems to be pointing towards potentially making container classes mutable, which may not be a terrible idea? The contained simulations will still be immutable unless I'm really misunderstanding something. |
Yea I think in general it would make some sense to create a distinction between (1) core components Although I think maybe this could go into the ominous web API refactor or the 3.0 redesign.. |
Sorry, which part here would be mutable? Just
This wouldn't really be compatibility breaking in any user-facing way and may not be too big of a change so there may not be a need to wait for that, but I guess depends on priority if we have something working even if ugly. |
just Job and Batch would be mutable. guess we wouldn't need to wait, I'm just not sure if we want to open this can of worms just for this bug fix, and should consider waiting for a time when we're doing a more comprehensive overhaul. |
Ok merging this and made an issue to follow up. #1823 |
Fixes #1816.