Skip to content

Commit

Permalink
add utf8 support in py2
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotan committed Jan 13, 2025
1 parent 862ecf8 commit bfe1736
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
6 changes: 3 additions & 3 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
2025-01-10 Jan Kotanski <[email protected]>
2025-01-13 Jan Kotanski <[email protected]>
* add support for utf8 in xmla attribute/field values (#174)
* drop support for python2
* tagged as 4.0.0
* add support for utf8 in py2 (#176)
* tagged as 3.13.0

2024-09-27 Jan Kotanski <[email protected]>
* remove NXcollection attribute for nexus_logs (#168)
Expand Down
2 changes: 1 addition & 1 deletion man/nxswriter.1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "NXSWRITER" "1" "Jan 10, 2025" "4.0" "NXSDataWriter"
.TH "NXSWRITER" "1" "Jan 13, 2025" "3.13" "NXSDataWriter"
.SH NAME
nxswriter \- nxswriter Documentation
.sp
Expand Down
2 changes: 1 addition & 1 deletion nxswriter/Release.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@


#: package version
__version__ = "4.0.0"
__version__ = "3.13.0"
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def run(self):
'Topic :: Scientific/Engineering :: Physics',
'Topic :: Software Development :: Libraries :: Python Modules',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
Expand Down
9 changes: 6 additions & 3 deletions test/TangoDataWriterH5Cpp_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ class TangoDataWriterH5CppTest(unittest.TestCase):
def __init__(self, methodName):
unittest.TestCase.__init__(self, methodName)

self._scanXmlpart = """
self._scanXmlpart = u"""
<group type="NXinstrument" name="instrument">
<attribute name ="short_name"> scan instrument </attribute>
<group type="NXdetector" name="detector">
<field units="µm" type="NX_FLOAT" name="counter1">
<field units="\u03bcm" type="NX_FLOAT" name="counter1">
<strategy mode="STEP"/>
<datasource type="CLIENT">
<record name="exp_c01"/>
Expand Down Expand Up @@ -1683,7 +1683,10 @@ def test_scanRecord_nexuspath(self):
self.assertEqual(at.shape, ())
self.assertEqual(at.dtype, "string")
self.assertEqual(at.name, "units")
self.assertEqual(at[...], u"µm")
if sys.version_info > (3, ):
self.assertEqual(at[...], u"\u03bcm")
else:
self.assertEqual(at[...], b"\xce\xbcm")

at = cnt.attributes["nexdatas_source"]
self.assertTrue(at.is_valid)
Expand Down
7 changes: 5 additions & 2 deletions test/TangoDataWriterH5PY_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self, methodName):
<group type="NXinstrument" name="instrument">
<attribute name ="short_name"> scan instrument </attribute>
<group type="NXdetector" name="detector">
<field units="µm" type="NX_FLOAT" name="counter1">
<field units="\u03bcm" type="NX_FLOAT" name="counter1">
<strategy mode="STEP"/>
<datasource type="CLIENT">
<record name="exp_c01"/>
Expand Down Expand Up @@ -1681,7 +1681,10 @@ def test_scanRecord_nexuspath(self):
self.assertEqual(at.shape, ())
self.assertEqual(at.dtype, "string")
self.assertEqual(at.name, "units")
self.assertEqual(at[...], u"µm")
if sys.version_info > (3, ):
self.assertEqual(at[...], u"\u03bcm")
else:
self.assertEqual(at[...], b"\xce\xbcm")

at = cnt.attributes["nexdatas_source"]
self.assertTrue(at.is_valid)
Expand Down

0 comments on commit bfe1736

Please sign in to comment.