-
Notifications
You must be signed in to change notification settings - Fork 78
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
Include tags in the /measurements and /inputs APIs #361
base: master
Are you sure you want to change the base?
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:
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.json
in the test case directory spec (comment that it is optional right now), and also add a section and spec fortags.json
as you've implemented similar to other json specs. - Update release notes with this edit
testcase.py
Outdated
@@ -645,6 +645,7 @@ def _get_var_metadata(self, fmu, var_list, inputs=False): | |||
maxi = None | |||
var_metadata[var] = {'Unit':unit, | |||
'Description':description, | |||
'tags': self.tags_json.get(var), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to capitalize 'tags'
like other meta data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
certainly. good catch.
testcases/testcase1/models/tags.json
Outdated
"point": "m:", | ||
"sensor": "m:", | ||
"temp": "m:", | ||
"unit": "s:C" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This unit should be K.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.json
in the test case directory spec (comment that it is optional right now), and also add a section and spec fortags.json
as 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.