Skip to content

Commit

Permalink
fix: name_is_valid tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
soyers committed Aug 26, 2024
1 parent 264fcb4 commit 116781a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion _pylibCZIrw/src/api/CZIwriteAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void CZIwriteAPI::WriteMetadata(
ssName << "";
nameIsValid = false;
}
return make_tuple(ssId.str(), make_tuple(true, ssName.str()));
return make_tuple(ssId.str(), make_tuple(nameIsValid, ssName.str()));
};

auto mdBldr = this->spWriter_->GetPreparedMetadata(prepareInfo);
Expand Down
8 changes: 8 additions & 0 deletions pylibCZIrw/tests/integration/write/test_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,17 @@ def test_write_metadata_application_version_matches_package_version() -> None:
},
[
{
"@Id": "Channel:0",
"@Name": "TestCh0",
"IsSelected": "true",
"Color": "#FF010203",
"ColorMode": "Color",
"Low": "0.2",
"High": "0.8",
},
{
"@Id": "Channel:1",
"@Name": "TestCh1",
"IsSelected": "true",
"Color": "#FFFFFEFD",
"ColorMode": "Color",
Expand Down Expand Up @@ -239,6 +243,10 @@ def __flatten(setting: Union[List[OrderedDict], OrderedDict]) -> Iterator[Ordere
with tempfile.TemporaryDirectory() as td:
# Act
with create_czi(join(td, "test.czi")) as test_czi:
# Write data to the CZI since behavior on empty images in not well-defined
test_czi.write(data=np.zeros((100, 100), dtype=np.uint8), plane={"C": 0})
test_czi.write(data=np.zeros((100, 100), dtype=np.uint8), plane={"C": 1})
# Write metadata
test_czi.write_metadata(
document_name="TestWriteMetadata",
scale_x=1.0,
Expand Down

0 comments on commit 116781a

Please sign in to comment.