Comments (8)
My main concern here is that users know when they're asking for a soft_get
instead of a real reading, even if they're not the driver authors.
When do you think this functionality will be useful?
- just as a one-off "remind me what I set this to"
- then we could make a method like
.latest()
or something, that as you say just returnsself._last_value
- then we could make a method like
- or can you see cases for using this in a
Loop
? I guess here's one: if you've got some other high-level parameter that includes a feedback loop, and elsewhere in the loop you want to store the feedback setting...- we can make a really simple object that wraps any parameter, just overriding
get
, so that it can be used in aLoop
.
- we can make a really simple object that wraps any parameter, just overriding
Actually, I bet the only thing a user has to see is .latest
, used as a function as in the first case, or without calling it you have an object that can be a Loop
action:
class StandardParameter(...):
def __init__(self):
...
self.latest = GetLatest(self)
...
class GetLatest(DelegateAttributes):
delegate_attr_objects = ['parameter']
def __init__(self, parameter):
self.parameter = parameter
def get(self):
return self.parameter._last_value
def __call__(self):
return self.get()
Seem reasonable? Any other ideas what to call this thing?
from qcodes.
Small change, if I first standardize the names of stored values between StandardParameter
and ManualParameter
as discussed in #38 and #41 then we can plug this into Parameter
rather than StandardParameter
- of course in ManualParameter
you wouldn't need this (it wouldn't hurt, it's doing exactly what .get()
does there anyway...) but it would be nice to allow in other Parameter
subclasses people might make.
from qcodes.
I definately like the idea of .latest() or .get_latest(). I think that would be a good addition.
However having .latest does not solve the problem I am having which relates to instruments that have a lacking communications protocol (and there are surprisingly many of them) In that case I would like it to be able to use the standard .get() function.
For the specific problem I am having now it is a VISA instrument so I would like my parameter to still be a visa instrument and just rerout parameter.get() to the proposed parameter.latest().
If we add this feature we should add a note on when to and when not to use this feature in the docstring that explains it, unless you see a better solution. (Maybe .latest() for every parameter?)
from qcodes.
However having .latest does not solve the problem I am having which relates to instruments that have a lacking communications protocol on (and there are surprisingly many of them) In that case I would like it to be able to use the standard .get() function.
I'm still not sure I get your point - you want to be able to use .get()
exactly, or you just want to make sure there's always something available?
Maybe .latest() for every parameter?
That's what I was proposing above - if you just want to read this value out, you do:
myparam.latest()
and to put this as data into a loop:
Loop(...).each(myparam.latest)
from qcodes.
I'm still not sure I get your point - you want to be able to use
.get()
exactly, or you just want to make sure there's always something available?
Yes, I want to rerout .get() to .latest() in some very specific cased (i.e. if the hardware does not support get-functionality). In all other cases I am very happy with the addition of the .latest() method.
from qcodes.
@alexcjohnson
Actually on second thought, let's stick with having only the .latest() and no .get() in the case of soft-parameters. The only addition I propose is to have the NotImplementedError in the .get() refer to the .latest() explicitly so that the user will know immediately how to solve this.
from qcodes.
The only addition I propose is to have the NotImplementedError in the .get() refer to the .latest() explicitly so that the user will know immediately how to solve this.
Haha I was about to propose exactly that. Sold, I'll add it to #48
from qcodes.
closed by #48
from qcodes.
Related Issues (20)
- Make it possible to use ConnectionPlus as a context manager
- Non-gridded data export to netcdf HOT 3
- Captured_run_id is incorrect if run has been inserted HOT 1
- Pyvisa sim instruments are not cleanup on close. HOT 1
- Lakeshore 336 Driver with USB interface not connecting HOT 9
- Random error in test_logger HOT 3
- Agilent E8257D Instrument Driver Bug in on() and off() Methods HOT 5
- Code coverage jumps by 10 lines
- Warning when calling data_set.cache.load_data HOT 1
- Acccessing a faulty property of an instrument throws obscure error.
- print_readable_snapshot() of instrument modules without parameters broken.
- Random failure in do_nd test HOT 2
- Cannot exit ipython with running qcodes.Monitor() HOT 4
- Add redirects to new documentation? HOT 2
- Error when running `Infiniium.py` driver file HOT 4
- Parameter.__getitem__ behavior HOT 5
- Ignored exception on ci in windows related to monitor and socket. HOT 1
- Alazar example (and driver) is broken HOT 2
- Parsing Error on Quantum Design DynaCool
- partial auto completion when coding HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qcodes.