Hello community,

here is the log from the commit of package python-praatio for openSUSE:Factory 
checked in at 2020-06-16 13:46:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-praatio (Old)
 and      /work/SRC/openSUSE:Factory/.python-praatio.new.3606 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-praatio"

Tue Jun 16 13:46:39 2020 rev:7 rq:814866 version:4.1.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-praatio/python-praatio.changes    
2020-02-10 21:56:27.546291672 +0100
+++ /work/SRC/openSUSE:Factory/.python-praatio.new.3606/python-praatio.changes  
2020-06-16 13:47:21.054448682 +0200
@@ -1,0 +2,7 @@
+Fri Jun 12 08:26:53 UTC 2020 - pgaj...@suse.com
+
+- version update to 4.1.0
+  * Textgrids can now be read "raw"
+- switch from nosetests to pytest
+
+-------------------------------------------------------------------

Old:
----
  praatIO-4.0.0.tar.gz

New:
----
  praatIO-4.1.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-praatio.spec ++++++
--- /var/tmp/diff_new_pack.uUsoco/_old  2020-06-16 13:47:22.602453903 +0200
+++ /var/tmp/diff_new_pack.uUsoco/_new  2020-06-16 13:47:22.602453903 +0200
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define         skip_python2 1
 Name:           python-praatio
-Version:        4.0.0
+Version:        4.1.0
 Release:        0
 Summary:        A library for working with praat
 License:        MIT
@@ -31,7 +31,7 @@
 BuildRequires:  python-rpm-macros
 Recommends:     praat
 # SECTION test requirements
-BuildRequires:  %{python_module nose}
+BuildRequires:  %{python_module pytest}
 # /SECTION
 BuildArch:      noarch
 %python_subpackages
@@ -65,15 +65,7 @@
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
 %check
