-
Notifications
You must be signed in to change notification settings - Fork 301
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 station snapshot of parameters with snapshot_exclude #2692
Fix station snapshot of parameters with snapshot_exclude #2692
Conversation
Add parameter with snapshot_exclude to station
Codecov Report
@@ Coverage Diff @@
## master #2692 +/- ##
==========================================
- Coverage 63.86% 63.84% -0.02%
==========================================
Files 198 198
Lines 26487 26489 +2
==========================================
- Hits 16916 16913 -3
- Misses 9571 9576 +5 |
@mgunyho thanks for the pr.
I don't see a better solution than checking this in |
This gets rid of the warning in the test
Alright, I added it now. It's true that this is a bit of an edge case. We are using some custom Station subclasses where this came up. |
@mgunyho custom station classes? :) that's interesting! could you share what these classes do and what is their goal? (we could also do it on slack if you prefer) |
@astafan8 We use station subclasses for a couple of purposes.
I'm not sure if we are doing things in the most optimal way, but it seems to work reasonably well for now. |
@mgunyho thank you for sharign! the first point makes sense and is an itneresting case; the folks i'm working with usually use separate yml files and anyway load all instruments from them. For the second point, also fair, however, this will be better solved (and we have it on our radar, just haven't got to doing it) by introducing a concept/variable of active experiment that you set once, and doNds and what not can pick it up (at the moment, donds and also Measuremnt class pick the "last" experiment which may well be the "active" one but also may not). |
Fixes #2671
However, there's still one issue: the line
in the test still issues a warning, because
add_component
takes a snapshot, because ofupdate_snapshot=True
. How should this be handled?I first thought that maybe it's the caller's responsibility to pass
update_snapshot=False
when adding an excluded parameter like this, but this won't work then when initializing the Station asStation(param1, param2, excluded_param, param4...)
.So maybe there could be a similar check in
add_component
forisinstance(component, Parameter) and not component.snapshot_exclude
, but that also feels a bit clumsy.@astafan8