fix: update pyparsing method names to resolve deprecation warnings#113
fix: update pyparsing method names to resolve deprecation warnings#113RobertSundling wants to merge 2 commits intopython-periodictable:masterfrom
Conversation
|
This seems like a very straightforward change... will you want a patch release on pypi after this, or are you working from source? |
For my projects that use periodictable, it's via pip and pypi. So it would be preferable if there could be a patch release there, too. (I do know that makes things a lot more complicated for you.) |
|
I also added |
|
I defer to @pkienzle on publishing new versions of |
|
Some of these were addressed in #109. Need to compare against fix-104-type-hinting to see if I missed any. |
Summary
Updates pyparsing method calls in
formulas.pyto use PEP8-compliant names, resolving deprecation warnings introduced in pyparsing 3.3.0 in December 2025. The PEP8-compliant names were introduced in pyparsing 3.0.0 in August 2021.Problem
Starting with pyparsing 3.3.0, the library emits
PyparsingDeprecationWarningfor methods using the old camelCase naming convention:These warnings appear when using periodictable for formula parsing, creating noise in applications and test suites.
Changes
Updated all pyparsing method calls in
periodictable/formulas.pyto use the new PEP8-compliant method names:setParseAction()set_parse_action()setName()set_name()parseString()parse_string()This was done using the pyparsing-provided migration tool:
pyparsing.tools.cvt_pyparsing_pep8_namesTesting
\dinside a comment on line 529 ofperiodictable/xsf.py)References