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

Supercede run_analysis.rb with buildstock_local #372

Open
joseph-robertson opened this issue May 24, 2023 · 14 comments
Open

Supercede run_analysis.rb with buildstock_local #372

joseph-robertson opened this issue May 24, 2023 · 14 comments
Labels
enhancement New feature or request

Comments

@joseph-robertson
Copy link
Contributor

Is your feature request related to a problem? Please describe.
See #349 for some context.

Describe the solution you'd like
The buildstock_local utility to have all the features of run_analysis.rb that are nice to have. For example, the ability to run only sets of specified building IDs.

It also appears that the buildstock_local utility requires that you update your path env var to point to the correct version of openstudio. Idea from @shorowit: Since the OS CLI now supports python, maybe bsb could be updated so that if you use openstudio buildstock_local ... instead of python buildstock_local, it's smart enough to use that openstudio.

Goals
Adopt buildstock_local in place of run_analysis.rb - it's "official" and means a whole lot less code to maintain in the resstock repo.

@joseph-robertson joseph-robertson added the enhancement New feature or request label May 24, 2023
@shorowit
Copy link
Contributor

It also appears that the buildstock_local utility requires that you update your path env var to point to the correct version of openstudio. Idea from @shorowit: Since the OS CLI now supports python, maybe bsb could be updated so that if you use openstudio buildstock_local ... instead of python buildstock_local, it's smart enough to use that openstudio.

I assume it's the python equivalent of something like this?

begin
  require 'openstudio'
  cli_path = OpenStudio.getOpenStudioCLI
rescue
  cli_path = ENV['OPENSTUDIO_EXE']
end

@afontani
Copy link
Collaborator

afontani commented May 31, 2023

From @joseph-robertson : Some potential features or benefits to run_analysis.rb

  • Only needs OS CLI (can we reduce the overhead?)
  • Only run a single or set of building IDs (more specific building model debugging)
  • Collect the warnings into a single file

@afontani afontani reopened this Aug 23, 2023
@joseph-robertson
Copy link
Contributor Author

@nmerket On the first (checked) item above, I'm confused. Something was changed/updated in buildstockbatch such that you can now use openstudio buildstock_local?

@nmerket
Copy link
Member

nmerket commented Aug 23, 2023

No, buildstock_local is still a python app. But it calls openstudio directly to run each simulation. We don't have any plans (or a way forward) to run buildstock_local from openstudio.

@shorowit
Copy link
Contributor

@nmerket openstudio can now run python scripts (just like it can run ruby scripts).

@nmerket
Copy link
Member

nmerket commented Aug 23, 2023

Yes, but there are a lot of dependencies in buildstockbatch. Several have compiled components. If it's anything like how ruby is shipped with openstudio, I'm dubious that we'll ever be able to run buildstockbatch from openstudio.

@shorowit
Copy link
Contributor

Ah, right. So that means running buildstock_local will always require more setup than run_analysis.rb.

@rajeee
Copy link
Contributor

rajeee commented Aug 23, 2023

What's the value of being able to run buildstockbatch from openstudio? Not having to setup buildstockbatch separately?

@joseph-robertson
Copy link
Contributor Author

Yes. From my perspective, with run_analysis.rb I don't need to: source activate xxx anything, pip install xxx anything, or change any paths.

@shorowit
Copy link
Contributor

To draw a parallel, the user can run run_analysis.rb with either ruby or openstudio. But by using openstudio, the user doesn't have to:

  1. Separately install ruby and any gems
  2. Tell the script where openstudio is installed

Plus there are fewer things that can go wrong -- wrong version of ruby, trouble compiling gems, etc. (And they already have openstudio since it's needed to run the simulations.)

@nmerket
Copy link
Member

nmerket commented Aug 23, 2023

How did getting nokogiri installed with openstudio go? Now imagine that with numpy, pandas, dask, pyarrow, lxml, s3fs, boto3, and more. Unless openstudio comes with a fully functional pip package manager (it might for all I know), we'd either need to preload that full stack of libraries in openstudio or rewrite buildstockbatch from scratch with only modules in the standard library. I'm not sure that's feasible or even possible. There's several things that buildstockbatch does that run_analysis.rb doesn't do, most notably timeseries aggregation, that depend heavily on those libraries.

@rajeee
Copy link
Contributor

rajeee commented Aug 23, 2023

I don't quite understand how openstudio handles package dependencies. For the case of ruby, @shorowit you said using openstudio directly means the user doesn't have to install any gems. Is the assumption there that the script is only using the gems that comes preinstalled with openstudio?

And I presume same is the case with python where python and some set of packages are shipped with openstudio?

@joseph-robertson
Copy link
Contributor Author

Probably getting into @kbenne's territory here.

@shorowit
Copy link
Contributor

Yes, openstudio comes preinstalled with various gems (run openstudio gem_list). We generally write ruby scripts to rely only on those gems, as that keeps it simple for the end user. That said, I think you can point openstudio at additional gems to use.

Support for python in openstudio is pretty new. I think it only comes with the standard library today; I don't know what the longer term plans are.

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

No branches or pull requests

5 participants