Skip to content

Commit

Permalink
Nucleartest 'doit' disabled to allow execution of simplify without at…
Browse files Browse the repository at this point in the history
…tempting to resolve a symbolic clebsch-gordan coefficient.

Also added some comments to the drs function retrieval function
  • Loading branch information
Wholinator committed Jan 24, 2025
1 parent d751911 commit ec3f690
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions drudge/drs.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,13 +347,13 @@ def __missing__(self, key: str):
if key.startswith('__') and key.endswith('__'):
raise KeyError(key)

for entry, excl in self._path:
if hasattr(entry, key) and key not in excl:
resolv = getattr(entry, key)
for entry, excl in self._path: #For every module/variable in the environment
if hasattr(entry, key) and key not in excl: # check if our key is defined in it
resolv = getattr(entry, key) # if found, pull it from the environment
break
else:
continue
else:
else: # if we didn't find earlier and break, default to defining it instead
resolv = DrsSymbol(self._drudge, key)
return resolv

Expand Down
2 changes: 1 addition & 1 deletion tests/nuclear_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def test_wigner3j_sum_to_wigner6j(nuclear: NuclearBogoliubovDrudge):
((-1) ** (j3 - m3) / (2 * j3 + 1))
* KroneckerDelta(j3, jprm3) * KroneckerDelta(m3, mprm3)
* Wigner6j(j1, j2, j3, j4, j5, j6)
).expand().simplify()
).expand().simplify(doit=False)

# For performance reason, just test a random arrangement of the summations.
random.shuffle(sums)
Expand Down

0 comments on commit ec3f690

Please sign in to comment.