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

Bugfix/python #656

Merged
merged 5 commits into from
Mar 10, 2021
Merged

Bugfix/python #656

merged 5 commits into from
Mar 10, 2021

Conversation

howff
Copy link
Contributor

@howff howff commented Mar 9, 2021

Proposed Changes

Handle missing MongoDB settings in default.yaml because settings are spread across two yaml files.
Allow a virtualenv to be specified instead of the default environment when running SRAnonTool.
Handle the output from the latest SemEHR anonymiser
Ignore None-type annotations

Types of changes

What types of changes does your code introduce? Tick all that apply.

  • Bugfix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation-Only Update (if none of the other choices apply)
    • In this case, ensure that the message of the head commit from the source branch is prefixed with [skip ci]

Checklist

By opening this PR, I confirm that I have:

  • Reviewed the contributing guidelines for this repository
  • Ensured that the PR branch is in sync with the target branch (i.e. it is automatically merge-able)
  • Updated any relevant API documentation
  • Created or updated any tests if relevant
  • Created a news file
    • NOTE: This must include any changes to any of the following files: default.yaml, any of the RabbitMQ server configurations, GlobalOptions.cs
  • Listed myself in the CONTRIBUTORS file 🚀
  • Requested a review by one of the repository maintainers

@howff howff marked this pull request as draft March 9, 2021 17:08
@howff howff requested a review from rkm March 10, 2021 13:49
@howff howff marked this pull request as ready for review March 10, 2021 13:51
@@ -144,11 +144,13 @@ def extract_file(input, output):
for root, dirs, files in os.walk(args.input, topdown=False):
for name in files:
extract_file(os.path.join(root, name), args.output_dir)
else:
elif mongodb != {}:
Copy link
Member

Choose a reason for hiding this comment

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

Is this a typo of mongo_db above? I'm not seeing mongodb defined anywhere

# could be a SOPInstanceUID in Mongo
# except SOPInstanceUID is not in the Mongo index,
# only the DicomFilePath.
mongodb = Mongo.SmiPyMongoCollection(mongo_host)
mongodb.setImageCollection('SR')
mongojson = mongodb.DicomFilePathToJSON(args.input)
extract_mongojson(mongojson, output_dir)
else:
logging.error(f'Cannot find {args.input} in as file or in MongoDB')
Copy link
Member

Choose a reason for hiding this comment

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

might be useful to exit non-zero here so any scripts can hook-into this

@howff howff requested a review from rkm March 10, 2021 15:38
@howff howff merged commit 54f523b into master Mar 10, 2021
@howff howff deleted the bugfix/python branch March 10, 2021 17:18
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