Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into volkoff
Browse files Browse the repository at this point in the history
  • Loading branch information
bluescarni committed Sep 4, 2024
2 parents aac755b + 6bddbef commit 9af9a6a
Show file tree
Hide file tree
Showing 25 changed files with 347 additions and 154 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
command: bash ./tools/circleci_conda_heyoka_head_312.sh
ubuntu_arm64:
machine:
image: ubuntu-2004:202101-01
image: ubuntu-2204:current
resource_class: arm.large
steps:
- checkout
Expand Down
35 changes: 16 additions & 19 deletions .github/workflows/gh_actions_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,10 @@ jobs:
HEYOKA_PY_BUILD_TYPE: "Python312"
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
steps:
# NOTE: don't updated to checkout@v4 here because
# the action does not work properly due to missing
# symbols on the ancient manylinux images.
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build
run: bash tools/gha_manylinux.sh
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: wheel_312
path: build/wheel/dist2/*.whl
Expand All @@ -59,10 +56,10 @@ jobs:
HEYOKA_PY_BUILD_TYPE: "Python311"
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build
run: bash tools/gha_manylinux.sh
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: wheel_311
path: build/wheel/dist2/*.whl
Expand All @@ -74,10 +71,10 @@ jobs:
HEYOKA_PY_BUILD_TYPE: "Python310"
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build
run: bash tools/gha_manylinux.sh
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: wheel_310
path: build/wheel/dist2/*.whl
Expand All @@ -89,10 +86,10 @@ jobs:
HEYOKA_PY_BUILD_TYPE: "Python39"
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build
run: bash tools/gha_manylinux.sh
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: wheel_39
path: build/wheel/dist2/*.whl
Expand All @@ -104,10 +101,10 @@ jobs:
HEYOKA_PY_BUILD_TYPE: "Python38"
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build
run: bash tools/gha_manylinux.sh
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: wheel_38
path: build/wheel/dist2/*.whl
Expand All @@ -118,26 +115,26 @@ jobs:
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: "3.10"
python-version: "3.12"
channels: conda-forge
channel-priority: strict
- uses: ilammy/msvc-dev-cmd@v1
- name: Build
shell: pwsh
run: |
conda install -y python=3.10 git pybind11 numpy<2 cmake llvmdev tbb-devel tbb astroquery libboost-devel fmt<11 skyfield spdlog sleef sympy cloudpickle zlib libzlib 'mppp=1.*' numba
conda install -y python=3.12 git pybind11 numpy<2 cmake llvmdev tbb-devel tbb astroquery libboost-devel fmt skyfield spdlog sleef sympy cloudpickle zlib libzlib 'mppp=1.*' numba
git clone --depth 1 https://github.com/bluescarni/heyoka.git heyoka_cpp
cd heyoka_cpp
mkdir build
cd build
cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_PREFIX_PATH=C:\Miniconda\envs\test\Library -DCMAKE_INSTALL_PREFIX=C:\Miniconda\envs\test\Library -DBoost_NO_BOOST_CMAKE=ON -DHEYOKA_ENABLE_IPO=yes -DHEYOKA_WITH_SLEEF=yes -DHEYOKA_WITH_MPPP=yes
cmake --build . --config Release --target install -j2
cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_PREFIX_PATH=C:\Miniconda\envs\test\Library -DCMAKE_INSTALL_PREFIX=C:\Miniconda\envs\test\Library -DHEYOKA_ENABLE_IPO=yes -DHEYOKA_WITH_SLEEF=yes -DHEYOKA_WITH_MPPP=yes
cmake --build . --config Release --target install -j4
cd ..
cd ..
mkdir build
cd build
cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_PREFIX_PATH=C:\Miniconda\envs\test\Library -DCMAKE_INSTALL_PREFIX=C:\Miniconda\envs\test\Library -DBoost_NO_BOOST_CMAKE=ON -DHEYOKA_PY_ENABLE_IPO=yes
cmake --build . --config Release --target install -j2
cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_PREFIX_PATH=C:\Miniconda\envs\test\Library -DCMAKE_INSTALL_PREFIX=C:\Miniconda\envs\test\Library -DHEYOKA_PY_ENABLE_IPO=yes
cmake --build . --config Release --target install -j4
cd ..
cd tools
python ci_test_runner.py --with-numba
Expand Down
17 changes: 14 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if(NOT CMAKE_BUILD_TYPE)
FORCE)
endif()

project(heyoka.py VERSION 5.1.0 LANGUAGES CXX C)
project(heyoka.py VERSION 6.0.0 LANGUAGES CXX C)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/yacma")

Expand Down Expand Up @@ -118,7 +118,7 @@ find_package(fmt REQUIRED CONFIG)
message(STATUS "fmt version: ${fmt_VERSION}")

# heyoka.
find_package(heyoka 5.1.0 REQUIRED CONFIG)
find_package(heyoka 6.0.0 REQUIRED CONFIG)

# Python.

Expand Down Expand Up @@ -166,8 +166,19 @@ if(${pybind11_VERSION} VERSION_LESS "2.10")
endif()

# Boost.
# NOTE: we look for Boost in CONFIG mode first, as that has become the official supported way
# of locating Boost in recent Boost/CMake versions. If we fail, we try again in
# MODULE mode as last resort.
# NOTE: need 1.69 for safe numerics.
find_package(Boost 1.69 REQUIRED serialization)
find_package(Boost 1.69 QUIET COMPONENTS serialization CONFIG)
if(NOT ${Boost_FOUND})
message(STATUS "Boost not found in CONFIG mode, retrying in MODULE mode.")
find_package(Boost 1.69 QUIET MODULE COMPONENTS serialization)
endif()
if(NOT ${Boost_FOUND})
message(FATAL_ERROR "Could not locate Boost in either CONFIG or MODULE mode.")
endif()
message(STATUS "Found Boost version ${Boost_VERSION}.")

# Mandatory dependency on TBB.
find_package(TBB REQUIRED CONFIG)
Expand Down
27 changes: 27 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,33 @@
Changelog
=========

6.0.0 (unreleased)
------------------

New
~~~

- Implement parallel compilation for Taylor integrators
and compiled functions
(`#188 <https://github.com/bluescarni/heyoka.py/pull/188>`__).
- Add the possibility of specifying the LLVM code model
used for JIT compilation
(`#188 <https://github.com/bluescarni/heyoka.py/pull/188>`__).

Changes
~~~~~~~

- heyoka.py now requires version 6.0.0 of the
heyoka C++ library
(`#188 <https://github.com/bluescarni/heyoka.py/pull/188>`__).

Fix
~~~

- Fix build system warnings when using recent versions of
CMake and Boost
(`#188 <https://github.com/bluescarni/heyoka.py/pull/188>`__).

5.1.0 (2024-07-23)
------------------

Expand Down
3 changes: 3 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@
# Force printing traceback to stderr on execution error.
nb_execution_show_tb = True

# Set a longer timeout for notebook execution.
nb_execution_timeout = 120

latex_engine = "xelatex"

myst_enable_extensions = [
Expand Down
12 changes: 9 additions & 3 deletions doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Dependencies
heyoka.py has several Python and C++ dependencies. On the C++ side, heyoka.py depends on:

* the `heyoka C++ library <https://github.com/bluescarni/heyoka>`__,
version 5.1.x (**mandatory**),
version 6.0.x (**mandatory**),
* the `Boost <https://www.boost.org/>`__ C++ libraries (**mandatory**),
* the `{fmt} <https://fmt.dev/latest/index.html>`__ library (**mandatory**),
* the `TBB <https://github.com/oneapi-src/oneTBB>`__ library (**mandatory**),
Expand All @@ -21,8 +21,7 @@ heyoka.py has several Python and C++ dependencies. On the C++ side, heyoka.py de
:ref:`heyoka <hy:installation>` and :ref:`mp++ <mppp:installation>` installation
instructions).

On the Python side, heyoka.py requires at least Python 3.5
(Python 2.x is **not** supported) and depends on:
On the Python side, heyoka.py requires at least Python 3.5 and depends on:

* `NumPy <https://numpy.org/>`__ (version <2, **mandatory**),
* `cloudpickle <https://github.com/cloudpipe/cloudpickle>`__ (**mandatory**),
Expand Down Expand Up @@ -88,6 +87,13 @@ heyoka.py. In order to install heyoka.py using pkg, execute the following comman
Installation from source
------------------------

.. warning::

When installing from source, it is important to ensure that the compiler that was used
to build heyoka.py's dependencies is ABI-compatible with the compiler that is being used
to build heyoka.py. Mixing incompatible compilers will likely lead to hard-to-diagnose
build and/or runtime issues.

heyoka.py is written in modern C++, and it requires a compiler able to understand
at least C++20. The library is regularly tested on
a continuous integration pipeline which currently includes several
Expand Down
4 changes: 2 additions & 2 deletions doc/notebooks/The expression system.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"Note that, while single and double precision are always supported in heyoka.py, support for [extended-precision](<./ext_precision.ipynb>) floating-point types varies depending on the software/hardware platform. Specifically:\n",
"\n",
"- on x86 processors, the NumPy {py:class}`~numpy.longdouble` type corresponds to 80-bit extended precision on most platforms (the exception being MSVC on Windows, where ``longdouble == float``);\n",
"- on some platforms (e.g., Unix ARM 64), the {py:class}`~numpy.longdouble` type implements the IEEE [quadruple-precision floating-point format](https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format);\n",
"- on some platforms (e.g., Linux ARM 64), the {py:class}`~numpy.longdouble` type implements the IEEE [quadruple-precision floating-point format](https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format);\n",
"- on some platforms where {py:class}`~numpy.longdouble` does **not** have quadruple precision, a nonstandard quadruple-precision type is instead available in C/C++ (this is the case, for instance, on x86-64 Linux and on some PowerPC platforms). On such platforms, and if the heyoka C++ library was compiled with support for the [mp++ library](https://github.com/bluescarni/mppp), quadruple precision is supported via the ``real128`` type (as shown above).\n",
"\n",
"Note that the non-IEEE {py:class}`~numpy.longdouble` type available on some PowerPC platforms (which implements a double-length floating-point representation with 106 significant bits) is **not** supported by heyoka.py at this time.\n",
Expand Down Expand Up @@ -184,7 +184,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.4"
}
},
"nbformat": 4,
Expand Down
11 changes: 5 additions & 6 deletions doc/notebooks/differentiable_atmosphere.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"*Izzo, Dario*, *Giacomo Acciarini*, and *Francesco Biscani*. \"NeuralODEs for VLEO simulations: Introducing thermoNET for Thermosphere Modeling.\" arXiv preprint arXiv:2405.19384 (2024).\n",
"```\n",
"\n",
"# Background\n",
"## Background\n",
"\n",
"We leverage the key observation that the thermosphere is well approximated (at any given time, and location) by an exponential behavior with respect to the altitude. \n",
"\n",
Expand Down Expand Up @@ -791,7 +791,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "diff_drag_py38",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -805,10 +805,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
},
"orig_nbformat": 4
"version": "3.12.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
4 changes: 2 additions & 2 deletions doc/notebooks/ext_precision.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"\n",
"- if you are using an Intel x86 processor and your C/C++ compiler implements ``long double`` as the 80-bit IEEE extended-precision format, then the 80-bit IEEE floating-point type is available as the NumPy {py:class}`~numpy.longdouble` type;\n",
"- if you are on a platform with support for the non-standard ``__float128`` type, then the 128-bit IEEE floating-point type is available as the ``heyoka.real128`` type;\n",
"- if you are on a platform where the C/C++ ``long double`` type is implemented as a quadruple-precision IEEE floating-point type (e.g., 64-bit ARM), then the 128-bit IEEE floating-point type is available as the NumPy {py:class}`~numpy.longdouble` type.\n",
"- if you are on a platform where the C/C++ ``long double`` type is implemented as a quadruple-precision IEEE floating-point type (e.g., 64-bit Linux ARM), then the 128-bit IEEE floating-point type is available as the NumPy {py:class}`~numpy.longdouble` type.\n",
"\n",
"In other words, extended precision computations in heyoka.py are supported via the NumPy {py:class}`~numpy.longdouble` type (which could be either an 80-bit or 128-bit floating-point type, depending on the platform) and the ``heyoka.real128`` type (which will always be a 128-bit floating-point type, if available).\n",
"\n",
Expand Down Expand Up @@ -415,7 +415,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.12.4"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions doc/notebooks/map_inversion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# The map inversion algorithm\n",
"## The map inversion algorithm\n",
"\n",
"We need to write a few helper function as to be able to perform the map inversion in **heyoka.py**. Fistly we must be able to extract the symbolic epressions of the polynomials $\\mathcal P^n_\\circ$ from the various states of the variational equations. \n",
"\n",
Expand Down Expand Up @@ -739,7 +739,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Let's visualize the impact points\n",
"## Let's visualize the impact points\n",
"\n",
"Our final aim was to compute the variations of the final state at the event, so we now produce 100 random **initial conditions** variations, and we compute, via our Taylor maps, the corresponding final conditions, which we expect all to lie on the sphere:"
]
Expand Down Expand Up @@ -825,7 +825,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "heyokapy_devel",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -843,5 +843,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
14 changes: 8 additions & 6 deletions doc/notebooks/sgp4_propagator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,11 @@
"# - generated an error code, or\n",
"# - ended up farther than 8000km from the Earth, or\n",
"# - contain non-finite positional data.\n",
"mask = np.logical_and(\n",
"mask = np.logical_and.reduce((\n",
" e[:, 0] == 0,\n",
" np.linalg.norm(r[:, 0], axis=1) < 8000,\n",
" np.all(np.isfinite(r[:, 0]), axis=1),\n",
")"
" np.all(np.isfinite(r[:, 0]), axis=1)\n",
"))"
]
},
{
Expand Down Expand Up @@ -658,11 +658,11 @@
"fig = plt.figure(figsize=(8,4))\n",
"\n",
"for i, ssv in enumerate(batch_sv):\n",
" cur_mask = np.logical_and(\n",
" cur_mask = np.logical_and.reduce((\n",
" batch_e[:, i] == 0,\n",
" np.linalg.norm(batch_r[:, i], axis=1) < 8000,\n",
" np.all(np.isfinite(batch_r[:, i]), axis=1),\n",
" )\n",
" ))\n",
" \n",
" # Compute the positional error in meters\n",
" # for the current date.\n",
Expand Down Expand Up @@ -708,14 +708,16 @@
"outputs": [],
"source": [
"# Build a first-order differentiable propagator.\n",
"dprop = hy.model.sgp4_propagator(sats, diff_order=1)"
"dprop = hy.model.sgp4_propagator(sats, diff_order=1, compact_mode=True)"
]
},
{
"cell_type": "markdown",
"id": "1c89b650-3ade-4b62-8924-626b5b4de7c4",
"metadata": {},
"source": [
"Note how we enabled the ``compact_mode`` flag: the computation of the derivatives will generate very large symbolic expressions, and enabling compact mode allows us to keep the compilation times at a manageable level.\n",
"\n",
"We can confirm that ``dprop`` is a differentiable propagator by taking a look at its {py:attr}`~heyoka.model.sgp4_propagator_dbl.diff_order` property:"
]
},
Expand Down
Loading

0 comments on commit 9af9a6a

Please sign in to comment.