-
Notifications
You must be signed in to change notification settings - Fork 5
Add BagIt functionality and BagIt test suite #26
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
base: dev
Are you sure you want to change the base?
Conversation
src/MEDFORD/objs/bagitHandler.py
Outdated
| with open(bag_info_path, 'w', encoding='utf-8') as f: | ||
| for line in bag_info_lines: | ||
| f.write(line + '\n') | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run Flake8 on all files to catch inconsistent formatting.
src/MEDFORD/objs/linecollections.py
Outdated
|
|
||
| def get_content(self, resolved_macros: Dict[str, str]) -> str : | ||
| out = self.headline.get_content(resolved_macros) | ||
| # print(f"Call stack: {traceback.format_stack()}", file=sys.stderr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if DEBUG
| assert L is not None | ||
| confirmed_lines.append(L) | ||
|
|
||
| lc : LineCollector = LineCollector(confirmed_lines) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this deal with the issue of the LineCollector TODO comment seen previously?
|
In general, now would be a good time to delete any file that became unused. Flake8 will tell you. |
…kenly being marked as required issue was that even if marked as optional, pydantic still requires them to be marked as equals None
…es. Also, removed printed output from tests.
…ring leading whitespace
94a60a9 to
2a11c03
Compare
src/MEDFORD/medford.py
Outdated
| write_json=args.write_json, | ||
| output_path="." | ||
| ) | ||
| >>>>>>> 90ea795 (halfway done with bagit handler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
src/MEDFORD/medford.py
Outdated
| json.dump(self.dict_data, f, indent=2) | ||
| combined_data = process_blocks_to_dict(self.blocks) | ||
| json.dump(combined_data, f, indent=2) | ||
| hello |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
|
Have you checked if the medford command actually works with your changes? I've already found 2 locations that should cause the entire program not to compile. |
This PR adds BagIt validation and compilation functionalities as well as a test suite testing it.
Included:
BagIt validator that validates: if file root exists, if file referenced exists, that all files in FileRoot must have corresponding tags, and if all files are readable
BagIt compiler that creates a .zip with: metadata files, manifest.txt, bag-info.txt, metadata.mfd, and metadata.json files
Test cases for all data provenance tokens and error cases.
Input .mfd files for testing.
Expected output Bags for validation
Test runner script and setup utilities
Run the test suite with python3 bagit_testsuite/bagit_testsuite_driver.py.