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

Serialize complex numbers #335

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

robertodr
Copy link

No description provided.

@codecov
Copy link

codecov bot commented Mar 27, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.11 ⚠️

Comparison is base (12bc5dd) 91.09% compared to head (a4f8bb3) 90.99%.

❗ Current head a4f8bb3 differs from pull request most recent head 1f14804. Consider uploading reports for the commit 1f14804 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #335      +/-   ##
==========================================
- Coverage   91.09%   90.99%   -0.11%     
==========================================
  Files          12       12              
  Lines        1775     1777       +2     
  Branches      376      377       +1     
==========================================
  Hits         1617     1617              
- Misses        110      111       +1     
- Partials       48       49       +1     
Impacted Files Coverage Δ
serde/se.py 97.43% <0.00%> (-0.63%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@robertodr
Copy link
Author

I think I need some guidance to implement this. I can't quite figure out where the appropriate point to unpack $a + \mathrm{i} b$ into a (a, b) tuple is. And also, once I have the tuple how to deserialize it back into $a+\mathrm{i} b$ format.

@yukinarit
Copy link
Owner

Hi @robertodr, Thank you for your effort! 🙏

Please try implementing render function for complex type for both serialize and deserialize. Render function renders the code in string, which is passed in exec later to generate real python functions.

Please take a look at this PR that I made to support DefaultDict.

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