-
Notifications
You must be signed in to change notification settings - Fork 8
feat: experiment library schema changes, ingestion report with errors, json schema warnings #435
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
Open
v-rocheleau
wants to merge
26
commits into
develop
Choose a base branch
from
features/library-strategies
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
e9cf81d
xml parsing
v-rocheleau 2f765da
xsd ontologies utils
v-rocheleau e479e4c
lint
v-rocheleau 26becc3
experiment library strategy data migration
v-rocheleau 762d23a
xsd dir name change
v-rocheleau a32bd01
fix poetry.lock
v-rocheleau 1390066
code clean
v-rocheleau d8d9a85
lint
v-rocheleau d030cb6
read library selection, add doc
v-rocheleau 48ff585
fix test data
v-rocheleau 2a93fe4
fix migration type
v-rocheleau eb93de0
migration fix, lint
v-rocheleau fae4540
add validation error descriptions to IngestError
v-rocheleau 0c1cb1b
ingest response format
v-rocheleau 9f8ff0c
ingestion error responds with warnings on schema changes
v-rocheleau 2194a08
update api ingestion tests
v-rocheleau 948f6bc
lint
v-rocheleau db378d2
add ingestion tests, exp workflow payload schema
v-rocheleau 881f792
infer success from status code
v-rocheleau b359973
remove line call
v-rocheleau 9b58dc4
get ingestion warnings from derived experiment results ingestion
v-rocheleau dd0f66c
save ingest report to file and output
v-rocheleau 74e55fa
Merge branch 'develop' into features/library-strategies
v-rocheleau f9fa0f9
fix migrations, lint
v-rocheleau 4148d36
schema changes version update
v-rocheleau bbef730
fix api ingest tests
v-rocheleau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
chord_metadata_service/experiments/migrations/0009_v4_1_0.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| from django.db import migrations | ||
|
|
||
|
|
||
| def set_experiment_library_strategy(apps, _schema_editor): | ||
| Experiment = apps.get_model("experiments", "Experiment") | ||
| for exp in Experiment.objects.filter(library_strategy="WES"): | ||
| exp.library_strategy = "WXS" | ||
| exp.save() | ||
|
|
||
|
v-rocheleau marked this conversation as resolved.
|
||
| class Migration(migrations.Migration): | ||
| dependencies = [ | ||
| ('experiments', '0007_v4_0_0'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.RunPython(set_experiment_library_strategy) | ||
| ] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| from .utils import readXsdSimpleTypeValues | ||
|
|
||
| __all__ = [ | ||
| "readXsdSimpleTypeValues", | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import xmltodict | ||
|
|
||
|
|
||
| def readXsdSimpleTypeValues(xsd_file_path: str, type_name: str): | ||
|
v-rocheleau marked this conversation as resolved.
Outdated
|
||
| """Reads an XML Schema Definition (XSD) file and returns a type's values. | ||
| The XSD file is parsed using xmltodict following this spec: | ||
| https://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html | ||
| """ | ||
| sra_file = open(xsd_file_path).read() | ||
|
v-rocheleau marked this conversation as resolved.
Outdated
|
||
| sra_experiment_data = xmltodict.parse(sra_file, namespaces={'xs': None}) | ||
| simple_types = {sp["@name"]: sp for sp in sra_experiment_data["schema"]["simpleType"]} | ||
| target_type = simple_types[type_name] | ||
| values = [val['@value'] for val in target_type['restriction']['enumeration']] | ||
| return values | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.