Skip to content

fix inconsistent error handling for Grid.load()#165

Open
orbeckst wants to merge 2 commits intomasterfrom
cleanup
Open

fix inconsistent error handling for Grid.load()#165
orbeckst wants to merge 2 commits intomasterfrom
cleanup

Conversation

@orbeckst
Copy link
Copy Markdown
Member

  • gOpenMol parser now captures its TypeError and raises ValueError if the header cannot be read; this makes it consistent with the other parsers
  • removed XFAILs from tests that check failure behavior for incorrectly specified file_format for Grid/Grid.load()
  • update CHANGELOG
  • update docs for Grid.load()

- gOpenMol parser now captures its TypeError and raises ValueError if the
  header cannot be read; this makes it consistent with the other parsers
- removed XFAILs from tests that check failure behavior for incorrectly
  specified file_format for Grid/Grid.load()
- update CHANGELOG
- update docs for Grid.load()
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.90%. Comparing base (b29c1f4) to head (51e2ca8).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #165      +/-   ##
==========================================
+ Coverage   88.20%   88.90%   +0.69%     
==========================================
  Files           5        5              
  Lines         814      820       +6     
  Branches      107      107              
==========================================
+ Hits          718      729      +11     
+ Misses         56       54       -2     
+ Partials       40       37       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@orbeckst orbeckst requested a review from BradyAJohnston April 10, 2026 02:24
Copy link
Copy Markdown
Member

@BradyAJohnston BradyAJohnston left a comment

Choose a reason for hiding this comment

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

Minor comments, LGTM

# quick and dirty... slurp it all in one go
datafmt = h['bsaflag'] + str(nentries) + self._data_bintype
a = numpy.array(unpack(datafmt, plt.read(calcsize(datafmt))))
except Exception as err:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we want this to be more specific with the exceptions it catches?

def test_load_wrong_fileformat(self, data, pklfile, fileformat):
with pytest.raises('ValueError'):
def test_load_wrong_fileformat_raises_ValueError(self, pklfile, fileformat):
with pytest.raises(ValueError):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe add a match= to be more specific?

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

Successfully merging this pull request may close these issues.

2 participants