-# Reset examples after Python 2 test run
-cp -rp examples examples-orig
-%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib}
-nosetests-%{$python_bin_suffix} --exe
-if [ -d examples-orig ]; then
-  rm -r examples
-  mv examples-orig examples
-fi
-}
+%pytest examples/test/*.py
 
 %files %{python_files}
 %license LICENSE

++++++ praatIO-4.0.0.tar.gz -> praatIO-4.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/praatIO-4.0.0/README.md new/praatIO-4.1.0/README.md
--- old/praatIO-4.0.0/README.md 2020-02-05 05:02:20.000000000 +0100
+++ new/praatIO-4.1.0/README.md 2020-05-13 15:25:07.000000000 +0200
@@ -91,6 +91,10 @@
 
 *Praatio uses semantic versioning (Major.Minor.Patch)*
 
+Ver 4.1 (May 13, 2020)
+- Textgrids can now be read "raw"
+    - For backwards compatibility, by default, unlabeled points and intervals 
are removed when opening textgrids
+
 Ver 4.0 (February 5, 2020)
 - Removed unlicensed xsampa.py file, along with associated utility 
sppas_util.py (originally added in Ver 3.4)
     - If you are not directly importing either of those files, you can upgrade 
without changing your code
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/praatIO-4.0.0/docs/tgio.html 
new/praatIO-4.1.0/docs/tgio.html
--- old/praatIO-4.0.0/docs/tgio.html    2020-02-05 05:02:20.000000000 +0100
+++ new/praatIO-4.1.0/docs/tgio.html    2020-05-13 15:25:07.000000000 +0200
@@ -69,7 +69,7 @@
 def _isclose(a, b, rel_tol=1e-14, abs_tol=0.0):
     return abs(a - b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)
 
-  
+
 def _getWavDuration(wavFN):
     "For internal use.  See praatio.audioio.WavQueryObj() for general 
use."
     audiofile = wave.open(wavFN, "r")
@@ -81,6 +81,11 @@
     return duration
 
 
+def _removeBlanks(tier):
+    entryList = [entry for entry in tier.entryList if entry[-1] != ""]
+    return tier.new(entryList=entryList)
+
+
 def _fillInBlanks(tier, blankLabel="", startTime=None, endTime=None):
     '''
     Fills in the space between intervals with empty space
@@ -1530,8 +1535,12 @@
             fd.write(outputTxt)
 
 
-def openTextgrid(fnFullPath):
-    
+def openTextgrid(fnFullPath, readRaw=False):
+    '''
+    Opens a textgrid for editing
+
+    readRaw: points and intervals with an empty label ie '' are 
removed unless readRaw=True
+    '''
     try:
         with io.open(fnFullPath, "r", encoding="utf-16") as fd:
             data = fd.read()
@@ -1547,6 +1556,12 @@
     else:
         textgrid = _parseNormalTextgrid(data)
     
+    if readRaw == False:
+        for tierName in textgrid.tierNameList:
+            tier = textgrid.tierDict[tierName]
+            tier = _removeBlanks(tier)
+            textgrid.replaceTier(tierName, tier)
+
     return textgrid
 
 
@@ -1613,8 +1628,6 @@
                     break
                 
                 label = label.strip()
-                if label == "":
-                    continue
                 tierEntryList.append((timeStart, timeEnd, label))
             tier = IntervalTier(tierName, tierEntryList, tierStart, tierEnd)
         else:
@@ -1626,8 +1639,6 @@
                     break
                 
                 label = label.strip()
-                if label == "":
-                    continue
                 tierEntryList.append((time, label))
             tier = PointTier(tierName, tierEntryList, tierStart, tierEnd)
         
@@ -1690,8 +1701,6 @@
                     break
                 
                 label = label.strip()
-                if label == "":
-                    continue
                 entryList.append((startTime, endTime, label))
                 
             newTG.addTier(IntervalTier(tierName, entryList,
@@ -1705,8 +1714,6 @@
                 except (ValueError, IndexError):
                     break
                 label = label.strip()
-                if label == "":
-                    continue
                 entryList.append((time, label))
                 
             newTG.addTier(PointTier(tierName, entryList,
@@ -1828,16 +1835,21 @@
 </details>
 </dd>
 <dt id="praatio.tgio.openTextgrid"><code class="name flex">
-<span>def <span 
class="ident">openTextgrid</span></span>(<span>fnFullPath)</span>
+<span>def <span class="ident">openTextgrid</span></span>(<span>fnFullPath, 
readRaw=False)</span>
 </code></dt>
 <dd>
-<section class="desc"></section>
+<section class="desc"><p>Opens a textgrid for editing</p>
+<p>readRaw: points and intervals with an empty label ie '' are removed unless 
readRaw=True</p></section>
 <details class="source">
 <summary>
 <span>Expand source code</span>
 </summary>
-<pre><code class="python">def openTextgrid(fnFullPath):
-    
+<pre><code class="python">def openTextgrid(fnFullPath, readRaw=False):
+    &#39;&#39;&#39;
+    Opens a textgrid for editing
+
+    readRaw: points and intervals with an empty label ie &#39;&#39; are 
removed unless readRaw=True
+    &#39;&#39;&#39;
     try:
         with io.open(fnFullPath, &#34;r&#34;, encoding=&#34;utf-16&#34;) as fd:
             data = fd.read()
@@ -1853,6 +1865,12 @@
     else:
         textgrid = _parseNormalTextgrid(data)
     
+    if readRaw == False:
+        for tierName in textgrid.tierNameList:
+            tier = textgrid.tierDict[tierName]
+            tier = _removeBlanks(tier)
+            textgrid.replaceTier(tierName, tier)
+
     return textgrid</code></pre>
 </details>
 </dd>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/praatIO-4.0.0/examples/test/tg_tests.py 
new/praatIO-4.1.0/examples/test/tg_tests.py
--- old/praatIO-4.0.0/examples/test/tg_tests.py 2020-02-05 05:02:20.000000000 
+0100
+++ new/praatIO-4.1.0/examples/test/tg_tests.py 2020-05-13 15:25:07.000000000 
+0200
@@ -24,6 +24,24 @@
         self.dataRoot = join(root, "files")
         self.outputRoot = join(self.dataRoot, "io_test_output")
     
+    def test_openTextgrid(self):
+        tgFN = join(self.dataRoot, "mary.TextGrid")
+        
+        tg = tgio.openTextgrid(tgFN)
+        tier = tg.tierDict['word']
+        numEntries = len(tier.entryList)
+
+        self.assertEqual(4, numEntries)
+
+    def test_openTextgrid_with_readRaw(self):
+        tgFN = join(self.dataRoot, "mary.TextGrid")
+        
+        tg = tgio.openTextgrid(tgFN, True)
+        tier = tg.tierDict['word']
+        numEntries = len(tier.entryList)
+
+        self.assertEqual(6, numEntries)
+
     def test_shift(self):
         '''Testing adjustments to textgrid times'''
         tgFN = join(self.dataRoot, "mary.TextGrid")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/praatIO-4.0.0/praatio/tgio.py 
new/praatIO-4.1.0/praatio/tgio.py
--- old/praatIO-4.0.0/praatio/tgio.py   2020-02-05 05:02:20.000000000 +0100
+++ new/praatIO-4.1.0/praatio/tgio.py   2020-05-13 15:25:07.000000000 +0200
@@ -45,6 +45,11 @@
     return duration
 
 
+def _removeBlanks(tier):
+    entryList = [entry for entry in tier.entryList if entry[-1] != ""]
+    return tier.new(entryList=entryList)
+
+
 def _fillInBlanks(tier, blankLabel="", startTime=None, endTime=None):
     '''
     Fills in the space between intervals with empty space
@@ -1494,8 +1499,12 @@
             fd.write(outputTxt)
 
 
-def openTextgrid(fnFullPath):
-    
+def openTextgrid(fnFullPath, readRaw=False):
+    '''
+    Opens a textgrid for editing
+
+    readRaw: points and intervals with an empty label ie '' are removed unless 
readRaw=True
+    '''
     try:
         with io.open(fnFullPath, "r", encoding="utf-16") as fd:
             data = fd.read()
@@ -1511,6 +1520,12 @@
     else:
         textgrid = _parseNormalTextgrid(data)
     
+    if readRaw == False:
+        for tierName in textgrid.tierNameList:
+            tier = textgrid.tierDict[tierName]
+            tier = _removeBlanks(tier)
+            textgrid.replaceTier(tierName, tier)
+    
     return textgrid
 
 
@@ -1577,8 +1592,6 @@
                     break
                 
                 label = label.strip()
-                if label == "":
-                    continue
                 tierEntryList.append((timeStart, timeEnd, label))
             tier = IntervalTier(tierName, tierEntryList, tierStart, tierEnd)
         else:
@@ -1590,8 +1603,6 @@
                     break
                 
                 label = label.strip()
-                if label == "":
-                    continue
                 tierEntryList.append((time, label))
             tier = PointTier(tierName, tierEntryList, tierStart, tierEnd)
         
@@ -1654,8 +1665,6 @@
                     break
                 
                 label = label.strip()
-                if label == "":
-                    continue
                 entryList.append((startTime, endTime, label))
                 
             newTG.addTier(IntervalTier(tierName, entryList,
@@ -1669,8 +1678,6 @@
                 except (ValueError, IndexError):
                     break
                 label = label.strip()
-                if label == "":
-                    continue
                 entryList.append((time, label))
                 
             newTG.addTier(PointTier(tierName, entryList,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/praatIO-4.0.0/setup.py new/praatIO-4.1.0/setup.py
--- old/praatIO-4.0.0/setup.py  2020-02-05 05:02:20.000000000 +0100
+++ new/praatIO-4.1.0/setup.py  2020-05-13 15:25:07.000000000 +0200
@@ -8,7 +8,7 @@
 from setuptools import setup
 import io
 setup(name='praatio',
-      version='4.0.0',
+      version='4.1.0',
       author='Tim Mahrt',
       author_email='timma...@gmail.com',
       url='https://github.com/timmahrt/praatIO',


Reply via email to