Closed fanmingyu212 closed 6 years ago
I dont have time to look at this right now but it seems to me that you are just renaming the header meant to number parameters, e.g.
[temperature 1] label = lab data = Value(21.0, 'degC')
could just be:
[parameter N] label = lab temperature 1 data = Value(21.0, 'degC')
is this not equally as flexible with no code changes?
We would like control over the bracket ([]'s) namespace. Right now you only have several fixed values. This way we can define (in our lab) what is a "Parameter", and what would fall under other categories as the need arises.
This certainly can be done all through the "Parameter" value, but we want access to the bracket namespace for hierarchical organization.
@aransfor does this make sense?
@jayich for sure I can see for organizational reasons. Give me a day or two to find time to go through the code but it should be straight forward
@theoriginaljuice @gregllong Can you guys please take a look at this code before Tony does to save him some time? I feel like the majority of our PR's Tony is taking the time to look through.
Addresses #238.
Data vault can only save
Independent
,Dependent
,Parameter
, andComment
in the .ini file now.With this PR, data vault can save values with any header in the ,ini file (displayed as sections in the .ini).
An example .ini is shown below:
wavemeter_frequency
andtemperature
are the new header names. Number of those sections are saved inwavemeter_frequency
andtemperature
options inGeneral
section.Also added data vault functions to add the headers and read the headers:
add_additional_header(self, c, header_name, name, data)
adds a new header. e.g.cxn.data_vault.add_additional_header("wavemeter_frequency", "422_nm", WithUnit(711, "THz"))
. Only lower case for theheader_name
is supported. It theheader_name
contains uppercase characters, it will be converted to lower case.additional_headers(self, c)
returns allheader_name
,label
pairs.get_additional_header(self, c, header_name, name, case_sensitive)
reads a value inheader_name
sections with labelname
.get_additional_headers(self, c)
returns all headers and values.The headers are designed to work very similar to parameters, but with flexibility to rename the sections. It could provide new naming schemes for the values saved in .ini to allow better organization.