Skip to content

Transformations require depends on#70

Closed
jokasimr wants to merge 2 commits into
mainfrom
transformations-require-depends-on
Closed

Transformations require depends on#70
jokasimr wants to merge 2 commits into
mainfrom
transformations-require-depends-on

Conversation

@jokasimr

Copy link
Copy Markdown
Contributor

I noticed that some targets of depends_on are not NXtransformations.
I don't think that is correct according to the nexus standard.

In any case, it causes problems in our transformation chain resolution because we expect that a target of a depends_on has a depends_on attribute and not a depends_on dataset, and non-NXtransformation components generally don't have a depends_on attribute, even if they might have a depends_on dataset.

Specifically, the detector component in the Estia nexus files depends on the /entry/instrument/multiblade_detector/transformations/detector_rotation entry which is a NXpositioner and does not have a depends_on attribute.

It does however have other attributes (transformation_type and vector) that indicates it was really intended to have been a NXtransformation but was mislabeled.

To catch this issue and similar I'm adding a requirement that any target of a depends_on has to be a NXtransformation.

@jokasimr jokasimr requested a review from SimonHeybrock June 24, 2026 14:37
@jokasimr jokasimr marked this pull request as draft June 24, 2026 14:46
@jokasimr

Copy link
Copy Markdown
Contributor Author

I think I might have misunderstood some things 🤔

There's probably still an issue here somewhere, but my interpretation is wrong.

NXtransformation does not exist, only NXtransformations (plural).

@jokasimr

Copy link
Copy Markdown
Contributor Author

Okay, I think the correct fix here is to say that the target of any depends_on (field or attribute) must itself have a depends_on attribute, otherwise the chain is broken.
Is this correct?

@SimonHeybrock

Copy link
Copy Markdown
Member

Okay, I think the correct fix here is to say that the target of any depends_on (field or attribute) must itself have a depends_on attribute, otherwise the chain is broken. Is this correct?

Yes, chains should always end in depends_on='.'.

Comment thread src/chexus/validators.py
Comment on lines +192 to +196
return (
node.attrs.get("NX_class") == "NXtransformation"
and "transformation_type" in node.attrs
and "vector" in node.attrs
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As you said yourself, this is not correct. The transformations themselves are typically just fields, not groups, so they do not have an NX_class.

@jokasimr

Copy link
Copy Markdown
Contributor Author

Superseded by #71

@jokasimr jokasimr closed this Jun 25, 2026
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