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

refactor: update to/from datename to isoformat compatible pattern #123

Open
wants to merge 4 commits into
base: v1
Choose a base branch
from

Conversation

dbirman
Copy link
Member

@dbirman dbirman commented Jan 6, 2025

This PR updates the date_name_patterns.datetime_to_name_string function to use the new pattern YYYY-MM-DDTHHMMSS. It also deprecates the datetime_from_name_string function in favor of using datetime.fromisoformat

It also updates the data name to the pattern <subject_id>_<datetime> instead of <label>_<date>_<time>

@dbirman dbirman linked an issue Jan 6, 2025 that may be closed by this pull request
@dbirman dbirman requested a review from dyf January 6, 2025 23:23
@dbirman dbirman requested a review from saskiad January 8, 2025 21:51
Copy link
Member

@dyf dyf left a comment

Choose a reason for hiding this comment

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

One comment for consideration.

f"^(?P<platform_abbreviation>.+?)_(?P<subject_id>.+?)_(?P<c_date>{RegexParts.DATE.value})_(?P<c_time>"
f"{RegexParts.TIME.value})$"
)
DERIVED = (
DERIVED_OLD = (
Copy link
Member

Choose a reason for hiding this comment

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

Maybe move these to a DataRegexLegacy class and keep their old names?

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.

Consider supporting fromisoformat as the default datetime parser
2 participants