Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Schedule CSV written in measure is not found #3609

Closed
macumber opened this issue Jul 31, 2019 · 6 comments · Fixed by NREL/OpenStudio-user-documentation#25
Closed

Schedule CSV written in measure is not found #3609

macumber opened this issue Jul 31, 2019 · 6 comments · Fixed by NREL/OpenStudio-user-documentation#25

Comments

@macumber
Copy link
Contributor

macumber commented Jul 31, 2019

Users are having issues with CSV files generated by measures. Users tend to write these in the measure directory which can lead to trouble. Need to have good example measure with tests in several contexts (CLI, App, PAT, openstudio-resources)

@macumber macumber self-assigned this Jul 31, 2019
@macumber macumber added this to the OpenStudio 2.9.0 milestone Jul 31, 2019
@macumber macumber assigned jmarrec and unassigned macumber Jul 31, 2019
@macumber
Copy link
Contributor Author

Measure should do something simple like write a CSV file and associate it with a load

@macumber
Copy link
Contributor Author

@mleachNREL thanks for the report

@jmarrec
Copy link
Collaborator

jmarrec commented Aug 30, 2019

@macumber Where would that measure output the CSV to? The model companion folder? If so, under which folder, resources?

@macumber
Copy link
Contributor Author

@jmarrec I think there are a couple of answers here. When a measure writes a file, it should write it to the current working directory. However, if the measure then creates a ScheduleFile to add to the model, the CSV file will be moved when you create the ExternalFile. The code in ExternalFile moves CSV files to the first path in the WorkflowJSON's files list.

I just added this code to the Workflow gem to add a generated files folder at the first index so all ExternalFiles added by measures in a simulation go there. Otherwise, we were getting files added back in shared resource directories which was not good for multiple runs referencing the same shared dirs. https://github.com/NREL/OpenStudio-workflow-gem/pull/88/files#diff-96bc621ae550711d9461f358341b833dR88

We might need something similar to the temporary OSW used in ApplyMeasureNow,

m_workingDir = openstudio::toPath(app->currentDocument()->modelTempDir()) / openstudio::toPath("ApplyMeasureNow");

@macumber
Copy link
Contributor Author

macumber commented Sep 6, 2019

Really this ticket is a documentation update. We need an example measure for the CSVFile (which is a form of documentation). We also should add a section on the measure writers guide about how to import files in a measure (from file paths) and how to write files in a measure (measures should write all files to the current working directory or the generated files path).

@jmarrec
Copy link
Collaborator

jmarrec commented Jun 7, 2021

Will be fixed by
NREL/OpenStudio-user-documentation#25

Related issue: #4046

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants