Skip to content

Commit

Permalink
resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Teque5 committed Jan 13, 2025
1 parent 5116a6c commit 44df831
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sigmf/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ def get_schema(version=toolversion, schema_file=SCHEMA_META):
TODO: In the future load specific schema versions.
"""
schema_dir = Path(__file__).parent
with open(schema_dir / schema_file, 'rb') as handle:
with open(schema_dir / schema_file, "rb") as handle:
schema = json.load(handle)
return schema
8 changes: 5 additions & 3 deletions sigmf/sigmffile.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,8 +837,9 @@ def verify_stream_hashes(self) -> None:
for stream in streams:
old_hash = stream.get("hash")
metafile_name = get_sigmf_filenames(stream.get("name"))["meta_fn"]
if Path.is_file(metafile_name):
new_hash = sigmf_hash.calculate_sha512(filename=metafile_name)
metafile_path = self.base_path / metafile_name
if Path.is_file(metafile_path):
new_hash = sigmf_hash.calculate_sha512(filename=metafile_path)
if old_hash != new_hash:
raise SigMFFileError(
f"Calculated file hash for {metafile_path} does not match collection metadata."
Expand All @@ -851,7 +852,8 @@ def set_streams(self, metafiles) -> None:
self.metafiles = metafiles
streams = []
for metafile in self.metafiles:
if metafile.endswith(".sigmf-meta") and Path.is_file(metafile):
metafile_path = self.base_path / metafile
if metafile.endswith(".sigmf-meta") and Path.is_file(metafile_path):
stream = {
# name must be string here to be serializable later
"name": str(get_sigmf_filenames(metafile)["base_fn"]),
Expand Down

0 comments on commit 44df831

Please sign in to comment.