Commit Graph

725 Commits

Author SHA1 Message Date
Ian Bell
5bae01a5e9 Use pickle instead of cPickle; deprecation [skip ci] 2025-04-21 18:06:13 -04:00
Ian Bell
4d59587f82 Work on fixing CI git revision in sdist
See #2518
2025-04-10 18:00:38 -04:00
Ian Bell
1f9360ed5c Two more np.nan 2025-04-07 07:30:28 -04:00
Ian Bell
a72baafc77 Add fluid files with superancillary data (#2503)
* Add fluid files with superancillary data

* Delete the large generated z-compressed header
2025-03-22 21:33:18 -04:00
Ian Bell
0a1f13a006 Fix unicode issues with the deprecated State class
Vaguely more sane
Closes #2497
2025-03-16 10:40:30 -04:00
Jeff Henning
3aa58efc5e Merge pull request #2499 from henningjp/MCDOCS
Update Mathcad wrapper docs [skip-ci]
2025-03-14 16:42:29 -04:00
henningjp
84f9660180 Update Mathcad wrapper docs [skip-ci] 2025-03-14 16:09:51 -04:00
jakobreichert
83a253cf9b Add set_cubic_alpha_C function to python wrapper (#2496) 2025-03-10 13:02:47 -04:00
Ian Bell
747f2b0235 Move to more modern pyproject.toml builds
Backwards compatible with old approach
2025-03-09 12:50:09 -04:00
Ian Bell
dc360fc167 miniz fluids (#2495)
* Ignore depcache files [skip ci]

* Z lib compress the fluid data

And migrate to newer version of miniz

* Add the writing of the .z file

* This works on MSVC, not sure about any other platform

How does one inform the linker about what locations to search for this file?

* Does this give the necessary linking info to the compiler?

* Include the header only for MSVC

* The incbin is still needed for non-windows

* Missing headers for Python

* Add miniz source file

* Missing import

* Provide a solution for compilers that don't support assembly to embed files

* Don't specify standard since we have mixed C/C++

https://stackoverflow.com/questions/49000674/cython-std-c11-error-using-both-c-and-c

* rename miniz to cpp

* And cmake

* Back to .c again

Not sure what to do about Python now

* Build the C library and then link it in

* FIx cmake too

* Location for .z file

* arg to setup function

* Check for z file [skip ci]

* Force build temp to be here

* Try switching to setuptools version

* Force the build_temp to be build before clib construction begins

That was subtle...
2025-03-09 10:38:56 -04:00
Ian Bell
906fdfe2d1 On PYPI project names are soon to be required to be all lowercase (#2489)
Test whether renaming the project in setup.py is enough. Does not impact the package name (CoolProp) that is included in the wheel so user code should not change
2025-03-01 15:45:56 -05:00
Ian Bell
3f885db54f Bump fmtlib to 11.1.3 (#2478)
* Bump fmtlib to 11.1.3

Required addition of unicode support

Add the flag for python wheel builds too
2025-02-23 15:48:28 -05:00
Jeff Henning
f3fa94d284 Minor edit to Mathcad libs README 2025-02-22 06:03:15 -04:00
Jeff Henning
276ac4ae01 Get Mathcad Workflow Running Again (#2471)
* Add PTC Libs and Terms of Use to wrappers/Mathcad

* Convert Mathcad README files from RST to MD

* Run Mathcad workflow with local Repo Files

* Allow Mathcad workflow to be called by other workflows
2025-02-18 21:59:43 -05:00
Ian Bell
275581e1ab Move to a more sane option for managing boost archive expansion 2025-01-01 15:07:45 -05:00
Ian Bell
6d23854efe No string in pxd either 2024-12-30 15:27:56 -05:00
Ian Bell
1f428fd935 Try to fix the python 3.13 builds on windows
Remove the string in interface. It seems like the string here should be left untyped to allow auto conversion of strings
2024-12-30 15:21:58 -05:00
MasterGPT9821
233e275b27 Fix Plots of log-p-h diagrams (#2446)
When i tried to plot log(p)-h-diagrams there always had been an issue in the common.py file in line 481. By deleting the "Isoline, self" between the () of super in this line i could fix this an the plots were generated. So i made this pull request.
2024-12-04 14:14:26 -05:00
gitsdfawfevi
a988270be2 Fix np.NaN for numpy >=2 (#2439)
Co-authored-by: gitsdfawfevi <user@server.fake>
2024-11-15 09:44:41 -05:00
Niels Holswilder
fbb2d587bd Python 3.13 and replace distutils with setuptools PEP 632 – Deprecate distutils (#2436)
* Update setup.py replace distutils with setuptools

PEP 632 – Deprecate distutils module.

Edit line 4-6:
from distutils.version import LooseVersion
from distutils.sysconfig import get_config_var
from setuptools.command.build_ext import build_ext
To
from packaging.version import Version
from sysconfig import get_config_var
from setuptools.command.build_ext import build_ext

Edit line 291:
cython_version = Version (Cython.__version__)
To
cython_version = str(Version (Cython.__version__))

Edit line 353:
from distutils.errors import CompileError
To
from setuptools import CompileError

Edit line 394:
from Cython.Distutils.extension import Extension
To
from setuptools.extension import Extension

Delete line 396:
from Cython.Distutils import build_ext
This is now handled with line 6 and thus redundant
from setuptools.command.build_ext import build_ext

Edit line 3, 60, 61 62, 66, 77, 229, and 291
Replace all instances of LooseVersion with Version

* Update python_buildwheels.yml

* Update python_cibuildwheel.yml

* Update setup.py

* Update setup.py

* Update setup.py

* Update python_buildwheels.yml

Added module packaging to the list of dependencies.

* Update python_cibuildwheel.yml

Updated cibuildwheel version form 2.17.0 to latest edition 2.21.3 for python 3.13 support.

* Update python_buildwheels.yml

Deleted lines with python specific exclusions for Windows ARM64 as it already excluded generically.

* Update python_buildwheels.yml

Deleted lines with python specific exclusions for MacOS as these are no longer supported.
2024-11-07 20:45:25 -05:00
Ian Bell
730620f7b1 Expose the neff function 2024-10-03 20:00:15 -04:00
Ian Bell
01b6804a60 Fix source searching in python build
On OSX you get the dreaded .DS_Store files to contend with
2024-08-01 11:25:06 -04:00
stephen-young
d06b84b02a Add link to coolprop-mat repo (#2396)
This commit adds a link to a repo that contains information on how to
call `CoolProp` through MATLAB's C interface with the `CoolProp` shared
library.
2024-07-29 17:58:40 -04:00
spinnau
956d949bbd Update build process for LibreOffice wrapper (#2341)
* Fix build of LibreOffice wrapper for LibreOffice SDK >= 7.5

In the LibreOffice SDK version 7.4 the "idlc" and "regmerge" tools were
deprecated and replaced by the new UNOIDL compiler "unoidl-write". The
old tools have been removed from version 7.5 onwards. Thus, the build
process is changed to use the new compiler.

- The new binary type libary format produced by "unoidl-write" has
  already been used internally since LibreOffice 4.1 in 2013, so that
  extensions built with the new compiler will also run on older office
  versions. The minimal LibreOffice version for the extension is
  therefore changed to 4.1
- With the "unoidl-write" compiler some API changes were introduced.
  Identifiers containing underscores must start with an uppercase
  letter, as identifiers with underscores and starting with a lowercase
  letter are reserved for internal purposes. Thus, the naming of some
  functions used in the extension is changed.

* Enable install of CoolProp python package dev versions

If the LibreOffice extension was built for a development version, then
it should also download the appropriate development version of the
CoolProp python package.

* Add a builder for LibreOffice wrapper

* Add LibreOffice builder to release workflow
2024-01-11 12:46:33 -05:00
Jeff Henning
edbb4920b8 Mathcad Wrapper README Formatting (#2296)
* Mathcad wrapper README formatting fix

* Rename MATHCADPrime.rst to MathcadPrime.rst

Was failing to build TOCtree
2023-09-24 07:41:46 -04:00
Jeff Henning
e1dde6cbff Update Mathcad docs for pre-compiled and discontinuation of Legacy Mathcad [skip-ci] (#2294)
* Update docs for Mathcad Prime install and Legacy Mathcad deprecation
2023-09-20 19:29:02 -04:00
Ian Bell
f0258a8d15 Prepare for cython 3.0
There is a bug in cython 3.0 with module-level dicts it seems
2023-08-06 11:56:09 -04:00
Ian Bell
de38f085cb Turn off the shared_ptr hacks 2023-08-06 11:55:05 -04:00
Ian Bell
39b5519ddb Make the AbstractState owned by State class public 2023-08-03 20:23:19 -04:00
Ian Bell
37c18d5006 Allow predefined mixtures to be added at runtime 2023-07-27 10:04:51 -04:00
Ian Bell
1c5f1768e5 Fix copying of State object with mixtures
need to keep phase imposed
2023-07-26 22:43:50 -04:00
Ian Bell
8066bc0a38 Fix two bugs in phase imposition for State class
The string comparison for phase will always fail because comparison is between bytes and str and phase setting should happen before update
2023-07-26 22:43:09 -04:00
Ian Bell
1ac6ee5383 Fix include path for fmtlib 2023-05-13 09:12:15 -04:00
Ian Bell
80c70e70f2 Fix fmtlib include path 2023-05-13 08:20:14 -04:00
Ian Bell
0ef60d9408 Also output the Fluid in State class 2023-02-04 13:29:18 -05:00
Jorrit Wronski
76daa5abe6 Force a native build on Linux instead of 64bit 2022-12-06 23:16:03 +01:00
Ian Bell
256b810f31 Fix constant generation after the clang-format 2022-04-06 10:54:40 -04:00
Julien Marrec
6913fc41dc Format macros, they keep getting picked incrementally by clang format + Strip trailing whitespaces
```
find . -regextype posix-extended -regex '.*\.(cpp|hpp|c|h|cxx|hxx|py)$' | xargs -I@ sed -i 's/[ \t]*$//' "@"
```
2022-04-01 07:39:35 -04:00
Julien Marrec
05c8cf503b Lint: use automated tooling to reformat C++ and CMakeLists files (#2103)
* Add initial clang tidy / clang format config files

* Clang format the entire codebase

```
find ./src -regextype posix-extended -regex '.*\.(cpp|hpp|c|h|cxx|hxx)$' | xargs clang-format-12 -style=file -i -fallback-style=none
find ./include -regextype posix-extended -regex '.*\.(cpp|hpp|c|h|cxx|hxx)$' | xargs clang-format-12 -style=file -i -fallback-style=none
find ./Web -regextype posix-extended -regex '.*\.(cpp|hpp|c|h|cxx|hxx)$' | xargs clang-format-12 -style=file -i -fallback-style=none
find ./dev -regextype posix-extended -regex '.*\.(cpp|hpp|c|h|cxx|hxx)$' | xargs clang-format-12 -style=file -i -fallback-style=none
find ./wrappers -regextype posix-extended -regex '.*\.(cpp|hpp|c|h|cxx|hxx)$' | xargs clang-format-12 -style=file -i -fallback-style=none
```

* Add a .cmake-format file and reformat CmakeLists.txt with it

https://github.com/cheshirekow/cmake_format

* Add a clang-format workflow


only runs on PRs, only on touched files
2022-03-31 10:51:48 -04:00
Julien Marrec
149a40d88b Add github action to build python wheels (including python 3.9 and 3.10) (#2097)
* Fix build error: `src/Backends/IF97/IF97Backend.h:54:34: error: call of overloaded ‘abs(double)’ is ambiguous`

Found with the manylinux_2_24_x86_64

gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516

* Register MSVC 2019 and 2022 in setup.py

* setup.py: when calling cmake, build in parallel

* Enable using Env variables instead of passing them as args to setup.py

* Github actions for linux: try 1

* use actions/checkout@v3 for submodules

* mod setup.py:; typo

* Random shot for cibuildwheel for all platforms

* I thought package_dir was a flag, but it's positional

* typo in cmake_compiler

* add cython to setup_requires

* try a pryproject.toml to install cython

* try more requirements?

* pywin32 only found on win32 I guess

* Try with CIBW_BEFORE_BUILD instead

* try to enable msvc via vcvarsall on windows, and pass MACOSX_DEPLOYMENT_TARGET

* more tweaks for windoze

* disable tests for now (fails on windows)

* tweak mac again: it seems mac doesn't understand a C++ lambda, so like it's using pre C++11

* tweak

* try 10.15 for mac...

* try to  force C++11 since mac picks up the path where lambdas are used...

* Move back down to 10.9 now that C++11 is enabled and it works on mac, it should be enough

* Try to debug win32

* Enable part of the upload step (minus the upload) to list the wheels

* try to allow win32 to fail for now (instead of plain disabling)

* Disable the python_linux.yml workflow, so cibuildwheels works fine.

* Adjust the upload step to point to the right folder

* make LGTM python happy
2022-03-31 09:26:31 -04:00
Ian Bell
381c8535e5 Update the Javascript tooling 2022-02-08 01:21:03 -05:00
henningjp
111fce7029 Updated Mathcad wrapper to handle Saturation/2-phase errors if TP inputs 2021-10-28 07:52:19 -04:00
Ian Bell
c06d2df794 Fix printing of State class 2021-10-02 15:05:56 -04:00
Ian Bell
64e27b95de Add function set_interaction_parameters 2021-07-27 14:50:09 -04:00
Bryan W. Weber
2ea29cfeaa Fix build on macOS (#2008)
The changes in #1990 require C++11 compiler support. On macOS 10.14 with
XCode 11.3, the -std=c++11 flag must be specified to the compiler.
2021-03-15 21:32:42 -04:00
Steffen Golle
cdc1eccc87 Add Rust Wrapper (#1977)
* Add Rust Wrapper

Signed-off-by: Steffen Golle <somnium@stampernet.de>

* Remove Rust Wrapper

Signed-off-by: Steffen Golle <somnium@stampernet.de>

* Add Rust Wrapper as submodule

Signed-off-by: Steffen Golle <somnium@stampernet.de>

* Add Rust Wrapper as submodule

Signed-off-by: Steffen Golle <somnium@stampernet.de>

* Remove Rust wrapper submodule

* Readd Rust wrapper version 0.2.0
2021-02-27 12:08:28 -05:00
Ian Bell
5674475f43 Tidy up paths 2021-02-02 16:19:47 -05:00
spinnau
eb3e4cec7a LibreOffice: Use pip for installing CoolProp python package (#1993)
Updated the installation routine for the CoolProp python package in the
LibreOffice wrapper to use pip. This simplifies the script, as the download
links for different platforms and ABI versions will be handled by pip.

Bundled Python interpreters in LibreOffice doesn't include pip. But as pip
itself is platform independent and runs on py2/py3, it will be bundled inside
the LibreOffice extension at build time.
2020-12-21 18:25:51 -05:00
Jorrit Wronski
7058c3f2df Reset the Python wrapper for PropsSI to a pre 47800331 state, should help with #1941 2020-07-28 16:07:39 +02:00
Ian Bell
e2b8d104b7 Fix docs for set_reference_stateD 2020-06-28 10:53:18 -04:00