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

STYLE: Prefer using f-strings #196

Merged
merged 1 commit into from
Dec 7, 2023

Conversation

jhlegarreta
Copy link
Contributor

Prefer using f-strings.

print(fields)

clusters = stats.to_numpy()[:, 0]
clusters = [os.path.basename(filepath).replace('.vtp', '').replace('.vtk', '').strip() for filepath in clusters]
print()
print('Fiber clusters per subject: (n=%d): ' % len(clusters))
print(f'Fiber clusters per subject: (n={len(clusters)}): ')

if len(clusters) == 800 and len(tracts) == 73:
comm_clusters = [3, 8, 33, 40, 46, 52, 56, 57, 62, 68, 69, 73, 86, 91, 109, 110, 114, 142, 144, 145, 146, 159, 163, 250, 251, 252, 257, 262, 263, 268, 271, 305, 311, 314, 322, 330, 334, 338, 342, 350, 363, 371, 375, 403, 410, 437, 440, 448, 456, 465, 468, 475, 484, 485, 488, 519, 522, 525, 543, 545, 549, 557, 576, 577, 582, 587, 591, 597, 601, 614, 620, 623, 627, 633, 645, 653, 658, 663, 670, 677, 683, 702, 770, 781]
Copy link
Contributor Author

@jhlegarreta jhlegarreta Nov 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should not be hard-coded here; they should be in a separate file so that

  • they can be located easily.
  • they can be reused by other scripts, if necessary.
  • if they need to be changed, this can be done easily in a place that contains only data-/atlas-related labels, and does not pollute the code.

To be done in a separate PR.

@jhlegarreta jhlegarreta force-pushed the TransitionTofStrings branch 3 times, most recently from a29c1f3 to 9958fff Compare November 30, 2023 18:42
Prefer using f-strings.
@jhlegarreta jhlegarreta marked this pull request as ready for review December 7, 2023 16:35
@ljod ljod merged commit e125aaa into SlicerDMRI:master Dec 7, 2023
10 checks passed
@jhlegarreta jhlegarreta deleted the TransitionTofStrings branch December 7, 2023 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants