Skip to content

IVS-516 - Use simple_spf only in parse_info task #188

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

Merged
merged 6 commits into from
May 8, 2025

Conversation

Ghesselink
Copy link
Contributor

@Ghesselink Ghesselink commented May 3, 2025

Depending on (and requires a new ifcopenshell build here):

Not strictly necessary, but nice to have everything aligned.

@Ghesselink Ghesselink requested review from aothms and rw-bsi May 3, 2025 01:07
@Ghesselink Ghesselink marked this pull request as draft May 3, 2025 02:33
@Ghesselink Ghesselink marked this pull request as ready for review May 3, 2025 13:59
Copy link
Contributor

@rw-bsi rw-bsi left a comment

Choose a reason for hiding this comment

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

Tests following the PR build are failing?

Example: https://github.com/buildingSMART/validate/actions/runs/14812516097/job/41588969992

======================================================================
ERROR: test_parse_info_task_valid_file_does_not_create_validation_outcome (apps.ifc_validation.tests.tests_parse_info_task.ParseInfoTaskTestCase.test_parse_info_task_valid_file_does_not_create_validation_outcome)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/validate/validate/backend/apps/ifc_validation/tests/tests_parse_info_task.py", line 28, in test_parse_info_task_valid_file_does_not_create_validation_outcome
    parse_info_subtask(
  File "/home/runner/work/validate/validate/backend/venv/lib/python3.11/site-packages/celery/local.py", line 182, in __call__
    return self._get_current_object()(*a, **kw)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/validate/validate/backend/venv/lib/python3.11/site-packages/celery/app/task.py", line 411, in __call__
    return self.run(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/validate/validate/backend/core/utils.py", line 71, in wrapper
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/validate/validate/backend/apps/ifc_validation_models/decorators.py", line 54, in wrapper
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/validate/validate/backend/apps/ifc_validation/tasks.py", line 380, in parse_info_subtask
    raise RuntimeError(error_message)
RuntimeError: Running /home/runner/work/validate/validate/backend/venv/bin/python3 /home/runner/work/validate/validate/backend/apps/ifc_validation/checks/header_policy/validate_header.py /home/runner/work/validate/validate/backend/apps/ifc_validation/fixtures/valid_file.ifc failed with exit code 1
Error opening file '/home/runner/work/validate/validate/backend/apps/ifc_validation/fixtures/valid_file.ifc': open() got an unexpected keyword argument 'only_header'

@Ghesselink
Copy link
Contributor Author

> open() got an unexpected keyword argument 'only_header'

There is a new SPF API to parse only the header, which is contained in this PR. I tested it locally by adding this to the .dev/venv folder (in ifcopenshell.simple_spf).
It was a bit of a puzzle to test and develop it due to the dependance of submodules. For the header validation, we do a pre-validation which is essentially running the header-part of the schema validation subtask. Because we're not opening the file with ifcopenshell.open anymore but with simple_spf.open(), this returns a different type for which the validate_ifc_header function within the schema validation must be adjusted: IfcOpenShell/IfcOpenShell#6650.

To be really complete, also this PR should be merged into ifcopenshell before this PR is merged. But it's not strictly necessary.

@Ghesselink Ghesselink force-pushed the IVS-516-Use-spf-only-in-parse-info-task branch from 0edc9e6 to 3dc6695 Compare May 8, 2025 10:27
@Ghesselink Ghesselink force-pushed the IVS-516-Use-spf-only-in-parse-info-task branch from 7383f19 to 3dc6695 Compare May 8, 2025 10:32
@Ghesselink Ghesselink merged commit 6e54a46 into development May 8, 2025
3 checks passed
@Ghesselink Ghesselink deleted the IVS-516-Use-spf-only-in-parse-info-task branch May 8, 2025 10:58
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