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

python: add support for formats #436

Merged
merged 6 commits into from
Aug 30, 2023
Merged

Conversation

vanyauhalin
Copy link
Contributor

@vanyauhalin vanyauhalin commented Jul 28, 2023

In this pull request, I've added the Codable module that I wrote while refactoring the history module to encode and decode JSON objects. The algorithm for converting to Codable instances is far from efficient, but it's simple and compatible with new Python features.

Maybe in the future, it would be worth replacing the local implementation with an external dependency that provides the same functionality, such as the relatively popular dataclasses-json. However, currently, this library isn't very friendly with type annotations (see issues) and has difficulties with type inference (see #227).

On the other hand, we can simply keep this implementation as it's because it's doing a great job.


Pending #435.

@vanyauhalin vanyauhalin requested a review from rivexe July 28, 2023 08:27
@vanyauhalin vanyauhalin force-pushed the feature/python-matrix-formats branch from bb48d77 to c06f2a5 Compare July 28, 2023 14:01
@vanyauhalin vanyauhalin marked this pull request as ready for review August 11, 2023 15:07
@vanyauhalin vanyauhalin force-pushed the feature/python-matrix-formats branch 2 times, most recently from f1f7fa8 to 8a0e6b0 Compare August 16, 2023 10:54
@vanyauhalin vanyauhalin marked this pull request as draft August 22, 2023 07:32
@vanyauhalin
Copy link
Contributor Author

Pending #445.

@vanyauhalin vanyauhalin marked this pull request as ready for review August 25, 2023 06:07
@vanyauhalin
Copy link
Contributor Author

@aleksandrfedorov97, please take a look at the new changes. I've replaced my "bike" that parses JSON objects to Python classes. Furthermore, I've also added memorization for the high-cost method in the FormatManager.

@LinneyS LinneyS merged commit b691eb5 into develop Aug 30, 2023
1 check failed
@LinneyS LinneyS deleted the feature/python-matrix-formats branch August 30, 2023 08:24
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.

4 participants