Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement structure style clusters #509

Merged
merged 5 commits into from
Jun 4, 2021
Merged

Implement structure style clusters #509

merged 5 commits into from
Jun 4, 2021

Conversation

tefra
Copy link
Owner

@tefra tefra commented Jun 2, 2021

Some schemas out there are simply huge and the generated modules are also huge, making them almost impossible to work with during development but also cause huge load times even when only a small fraction of classes are needed by document type.

Obviously it's impossible in python to go the one class per file way due to circular imports but we can group strongly coupled classes together in an effort to create smaller modules.

Algorithm: http://code.activestate.com/recipes/578507/

Steps:

  • Decouple mappers from module/package assignment
  • Move designation process inside the the class analyzer
  • Verify that everything still works
  • Add new style
  • Test again all samples with new style

@codecov
Copy link

codecov bot commented Jun 2, 2021

Codecov Report

Merging #509 (c75e6bb) into master (5bf4a87) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #509   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           84        86    +2     
  Lines         7412      7478   +66     
  Branches      1299      1308    +9     
=========================================
+ Hits          7412      7478   +66     
Impacted Files Coverage Δ
xsdata/cli.py 100.00% <ø> (ø)
xsdata/codegen/handlers/class_bare_inner.py 100.00% <ø> (ø)
xsdata/models/mixins.py 100.00% <ø> (ø)
xsdata/codegen/analyzer.py 100.00% <100.00%> (ø)
xsdata/codegen/container.py 100.00% <100.00%> (ø)
xsdata/codegen/handlers/__init__.py 100.00% <100.00%> (ø)
xsdata/codegen/handlers/attribute_default_value.py 100.00% <100.00%> (ø)
xsdata/codegen/handlers/attribute_group.py 100.00% <100.00%> (ø)
xsdata/codegen/handlers/attribute_overrides.py 100.00% <100.00%> (ø)
xsdata/codegen/handlers/attribute_substitution.py 100.00% <100.00%> (ø)
... and 22 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5bf4a87...c75e6bb. Read the comment docs.

@tefra tefra changed the title Implement structure style clustered Implement structure style clusters Jun 3, 2021
@tefra
Copy link
Owner Author

tefra commented Jun 3, 2021

I am really excited about this one, first all one of the ugliest parts of the process now has moved into the analyzer process instead of running after the mapping process out of place and secondly this style is the closest thing to one class per file for python

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 3, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@tefra
Copy link
Owner Author

tefra commented Jun 3, 2021

This also fixes an issue with the netex collection failing to discover one derived typed 🧨

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