Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
randytpierce committed Sep 13, 2024
1 parent 5b965cb commit 96c974c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
6 changes: 4 additions & 2 deletions src/vxingest/grib2_to_cb/grib_builder_parent.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,13 +802,15 @@ def build_document(self, queue_element):
if self.do_profiling:
with cProfile.Profile() as _pr:
self.handle_document()
with Path(self.profile_output_path / "profiling_stats.txt").open(
with Path(self.profile_output_path / "profiling_stats.txt").open(
"w", encoding="utf-8"
) as stream:
stats = Stats(_pr, stream=stream)
stats.strip_dirs()
stats.sort_stats("time")
stats.dump_stats(self.profile_output_path / "profiling_stats.prof")
stats.dump_stats(
self.profile_output_path / "profiling_stats.prof"
)
stats.print_stats()
else:
self.handle_document()
Expand Down
3 changes: 1 addition & 2 deletions src/vxingest/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,7 @@ def run_ingest() -> None:
args.log_dir / f"all_logs-{runtime.strftime('%Y-%m-%dT%H:%M:%S%z')}.log",
)
# set profiling output
os.environ['PROFILE_OUTPUT_DIR'] = args.log_dir

os.environ["PROFILE_OUTPUT_DIR"] = args.log_dir

logger.info("Getting credentials")
creds = get_credentials(args.credentials_file)
Expand Down
12 changes: 7 additions & 5 deletions tests/vxingest/builder_common/test_unit_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,14 @@ def connect_cb():
)
return cb_connection

@ pytest.mark.integration

@pytest.mark.integration
def test_get_file_list(request):
vx_ingest = VXIngest()
vx_ingest.credentials_file = os.environ["CREDENTIALS"]
vx_ingest.cb_credentials = vx_ingest.get_credentials(vx_ingest.load_spec)
vx_ingest.connect_cb()
testdata = Path(
"tests/vxingest/builder_common/testdata/get_file_list_grib2.n1ql"
)
testdata = Path("tests/vxingest/builder_common/testdata/get_file_list_grib2.n1ql")
with testdata.open(mode="r", encoding="utf-8") as file:
_statement = file.read()
temp_dir_path = "/tmp/vx_ingest"
Expand All @@ -72,7 +71,10 @@ def test_get_file_list(request):
)
assert file_list is not None, f"{request.node.name}: file_list is None"
assert len(file_list) > 0, f"{request.node.name}: file_list is empty"
assert file_list[3] > file_list[2], f"{request.node.name}: file_list is not reverse sorted"
assert (
file_list[3] > file_list[2]
), f"{request.node.name}: file_list is not reverse sorted"


@pytest.mark.integration
def test_stations_fcst_valid_epoch(request):
Expand Down

0 comments on commit 96c974c

Please sign in to comment.