|
From: Rafael L. <ra...@la...> - 2026-10-13 05:37:55
|
I reverse-engineered the output of the ParseResults class and came up with a patch that resolves the '=>' issues. However, since I did not base it on a thorough understanding of the PyParsing code, I am not sure if it is fully appropriate. However, it does solve 19 of the 24 unit test failures caused by upgrading to version 3.3.3 of PyParsing.
The output of the remaining five unit test failures is shown below. It seems that the source of the problem is elsewhere.
Best,
Rafael Laboissière
FAIL: test_integer_dimensions_reordered (__main__.main.<locals>.ScriptTestCase.test_integer_dimensions_reordered)
geometry/integer_dimensions_reordered.xmds
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/rafael/devel/debian/xmds2/xmds2/./run_tests.py", line 328, in newfunc
return func(*(args + fargs), **newkeywords)
File "/home/rafael/devel/debian/xmds2/xmds2/./run_tests.py", line 303, in scriptTestingFunction
self.assertTrue(array_approx_equal(v1['array'], v2['array'], currentAbsoluteTolerance, currentRelativeTolerance),
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"Dependent variable '%s' in moment group %i of file '%s' failed to pass tolerance criteria." % (v1['name'], mgNum+1, sourceFile))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: np.False_ is not true : Dependent variable 'xR' in moment group 1 of file 'integer_dimensions_reordered.xsil' failed to pass tolerance criteria.
======================================================================
FAIL: test_combined (xpdeint.CodeParser.NonlocalDimensionAccessForComponentsTests.test_combined)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/rafael/devel/debian/xmds2/xmds2/xpdeint/CodeParser.py", line 502, in test_combined
self.assertEqual(
~~~~~~~~~~~~~~~~^
nonlocalDimensionAccessForComponents(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<3 lines>...
[('phi', {'j': ('0 - 9', 9), 'kz': ('-kz', 38)}, slice(0, 42))]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
AssertionError: Lists differ: [('phi', {'j': ('0 - 9', 9), 'kz': ('0 - 9', 9)}, slice(0, 42, None))] != [('phi', {'j': ('0 - 9', 9), 'kz': ('-kz', 38)}, slice(0, 42, None))]
First differing element 0:
('phi', {'j': ('0 - 9', 9), 'kz': ('0 - 9', 9)}, slice(0, 42, None))
('phi', {'j': ('0 - 9', 9), 'kz': ('-kz', 38)}, slice(0, 42, None))
- [('phi', {'j': ('0 - 9', 9), 'kz': ('0 - 9', 9)}, slice(0, 42, None))]
? -- ^^ ^
+ [('phi', {'j': ('0 - 9', 9), 'kz': ('-kz', 38)}, slice(0, 42, None))]
? ^^ ^^
======================================================================
FAIL: test_multipleAccess (xpdeint.CodeParser.NonlocalDimensionAccessForComponentsTests.test_multipleAccess)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/rafael/devel/debian/xmds2/xmds2/xpdeint/CodeParser.py", line 510, in test_multipleAccess
self.assertEqual(
~~~~~~~~~~~~~~~~^
nonlocalDimensionAccessForComponents(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<3 lines>...
[('velocity', {'time': ('0.3e-6', 32), 'idx': ('-9 * (1 + 2)', 47)}, slice(15, 60))]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
AssertionError: Lists differ: [('ve[22 chars]3e-6', 32), 'idx': ('0.3e-6', 32)}, slice(15, 60, None))] != [('ve[22 chars]3e-6', 32), 'idx': ('-9 * (1 + 2)', 47)}, slice(15, 60, None))]
First differing element 0:
('vel[20 chars].3e-6', 32), 'idx': ('0.3e-6', 32)}, slice(15, 60, None))
('vel[20 chars].3e-6', 32), 'idx': ('-9 * (1 + 2)', 47)}, slice(15, 60, None))
[('velocity',
- {'idx': ('0.3e-6', 32), 'time': ('0.3e-6', 32)},
+ {'idx': ('-9 * (1 + 2)', 47), 'time': ('0.3e-6', 32)},
slice(15, 60, None))]
======================================================================
FAIL: test_combined (xpdeint.CodeParser.TargetComponentsForOperatorsInStringTests.test_combined)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/rafael/devel/debian/xmds2/xmds2/xpdeint/CodeParser.py", line 449, in test_combined
self.assertEqual(
~~~~~~~~~~~~~~~~^
targetComponentsForOperatorsInString(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<3 lines>...
[('T', 'mu', slice(18, 29)), ('L', 'j[0]+k', slice(30, 42))]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
AssertionError: Lists differ: [('T', 'mu/* */', slice(18, 29, None)), ('L', 'j[0]+k', slice(30, 42, None))] != [('T', 'mu', slice(18, 29, None)), ('L', 'j[0]+k', slice(30, 42, None))]
First differing element 0:
('T', 'mu/* */', slice(18, 29, None))
('T', 'mu', slice(18, 29, None))
- [('T', 'mu/* */', slice(18, 29, None)), ('L', 'j[0]+k', slice(30, 42, None))]
? -----
+ [('T', 'mu', slice(18, 29, None)), ('L', 'j[0]+k', slice(30, 42, None))]
======================================================================
FAIL: test_ignoreChildComment (xpdeint.CodeParser.TargetComponentsForOperatorsInStringTests.test_ignoreChildComment)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/rafael/devel/debian/xmds2/xmds2/xpdeint/CodeParser.py", line 457, in test_ignoreChildComment
self.assertEqual(
~~~~~~~~~~~~~~~~^
targetComponentsForOperatorsInString(['T'], self._block('T[mu /* */ ]')),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[('T', 'mu', slice(0, 12))]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
AssertionError: Lists differ: [('T', 'mu/* */', slice(0, 12, None))] != [('T', 'mu', slice(0, 12, None))]
First differing element 0:
('T', 'mu/* */', slice(0, 12, None))
('T', 'mu', slice(0, 12, None))
- [('T', 'mu/* */', slice(0, 12, None))]
? -----
+ [('T', 'mu', slice(0, 12, None))]
----------------------------------------------------------------------
Ran 174 tests in 486.256s
FAILED (failures=5)
* Rafael Laboissière <ra...@de...> [2026-10-12 15:40]:
> Dear XMDS developers,
>
> A bug report has recently been filed against the Debian package xmds2 [1]. It reports the failure of several unit tests during the building of the package. The full build log is available [2], although I do not know whether this URL is permanent.
>
> I believe that the failures are caused by upgrading PyParsing to version 3.3.3. With version 3.3.2, the xmds2 Debian package builds correctly.
>
> I detected two types of failure. One relates to the parsing of inline comments ("/* ...*/") failing, and the other relates to the "=>" construct not being treated correctly. The latter seems to be caused by line 170, inside the nonlocalDimensionAccessForComponents() function in the xpdeint/CodeParser.py file:
>
> tokenDict = dict(list(tokens.access[0].items()))
>
> This code appears to depend on the internals of the ParseResults class, and is not yielding the correct result. Unfortunately, I do not have the necessary skills to fix the problem.
>
> I hope you will find a fix for the problem.
>
> Best,
>
> Rafael Laboissière
>
> [1] http://bugs.debian.org/1150470
> [2] https://people.debian.org/~sanvila/build-logs/202610/xmds2_3.1.0+dfsg4-1_amd64-20261009T173717.282Z
>
>
> _______________________________________________
> xmds-devel mailing list
> xmd...@li...
> https://lists.sourceforge.net/lists/listinfo/xmds-devel
|