Skip to content

Conversation

chrisjonesBSU
Copy link
Member

I've been running into a couple issues.

  1. gsd.hoomd errors out during a validation step before writing a new snapshot to file. This is caused by converting the bond_types list to an array before appending the snapshot to the new gsd file.

In gsd.hoomd

        if name == 'types':
            matches_default_value = data == container._default_value[name]

container._decult_value[name] is an empty list for bonds/angles/dihedrals, and data (passed in by grits) was an array of strings, resulting in numpy-related broadcast error.

A quick example here:

>>> myarr = np.array(["A", "B"])
>>> myarr == []
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: operands could not be broadcast together with shapes (2,) (0,)
>>> mylist = ["A", "B"]
>>> mylist == []
False
>>>
  1. self.atomistic is throwing an error only when calling the visualize() method. I'm fairly certain this is caused by cloning of the compound which we've added some custom attributes to. I think it's fine to remove this bit of information from the __repr__ method only, the attribute itself is still there, and works when called directly.

@chrisjonesBSU chrisjonesBSU added the bug Something isn't working label Jun 23, 2025
Copy link

codecov bot commented Jun 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.98%. Comparing base (9676c7b) to head (759a753).
Report is 23 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #95   +/-   ##
=======================================
  Coverage   94.98%   94.98%           
=======================================
  Files           4        4           
  Lines         459      459           
=======================================
  Hits          436      436           
  Misses         23       23           
Files with missing lines Coverage Δ
grits/coarsegrain.py 95.94% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chrisjonesBSU chrisjonesBSU merged commit 4d187a5 into cmelab:main Jun 23, 2025
10 checks passed
@chrisjonesBSU chrisjonesBSU deleted the fix-atomistic-error branch June 23, 2025 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants