-
Notifications
You must be signed in to change notification settings - Fork 210
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
Failed to Infer Measure Name #5215
Comments
I think this is related to #5212 |
I've added this and related measure to OS GItHub project and tagged for 3.9.0. One possible related behavior I saw in the past and I want to test if still happens, is that once an error is in the XML file (link example described at top of this issue) you can't clear it out even after measure is fixed with |
@kflemin the Measure that you linked as an example does not have an |
Expanding on this a bit, it looks like all of the measures in https://github.com/NREL/OpenStudio-workflow-gem/blob/39c84e45f152446a92379a501807e2691dba15ab/spec/files/script_error_osw intentionally have various errors for testing purposes. I don't think all of these will cause fatal errors (I tested a number of them by calling Having said all of this, if someone has an example measure that appears to be valid that we can use to reproduce this issue, I would be interested in it. |
From @kflemin, another measure that bubbles up the reported issue is https://github.com/pnnl/openstudio-building-energy-standard-measures-gem/tree/master/lib/measures/GenerateConStrainReport. I was able to reproduce the problem and found that this Measure is trying to load the ConStrain, which we do not include with OpenStudio. As a result OpenStudio fails to load/parse the Measure and the Measure update process fails with the following output. ![]() One solution is to use the
|
Based on what I've seen I think this issue consistently stems from issues in the Measure itself. We can either:
|
When a measure (Ruby or Python) requires custom gems we have put the include outside of the run method. When that library isn't found it can be hard for user to see what is going on. If we have people move those inside of run, then we can add a rescue and check to see if it was loaded, and then runner false with runner.registerError message to user explaining why it failed. If we can add to measure.xml output that could be useful, or make sure it shows up on verbose log for runner. But neither of those changes seem necessary for 3.9.0. I do want to make sure UO tests run. If we don't have any other specific change to make now we can always make an RC1 and just test it right away so if we need fix in RC2 we can do that. |
When running the openstudio CLI
measure -u
call on a measure, I often get this error: "Failed to infer measure name from '/path/to/measure/measure.rb'". I get it on Python measures as well as Ruby measures. This error also ends up in the xml file in an tag. For example: https://github.com/NREL/OpenStudio-workflow-gem/blob/39c84e45f152446a92379a501807e2691dba15ab/spec/files/script_error_osw/measures/IncreaseWallRValue/measure.xml#L4Measures contains such errors do not get uploaded to the BCL. I don't think they work in the OS apps either.
Ruby code that triggers the error:
OpenStudio/ruby/engine/RubyEngine.cpp
Lines 154 to 203 in ba1b94b
Python code that triggers the error:
OpenStudio/python/engine/PythonEngine.cpp
Lines 286 to 310 in eb043d2
I'd like to understand better why this error is being triggered...I can't tell exactly from the code. It would seem like there's a typo or not-recommended pattern in the class name, but that doesn't actually seem to be the case.
Another piece of information: I can sometimes update a measure with
openstudio measure -u
which triggers the error (in addition to doing other cleanup with the files and checksums but doesn't touch name/class_name), remove the error from the measure.xml, re-update the measure withopenstudio measure -u
again, and now it works?!thanks!
The text was updated successfully, but these errors were encountered: