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

Fix numpy serialization #860

Merged
merged 2 commits into from Nov 14, 2022
Merged

Conversation

tvt173
Copy link
Collaborator

@tvt173 tvt173 commented Nov 14, 2022

Fixes serialization of numpy arrays such that they are retained as numeric types (this was also the old, gdsfactory 5.x behaviour). Increases the default maximum # of digits retained when serializing arrays from 3 to 8 (this could cause side effects if not enough digits are retained, and 8 should still be plenty to ensure consistency across machines... 1e-8 is the default atol threshold in np.isclose()).

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Nov 14, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 1.05%.

Quality metrics Before After Change
Complexity 17.10 🙂 19.96 😞 2.86 👎
Method Length 75.43 🙂 79.71 🙂 4.28 👎
Working memory 14.44 😞 14.21 😞 -0.23 👍
Quality 44.10% 😞 43.05% 😞 -1.05% 👎
Other metrics Before After Change
Lines 107 113 6
Changed files Quality Before Quality After Quality Change
gdsfactory/serialization.py 44.10% 😞 43.05% 😞 -1.05% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
gdsfactory/serialization.py clean_value_json 31 😞 365 ⛔ 20 ⛔ 14.96% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@sonarcloud
Copy link

sonarcloud bot commented Nov 14, 2022

Kudos, SonarCloud Quality Gate passed!    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
2.2% 2.2% Duplication

@tvt173
Copy link
Collaborator Author

tvt173 commented Nov 14, 2022

i think tests are failing on CI for this PR because a cell name changed and results in a changed filename in gdslib. I believe it should all pass once that file gets updated in gdslib. please take a look @joamatab

@joamatab joamatab merged commit 4056bde into gdsfactory:master Nov 14, 2022
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.

None yet

2 participants