Skip to content

(closes #3135) Fix cyclic dependencies by replacing Scalartype import-time instantiations#3436

Open
sergisiso wants to merge 7 commits into
masterfrom
scalartype_constructors
Open

(closes #3135) Fix cyclic dependencies by replacing Scalartype import-time instantiations#3436
sergisiso wants to merge 7 commits into
masterfrom
scalartype_constructors

Conversation

@sergisiso
Copy link
Copy Markdown
Collaborator

I hit #3135 again where some cyclic dependencies cannot be prevented by adding the import inside methods because they happen when symbols are initialised at import-time. To remove this import time instantiations I opted for creating ScalarType staticmethods instead of the factory proposed in the issue. The change itself is small, but it is repeated many many times.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.96%. Comparing base (b45ff81) to head (13e794c).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3436   +/-   ##
=======================================
  Coverage   99.96%   99.96%           
=======================================
  Files         391      391           
  Lines       54668    54692   +24     
=======================================
+ Hits        54649    54673   +24     
  Misses         19       19           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sergisiso sergisiso requested review from LonelyCat124 and arporter and removed request for arporter May 19, 2026 07:52
@sergisiso
Copy link
Copy Markdown
Collaborator Author

@LonelyCat124 @arporter This is ready for review

@sergisiso sergisiso changed the title (closes #3135) Prevent import time cyclic dependencies with Scalartype constructors (closes #3135) Fix cyclic dependencies by replacing Scalartype import-time instantiations May 19, 2026
@sergisiso sergisiso self-assigned this May 19, 2026
Copy link
Copy Markdown
Collaborator

@LonelyCat124 LonelyCat124 left a comment

Choose a reason for hiding this comment

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

@sergisiso I struggled to look through every single change (my browser is dying looking at the diffs...) but I found some minor issues to check with imports in examples and docs - can you check these? Then I can probably merge.

Comment thread doc/developer_guide/psyir.rst Outdated
Comment thread doc/user_guide/psyir.rst Outdated
@sergisiso
Copy link
Copy Markdown
Collaborator Author

@LonelyCat124 This is ready for another review.

@LonelyCat124
Copy link
Copy Markdown
Collaborator

Set ITs running as a sanity check but otherwise all is good.

@sergisiso
Copy link
Copy Markdown
Collaborator Author

@LonelyCat124 the integration test spotted a INTEGER_TYPE in lfric_apps. I will push a fix now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants