Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix numerical ranges in concise #1010

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading