Skip to content

Commit

Permalink
Added explicit init of MepoComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
pchakraborty committed Oct 1, 2024
1 parent ecdb1ef commit 6e1cbec
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 21 deletions.
31 changes: 21 additions & 10 deletions src/mepo/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,27 @@ class MepoComponent(object):
"ignore_submodules",
]

def __init__(self):
self.name = None
self.local = None
self.remote = None
self.version = None
self.sparse = None
self.develop = None
self.recurse_submodules = None
self.fixture = None
self.ignore_submodules = None
def __init__(
self,
name=None,
local=None,
remote=None,
version=None,
sparse=None,
develop=None,
recurse_submodules=None,
fixture=None,
ignore_submodules=None,
):
self.name = name
self.local = local
self.remote = remote
self.version = version
self.sparse = sparse
self.develop = develop
self.recurse_submodules = recurse_submodules
self.fixture = fixture
self.ignore_submodules = ignore_submodules

def __repr__(self):
# Older mepo clones will not have ignore_submodules in comp, so
Expand Down
22 changes: 11 additions & 11 deletions tests/test_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ def get_registry():


def get_fvdycore_component():
comp = MepoComponent()
comp.name = "fvdycore"
comp.local = "./src/Components/@FVdycoreCubed_GridComp/@fvdycore"
comp.remote = "https://github.com/GEOS-ESM/GFDL_atmos_cubed_sphere.git"
comp.version = MepoVersion(name="geos/v1.3.0", type="t", detached=True)
comp.sparse = None
comp.develop = "geos/develop"
comp.recurse_submodules = None
comp.fixture = False
comp.ignore_submodules = None
return comp
return MepoComponent(
name="fvdycore",
local="./src/Components/@FVdycoreCubed_GridComp/@fvdycore",
remote="https://github.com/GEOS-ESM/GFDL_atmos_cubed_sphere.git",
version=MepoVersion(name="geos/v1.3.0", type="t", detached=True),
sparse=None,
develop="geos/develop",
recurse_submodules=None,
fixture=False,
ignore_submodules=None,
)


def get_fvdycore_serialized():
Expand Down

0 comments on commit 6e1cbec

Please sign in to comment.