Skip to content
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

ConStrain Supply Air Temperature Reset Verification Measure #14

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

jslane-h
Copy link
Collaborator

  • Model measure to create a supply air temperature reset verification case and workflow JSON to run that verification case
  • Arguments are idf_path, output_dataset_path, output_dir, air_loop_name, design_zone_cooling_air_temp
  • Saves constrain_workflow.json and supply_air_temperature_reset_verification_case.json in output_dir

@jslane-h jslane-h self-assigned this Sep 23, 2024
design_zone_cooling_air_temp = runner.getDoubleArgumentValue(
"design_zone_cooling_air_temp", user_arguments
)
idf_file_path = runner.getStringArgumentValue("idf_path", user_arguments)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jslane-h - I feel like this is a bit confusing since this is an OpenStudio measure. Also, because we're not running the simulation using ConStrain I think this could be left blank in the verification case. If so, we could get rid of that argument. Have you tried it? If no, could you please give it a shot?


measure.run(model, runner, argument_map)
result = runner.result()
assert result.value().valueName() == "Success"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we perhaps also check that the correct output variable has been added?


args_dict = {
"air_loop_name": "Test Air Loop",
"design_zone_cooling_air_temp": 40,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this doesn't matter here but just for reference, let's change that to 24.

args_dict = {
"air_loop_name": "Test Air Loop",
"design_zone_cooling_air_temp": 40,
"idf_path": "./lib/measures/ConstrainSupplyAirTemperatureResetVerification/tests/input/test.idf",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't need that argument we should probably remove the IDF file from this PR.

args.append(idf_path)
args.append(output_dataset_path)
args.append(output_dir)
# TODO: If the user doesn't provide a design_zone_cooling_air_temp, we can infer it from other modeling inputs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should move that to a GitHub issue so it doesn't get buried?

Copy link
Contributor

@lymereJ lymereJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jslane-h! I think that it overall looks good. I left a few comments. Have you run openstudio measure -t to see if any issue popped-up? We'll also have to update the license, it will probably be the same as the other measure but we can check.

@lymereJ
Copy link
Contributor

lymereJ commented Oct 2, 2024

Hi @kflemin - When I run openstudio measure -t in my local clone with this measure I get the following error:

[utilities.bcl.BCLMeasure] <0> /mnt/c/OSSTD_repos/openstudio-building-energy-standard-measures-gem/lib/measures/ConstrainSupplyAirTemperatureResetVerification/tests/output/constrain_workflow.json is not inside an approved subfolder.
[utilities.bcl.BCLMeasure] <0> /mnt/c/OSSTD_repos/openstudio-building-energy-standard-measures-gem/lib/measures/ConstrainSupplyAirTemperatureResetVerification/tests/output/supply_air_temperature_reset_verification_case.json is not inside an approved subfolder.

In the past you pointed out that we should update our .gitignore file but I think that we've already done it so I'm not sure why we're still getting the error only for this measure. Do you know why?

model = openstudio.model.Model()

# get arguments
arguments = measure.arguments(model)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need to get arguments twice in the test function?

air_loop,
design_zone_cooling_air_temp,
)
with open(f"{output_dir}/supply_air_temperature_reset_verification_case.json", "w") as f:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the supply_air_temperature_reset_verification_case.json exists all the time?
If not, suggest adding a file exist check first.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added line 261 to handle this. open's "w" mode will create a new file if it doesn't exist, but it won't create any directories.

json.dump(verification_cases, f, indent=2)

workflow = self.get_workflow(output_dataset_path, output_dir)
with open(f"{output_dir}/constrain_workflow.json", "w") as f:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar comments here.

@kflemin
Copy link

kflemin commented Oct 7, 2024

Hi @kflemin - When I run openstudio measure -t in my local clone with this measure I get the following error:

[utilities.bcl.BCLMeasure] <0> /mnt/c/OSSTD_repos/openstudio-building-energy-standard-measures-gem/lib/measures/ConstrainSupplyAirTemperatureResetVerification/tests/output/constrain_workflow.json is not inside an approved subfolder.
[utilities.bcl.BCLMeasure] <0> /mnt/c/OSSTD_repos/openstudio-building-energy-standard-measures-gem/lib/measures/ConstrainSupplyAirTemperatureResetVerification/tests/output/supply_air_temperature_reset_verification_case.json is not inside an approved subfolder.

In the past you pointed out that we should update our .gitignore file but I think that we've already done it so I'm not sure why we're still getting the error only for this measure. Do you know why?

Hi @lymereJ,

I see your change in .gitignore, looks good. The tests/output directory should not get committed to the repo since it contains temporary output files from running the tests. But you are getting an error when running locally, and i'm not sure why. If you delete the tests/output directory (or at least its contents) and run your local command again, do you get an error? If so, I would open a ticket on the OpenStudio repo.

@lymereJ
Copy link
Contributor

lymereJ commented Oct 7, 2024

@kflemin - Thanks! Removing them did the trick.

@lymereJ
Copy link
Contributor

lymereJ commented Oct 7, 2024

@weilixu - Have all your comments been addressed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants