-
Notifications
You must be signed in to change notification settings - Fork 1
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 to create a more maintainable structure #16
Conversation
Hi James, we need all the exisiting Names for the adaptors otherwise the current system will stop working. I think your names are the correct ones, so could you add temporary links matching the old "Cds" names to your new ones. |
After our long discussion, please remove all the renaming, and just do the restructuring |
cads_adaptors/adaptors/__init__.py
Outdated
@@ -1,6 +1,9 @@ | |||
import abc | |||
from typing import Any, BinaryIO | |||
|
|||
from cads_adaptors import constraints, costing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer needed
cads_adaptors/tools/adaptor_tools.py
Outdated
if not issubclass(adaptor_class, adaptor.AbstractAdaptor): | ||
raise TypeError(f"{adaptor_class!r} is not subclass of AbstractAdaptor") | ||
if not issubclass(adaptor_class, AbstractAdaptor): | ||
raise TypeError(f"{adaptor_class!r} is not subclass of Base") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line needs to be reverted:
raise TypeError(f"{adaptor_class!r} is not subclass of Base") | |
raise TypeError(f"{adaptor_class!r} is not subclass of AbstractAdaptor") |
I just merged the updates which Ale made to main |
cads_adaptors/adaptors/mars.py
Outdated
from cads_adaptors.adaptors import cds, Request | ||
|
||
|
||
class DirectMarsAdaptor(cds.AbstractCdsAdaptor): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class DirectMarsAdaptor(cds.AbstractCdsAdaptor): | |
class DirectMarsCdsAdaptor(cds.AbstractCdsAdaptor): |
cads_adaptors/adaptors/mars.py
Outdated
return open("data.grib") # type: ignore | ||
|
||
|
||
class MarsAdaptor(cds.AbstractCdsAdaptor): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class MarsAdaptor(cds.AbstractCdsAdaptor): | |
class MarsCdsAdaptor(cds.AbstractCdsAdaptor): |
cads_adaptors/adaptors/url.py
Outdated
from cads_adaptors.adaptors import cds, Request | ||
|
||
|
||
class UrlAdaptor(cds.AbstractCdsAdaptor): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class UrlAdaptor(cds.AbstractCdsAdaptor): | |
class UrlCdsAdaptor(cds.AbstractCdsAdaptor): |
Refactors the organisation of modules for improved readability and maintainability.