usnistgov / REFPROP-wrappers

Wrappers around NIST REFPROP for languages such as Python, MATLAB, etc.
195 stars 127 forks source link

Mathematica 13.2 Breaks Unit Handling in Mathematica Wrapper #495

Closed henningjp closed 1 year ago

henningjp commented 1 year ago

Description

Mathematica 13.2 breaks some unit handling employed in the RefpropLink paclet; Specifically the definition of Newton (N) and Ferenheit (°F) in the underlying RefpropUnits code.

Steps to Reproduce

  1. Just load the RefpropLink wrapper per usual with
    Needs["RefpropLink`"]

Expected behavior: No errors on load and accurate behavior of pre-defined units.

Actual behavior:

  1. Loading RefpropLink throws an error, at which point there is confusion between N, Newton, and Newtons.

    Quantity: Unable to interpret unit specification 1. N .
  2. Applying pre-defined unit, °F, results in non-sensical unit conversion

    In[1] T = 72 °F
    Out[1] 18426.8 K

These are the only issues discovered so far. Basic REFPROP wrapper functionality is still working.

Versions

REFPROP Version: REFPROP 10
Operating System and Version: Windows 10 Access Method: Mathematica Wrapper (Mathematica 13.2 - Recent Update)

Additional Information

Working on fixing this.
Suggest not upgrading to 13.2 just yet until a patch is created.

Suspect some duplicate symbol definitions are now bleeding over to create conflicts with unit symbols initialized when RefpropLink is loaded.

ianhbell commented 1 year ago

Would this break backwards compatibility for earlier version of Mathematica?

henningjp commented 1 year ago

No. I can fix the first issue for all versions and have already tested it using a more rigorous unit definition.

The second issue may fix itself if it’s really a Wolfram bug. If not, a workaround can be made to be version dependent in the paclet code; provided I can find a workaround.

ianhbell commented 1 year ago

Did you report the possible bug?

henningjp commented 1 year ago

Checked version 3.1 at work this week to verify. Works fine. Reporting 13.2 issue with examples this Friday to Wolfram.

henningjp commented 1 year ago

Wolfram is aware and working on it. In the meantime, they've provided a work-around. I'll issue a patch update this week once I've tested it with the workaround applied only if MM version 13.2 is detected by the paclet scripts.