Recent Releases of Efficient Polyhedral Gravity Modeling in Modern C++ and Python

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - v3.3.0

Changelog

  • New enum MetricUnit to optionally specify the metric unit of the polyhedral mesh when constructing a Polyhedron.
    • Can be either $m$, $km$ or $unitless$ --> The density must match, hence it should be handed over in $kg/m^3$, $kg/km^3$ or unitless as well.
    • The output of the GravityEvaluable or the evaluate function will match the input unit. So, for the potential the result is either $m^2/s^2$, $km^2/s^2$ or unitless.
    • If unitless is chosen, the results are not multiplied by the Gravitational constant $G$!
    • If the optional metric unit is not specified when constructing the polyhedron, METER is assumed which correspomnds to previous behavior. Hence, existing code will produce the same results without any modification necessary when updating to v3.3.0
  • We now support the Wavefront OBJ format/ the .tab file distributed by e.g. NASA as polyhedral mesh input!

Please refer to the documentation for additional details!

Details

  • Update Github Actions by @schuhmaj in https://github.com/esa/polyhedral-gravity-model/pull/43
  • Modernize CMake Fetching & Update Mamba CI/ CD by @schuhmaj in https://github.com/esa/polyhedral-gravity-model/pull/44
  • Small Fixes and Tidy Up by @schuhmaj in https://github.com/esa/polyhedral-gravity-model/pull/45
  • Mesh improvements by @schuhmaj in https://github.com/esa/polyhedral-gravity-model/pull/46
  • Add CMake policy version to Release Pipeline by @schuhmaj in https://github.com/esa/polyhedral-gravity-model/pull/48

Full Changelog: https://github.com/esa/polyhedral-gravity-model/compare/v3.2.1...v3.3.0

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj 8 months ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v3.2.1

Changelog

  • Wheels for Python 3.13 🥳 Free-threaded versions of the wheels are also available on PyPI for Linux and macOS-based systems. Free-threaded builds for Windows have not yet been released.
  • Starting with v3.2.1, Pre-built wheels for musllinux-systems are now available as well via PyPI
  • For our C++ user base, the LOGGING_LEVEL CMake build option is now specified using natural language syntax. E.g. LOGGING_LEVEL=INFO instead of LOGGING_LEVEL= 2

Related Pull Requests

  • JOSS References for README and Documentation by @schuhmaj in https://github.com/esa/polyhedral-gravity-model/pull/41
  • Python 3.13 Wheels/ Release 3.2.1 by @schuhmaj in https://github.com/esa/polyhedral-gravity-model/pull/42

Full Changelog: https://github.com/esa/polyhedral-gravity-model/compare/v3.2.0...v3.2.1

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 1 year ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v3.2.0

Changelog

No changes for end-users compared to v3.0.0!

This is the JOSS release. It fixes the Pipeline for macOS x86_64 wheels. It does not contain any other changes to the implementation but only fixes the CI/ CD.

Details

  • Fix Deployment for macOS x86_64 wheels on PyPi by @schuhmaj in https://github.com/esa/polyhedral-gravity-model/pull/40

Full Changelog: https://github.com/esa/polyhedral-gravity-model/compare/v3.1.0...v3.2.0

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 1 year ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v3.1.0

JOSS Release v3.1.0

No changes for end-users compared to v3.0.0!

The tests were revised, the CI/CD was improved, and the JOSS paper was brought into its release state.

What's Changed

  • Linux aarch64 Wheels in the CI/CD by @schuhmaj in https://github.com/esa/polyhedral-gravity-model/pull/37
  • Improve Test Stability & Minor fixes to documentation by @schuhmaj in https://github.com/esa/polyhedral-gravity-model/pull/39
  • Fixing syntax for one reference by @dfm in https://github.com/esa/polyhedral-gravity-model/pull/38

New Contributors

  • @dfm made their first contribution in https://github.com/esa/polyhedral-gravity-model/pull/38

Full Changelog: https://github.com/esa/polyhedral-gravity-model/compare/v3.0.0...v3.1.0

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 1 year ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v3.0.0

Key Changes

  • The accelerations are now multiplied by -1.0 to follow the geodesy and geophysics sign conventions > [!IMPORTANT] > This gravity model's output now obeys to the geodesy and geophysics sign conventions. Hence, the potential $V$ for a polyhedron with a mass $m > 0$ is defined as positive. Accordingly, the accelerations are defined as $\textbf{g} = + \nabla V$. The sign of the acceleration output is inverted when compared to the older version, v2.1.0, and before Have a look at I/O Explaination

Python Interface

  • The Polyhedron is now exposed to Python and enforces compliance with the gravity model preconditions about the vertex ordering. It is impossible to create an invalid Polyhedron if not explicitly specified via the __init__-method.

  • The evaluate and GravityEvaluable do not take a polyhedral_source & density anymore. They only take a Polyhedron as an input argument

  • The utility submodule was removed. This functionality is now grouped inside the Polyhedron class.

    • The read(filenames) to yield vertices and faces can be modeled by creating a Polyhedron from filenames and then effectively by accessing its vertcies and faces properties
    • The check_mesh is now effectively part of the construction of a Polyhedron. If you still require a dedicated check:
    • Construct the Polyhedron with disabled checks (integrity_check=PolyhedronIntegrity.DISABLE)
    • Call check_normal_orientation on the instance. It returns the majority plane unit normal orientation (INWARDS or OUTWARDS) and a set of face indices violating this orientation. So, e.g., all plane unit normals are pointing OUTWARDS except the normal at face's array index 1.
    • More details in the docs

