Skip to content

Commit

Permalink
Merge pull request #90 from SciCatProject/test-1104
Browse files Browse the repository at this point in the history
Configuration stuff
  • Loading branch information
YooSunYoung authored Nov 4, 2024
2 parents 427a2a9 + d6fdd84 commit c81ac41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
10 changes: 5 additions & 5 deletions src/scicat_communication.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def retrieve_value_from_scicat(
field_name: str, # variable_recipe["field"]
) -> str:
response: dict = requests.get(
scicat_endpoint_url, headers=config.additional_headers, timeout=config.timeout
scicat_endpoint_url, headers=config.headers, timeout=config.timeout
).json()
return response[field_name] if field_name else response

Expand Down Expand Up @@ -55,7 +55,7 @@ def create_scicat_dataset(
response = _post_to_scicat(
url=config.urls.datasets,
posting_obj=dataset,
headers=config.additional_headers,
headers=config.headers,
timeout=config.timeout,
)
result: dict = response.json()
Expand Down Expand Up @@ -87,7 +87,7 @@ def create_scicat_origdatablock(
response = _post_to_scicat(
url=config.urls.origdatablocks,
posting_obj=origdatablock,
headers=config.additional_headers,
headers=config.headers,
timeout=config.timeout,
)
result: dict = response.json()
Expand Down Expand Up @@ -122,7 +122,7 @@ def check_dataset_by_pid(
) -> bool:
response = _get_from_scicat(
url=urljoin(config.host_address, f"datasets/{quote(pid)}"),
headers=config.additional_headers,
headers=config.headers,
timeout=config.timeout,
stream=config.stream,
verify=config.verify,
Expand Down Expand Up @@ -159,7 +159,7 @@ def check_dataset_by_metadata(
logger.info("Checking if dataset exists by metadata with url: %s", url)
response = _get_from_scicat(
url=url,
headers=config.additional_headers,
headers=config.headers,
timeout=config.timeout,
stream=config.stream,
verify=config.verify,
Expand Down
8 changes: 1 addition & 7 deletions src/scicat_offline_ingestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,11 @@ def main() -> None:
metadata_schema.variables, h5file, config
)

# Collect data-file descriptions
if not config.ingestion.file_handling.use_full_file_path:
source_folder = variable_map["source_folder"]
else:
source_folder = None

data_file_list = create_data_file_list(
nexus_file=nexus_file_path,
ingestor_directory=ingestor_directory,
config=fh_options,
source_folder=source_folder,
source_folder=variable_map["source_folder"],
logger=logger,
# TODO: add done_writing_message_file and nexus_structure_file
)
Expand Down

0 comments on commit c81ac41

Please sign in to comment.