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 to create a more maintainable structure #16

Merged
merged 13 commits into from
Jul 11, 2023
Merged

Conversation

JamesVarndell
Copy link
Contributor

Refactors the organisation of modules for improved readability and maintainability.

@JamesVarndell JamesVarndell requested a review from EddyCMWF July 10, 2023 15:50
@EddyCMWF
Copy link
Contributor

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.

@EddyCMWF
Copy link
Contributor

After our long discussion, please remove all the renaming, and just do the restructuring

@@ -1,6 +1,9 @@
import abc
from typing import Any, BinaryIO

from cads_adaptors import constraints, costing
Copy link
Contributor

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

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")
Copy link
Contributor

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:

Suggested change
raise TypeError(f"{adaptor_class!r} is not subclass of Base")
raise TypeError(f"{adaptor_class!r} is not subclass of AbstractAdaptor")

@EddyCMWF
Copy link
Contributor

EddyCMWF commented Jul 11, 2023

I just merged the updates which Ale made to main
I also made the changes to trigger the actions, which are now failing. You can use make qa to fix the code standards things, but the unit tests are failing because the class names have not had the Cds put back in.

from cads_adaptors.adaptors import cds, Request


class DirectMarsAdaptor(cds.AbstractCdsAdaptor):
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
class DirectMarsAdaptor(cds.AbstractCdsAdaptor):
class DirectMarsCdsAdaptor(cds.AbstractCdsAdaptor):

return open("data.grib") # type: ignore


class MarsAdaptor(cds.AbstractCdsAdaptor):
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
class MarsAdaptor(cds.AbstractCdsAdaptor):
class MarsCdsAdaptor(cds.AbstractCdsAdaptor):

from cads_adaptors.adaptors import cds, Request


class UrlAdaptor(cds.AbstractCdsAdaptor):
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
class UrlAdaptor(cds.AbstractCdsAdaptor):
class UrlCdsAdaptor(cds.AbstractCdsAdaptor):

@EddyCMWF EddyCMWF merged commit 6ec6e56 into develop Jul 11, 2023
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