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

BUG (maybe) - Error loading and verifying case #36

Closed
blthayer opened this issue Feb 5, 2022 · 8 comments
Closed

BUG (maybe) - Error loading and verifying case #36

blthayer opened this issue Feb 5, 2022 · 8 comments

Comments

@blthayer
Copy link

blthayer commented Feb 5, 2022

Overview

When attempting to run pvrpm, I get the following error:

$ pvrpm run --case ./ ./richland.yaml
2022-02-05 11:22:12,974--ERROR: Error loading and verifying case: Couldn't find module for file richland.json!

System/Environment

  • OS: Ubuntu 20.04.3
  • Python: 3.10.2
  • SAM: 2021.12.02
  • pvrpm installed from master at c6cd62a

Reproducing

Unzip richland.zip into a directory. It contains:

  • richland.sam
  • richland.json (exported data from SAM via "Generate Code" -> "JSON for inputs")
  • richland.yaml (pvrpm configuration file)

From within the directory with the files above, execute pvrpm run --case ./ ./richland.yaml

Misc Notes

The PVRPM docs seem to indicate that SAM should generate multiple JSON files, but this is not the case for me.

Also, when I use SAM to export to json, SAM crashes, but does successfully generate a single json file as well as the .h and .so files. Here's the output from SAM in my terminal:

...

(sam.bin:11945): Gtk-CRITICAL **: 11:17:53.945: IA__gtk_widget_set_size_request: assertion 'height >= -1' failed

(sam.bin:11945): Gtk-CRITICAL **: 11:17:53.951: IA__gtk_widget_set_size_request: assertion 'height >= -1' failed

(sam.bin:11945): Gtk-CRITICAL **: 11:17:53.956: IA__gtk_widget_set_size_request: assertion 'height >= -1' failed

(sam.bin:11945): Gtk-CRITICAL **: 11:17:53.957: IA__gtk_widget_set_size_request: assertion 'height >= -1' failed
free(): double free detected in tcache 2
Aborted (core dumped)
@brandons209
Copy link
Contributor

It looks like you are using a PVWatts model. PyPVRPM only supports Detailed PV Models. If you switch your model to that it should resolve this issue.

@blthayer
Copy link
Author

Oops, I missed that note in the documentation on my first read through! Thanks for setting me straight.

@blthayer
Copy link
Author

I'm still getting the same error after updating to use Detailed PV Models and a financial model that supports lifetime costs (as far as I could tell). I've attached a .zip archive with the exported json file and yaml configuration file
richland_detailed.zip.

At any rate, I would consider updating the error message to give the user actionable information.

Looking at the code where I believe the error message originates from, it seems that the module name is being inferred from the name of the json file. However, as I mentioned in #39, SAM is only exporting a single json file for me (and I'm not sure if this is expected behavior or a problem with SAM. As mentioned above SAM does crash after creating the single json file plus the .h and .so files)

@blthayer blthayer reopened this Feb 12, 2022
@brandons209
Copy link
Contributor

I will take a look, this is most likely an error in SAM, there should be more then 1 file.

@brandons209
Copy link
Contributor

brandons209 commented Feb 12, 2022

I need you to send me your SAM case file to check it, also make sure you are not renaming the JSON files as well.

@brandons209
Copy link
Contributor

brandons209 commented Feb 12, 2022

Okay, I figured it out. I misread your initial bug report, you are selecting the wrong option when you click the "Generate Code" menu item. You need to do "Generate Code" -> "PySAM JSON" not "JSON for Inputs". I think the latter option puts all of the information for the modules into a single JSON, rather then properly separate them as PySAM requires.

@brandons209
Copy link
Contributor

As an addition to this, I realize the Getting Started page did say select JSON for Inputs, I think this changed with the latest version of SAM. Sorry for the confusion as I didn't realize this, I will fix the docs now.

@blthayer
Copy link
Author

I'm now able to get my case past this error thanks to the updated documentation.

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

No branches or pull requests

2 participants