Skip to content

Fix/100, 98, 78#118

Merged
swhume merged 8 commits into
mainfrom
fix/100
Jun 23, 2026
Merged

Fix/100, 98, 78#118
swhume merged 8 commits into
mainfrom
fix/100

Conversation

@swhume

@swhume swhume commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Added minor fixes for issues:

  • 100 nested sub-classes
  • 98 origins as a list - also opened an issue for DDS to change origin to be a list of dictionaries - generator code now processes both plain dictionaries and a list of dictionaries
  • 78 missing significant digits - this requires a USDM file update to point to the latest DSSs - added a workaround in the code for cases where a type=float and displayFormat exists but significant digits is missing, now it will use the displayFormat to create the missing significant digits value

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses three Define generator edge cases: flattening deeply nested observationClass.subClasses into Define-XML v2.1’s flat def:SubClass representation, handling origin provided as either a dict or a list of dicts, and providing a workaround to derive missing SignificantDigits from displayFormat for float items.

Changes:

  • Add subclass-flattening logic with a capped nesting depth and accompanying unit/integration tests.
  • Update derived-method detection to work with multiple origins.
  • Normalize origin input shape (dict vs list) and add a float SignificantDigits fallback derived from displayFormat.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/generators/define/tests/test_itemgroups_subclasses.py Adds coverage for nested subclass flattening and end-to-end XML output expectations.
src/generators/define/post_processing.py Updates derived-method detection to scan all origins rather than only the first.
src/generators/define/items.py Normalizes origin as dict/list and adds displayFormat-based SignificantDigits fallback logic.
src/generators/define/itemGroups.py Implements recursive flattening of nested subclasses with a max depth cap.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/generators/define/items.py Outdated
Comment thread src/generators/define/items.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.

Comment thread src/generators/define/items.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.

Comment thread src/generators/define/tests/test_origin_shapes.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 9 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 9 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 9 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 9 changed files in this pull request and generated no new comments.

@swhume swhume requested review from dostiep and mikemolter and removed request for dostiep June 22, 2026 21:01

@dostiep dostiep left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

All looks good to me.

@swhume swhume merged commit 0461904 into main Jun 23, 2026
6 checks passed
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