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

Support modern compilers, Python, Jupyter and NumPy releases #5034

Open
wants to merge 5 commits into
base: python
Choose a base branch
from

Conversation

jngrad
Copy link
Member

@jngrad jngrad commented Jan 31, 2025

Description of changes:

  • bump all compiler version requirements
    • C++20 core features are now almost fully supported
  • remove now obsolete re-implementations of C++20 algorithms
  • massively reduce the complexity of the CMake build system for tutorials
  • fix deprecation warnings from recent versions of NumPy, SciPy, JupyterLab, and the Python standard library
  • improve code coverage and remove unreachable code

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Use standard CMake targets to configure tutorials. Mark figure files
as dependencies of the Jupyter notebooks that actually use them.
Make python and html targets depend on the original tutorial file in
the source directory. Convert solution cells to hidden solutions.
Replace Utils functionality by equivalent C++20 features.
Remove unused or duplicated code. Improve code coverage.
f *= np.sign(r - offset)
b1 * e1 * np.power(sigma / np.sqrt(h), e1) -
b2 * e2 * np.power(sigma / np.sqrt(h), e2)) / h
f *= np.sign(r - offset) if generic and not has_ljgen_softcore else 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the benefit in using a ternary operator here? If this line wasn't reached in coverage before, I'm not in favor of "green washing" this line with this.

Comment on lines -195 to -200
if p.id == 1:
# Parse the bond
self.assertEqual(len(p.bonds), 2)
# Bond type
self.assertEqual(p.bonds[0][0], self.bond_pair)
self.assertEqual(p.bonds[1][0], self.bond_vs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my understanding, it means that this branch was never reached in CI?

python3 -m pip install --user -c requirements.txt \
nbformat nbconvert jupyterlab
python3 -m pip install -c requirements.txt \
jupyterlab>=4.3 nbformat nbconvert lxml[html_clean]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this lxml-package do?

@@ -44,24 +45,18 @@ auto mask_impl(Integral mask, T t, std::index_sequence<I...>) {
* instance of the type).
*
* Example:
* mask(0b1011, {1, 2, 3, 4}) => {1, 0, 3, 4}
* <tt>mask(0b1011u, {1, 2, 3, 4}) => {1, 2, 0, 4}</tt>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change? If this is true, I don't understand the masking.

@@ -5,7 +5,8 @@ How to get started with Sphinx

.. code-block:: bash

pip3 install --user --upgrade 'sphinx>=2.3.0,!=3.0.0' 'sphinxcontrib-bibtex>=0.3.5'
python3 -m pip install -c requirements.txt \
sphinx sphinx-toggleprompt sphinxcontrib-bibtex numpydoc pybtex
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we need pybtex for?

Comment on lines -246 to -251
std::transform(node_ids[this_node].cbegin(), node_ids[this_node].cend(),
parts.begin(), [](int p_id) {
auto const p = get_cell_structure().get_local_particle(p_id);
assert(p != nullptr);
return *p;
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that we don't have particles of the head node in the cache after the call to prefetch_particle_data?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants