NatLabRockies / NatLabRockies/H2Integrate

Fix/update warning filtering in electrolyzer models (and elsewhere)

Open
#476 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
26
Forks
44
Avg merge
3d 22h
Merged PRs (30d)
16

Description

In PR #462 some warning filters in files for the electrolyzer models were modified. The changes were:

  • h2integrate/converters/hydrogen/pem_model/run_PEM_main.py: modified warnings.filterwarnings("ignore") to warnings.filterwarnings("ignore", category=RuntimeWarning). The run-time warnings may occur through-out this function and some of the calculations in PEM_H2_LT_electrolyzer_Clusters.py because of divide by zeros resulting from a case when a stack is off and does not produce hydrogen, then efficiency calculations (power/hydrogen production) result in nans which are handled elsewhere in the wrappers of these methods.
  • h2integrate/converters/hydrogen/pem_model/PEM_H2_LT_electrolyzer_Clusters.py added a warning filter to filter out spicy.optimize.OptimizeWarning to the method iv_curve(). This is to filter out a warning about the "covariance of the parameters" not being able to be calculated, but this warning does not impact performance or indicate anything unexpected in happening in this method, this method only requires that the coefficients are estimated (which is done successfully)

So - to remove filtering warnings would require updating calculations that may divide by zero.

Other warning filtering should be removed throughout the code, I am not sure if that is done in many other places.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing PR #462 and the warning handling in h2integrate/converters/hydrogen/pem_model/run_PEM_main.py and PEM_H2_LT_electrolyzer_Clusters.py. Search the repository for other warning filters, then determine which filters are masking divide-by-zero behavior or the noted OptimizeWarning. Done means unnecessary filtering is removed while the electrolyzer-specific cases are handled intentionally.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.