[!TIP] Find more help in the updated Python Examples

C++ Library

  • The Polyhedron is now exposed to Python and enforces compliance with the gravity model preconditions about the vertex ordering. It is impossible to create an invalid Polyhedron if not explicitly specified via the constructor

  • The evaluate and GravityEvaluable do not take a polyhedral_source & density anymore. They only take a Polyhedron as an input argument

  • When using the C++ executable - The yaml configuration file parameter check_mesh defaults now to true and will repair the mesh if possible (so basically, true/ false <--> PolyhedronIntegrity::HEAL/ PolyhedronIntegrity::DISABLE)

[!TIP] Find more help in the updated C++ Examples

Details

Resolved Issues & Pull Requests

  • Paper writing by @gomezzz in https://github.com/esa/polyhedral-gravity-model/pull/11
  • JOSS - PRE REVIEW Changes by @schuhmaj in https://github.com/esa/polyhedral-gravity-model/pull/18
  • [JOSS Review] Fix Python syntax of minimal example by @santisoler in https://github.com/esa/polyhedral-gravity-model/pull/20
  • [JOSS Review] Minor fix to example using GravityEvaluable by @santisoler in https://github.com/esa/polyhedral-gravity-model/pull/23
  • [JOSS Review] Increase indentation of list in CONTRIBUTING.md by @santisoler in https://github.com/esa/polyhedral-gravity-model/pull/25
  • [JOSS Review] Improve Python tests and unpin Numpy version by @santisoler in https://github.com/esa/polyhedral-gravity-model/pull/26
  • Switch to GitHubPages by @schuhmaj in https://github.com/esa/polyhedral-gravity-model/pull/35
  • [JOSS Review] Bits and Pieces - Version 2.2 by @schuhmaj in https://github.com/esa/polyhedral-gravity-model/pull/31
  • Version 3 - Failsafe Polyhedral Gravity Modeling & Polyhedron Class by @schuhmaj in https://github.com/esa/polyhedral-gravity-model/pull/36

New Contributors

  • @santisoler made their first contribution in https://github.com/esa/polyhedral-gravity-model/pull/20

Full Changelog: https://github.com/esa/polyhedral-gravity-model/compare/v2.1.0...v3.0.0

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 1 year ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v2.1.0

Changelog

  • Added pickle support. The gravity evaluable can now be pickled to the persistent memory (including its internal cache)
  • Fixed the error message that appears when numerical instabilities might occur

New Feature: Serialization of a GravityEvaluable

```python import polyhedral_gravity import pickle

evaluable = polyhedralgravity.GravityEvaluable((vertices, faces), DENSITY) with open("evaluable.pk", "wb") as f: pickle.dump(evaluable, f, pickle.HIGHESTPROTOCOL)

with open("evaluable.pk", "rb") as f: evaluable = pickle.load(f) ```

Full Changelog: https://github.com/esa/polyhedral-gravity-model/compare/v2.0.3...v2.1.0

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 2 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v2.0.3

PyPi Full Release Version

You can skip this version since it does not add anything to the program itself

  • Added GitHubAction workflow, which builds wheels for all major CPython & PyPy versions on the three operating systems: Windows, MacOS, and (Many)Linux

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 2 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v2.0.0

What's Changed

  • Add Warning in case of running into floating point arithmetic issues
  • Add class GravityEvaluable to cache common properties in multi-point evaluation
  • Add option to disable the parallelisation (if built with any) during runtime

Details

This change included a small change to the Python API, which might break current code!

  • The naming of the arguments changed
  • The evaluate method takes no vertices and faces as a tuple, rather than as separate arguments

```python import polyhedral_gravity as model

The "free function" evaluate has now always three arguments (or an optional fourth one)

The keywords of the signature are now always the SAME!

So the third argument takes computationpoints or a SINGLE computationpoint

Optionally with the keyword prefix

The "parallel" argument allows to disable the parallelization

model.evaluate(polyhedralsource=(vertices, faces), density=1.0, computationpoints=[..], parallel=True)

Removed signature (vertices and faces as separate arguments)

model.evaluate(vertices, faces, density=1.0, computation_points=[..])

```

GravityEvaluable speeds up the runtime by around factor 30 if one wants to compute multiple points one by one - e.g. when propagating a trajectory.

```python import polyhedral_gravity as model

Construction like above, but only with the two "persistent" arguments

evaluable = model.GravityEvaluable((vertices, faces), density)

for i in range(N): # The second argument is optional and defaults to True evaluable(computation_points[i], parallel=True)

```

Results from comparing the old & new interface (N=1, so small runtime differences are not really expressive) 1000 random sampled points around Eros using Apple Clang 14, M1 Pro and the TBB Backend.

