Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New OME XML test case not working #144

Open
haesleinhuepf opened this issue Nov 21, 2024 · 2 comments
Open

New OME XML test case not working #144

haesleinhuepf opened this issue Nov 21, 2024 · 2 comments

Comments

@haesleinhuepf
Copy link
Owner

Hi Riccardo @rmassei ,

in #142, this notebook doesn't work on my computer (the assert fails). There is a special character in the xml, which might be read differently on my Windows. I removed the notebook from your submission and if you can make it work again, a follow-up PR would be welcome.

read_ome_xml_from_ome_tiff.ipynb.txt

Error:

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
Cell In[3], line 1
----> 1 check(read_ome_metadata_from_ome_tiff)

Cell In[2], line 11, in check(candidate)
      8 ome_string_result = ome_string_result.strip()
      9 ome_string_expected = ome_string_expected.strip()
---> 11 assert ome_string_result == ome_string_expected

AssertionError: 

Thanks!

Best,
Robert

@rmassei
Copy link

rmassei commented Nov 21, 2024

Really strange, it seems that the additional character is in the expected string

Number of characters in results: 2866
Number of characters in results: 2867

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
Cell In[6], line 1
----> 1 check(read_ome_metadata_from_ome_tiff)

Cell In[5], line 14, in check(candidate)
     11 print(f"Number of characters in results: {len(ome_string_result)}")
     12 print(f"Number of characters in results: {len(ome_string_expected)}")
---> 14 assert ome_string_result == ome_string_expected

AssertionError: 

I will dig into it

@rmassei
Copy link

rmassei commented Nov 21, 2024

found it, the code was reading "µm" as "µm" due to the missing utf-8 encoding. :)
Easy fix, new version is coming in the next PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants