Skip to content

Preserve flexible ELN metadata named parts - #92

Merged
sciappbot merged 1 commit into
sciapp:developfrom
CAOShurong:codex/preserve-eln-parts-metadata
Aug 12, 2026
Merged

Preserve flexible ELN metadata named parts#92
sciappbot merged 1 commit into
sciapp:developfrom
CAOShurong:codex/preserve-eln-parts-metadata

Conversation

@CAOShurong

Copy link
Copy Markdown
Contributor

Summary

  • preserve flexible ELN metadata whose sanitized key is already parts
  • choose a collision-free key for imported nested Dataset relationships using the existing ELN key sanitizer
  • add an end-to-end regression based on the existing SciLog interoperability archive

Problem

Nested Dataset import currently adds generated object references under a hard-coded parts property after the object has been created. If variableMeasured already contains a PropertyValue whose sanitized key is parts, this post-processing step overwrites both its schema and data.

The importer already has _sanitize_keys() for resolving flexible-metadata key collisions. This change uses the same sanitizer for the generated relationship property. Existing imports without a collision keep the parts key; colliding imports preserve the original metadata and use property_parts for the generated references.

Verification

  • Before the change, the new SciLog-based regression fails because Original parts metadata is replaced by five object references.
  • python -m pytest -q --tb=short tests/logic/test_eln_import.py::test_import_nested_datasets_preserves_parts_metadata tests/logic/test_eln_import.py::test_import_nested_datasets
  • Representative SampleDB, SciLog, eLabFTW, PASTA, and Kadi4Mat importer paths: 6 passed.
  • Full Windows importer comparison: this branch 35 passed / 22 failed; upstream develop at d9374c2f 34 passed / 22 failed, with the same 22 platform/environment-dependent failures.
  • Project CI static-analysis commands passed: pycodestyle, pyflakes, pylint, and strict mypy.

@CAOShurong
CAOShurong marked this pull request as ready for review August 12, 2026 12:30
@sciappbot
sciappbot merged commit cb6e031 into sciapp:develop Aug 12, 2026
@FlorianRhiem

Copy link
Copy Markdown
Member

Hey @CAOShurong, thanks for the PR, I've merged it into develop.

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.

3 participants