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

Reorganize json objects #65

Merged
merged 4 commits into from
Mar 7, 2024
Merged

Reorganize json objects #65

merged 4 commits into from
Mar 7, 2024

Conversation

BenediktBurger
Copy link
Member

Now that we have our own json-objects and errors file, we can put all errors (even the LECO ones and the pyleco INVALID_SERVER_RESPONSE) into one file instead of keeping errors distributed over several files (errors, json_utils.errors, rpc_generator).

Copy link

codecov bot commented Mar 4, 2024

Codecov Report

Attention: Patch coverage is 88.57143% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 87.68%. Comparing base (db1e795) to head (5b3b193).

Files Patch % Lines
pyleco/json_utils/errors.py 71.42% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #65      +/-   ##
==========================================
+ Coverage   87.58%   87.68%   +0.10%     
==========================================
  Files          36       36              
  Lines        2859     2867       +8     
  Branches      346      347       +1     
==========================================
+ Hits         2504     2514      +10     
+ Misses        295      293       -2     
  Partials       60       60              
Flag Coverage Δ
unittests 87.68% <88.57%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@BenediktBurger
Copy link
Member Author

What do you think about the reorganization, that all errors are in one file and all json rpc objects in another file, @bilderbuchi ?

@bilderbuchi
Copy link
Member

What do you think about the reorganization, that all errors are in one file and all json rpc objects in another file, @bilderbuchi ?

Sounds good in general to keep error definitions together. From a quick glance, it seems strange that all (even generic) errors are in the json_utils module, I would have thought to prefer the pyleco.errors module as the more fitting place to collect all the errors (json-related and other)?

@BenediktBurger
Copy link
Member Author

BenediktBurger commented Mar 6, 2024

Thanks for your comment.
Basically all errors are json errors, either defikned by jsonrpc or defined by leco for use in jsonrpc messages.
The LECO error codes (for example for NOT_SIGNED_IN) are according to jsonrpc specifications and a re meant to be sent via jsonrpc messages, so they are json errors.

If you deem it better, I'll move the errors file to the root directory.

@bilderbuchi
Copy link
Member

If you deem it better, I'll move the errors file to the root directory.

I don't have strong feelings either way.

@BenediktBurger
Copy link
Member Author

Thanks for your comments. I looked at the code again, and the errors are all json related, therefore, I'll keep them in the json directory.

@BenediktBurger BenediktBurger merged commit 20d57c0 into main Mar 7, 2024
20 checks passed
@BenediktBurger BenediktBurger deleted the reorganize_json_objects branch March 7, 2024 10:31
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.

2 participants