Skip to content

Commit

Permalink
Merge pull request #1010 from rhayes777/feature/concise_issues
Browse files Browse the repository at this point in the history
fix numerical ranges in concise
  • Loading branch information
rhayes777 authored Apr 22, 2024
2 parents f55f353 + 03eff31 commit a8d0101
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions autofit/mapper/prior_model/representative.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ def _find_groups(path_value_tuples, position):
paths.append((path, value))

for (before, after, value), names in groups.items():
try:
names = list(map(int, names))
except ValueError:
pass

representative_key = (
f"{min(names)} - {max(names)}" if len(set(names)) > 1 else names[0]
)
Expand Down
2 changes: 1 addition & 1 deletion autofit/text/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def add(self, path: Tuple[str, ...], value):

@property
def text(self):
return "\n".join(self.list)
return "\n".join(map(str, self.list))

@property
def list(self):
Expand Down
6 changes: 3 additions & 3 deletions test_autofit/text/test_concise.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ def test_model_info(collection):
== """Total Free Parameters = 3
model Collection (N=3)
0 - 9 Gaussian (N=3)
0 - 19 Gaussian (N=3)
0 - 9
0 - 19
centre UniformPrior [0], lower_limit = 0.0, upper_limit = 1.0
normalization UniformPrior [1], lower_limit = 0.0, upper_limit = 1.0
sigma UniformPrior [2], lower_limit = 0.0, upper_limit = 1.0"""
Expand Down Expand Up @@ -69,7 +69,7 @@ def test_model_results(samples):
Maximum Log Posterior 1.00000000
model Collection (N=3)
0 - 9 Gaussian (N=3)
0 - 19 Gaussian (N=3)
Maximum Log Likelihood Model:
Expand Down

0 comments on commit a8d0101

Please sign in to comment.