```

## Old Single-Point

--> 1000 times 1 point with old interface --> Time taken: 7862.830 microseconds per point

## Old Multi-Point

--> 1 time N points with old interface --> Time taken: 271.561 microseconds per point

## GravityEvaluable (Single-Point)

--> 1000 times 1 point with GravityEvaluable --> Time taken: 331.350 microseconds per point

## GravityEvaluable (Multi-Point)

--> 1 time 1000 points with GravityEvaluable --> Time taken: 255.692 microseconds per point ```

Full Changelog: https://github.com/esa/polyhedral-gravity-model/compare/v1.2.1...v2.0.0

EDIT: This is a re-release including fixes for the conda-deployment

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 2 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - TEMP

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 2 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v2.0.0

What's Changed

  • Add Warning in case of running into floating point arithmetic issues
  • Add class GravityEvaluable to cache common properties in multi-point evaluation
  • Add option to disable the parallelisation (if built with any) during runtime

Details

This change included a small change to the Python API, which might break current code!

  • The naming of the arguments changed
  • The evaluate method takes no vertices and faces as a tuple, rather than as separate arguments

```python import polyhedral_gravity as model

The "free function" evaluate has now always three arguments (or an optional fourth one)

The keywords of the signature are now always the SAME!

So the third argument takes computationpoints or a SINGLE computationpoint

Optionally with the keyword prefix

The "parallel" argument allows to disable the parallelization

model.evaluate(polyhedralsource=(vertices, faces), density=1.0, computationpoints=[..], parallel=True)

Removed signature (vertices and faces as separate arguments)

model.evaluate(vertices, faces, density=1.0, computation_points=[..])

```

GravityEvaluable speeds up the runtime by around factor 30 if one wants to compute multiple points one by one - e.g. when propagating a trajectory.

```python import polyhedral_gravity as model

Construction like above, but only with the two "persistent" arguments

evaluable = model.GravityEvaluable((vertices, faces), density)

for i in range(N): # The second argument is optional and defaults to True evaluable(computation_points[i], parallel=True)

```

Results from comparing the old & new interface (N=1, so small runtime differences are not really expressive) 1000 random sampled points around Eros using Apple Clang 14, M1 Pro and the TBB Backend.

```

## Old Single-Point

--> 1000 times 1 point with old interface --> Time taken: 7862.830 microseconds per point

## Old Multi-Point

--> 1 time N points with old interface --> Time taken: 271.561 microseconds per point

## GravityEvaluable (Single-Point)

--> 1000 times 1 point with GravityEvaluable --> Time taken: 331.350 microseconds per point

## GravityEvaluable (Multi-Point)

--> 1 time 1000 points with GravityEvaluable --> Time taken: 255.692 microseconds per point ```

Full Changelog: https://github.com/esa/polyhedral-gravity-model/compare/v1.2.1...v2.0.0

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 2 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.2.1

Changelog

  • FIXED: Build Issues on conda for OSX Toolchain (version 10.9 does not support C++ 17's optional)
  • Use spdlog v1.11

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj about 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - v1.2.0

What's Changed

  • Added (optional) mesh sanity checks:
    • Check if normals are pointing outwards (uses Möller–Trumbore intersection algorithm)
    • Check if triangles are degenerate
  • Updated the documentation accordingly
  • Simplified CMake Parallelization setup (the old system was quite misleading with two variables)
  • Exposed certain previously exclusive C++ functions into a Python submodule utility

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj about 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.1.6

  • Removed yaml-cpp from Python interface dependencies
  • Revamped CMake extensively

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.1.5

  • Corrected version number
  • fixed thrust CMake warning

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.1.4

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.1.3

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.1.2

  • Thrust and Tetgen CMake revamp

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.1.1

  • thrust from find_package
  • Building shared_libraries by default

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.1.0

  • Adapted pip build script for more flexibility on conda-forge

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.0.13

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.0.12

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.0.11

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.0.10

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.0.9

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.0.8

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.0.7

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.0.6

What's Changed

  • CMake dependencies Update by @schuhmaj in https://github.com/esa/polyhedral-gravity-model/pull/2

Full Changelog: https://github.com/esa/polyhedral-gravity-model/compare/v1.0.5...v1.0.6

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.0.5

  • Upgrade to thrust 1.17.0

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.0.4

  • Fix for thrust not finding version.h on conda linux toolchain

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.0.3

  • Enables thrust log messages for pip installation

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.0.2

  • Changed setup.py

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.0.1

  • Fixed TBB-setup in CMake Toolchain, leading to compile errors under certain circumstances
    • TBB was built with strict enforcement of warnings as errors
    • TBB was built together with its tests
  • Added setup.py
    • It is now possible to install the python interface with pip: just type in the repo's root: pip install .
    • Uniform approach will simplify deployment on conda without the need for separate sh/bat files
    • Tested on Windows/ Linux (Debian)/ macOS
  • Updated README.md and docs accordingly

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 3 years ago

Efficient Polyhedral Gravity Modeling in Modern C++ and Python - Release v1.0.0

Scientific Software - Peer-reviewed - Jupyter Notebook
Published by schuhmaj over 3 years ago