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

Specimen description and preparation step fixes #246

Conversation

erikogabrielsson
Copy link
Contributor

Hi,

I had some problems with using the 'SpecimenDescriptionandSpecimenPreparationStep` content items:

  • The name for the DateTimeContentItem was incorrectly capitalized.
  • Datetimes would not parse correctly.
  • Some attributes in the standard were missing.

This PR fixes the above issues and adds tests for the bugs and added parameters. I'm not sureif the approach and style is in line with the rest of the code or if these changes breaks anything else. I'm happy to receive feedback if that is the case.

@CPBridge
Copy link
Collaborator

CPBridge commented Aug 3, 2023

Thanks @erikogabrielsson I'll take look!

Copy link
Collaborator

@CPBridge CPBridge left a comment

Choose a reason for hiding this comment

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

Hi @erikogabrielsson , sorry it took so long to look at this properly. Your help with this is very much appreciated!

Overall looks great but I have some comments on the specifics

Thanks!

src/highdicom/content.py Outdated Show resolved Hide resolved
src/highdicom/content.py Outdated Show resolved Hide resolved
src/highdicom/content.py Outdated Show resolved Hide resolved
src/highdicom/content.py Show resolved Hide resolved
src/highdicom/content.py Show resolved Hide resolved
src/highdicom/content.py Show resolved Hide resolved
src/highdicom/content.py Show resolved Hide resolved
src/highdicom/content.py Outdated Show resolved Hide resolved
tests/test_content.py Show resolved Hide resolved
raise ValueError(
f'Could not decode time value "{self.Time}"'
) from exception
return value.replace()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I didn't write this code originally (that was @hackermd ) and I'm not sure why it was written like it is nor why it doesn't work. Your approach seems more logical I have to say. But have you tried it with pydicom.config.datetime_conversion?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added config.datetime_conversion = datetime_conversion as parameter to the test_from_dataset and it looks OK. Looking at the DA, TM, and DT inits they either take a string or a date, time, or datetime.

@CPBridge
Copy link
Collaborator

Oh and one more request, sorry. Since this involves API changes could you please change the target branch of the pull request from master to v0.22.0dev and we'llaim to release the changes in the next minor release. Thanks

@erikogabrielsson erikogabrielsson changed the base branch from master to v0.22.0dev September 24, 2023 14:40
@erikogabrielsson
Copy link
Contributor Author

Hi @CPBridge and thanks for the review. No worries regarding the timing.

I think I have addressed all of your comments with new commits. Please re-review and let me know if anything was missed.

src/highdicom/content.py Outdated Show resolved Hide resolved
@CPBridge
Copy link
Collaborator

Thanks @erikogabrielsson, your changes look good. However it seems that some comments from my review may have been missed, probably because of github's annoying habit of "collapsing" comments in the middle of a review?

Specifically I'm talking about this, this and this.

@erikogabrielsson
Copy link
Contributor Author

Yes I had missed those (they were collapsed). I have now addressed the missed comments.

Copy link
Collaborator

@CPBridge CPBridge left a comment

Choose a reason for hiding this comment

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

Thanks for your hard work on this @erikogabrielsson, we'll put these changes 0.22.0 (hopefullly not too long until I get around to this)

@CPBridge
Copy link
Collaborator

PS I'll give @hackermd a few more days to comment if he likes before merging

@CPBridge CPBridge merged commit 80a81f9 into ImagingDataCommons:v0.22.0dev Nov 9, 2023
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.

None yet

2 participants