From cb92ff6a9190ada12daaff78ca31cb97bad2b618 Mon Sep 17 00:00:00 2001 From: firatbezir Date: Mon, 10 Feb 2025 22:01:51 +0300 Subject: [PATCH 1/4] Update README with verification instructions --- README.md | 108 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 65 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 847af7d6f..d9141c7c1 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ + # SymEngine Python Wrappers -Python wrappers to the C++ library [SymEngine](https://github.com/symengine/symengine), +Python wrappers to the C++ library [SymEngine](https://github.com/symengine/symengine), a fast C++ symbolic manipulation library. -[![Build Status](https://travis-ci.org/symengine/symengine.py.svg)](https://travis-ci.org/symengine/symengine.py) [![Build status](https://ci.appveyor.com/api/projects/status/sl189l9ck3gd8qvk/branch/master?svg=true)](https://ci.appveyor.com/project/symengine/symengine-py/branch/master) +[![Build Status](https://travis-ci.org/symengine/symengine.py.svg)](https://travis-ci.org/symengine/symengine.py) +[![Build status](https://ci.appveyor.com/api/projects/status/sl189l9ck3gd8qvk/branch/master?svg=true)](https://ci.appveyor.com/project/symengine/symengine-py/branch/master) ## Installation @@ -11,71 +13,91 @@ a fast C++ symbolic manipulation library. See License section for information about wheels - pip install symengine --user +```bash +pip install symengine --user +``` ### Conda package manager - conda install python-symengine -c symengine -c conda-forge +```bash +conda install python-symengine -c symengine -c conda-forge +``` -optionally, you may choose to install an early [developer preview](https://github.com/symengine/python-symengine-feedstock): +Optionally, you may choose to install an early [developer preview](https://github.com/symengine/python-symengine-feedstock): - conda install python-symengine -c symengine/label/dev -c conda-forge +```bash +conda install python-symengine -c symengine/label/dev -c conda-forge +``` ### Build from source Install prerequisites. - CMake >= 2.8.12 - Python3 >= 3.8 - Cython >= 0.29.24 - SymEngine >= 0.7.0 +```bash +CMake >= 2.8.12 +Python3 >= 3.8 +Cython >= 0.29.24 +SymEngine >= 0.7.0 +``` -For SymEngine, only a specific commit/tag (see symengine_version.txt) is supported. -Latest git master branch may not work as there may be breaking changes in SymEngine. +For **SymEngine**, only a specific commit/tag (see `symengine_version.txt`) is supported. +The latest git master branch may not work as there may be breaking changes in **SymEngine**. Python wrappers can be installed by, - python setup.py install +```bash +python setup.py install +``` + +Additional options to `setup.py` are: + +```bash +python setup.py install build_ext + --symengine-dir=/path/to/symengine/install/dir # Path to SymEngine install directory or build directory + --compiler=mingw32|msvc|cygwin # Select the compiler for Windows + --generator=cmake-generator # CMake Generator + --build-type=Release|Debug # Set build-type for multi-configuration generators like MSVC + --define="var1=value1;var2=value2" # Give options to CMake + --inplace # Build the extension in source tree +``` + +Standard options to `setup.py` like `--user`, `--prefix` can be used to configure install location. +NumPy is used if found by default, if you wish to make your choice of NumPy use explicit: then add e.g. `WITH_NUMPY=False` to `--define`. + +### Notes on Dependencies -Additional options to setup.py are +If you intend to evaluate floating-point expressions (using **lambdify**), you should consider linking against **LLVM**. Many users might also benefit from linking against **FLINT**, as it is now LGPL-licensed. - python setup.py install build_ext - --symengine-dir=/path/to/symengine/install/dir # Path to SymEngine install directory or build directory - --compiler=mingw32|msvc|cygwin # Select the compiler for Windows - --generator=cmake-generator # CMake Generator - --build-type=Release|Debug # Set build-type for multi-configuration generators like MSVC - --define="var1=value1;var2=value2" # Give options to CMake - --inplace # Build the extension in source tree +In general, **sudo** is only required if you are installing to the default prefix (`/usr/local`). We recommend specifying a custom prefix (`--prefix=$HOME/.local`) to avoid requiring administrative privileges, which most users can do without using **sudo**. -Standard options to setup.py like `--user`, `--prefix` can be used to -configure install location. NumPy is used if found by default, if you wish -to make your choice of NumPy use explicit: then add -e.g. ``WITH_NUMPY=False`` to ``--define``. +If you're uncomfortable specifying the prefix manually, we suggest using **Conda** or installing the pre-built wheels via **pip** instead of building from source. -Use SymEngine from Python as follows: +## Verification - >>> from symengine import var - >>> var("x y z") - (x, y, z) - >>> e = (x+y+z)**2 - >>> e.expand() - 2*x*y + 2*x*z + 2*y*z + x**2 + y**2 + z**2 +You can verify the installation of **SymEngine** by using the provided code snippet in this README. This snippet ensures that the installation works as expected and that basic functionality is available. -You can read Python tests in `symengine/tests` to see what features are -implemented. +```python +from symengine import var +x, y, z = var('x y z') +e = (x + y + z)**2 +expanded_e = e.expand() +print(expanded_e) +``` +This will output: +```python +x**2 + y**2 + z**2 + 2*x*y + 2*x*z + 2*y*z +``` +Note: The verification code provided above checks the functionality of SymEngine. For additional verification specific to SymEngine, please refer to the [official SymEngine Python bindings repository](https://github.com/symengine/symengine.py) for further tests and examples. ## License -symengine.py is MIT licensed and uses several LGPL, BSD-3 and MIT licensed libraries +symengine.py is MIT licensed and uses several LGPL, BSD-3, and MIT licensed libraries. -Licenses for the dependencies of pip wheels are as follows, +Licenses for the dependencies of pip wheels are as follows: -pip wheels on Unix use GMP (LGPL-3.0-or-later), MPFR (LGPL-3.0-or-later), -MPC (LGPL-3.0-or-later), LLVM (Apache-2.0), zlib (Zlib), libxml2 (MIT), -zstd (BSD-3-Clause) and symengine (MIT AND BSD-3-Clause). -pip wheels on Windows use MPIR (LGPL-3.0-or-later) instead of GMP above and -pthreads-win32 (LGPL-3.0-or-later) additionally. -NumPy (BSD-3-Clause) and SymPy (BSD-3-Clause) are optional dependencies. -Sources for these binary dependencies can be found on https://github.com/symengine/symengine-wheels/releases +- pip wheels on Unix use **GMP** (LGPL-3.0-or-later), **MPFR** (LGPL-3.0-or-later), **MPC** (LGPL-3.0-or-later), **LLVM** (Apache-2.0), **zlib** (Zlib), **libxml2** (MIT), **zstd** (BSD-3-Clause), and **symengine** (MIT AND BSD-3-Clause). +- pip wheels on Windows use **MPIR** (LGPL-3.0-or-later) instead of **GMP** above and **pthreads-win32** (LGPL-3.0-or-later) additionally. +- **NumPy** (BSD-3-Clause) and **SymPy** (BSD-3-Clause) are optional dependencies. +- Sources for these binary dependencies can be found on [symengine-wheels](https://github.com/symengine/symengine-wheels/releases). From 984cb44b9b85c55b6e375b548b5665fd9183dece Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sun, 16 Feb 2025 18:30:19 -0600 Subject: [PATCH 2/4] Remove symengine conda channel from isntructions --- README.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/README.md b/README.md index d9141c7c1..6e6e624fc 100644 --- a/README.md +++ b/README.md @@ -20,13 +20,7 @@ pip install symengine --user ### Conda package manager ```bash -conda install python-symengine -c symengine -c conda-forge -``` - -Optionally, you may choose to install an early [developer preview](https://github.com/symengine/python-symengine-feedstock): - -```bash -conda install python-symengine -c symengine/label/dev -c conda-forge +conda install python-symengine -c conda-forge ``` ### Build from source From 63a7a0f6d3bde94b1fb21cd87874935478ee4875 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sun, 16 Feb 2025 18:35:57 -0600 Subject: [PATCH 3/4] Update README.md --- README.md | 52 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 6e6e624fc..2a89249ea 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # SymEngine Python Wrappers -Python wrappers to the C++ library [SymEngine](https://github.com/symengine/symengine), +Python wrappers to the C++ library [SymEngine](https://github.com/symengine/symengine), a fast C++ symbolic manipulation library. [![Build Status](https://travis-ci.org/symengine/symengine.py.svg)](https://travis-ci.org/symengine/symengine.py) @@ -34,8 +34,9 @@ Cython >= 0.29.24 SymEngine >= 0.7.0 ``` -For **SymEngine**, only a specific commit/tag (see `symengine_version.txt`) is supported. -The latest git master branch may not work as there may be breaking changes in **SymEngine**. +For **SymEngine**, only a specific commit/tag (see `symengine_version.txt`) is +supported. The latest git master branch may not work as there may be breaking +changes in **SymEngine**. Python wrappers can be installed by, @@ -55,20 +56,31 @@ python setup.py install build_ext --inplace # Build the extension in source tree ``` -Standard options to `setup.py` like `--user`, `--prefix` can be used to configure install location. -NumPy is used if found by default, if you wish to make your choice of NumPy use explicit: then add e.g. `WITH_NUMPY=False` to `--define`. +Standard options to `setup.py` like `--user`, `--prefix` can be used to +configure install location. NumPy is used if found by default, if you wish +to make your choice of NumPy use explicit: then add +e.g. `WITH_NUMPY=False` to `--define`. ### Notes on Dependencies -If you intend to evaluate floating-point expressions (using **lambdify**), you should consider linking against **LLVM**. Many users might also benefit from linking against **FLINT**, as it is now LGPL-licensed. +If you intend to evaluate floating-point expressions (using **lambdify**), +you should consider linking against **LLVM**. Many users might also benefit +from linking against **FLINT**, as it is now LGPL-licensed. -In general, **sudo** is only required if you are installing to the default prefix (`/usr/local`). We recommend specifying a custom prefix (`--prefix=$HOME/.local`) to avoid requiring administrative privileges, which most users can do without using **sudo**. +In general, **sudo** is only required if you are installing to the default +prefix (`/usr/local`). We recommend specifying a custom prefix +(`--prefix=$HOME/.local`) to avoid requiring administrative privileges, +which most users can do without using **sudo**. -If you're uncomfortable specifying the prefix manually, we suggest using **Conda** or installing the pre-built wheels via **pip** instead of building from source. +If you're uncomfortable specifying the prefix manually, we suggest using +**Conda** or installing the pre-built wheels via **pip** instead of building +from source. ## Verification -You can verify the installation of **SymEngine** by using the provided code snippet in this README. This snippet ensures that the installation works as expected and that basic functionality is available. +You can verify the installation of **SymEngine** by using the provided code +snippet in this README. This snippet ensures that the installation works as +expected and that basic functionality is available. ```python from symengine import var @@ -82,16 +94,26 @@ This will output: x**2 + y**2 + z**2 + 2*x*y + 2*x*z + 2*y*z ``` -Note: The verification code provided above checks the functionality of SymEngine. For additional verification specific to SymEngine, please refer to the [official SymEngine Python bindings repository](https://github.com/symengine/symengine.py) for further tests and examples. +Note: The verification code provided above checks the functionality of +SymEngine. For additional verification specific to SymEngine, please refer to +the [official SymEngine Python bindings repository](https://github.com/symengine/symengine.py) +for further tests and examples. ## License -symengine.py is MIT licensed and uses several LGPL, BSD-3, and MIT licensed libraries. +symengine.py is MIT licensed and uses several LGPL, BSD-3, and MIT licensed +libraries. Licenses for the dependencies of pip wheels are as follows: -- pip wheels on Unix use **GMP** (LGPL-3.0-or-later), **MPFR** (LGPL-3.0-or-later), **MPC** (LGPL-3.0-or-later), **LLVM** (Apache-2.0), **zlib** (Zlib), **libxml2** (MIT), **zstd** (BSD-3-Clause), and **symengine** (MIT AND BSD-3-Clause). -- pip wheels on Windows use **MPIR** (LGPL-3.0-or-later) instead of **GMP** above and **pthreads-win32** (LGPL-3.0-or-later) additionally. -- **NumPy** (BSD-3-Clause) and **SymPy** (BSD-3-Clause) are optional dependencies. -- Sources for these binary dependencies can be found on [symengine-wheels](https://github.com/symengine/symengine-wheels/releases). +- pip wheels on Unix use **GMP** (LGPL-3.0-or-later), + **MPFR** (LGPL-3.0-or-later), **MPC** (LGPL-3.0-or-later), + **LLVM** (Apache-2.0), **zlib** (Zlib), **libxml2** (MIT), + **zstd** (BSD-3-Clause), and **symengine** (MIT AND BSD-3-Clause). +- pip wheels on Windows use **MPIR** (LGPL-3.0-or-later) instead of **GMP** + above and **pthreads-win32** (LGPL-3.0-or-later) additionally. +- **NumPy** (BSD-3-Clause) and **SymPy** (BSD-3-Clause) are optional + dependencies. +- Sources for these binary dependencies can be found on + [symengine-wheels](https://github.com/symengine/symengine-wheels/releases). From a3a9ce81796a2b4defdc2b7f074d440c58158e39 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sun, 16 Feb 2025 18:38:47 -0600 Subject: [PATCH 4/4] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 2a89249ea..e13eb7272 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ - # SymEngine Python Wrappers Python wrappers to the C++ library [SymEngine](https://github.com/symengine/symengine),