Skip to content

Commit

Permalink
Dev (#345)
Browse files Browse the repository at this point in the history
* BCO scoring changes

* Add New Production Deployment md

Changes to be committed:
	deleted:    docs/bco_scores.json
	modified:   docs/deployment/productionDeployment.md
	new file:   docs/newProductionInstance.md

* Update config.md

* Add API endpoint for basic comaprison

Changes to be committed:
	modified:   biocompute/apis.py
	modified:   biocompute/urls.py
	modified:   requirements.txt

* Fix Django CI issue (#340)

biocompute-objects/portal_userdb#380

Changes to be committed:
	modified:   .github/workflows/django.yml
	modified:   biocompute/apis.py
	modified:   biocompute/models.py
	modified:   config/settings.py
	modified:   config/urls.py

* Update to BcoValidator.load_schema (#341)

Updated the function to check locally for the most used schemas. Improves
testing and speed in BCO validation.

Changes to be committed:
	modified:   biocompute/services.py
	renamed:    config/IEEE/2791object.json -> config/schemas/2791object.json
	new file:   config/schemas/dataset_extension.json
	renamed:    config/IEEE/description_domain.json -> config/schemas/description_domain.json
	renamed:    config/IEEE/error_domain.json -> config/schemas/error_domain.json
	renamed:    config/IEEE/execution_domain.json -> config/schemas/execution_domain.json
	new file:   config/schemas/fhir_extension.json
	new file:   config/schemas/galaxy_extension.json
	renamed:    config/IEEE/io_domain.json -> config/schemas/io_domain.json
	new file:   config/schemas/license_extension.json
	renamed:    config/IEEE/parametric_domain.json -> config/schemas/parametric_domain.json
	renamed:    config/IEEE/provenance_domain.json -> config/schemas/provenance_domain.json
	new file:   config/schemas/scm_extension.json
	renamed:    config/IEEE/usability_domain.json -> config/schemas/usability_domain.json

* Add additional schema files and reorganize

Changes to be committed:
	modified:   biocompute/services.py
	new file:   config/schemas/1.1.0/dataset_extension.json
	new file:   config/schemas/1.1.0/fhir_extension.json
	new file:   config/schemas/1.1.0/galaxy_extension.json
	new file:   config/schemas/1.1.0/license_extension.json
	new file:   config/schemas/1.1.0/scm_extension.json
	renamed:    config/schemas/dataset_extension.json -> config/schemas/1.2.0/dataset_extension.json
	renamed:    config/schemas/fhir_extension.json -> config/schemas/1.2.0/fhir_extension.json
	renamed:    config/schemas/galaxy_extension.json -> config/schemas/1.2.0/galaxy_extension.json
	renamed:    config/schemas/license_extension.json -> config/schemas/1.2.0/license_extension.json
	renamed:    config/schemas/scm_extension.json -> config/schemas/1.2.0/scm_extension.json
	renamed:    config/schemas/2791object.json -> config/schemas/2791/2791object.json
	renamed:    config/schemas/description_domain.json -> config/schemas/2791/description_domain.json
	renamed:    config/schemas/error_domain.json -> config/schemas/2791/error_domain.json
	renamed:    config/schemas/execution_domain.json -> config/schemas/2791/execution_domain.json
	renamed:    config/schemas/io_domain.json -> config/schemas/2791/io_domain.json
	renamed:    config/schemas/parametric_domain.json -> config/schemas/2791/parametric_domain.json
	renamed:    config/schemas/provenance_domain.json -> config/schemas/2791/provenance_domain.json
	renamed:    config/schemas/usability_domain.json -> config/schemas/2791/usability_domain.json
	modified:   config/settings.py
	modified:   requirements.txt

* Add instructions for Docker deployment

Changes to be committed:
	modified:   Dockerfile
	modified:   docker-compose.yml
	modified:   docs/deployment/dockerDeployment.md
	new file:   entrypoint.sh

* Update comparison API (#344)

Changes to be committed:
	modified:   biocompute/apis.py

---------

Co-authored-by: Kiran Sen <[email protected]>
Co-authored-by: Kiran Sen <[email protected]>
  • Loading branch information
3 people committed Aug 22, 2024
1 parent c39a741 commit 2ca9b40
Showing 1 changed file with 22 additions and 30 deletions.
52 changes: 22 additions & 30 deletions biocompute/apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,35 +910,27 @@ def post(self, request):
accepted_requests = True
data = request.data

for index, comparison in enumerate(data):
new_bco, old_bco = comparison
identifier = new_bco["object_id"]+ " vs " + old_bco["object_id"]

# new_results = validator.parse_and_validate(bco=new_bco)
# old_results = validator.parse_and_validate(bco=old_bco)
# import pdb; pdb.set_trace()
# new_identifier, new_results = new_results.popitem()
# old_identifier, old_results = bco_results.popitem()

# if results["number_of_errors"] > 0:
# rejected_requests = True
# bco_status = "FAILED"
# status_code = 400
# message = "BCO not valid"

# else:
# accepted_requests = True
# bco_status = "SUCCESS"
# status_code = 200
# message = "BCO valid"
try:

for index, comparison in enumerate(data):
new_bco, old_bco = comparison
identifier = new_bco["object_id"]+ " vs " + old_bco["object_id"]

result = DeepDiff(new_bco, old_bco)
parsed_results = {
'dictionary_item_removed': list(result['dictionary_item_removed']),
'values_changed': list(result['values_changed']),
'iterable_item_removed': list(result['iterable_item_removed'])
}

response_data.append(bulk_response_constructor(
identifier = identifier,
status="SUCCESS",
code=200,
# message=message,
data=DeepDiff(new_bco, old_bco).to_json()
))
response_data.append(bulk_response_constructor(
identifier = identifier,
status="SUCCESS",
code=200,
data=parsed_results
))

status_code = response_status(accepted_requests, rejected_requests)
return Response(status=status_code, data=response_data)
status_code = response_status(accepted_requests, rejected_requests)
return Response(status=status_code, data=response_data)
except Exception:
return Response(status=status.HTTP_400_BAD_REQUEST, data={})

0 comments on commit 2ca9b40

Please sign in to comment.