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

Refactor with API #2

Merged
merged 99 commits into from
May 22, 2024
Merged

Conversation

pkhalaj
Copy link
Collaborator

@pkhalaj pkhalaj commented Apr 5, 2024

This PR includes the following:

  • - Refactoring the code and provide a lean and modular SDK
  • - Adding an API server to ease the access
  • - Laying the foundation to support different databases (e.g. SQL and MongoDB): For now only MongoDB is supported!
  • - Efficient error handling and logging
  • - Validation and configurations
  • - Tests
  • - Documentation
  • - Make a clean entry point for the recorder

- Amend `README.rst`
- Add metadata to `__init__.py`
- Remove license/copyright notices from other places as we are now using `README.rst` for this purpose.
- Remove `version.py`
@pkhalaj pkhalaj marked this pull request as draft April 5, 2024 09:28
@pkhalaj pkhalaj force-pushed the feature/refactor-with-api branch from cc6e8aa to f3eef38 Compare April 8, 2024 20:37
@pkhalaj pkhalaj force-pushed the feature/refactor-with-api branch 6 times, most recently from 628ec4a to fa17e99 Compare May 5, 2024 22:20
@pkhalaj pkhalaj force-pushed the feature/refactor-with-api branch from fa17e99 to 559b20f Compare May 5, 2024 23:25
@mraspaud mraspaud self-requested a review May 6, 2024 07:41
Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I went through all the files I think :)

First of all, great work with all this! looks clean and organised! Having also documentation autogenerated on readthedocs will help a lot when we work more with this.

I have comments inline, and then some general comments here:

  • I'm not too familiar with rest apis and databases, so I was relying on the tests to get a better grip of the provided functionalities here. Do I understand correctly that adding a record to the database is not supported yet?
  • For timeouts, we generally use seconds as units in pytroll modules (can be a floating point number)
  • Regarding type annotations: I'm not a big fan in general, sorry :) Do you think it would be possible to make them simpler by removing cases we don't need? or refactoring them to simpler types?
  • For linting, we use ruff, see the rules we use here for example: https://github.com/pytroll/pytroll-watchers/blob/main/pyproject.toml#L50-L52

Ok, I'll stop here :) but again, great work!

pkhalaj and others added 5 commits May 13, 2024 11:34
New functionality has been added to the MongoDB class. As a result, the errors are now raised there instead of the API routes.

TODO: Documentation and more tests.
@mraspaud mraspaud marked this pull request as ready for review May 15, 2024 09:11
Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, here comes the next batch of comments. Again, great work, I'm just very opinionated on code readability, sorry :)

Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mraspaud mraspaud merged commit 7675129 into pytroll:master May 22, 2024
6 checks passed
@pkhalaj pkhalaj deleted the feature/refactor-with-api branch May 22, 2024 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants