Metadata#107
Conversation
… snapshot to just have update
|
I also changed a lot of the naming in |
|
The naming in the station was maybe not so smart. now I cant do But if we want to add all kinds of things to the station, we cant just call the things instruments? |
Useful for slow commands, useless info, or commands that only work under certain conditions.
|
Trying to save the for i in station.default_measurement:
print(i.__class__)
print(i.name)I cannot access the Somehow I find the non-unique names of parameters and instruments troublesome. Also later in the data analysis we need to go the other way around for which we kind of need unique names, no? I cant even tell the parameter what instrument it belongs to as the instrument name is not unique, and a unique name is only generated in the station. I'm kind of confused here :) |
Good point - I guess we need a "full name" concept that gets used whenever a parameter is recorded out of the context of its instrument (if it even is part of an instrument). The easiest thing to do is make this a @property
def full_name(self):
if hasattr(self, '_instrument') and hasattr(self._instrument, 'name'):
return self._instrument.name + '.' + self.name
else:
return self.nameWhen the |
|
That name, would not be unique either. I can easily make 10 instruments that have the same |
Moreover the fact that you have to try and pull out what kind of component you have later, based on its class, is problematic. Particularly for parameters, they really should be duck typed so people can write their own classes that don't inherit from ours at all. Different groups sounds like the winner to me. |
|
@alexcjohnson today I was trying to collect metadata for the measurement during the What would be the general strategy to save the whole measurement information? |
That seems like a problem for other reasons... we should enforce uniqueness of instrument names. |
Yes, I agree, but how, as it is now I dont have to put them into the station, so how would you enforce that without having a collecting mechanism? |
| 'arrays': array_snaps, | ||
| 'formatter': full_class(self.formatter), | ||
| 'io': repr(self.io) | ||
| }) |
There was a problem hiding this comment.
@alexcjohnson, is the mode of no interest?
There was a problem hiding this comment.
mode is an internal thing that changes throughout the life of a DataSet. But I did include the run() flags which tell you what you might have wanted to know with mode and more, in a more useful way.
|
@MerlinSmiles I added a bunch of tests and cleaned up a few things as a result. I think this is OK from my perspective now, do you want to give it a last look? I'm going to leave the integration of metadata with the DataManager for later; it has only minor effects and this PR is super huge already. |
| # even though we removed io from the snapshot, it's still in .metadata | ||
| self.assertIn('io', data.metadata) | ||
|
|
||
| # then do the same transormations to metadata to check it too |
There was a problem hiding this comment.
Just a minor typo here transormations
There was a problem hiding this comment.
thanks! qdev-dk-archive@cc0601e fixes this and your question from chat about the confusing call in make_sweep tests.
|
This looks good to me! cant find anything that bothers me. nice with the 'tyop' in the commit message :D |
|
Any more comments before we merge this? @AdriaanRol @guenp @damazter ? This PR is probably too sprawling to review now anyway, I suggest we merge it and folks can play with it in master and open new issues as things come up. |
|
No time for really checking it out but I want to use quite a few of these features in #179 so I'm in favor of merging |
This is a first step towards saving of all avlailable (but still somewhat relevant) metadata as partly discussed in #93.
This is a work in progress, so far, I have been adjusting:
setandgetcmds and those fancy ones.address,ports,terminators, the__class__I propose that we enforce this by default. I kind of did this already by adding the
IDNto the Instrument class.For now the
station.snapshot()at least gives more information on the setup than before.