Include tags in the /measurements and /inputs APIs#361
Include tags in the /measurements and /inputs APIs#361
Conversation
|
Thanks @kbenne for this. I like having the tags.json and it's similarities to other .json data types we have, in terms of its inclusion in the test case fmu and then expression through the API. I have a couple of comments/questions though:
|
|
dhblum
left a comment
There was a problem hiding this comment.
@kbenne I think eventually it would be good to at least be able to specify (in a test case) and get (as a user) a full haystack model, which if I understand correctly could be implemented as a json of tags. Does it require a full haystack API implementation to get the haystack model, or does one without the other sound ridiculous? A haystack API could indeed live alongside and be complementary to the current BOPTEST API, but with notable overlaps in functionality being PointWrite-/advance (though advance also advances the simulation) and HisRead-/results.
In the meantime for this PR, can you :
- Address my inline comments and
- Update design documentation to include
tags.jsonin the test case directory spec (comment that it is optional right now), and also add a section and spec fortags.jsonas you've implemented similar to other json specs. - Update release notes with this edit
| maxi = None | ||
| var_metadata[var] = {'Unit':unit, | ||
| 'Description':description, | ||
| 'tags': self.tags_json.get(var), |
There was a problem hiding this comment.
Does it make sense to capitalize 'tags' like other meta data?
There was a problem hiding this comment.
certainly. good catch.
| "point": "m:", | ||
| "sensor": "m:", | ||
| "temp": "m:", | ||
| "unit": "s:C" |
There was a problem hiding this comment.
@kbenne I think eventually it would be good to at least be able to specify (in a test case) and get (as a user) a full haystack model, which if I understand correctly could be implemented as a json of tags. Does it require a full haystack API implementation to get the haystack model, or does one without the other sound ridiculous? A haystack API could indeed live alongside and be complementary to the current BOPTEST API, but with notable overlaps in functionality being
PointWrite-/advance(though advance also advances the simulation) andHisRead-/results.In the meantime for this PR, can you :
- Address my inline comments and
- Update design documentation to include
tags.jsonin the test case directory spec (comment that it is optional right now), and also add a section and spec fortags.jsonas you've implemented similar to other json specs.- Update release notes with this edit
As far as I know, you don't have to implement all of the Haystack API. In fact the API specifies an /ops endpoint that returns a form of documentation for what endpoints the server is supporting. I think read and nav would be sufficient for model discovery.
There was a problem hiding this comment.
Then the use of /ops, read, and nav, along with implementing an example "full" model, I think could be a good next goal, at least in the direction of haystack support.
There was a problem hiding this comment.
For #361 (comment) the unit has been changed in 0868a08.
|
Unit tests pass at commit 262c9f5. Further commits after this store Haystack tags in the
The output of |

ref #360
This implements a mechanism for capturing tags and returning them via the API. Additional work will be required to define high quality, standards compliant tags. There is an example of a tag file here https://github.com/ibpsa/project1-boptest/blob/issue360_tagging/testcases/testcase1/models/tags.json.