Skip to content

Support contributed base classes and check base-class use - #276

Merged
rayosborn merged 3 commits into
nexpy:mainfrom
rayosborn:contributed-base-classes-and-inspect-application
Oct 14, 2026
Merged

rayosborn merged 3 commits into
nexpy:mainfrom
rayosborn:contributed-base-classes-and-inspect-application

Conversation

@rayosborn

Copy link
Copy Markdown
Contributor

Base classes in contributed_definitions are now added to nxclasses, and application validation warns when a definition uses a group its parent base class does not allow.

Summary

  • get_contributed_base_classes() returns the contributed definitions with category="base". get_base_classes() appends them after the standard classes, and contributed=False restores the old list.
  • lint_nxdl() finds and lints contributed base classes (e.g. NXgoniometer) with a warning that they are contributed, instead of reporting an error. Messages without a line number no longer show a bracketed location in nxlint.
  • Application validation warns when a group in the file, used by the definition, is not allowed in its parent by the base class (e.g. NXsource in NXentry in NXmx). GroupValidator.check_in_parent() holds this check and the base-class check uses it too, so its output is unchanged.
  • inspect_application() prints the highlighted NXDL file of an application definition, like inspect_base_class().
  • Adds NXgoniometer.nxdl.xml to the contributed definitions.

Tests

  • Added tests for check_in_parent() and the application base-class warning.

rayosborn and others added 3 commits October 14, 2026 12:04
Add contributed base classes to nxclasses via get_contributed_base_classes()
and a 'contributed' keyword in get_base_classes(). Let lint_nxdl find and
lint base classes in the contributed definitions, warning that they are
contributed. Warn when a group used by an application definition is not
allowed in its parent by the base class, and add inspect_application().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rayosborn
rayosborn merged commit 273cc42 into nexpy:main Oct 14, 2026
19 checks passed
@rayosborn
rayosborn deleted the contributed-base-classes-and-inspect-application branch October 14, 2026 20:19
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.

1 participant