First time here? Check out the Help page!
1 | initial version |
First off, I understand the logic of thinking it's because Python Measures aren't prime ready that you're having an issue.
I don't have anything to go on to pinpoint exactly what's your problem, but I don't think it's related to Python Measures (until proven otherwise).
I can run a Python reporting measure fine. For example the template one at https://github.com/NREL/OpenStudio/blob/develop/src/utilities/bcl/templates/ReportingMeasure/measure.py
Which you can generate from:
openstudio measure new -c PythonReporting -t ReportingMeasure -l Python -n "Python Reporting Measure" -d "A sample reporting measure in python " -m "Tests loading sql and co" --taxonomy-tag "Reporting.QAQC" ./python_reporting_measure
Here's a link to a working example: https://drive.google.com/file/d/1l7ug9r_8i185n4uchLpu1cOs-A0UPavw/view?usp=sharing
openstudio run -w workflow.osw
This produces a reports/reporting_measure_name_report.html that works fine and displays the SQL file's outdoor dry bulb conditions.
2 | No.2 Revision |
First off, I understand the logic of thinking it's because Python Measures aren't prime ready that you're having an issue.
I don't have anything to go on to pinpoint exactly what's your problem, but I don't think it's related to Python Measures (until proven otherwise).
I can run a Python reporting measure fine. For example the template one at https://github.com/NREL/OpenStudio/blob/develop/src/utilities/bcl/templates/ReportingMeasure/measure.py
Which you can generate from:
openstudio measure new -c PythonReporting -t ReportingMeasure -l Python -n "Python Reporting Measure" -d "A sample reporting measure in python " -m "Tests loading sql and co" --taxonomy-tag "Reporting.QAQC" ./python_reporting_measure
Here's a link to a working example: https://drive.google.com/file/d/1l7ug9r_8i185n4uchLpu1cOs-A0UPavw/view?usp=sharing
openstudio run -w This produces a reports/reporting_measure_name_report.html that works fine and displays the SQL file's outdoor dry bulb conditions.
3 | No.3 Revision |
Edit: I found the same behavior with Ruby. It's because the default measures do sql_file.close at the end. So you can't query it.
You need to do
if not sqlFile.connectionOpen():
sqlFile.reopen()
First off, I understand the logic of thinking it's because Python Measures aren't prime ready that you're having an issue.
I don't have anything to go on to pinpoint exactly what's your problem, but I don't think it's related to Python Measures (until proven otherwise).
I can run a Python reporting measure fine. For example the template one at https://github.com/NREL/OpenStudio/blob/develop/src/utilities/bcl/templates/ReportingMeasure/measure.py
Which you can generate from:
openstudio measure new -c PythonReporting -t ReportingMeasure -l Python -n "Python Reporting Measure" -d "A sample reporting measure in python " -m "Tests loading sql and co" --taxonomy-tag "Reporting.QAQC" ./python_reporting_measure
Here's a link to a working example: https://drive.google.com/file/d/1l7ug9r_8i185n4uchLpu1cOs-A0UPavw/view?usp=sharing
openstudio run -w workflow.osw
This produces a reports/reporting_measure_name_report.html that works fine and displays the SQL file's outdoor dry bulb conditions.
4 | No.4 Revision |
Edit: I found the same behavior with Ruby. It's because the default measures do sql_file.close at the end. So you can't query it.
You need to do
if not sqlFile.connectionOpen():
sqlFile.reopen()
Filed it at https://github.com/NREL/OpenStudio/issues/5147 for clarifications
First off, I understand the logic of thinking it's because Python Measures aren't prime ready that you're having an issue.
I don't have anything to go on to pinpoint exactly what's your problem, but I don't think it's related to Python Measures (until proven otherwise).
I can run a Python reporting measure fine. For example the template one at https://github.com/NREL/OpenStudio/blob/develop/src/utilities/bcl/templates/ReportingMeasure/measure.py
Which you can generate from:
openstudio measure new -c PythonReporting -t ReportingMeasure -l Python -n "Python Reporting Measure" -d "A sample reporting measure in python " -m "Tests loading sql and co" --taxonomy-tag "Reporting.QAQC" ./python_reporting_measure
Here's a link to a working example: https://drive.google.com/file/d/1l7ug9r_8i185n4uchLpu1cOs-A0UPavw/view?usp=sharing
openstudio run -w workflow.osw
This produces a reports/reporting_measure_name_report.html that works fine and displays the SQL file's outdoor dry bulb conditions.