Skip to content

Commit dffe4f6

Browse files
committed
addressed suggestions to PR #6
1 parent 535a25a commit dffe4f6

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

deep_code/tests/utils/test_ogc_api_record.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def test_record_properties_to_dict(self):
137137
class TestLinksBuilder(unittest.TestCase):
138138
def test_build_theme_links_for_records(self):
139139
links_builder = LinksBuilder(themes=["climate", "ocean"])
140-
theme_links = links_builder.build_them_links_for_records()
140+
theme_links = links_builder.build_theme_links_for_records()
141141

142142
expected_links = [
143143
{

deep_code/tools/publish.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ def publish_files(
100100

101101
class Publisher:
102102
"""Publishes products (datasets) to the OSC GitHub repository.
103-
Inherits from BasePublisher for GitHub publishing logic.
104103
"""
105104

106105
def __init__(self, dataset_config_path: str, workflow_config_path: str):
@@ -317,7 +316,7 @@ def publish_workflow_experiment(self, write_to_file: bool = False):
317316
exp_record_properties = copy.deepcopy(wf_record_properties)
318317

319318
link_builder = LinksBuilder(osc_themes)
320-
theme_links = link_builder.build_them_links_for_records()
319+
theme_links = link_builder.build_theme_links_for_records()
321320

322321
workflow_record = WorkflowAsOgcRecord(
323322
id=workflow_id,

deep_code/utils/ogc_api_record.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def to_dict(self, value_name: str | None = None) -> dict[str, JsonValue]:
8282
data = super().to_dict(value_name)
8383
if self.osc_workflow is not None:
8484
data["osc:workflow"] = self.osc_workflow
85-
del data["osc_workflow"] # Remove the original key as it be renamed it
85+
del data["osc_workflow"] # Remove the original key as it has been renamed
8686
if self.osc_project is not None:
8787
data["osc:project"] = self.osc_project
8888
del data["osc_project"]
@@ -94,13 +94,9 @@ def __init__(self, themes: list[str]):
9494
self.themes = themes
9595
self.theme_links = []
9696

97-
@staticmethod
98-
def format_string(s):
99-
return s.capitalize()
100-
101-
def build_them_links_for_records(self):
97+
def build_theme_links_for_records(self):
10298
for theme in self.themes:
103-
formatted_theme = self.format_string(theme)
99+
formatted_theme = theme.capitalize()
104100
link = {
105101
"rel": "related",
106102
"href": f"../../themes/{theme}/catalog.json",

0 commit comments

Comments
 (0)