Skip to content

Commit

Permalink
add CoSTEER unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
XianBW committed Dec 23, 2024
1 parent 3db73f0 commit 7f85fdf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
6 changes: 3 additions & 3 deletions rdagent/components/coder/data_science/ensemble/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def load_ensemble_spec():
return f.read()


def develop_ensemble():
def develop_one_competition(competition: str):
# Initialize scenario and coder
scen = DataScienceScen(competition="aerial-cactus-identification")
scen = DataScienceScen(competition=competition)
ensemble_coder = EnsembleCoSTEER(scen)
# Load ensemble specification
ensemble_spec = load_ensemble_spec()
Expand All @@ -55,4 +55,4 @@ def develop_ensemble():


if __name__ == "__main__":
develop_ensemble()
develop_one_competition("aerial-cactus-identification")
36 changes: 20 additions & 16 deletions test/utils/coder/test_CoSTEER.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import unittest


class CoSTEERTest(unittest.TestCase):

def setUp(self):
pass
self.test_competition = "aerial-cactus-identification"

def tearDown(self):
pass
Expand All @@ -13,31 +12,36 @@ def to_str(self, obj):
return "".join(str(obj).split())

def test_data_loader(self):
# 1) Build the data loader task/experiment
# 2) build an according CoSTEER
# 3) test the results
# - check spec.md
# - check data_loader.py
from rdagent.components.coder.data_science.raw_data_loader.test import (
develop_one_competition,
)

exp = develop_one_competition("aerial-cactus-identification")
# if all tasks in exp are failed, will raise CoderError
exp = develop_one_competition(self.test_competition)

pass
def test_feature(self):
from rdagent.components.coder.data_science.feature.test import (
develop_one_competition,
)
exp = develop_one_competition(self.test_competition)

def test_model(self):
# 1) Build the model experiment/task/workspace from tpl_ex
# 2) build an according CoSTEER
# 3) test the results
from rdagent.components.coder.data_science.model.test import (
develop_one_competition,
)
exp = develop_one_competition(self.test_competition)

exp = develop_one_competition("aerial-cactus-identification")

pass

def test_ensemble(self):
from rdagent.components.coder.data_science.ensemble.test import (
develop_one_competition,
)
exp = develop_one_competition(self.test_competition)

def test_workflow(self):
from rdagent.components.coder.data_science.workflow.test import (
develop_one_competition,
)
exp = develop_one_competition(self.test_competition)

if __name__ == "__main__":
unittest.main()
Expand Down

0 comments on commit 7f85fdf

Please sign in to comment.