Skip to content

Wave File Reader error handling, header reading#1701

Merged
mjprilliman merged 7 commits into
patchfrom
me-wave-file-reader
Mar 1, 2024
Merged

Wave File Reader error handling, header reading#1701
mjprilliman merged 7 commits into
patchfrom
me-wave-file-reader

Conversation

@mjprilliman

Copy link
Copy Markdown
Collaborator

Pull Request Template

Description

-Update file reader to catch missing data, throw error in JPD generation process
-Update file reader to be more flexible with header data in first two rows

Fixes #1673

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • This change modifies variables in existing compute modules. Please see Checking for PySAM Incompatible API Changes.

Checklist:

If you have added a new compute module in a SSC pull request related to this one, be sure to check the Process Requirements.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@cpaulgilman

Copy link
Copy Markdown
Collaborator

@mjprilliman Is there supposed to be an option to choose time series or JPD for the ME Wave model? Help describes the option, but I don't see it on the Wave Resource page:

image

Also, when I click Create JPD from time series weather file(s) for a folder with 1979-2010 time series data that I just downloaded, I get a UI callback error:

Could not evaluate callback function:jpd_multiyear->on_change
[60]: error in call to 'value()': variable 'wave_resource_filename' does not exist in this context[51]: eval error in statement list
[49]: eval error in statement list
[46]: eval error in statement list
[46]: error inside function call

@mjprilliman

Copy link
Copy Markdown
Collaborator Author

@mjprilliman Is there supposed to be an option to choose time series or JPD for the ME Wave model? Help describes the option, but I don't see it on the Wave Resource page:

image

Also, when I click Create JPD from time series weather file(s) for a folder with 1979-2010 time series data that I just downloaded, I get a UI callback error:

Could not evaluate callback function:jpd_multiyear->on_change
[60]: error in call to 'value()': variable 'wave_resource_filename' does not exist in this context[51]: eval error in statement list
[49]: eval error in statement list
[46]: eval error in statement list
[46]: error inside function call

Paul, no for the Single Owner model there is only the time series option due to the requirement for a time series in the cash flow. This PR is to fix some issues with JPD file generation and to make the header data for wave and tidal resource data more dynamic. I will look into the bug you've posted and schedule a meeting to discuss the weather file handling.

@cpaulgilman cpaulgilman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

JPD file generation works. Other issues to be fixed separately.

@cpaulgilman

cpaulgilman commented Feb 29, 2024

Copy link
Copy Markdown
Collaborator

@mjprilliman I'm testing this with the hourly file you fixed from this discussion on the SAM Forum. I put the file in my SAM Downloaded Weather files folder, but am not seeing it in the library, even after clicking Refresh library and reloading the input page. The file does appear in the library in SAM 2023.12.17, but not in my build from this me-wave-file-reader branch.

image

@cpaulgilman cpaulgilman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

See my previous comment about the library.

@mjprilliman

Copy link
Copy Markdown
Collaborator Author

@mjprilliman I'm testing this with the hourly file you fixed from this discussion on the SAM Forum. I put the file in my SAM Downloaded Weather files folder, but am not seeing it in the library, even after clicking Refresh library and reloading the input page. The file does appear in the library in SAM 2023.12.17, but not in my build from this me-wave-file-reader branch.

image

Did you have the ssc branch checked out as well?

@cpaulgilman

Copy link
Copy Markdown
Collaborator

Did you have the ssc branch checked out as well?

Yes, this is for a clean build from SAM/me-wave-file-reader and ssc/me-wave-file-reader.

@mjprilliman

Copy link
Copy Markdown
Collaborator Author

Did you have the ssc branch checked out as well?

Yes, this is for a clean build from SAM/me-wave-file-reader and ssc/me-wave-file-reader.

Can you pull ssc for the most recent commit and try again? I downloaded the file directly from email and was able to get it into the library locally just now.

@cpaulgilman

Copy link
Copy Markdown
Collaborator

In the UI callback for the Marine Wave Resource Time Series form, I'm seeing rescanlibrary('wave_ts') and rescanlibrary( 'wave' ). I think the name of the wave library is location_ts, not wave_ts or wave. I tried changing those, but that didn't fix it, so I'm not sure what the problem is.

Also, in this snippet for the Refresh library button there is refresh('wave_resource_matrix'), but wave_resource_matrix is not an input on that form:

image

@cpaulgilman

cpaulgilman commented Mar 1, 2024

Copy link
Copy Markdown
Collaborator

@mjprilliman Here's some additional information: I have several valid wave resource files in my <user>/SAM Downloaded Weather Files folder. If my list of wave data folders is empty, then the files do not appear in the library:

image

However, if I add <user>/SAM Downloaded Weather Files to my list of wave data folders, then the files appear in the library:

image

The library should populate from the folder shown in "Folder for Downloaded Wave Data Files" and the folders listed under "Wave Data File Folders" in the Wave Resource Data Settings widget.

@cpaulgilman cpaulgilman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hourly ME Wave files load into Wave Resource library correctly and simulations run.

@cpaulgilman cpaulgilman added the added to release notes PR and/or issue has been added to release notes for a public release label Mar 1, 2024
@mjprilliman mjprilliman merged commit e6e3861 into patch Mar 1, 2024
@mjprilliman mjprilliman deleted the me-wave-file-reader branch March 1, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

added to release notes PR and/or issue has been added to release notes for a public release bug marine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ME JPD File generation not working past certain number of years

2 participants