1

OS measure subfolder

Hi there, I am facing a problem with a measure using a resource folder with a subfolder "data" containing several csv files. If I run the model using the measure, it does not copy the subfolder "data" with the csv files into the temp folder. Do you have an idea what the problem could be here? Obviously the measure fails because it does not find the needed csv files.

Thanks for your help.

Phil's avatar
181
Phil
asked 2020-12-04 02:16:05 -0500
__AmirRoth__'s avatar
4.4k
__AmirRoth__
updated 2021-07-09 17:49:38 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

Try putting your CSV into the resources/ subfolder.

That is given the following structure:

measure_folder/measure.xml
measure_folder/measure.rb

Put your files either as :

measure_folder/resources/file1.csv
measure_folder/resources/data/file1.csv

Edit: I knew from memory that the resources/ subfolder would be copied along with the tests/one, but I was having trouble finding where this would be defined. I think it's here: https://github.com/NREL/OpenStudio/bl...

Julien Marrec's avatar
29.7k
Julien Marrec
answered 2020-12-04 04:51:39 -0500, updated 2020-12-04 04:54:59 -0500
edit flag offensive 0 remove flag delete link

Comments

Hi Julien

Option 1 with "measure_folder/resources/file1.csv" works but it is a bit messy with several csv files and other helper measures.

Option 2 does not work. OS just copies the resources folder with my helper measures and ignores all other subfolders.

Phil's avatar Phil (2020-12-04 08:56:25 -0500) edit

Go with option 1 then.

Julien Marrec's avatar Julien Marrec (2020-12-04 09:17:59 -0500) edit

but its messy :-(

Phil's avatar Phil (2020-12-04 11:44:26 -0500) edit
1
  1. If that's really bothering you, in that case open an enhancement request on github. This time I went ahead and created it for you as an example: NREL/OpenStudio#4156

  2. You do not have to develop your measure inside your ~/OpenStudio/Measures folder. There are a ton of ways to develop them somewhere else and have them ship to your ~/OpenStudio/Measures/ folder for testing as needed or to export it to the BCL (a rake task that would glob and copy stuff for eg, symlinking, etc).

Julien Marrec's avatar Julien Marrec (2020-12-08 04:02:25 -0500) edit
add a comment see more comments