Skip to content

Commit 0f6af89

Browse files
committed
Index formatting tweaks
1 parent cd041f3 commit 0f6af89

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

adcc/ExcitedStates.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242

4343
class FormatExcitationVector:
44-
def __init__(self, matrix, tolerance=1e-3, index_format=None):
44+
def __init__(self, matrix, tolerance=0.01, index_format=None):
4545
"""
4646
Set up a formatter class for formatting excitation vectors.
4747
@@ -471,7 +471,7 @@ def _repr_pretty_(self, pp, cycle):
471471
else:
472472
pp.text(self.describe())
473473

474-
def describe_amplitudes(self, tolerance=1e-3, index_format=None):
474+
def describe_amplitudes(self, tolerance=0.01, index_format=None):
475475
"""
476476
Return a string describing the dominant amplitudes of each
477477
excitation vector in human-readable form. The ``kwargs``

adcc/FormatDominantElements.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929

3030

3131
class FormatDominantElements:
32-
def __init__(self, mospaces, tolerance=1e-3, index_format=FormatIndexAdcc):
32+
def __init__(self, mospaces, tolerance=0.01, index_format=FormatIndexAdcc):
3333
self.mospaces = mospaces
34-
self.tolerance = 1e-3
34+
self.tolerance = tolerance
3535
self.value_format = "{:+8.3g}" # Formatting used for the values
3636

3737
if isinstance(index_format, type):

adcc/FormatIndex.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,7 @@ def optimise_formatting(self, space_index_pairs):
245245
"""
246246
maxlen = max(len(self._translate_index(space, idx)[1])
247247
for space, idx in space_index_pairs)
248-
log_max_idx = int(np.log(max(1, maxlen)))
249-
self.maxlen_offset = max(log_max_idx, self.maxlen_offset, 2)
248+
self.maxlen_offset = max(maxlen, self.maxlen_offset, 2)
250249

251250
def format(self, space, idx, concat_spin=True):
252251
word, offset, spin = self._translate_index(space, idx)

0 commit comments

Comments
 (0)