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

Beginning update reproin.py to deal with ses-X* instances #592

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Michael-Sun
Copy link

No description provided.

@@ -124,6 +124,9 @@

- We replace all ( with { and ) with } to be able e.g. to specify session {date}
- "WIP " prefix unconditionally added by the scanner is stripped


-Michael-Sun Plans on adding a heuristic to deal with ses-X* instances
Copy link
Member

Choose a reason for hiding this comment

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

make it happen!

Copy link
Member

Choose a reason for hiding this comment

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

add above , where _ses- marker described, description that XXX markers are dealt in some other way.

@yarikoptic yarikoptic marked this pull request as draft September 23, 2022 15:32
@Michael-Sun Michael-Sun marked this pull request as ready for review September 23, 2022 16:00
@Michael-Sun
Copy link
Author

Made some edits to do some default behavior if it sees and X* or x*

if prior_sessions:
session = '%03d' % (len(prior_sessions) + 1)
else:
session='001'
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should hardcode to %03d since intention on formatting might have been different etc.

  • do not just take the length of prior_sessions but
    • extract labels (what comes after ses-), see what length they have. if non-uniform (1,...,12) - use plain '%d'. If uniform - use f'%0{len(ses_labels[0])}d'`
    • do not base on len(prior_sessions) but convert all session labels into int. If errors - errors. Take max of those ints, so smth like max(map(int, ses_labels))
  • make this logic into a function get_next_xxx_session(prior_session_dirs: list[str]), for which also add unittests for it

@@ -780,6 +783,13 @@ def infotoids(seqinfos, outdir):
"Should have got a single session marker. Got following: %s"
% ', '.join(map(repr, ses_markers))
)
if re.match("(X|x)*", ses_markers):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if re.match("(X|x)*", ses_markers):
if re.match("XX+$", ses_markers) or re.match("xx+$", ses_markers):

to

  • ensure consistent xxx or XXX and not XxX
  • require at least 2 of those xs
  • no other symbol there (anchor)

Copy link
Member

@yarikoptic yarikoptic left a comment

Choose a reason for hiding this comment

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

left comments on how to proceed. Will move to draft mode. Please undraft when you consider it ready and ping me

@yarikoptic yarikoptic marked this pull request as draft February 17, 2023 14:31
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.

2 participants