Skip to content

Commit c506730

Browse files
committed
changing signature to use kwargs
1 parent 64adf7c commit c506730

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

applications/sckanner/backend/sckanner/migrations/data/composer_ingestion_script.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@ def fetch_paginated_data(population_ids: list[str], stdout=None):
123123
return detailed_data
124124

125125

126-
def get_statements(version="", stdout=None, a_b_via_c_json_file_path=None):
126+
def get_statements(version="", **kwargs):
127+
# Extract parameters from kwargs with defaults
128+
stdout = kwargs.get('stdout', None)
129+
a_b_via_c_json_file_path = kwargs.get('a_b_via_c_json_file_path', None)
130+
127131
try:
128132
# Step 1: Load raw JSON from file or external source
129133
if a_b_via_c_json_file_path:

applications/sckanner/backend/sckanner/migrations/data/neurondm_ingestion_script.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,11 @@ def refine_statement(statement: Dict) -> Dict:
10821082

10831083
## Based on:
10841084
## https://github.com/tgbugs/pyontutils/blob/30c415207b11644808f70c8caecc0c75bd6acb0a/neurondm/docs/composer.py#L668-L698
1085-
def get_statements(version="", local=False, full_imports=[], label_imports=[]):
1085+
def get_statements(version="", **kwargs):
1086+
# Extract parameters from kwargs with defaults
1087+
local = kwargs.get('local', False)
1088+
full_imports = kwargs.get('full_imports', [])
1089+
label_imports = kwargs.get('label_imports', [])
10861090

10871091
config = Config('random-merge')
10881092
g = OntGraph() # load and query graph

applications/sckanner/backend/sckanner/services/ingestion/connectivity_statement_adapter.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,13 @@ def _parse_and_validate_statements(
4040

4141
# Get statements from the uploaded module
4242
if hasattr(module, "get_statements") and callable(module.get_statements):
43-
# Pass the a_b_via_c_json_file path if available
44-
a_b_via_c_json_file_path = None
43+
# Prepare kwargs to pass to get_statements
44+
kwargs = {}
4545
if self.snapshot.a_b_via_c_json_file:
46-
a_b_via_c_json_file_path = self.snapshot.a_b_via_c_json_file.path
46+
kwargs['a_b_via_c_json_file_path'] = self.snapshot.a_b_via_c_json_file.path
4747

48-
statements = module.get_statements(
49-
self.snapshot.version,
50-
a_b_via_c_json_file_path=a_b_via_c_json_file_path
51-
)
48+
# Call get_statements with version and any additional kwargs
49+
statements = module.get_statements(self.snapshot.version, **kwargs)
5250
try:
5351
# Validate the statements against the schema
5452
current_path = os.path.dirname(os.path.abspath(__file__))

0 commit comments

Comments
 (0)