Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
STYLE: Fix registration id string creation floating point formatting
Fix formatting of numbers that can be floats when creating the registration id string: when transitioning to f-strings (commit ac6040f), it was assumed that `sigma` and `grid_resolution` would be integers, based on the existing formatting. However, these attributes can be set to non-integer values. The pre-f-string transition solution, e.g.: ``` "(...)_sigma_%03d_grid_%03d" % (subject_idx, iteration_count, sigma, grid_resolution) ``` trimmed the decimal part, and thus, for e.g. `sigma` 7.5 and `grid_resolution` 1.5, it would produce: ``` '(...)_sigma_007_grid_001' ``` With the introduction of f-strings, i.e. ``` f"(...)_sigma_{sigma:03d}_grid_{grid_resolution:03d}" ``` this would produce an error, since the `sigma` and `grid_resolution` floating point value cannot be formatted as an integer: ``` {ValueError}ValueError("Unknown format code 'd' for object of type 'float'") ``` This patch set fixes the error by adopting the previous behavior: it trims the decimal part. Left behind in commit d7c6bd8.
- Loading branch information