Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for heyoka 3.1 #140

Merged
merged 7 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 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 3.0.0 LANGUAGES CXX C)
project(heyoka.py VERSION 3.1.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 3.0.0 REQUIRED CONFIG)
find_package(heyoka 3.1.0 REQUIRED CONFIG)

# Python.

Expand Down
23 changes: 22 additions & 1 deletion doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,30 @@
Changelog
=========

3.0.1 (unreleased)
3.1.0 (unreleased)
------------------

New
~~~

- Implement the eccentric longitude :math:`F` in the expression
system (`#140 <https://github.com/bluescarni/heyoka.py/pull/140>`__).
- Implement the delta eccentric anomaly :math:`\Delta E` in the expression
system (`#140 <https://github.com/bluescarni/heyoka.py/pull/140>`__).
Taylor derivatives are not implemented yet.
- Implement convenience properties to fetch the gradient/Jacobian
from a ``dtens`` object
(`#140 <https://github.com/bluescarni/heyoka.py/pull/140>`__).
- New example notebook implementing Lagrange propagation
(`#140 <https://github.com/bluescarni/heyoka.py/pull/140>`__).

Changes
~~~~~~~

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

Fix
~~~

Expand Down
2 changes: 2 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
"binderhub_url": "https://mybinder.org",
"notebook_interface": "jupyterlab",
},
# See: https://github.com/pydata/pydata-sphinx-theme/issues/1492
"navigation_with_keys": False,
}

nb_execution_mode = "force"
Expand Down
1 change: 1 addition & 0 deletions doc/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Celestial mechanics and astrodynamics
notebooks/ttv
notebooks/vsop2013
notebooks/tides_spokes
notebooks/lagrangian_propagator

Event detection
---------------
Expand Down
2 changes: 1 addition & 1 deletion 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 3.0.x (**mandatory**),
version 3.1.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 Down
57 changes: 46 additions & 11 deletions doc/notebooks/ex_system_revisited.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,8 @@
"id": "b19b9377-a4d3-49f7-a341-1a290650dd79",
"metadata": {},
"source": [
"(computing_derivatives)=\n",
"\n",
"## Computing derivatives\n",
"\n",
"heyoka.py provides two ways of computing the derivatives of an expression. The first one is the ``diff()`` function:"
Expand Down Expand Up @@ -1138,6 +1140,39 @@
"dt.get_derivatives(diff_order=1, component=0)"
]
},
{
"cell_type": "markdown",
"id": "9aaae8d3-8f36-4757-b9f6-982533c57483",
"metadata": {},
"source": [
"Starting with heyoka.py 3.1, the convenience properties ``gradient`` and ``jacobian`` can be used to access the gradient and Jacobian from a ``dtens`` object. For instance:"
]
},
{
"cell_type": "code",
"execution_count": 39,
"id": "e962103f-8a9d-4a3a-88c8-854beb9e0c2b",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[1.0000000000000000, {({z} * {-sin((y * z))})},\n",
" {({y} * {-sin((y * z))})}],\n",
" [{exp((x - z))}, {y**-1.0000000000000000}, {-{exp((x - z))}}]],\n",
" dtype=object)"
]
},
"execution_count": 39,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Fetch from dt the Jacobian as a 2D array.\n",
"dt.jacobian"
]
},
{
"cell_type": "markdown",
"id": "19457ff7-1b91-40e4-9c74-75ca3f8ad39b",
Expand All @@ -1164,7 +1199,7 @@
},
{
"cell_type": "code",
"execution_count": 39,
"execution_count": 40,
"id": "14912d7e-50ce-4831-978d-d207d8cf0b49",
"metadata": {},
"outputs": [
Expand All @@ -1174,7 +1209,7 @@
"(x_1 * x_2 * x_3 * x_4 * x_5 * x_6 * x_7 * x_8)"
]
},
"execution_count": 39,
"execution_count": 40,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1195,7 +1230,7 @@
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": 41,
"id": "517f3c2d-b2a9-4fb7-b646-2bd5fa785772",
"metadata": {},
"outputs": [
Expand All @@ -1212,7 +1247,7 @@
" (x_1 * x_2 * x_3 * x_4 * x_5 * x_6 * x_7)]"
]
},
"execution_count": 40,
"execution_count": 41,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1234,7 +1269,7 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": 42,
"id": "eb05a503-123c-44c0-91c3-3a3c9022f1e3",
"metadata": {},
"outputs": [
Expand All @@ -1251,7 +1286,7 @@
" (u_0 * u_1 * u_2 * u_3 * u_4 * u_5 * u_7)]"
]
},
"execution_count": 41,
"execution_count": 42,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1271,7 +1306,7 @@
},
{
"cell_type": "code",
"execution_count": 42,
"execution_count": 43,
"id": "e6bd5955-c51a-4a9e-b077-ba80ffa30d63",
"metadata": {},
"outputs": [
Expand All @@ -1288,7 +1323,7 @@
" {({x_7} * {({(x_5 * x_6)} * {((x_1 * x_2) * (x_3 * x_4))})})}]"
]
},
"execution_count": 42,
"execution_count": 43,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1309,7 +1344,7 @@
},
{
"cell_type": "code",
"execution_count": 43,
"execution_count": 44,
"id": "baab73a4-7e7b-40dc-a76a-4696e49278b6",
"metadata": {},
"outputs": [
Expand All @@ -1336,7 +1371,7 @@
" (u_2 * u_17)]"
]
},
"execution_count": 43,
"execution_count": 44,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1356,7 +1391,7 @@
},
{
"cell_type": "code",
"execution_count": 44,
"execution_count": 45,
"id": "48690c49-990b-4fe5-8ffb-77ee80ad9d3a",
"metadata": {},
"outputs": [
Expand Down
Loading