Skip to content

Commit

Permalink
Merge branch 'topic/default/prepare-0.8.0' into 'branch/default'
Browse files Browse the repository at this point in the history
Prepare 0.8.0rc0

See merge request fluiddyn/fluidsim!367
  • Loading branch information
paugier committed Jan 30, 2024
2 parents 46b7e6c + 26515e6 commit 51e02ae
Show file tree
Hide file tree
Showing 89 changed files with 486 additions and 387 deletions.
5 changes: 3 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ pixi-test:
- pixi info
# - rm -rf ../transonic
# - hg clone https://foss.heptapod.net/fluiddyn/transonic ../transonic
- pixi run install-editable
- pixi run install-dependencies
- pixi run pip install -e . -v --no-build-isolation --no-deps -C compile-args=-j2
- pixi run pytest -v lib
- pixi run fluidsim-test -v
# currently broken because of fluidfft conda issues
Expand Down Expand Up @@ -195,7 +196,7 @@ pages:
- python -m venv .venv
- . .venv/bin/activate
- pip install fluidfft --no-deps
- pdm install -G doc -G fft -G test --no-self
- pdm sync -G doc -G fft -G test --no-self
- pip install . --config-settings=setup-args=-Dtransonic-backend=python --no-deps
- pdm run xvfb-run --auto-servernum sphinx-build -W -b html -d doc/_build/doctrees doc doc/_build/html
- mkdir -p public/$CI_COMMIT_REF_NAME
Expand Down
14 changes: 10 additions & 4 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

See also the [unreleased changes].

% Type of changes

% ---------------
Expand All @@ -22,11 +24,13 @@ and this project adheres to

% Security Security in case of vulnerabilities.

% Unreleased_

% -----------
## [0.8.0] (2024-01-28)

% towncrier release notes start
- Build and upload wheels on PyPI with Github Actions.
- Much better CI in foss.heptapod.net and Github Actions.
- Use the [Meson build system](https://mesonbuild.com) via
[meson-python](https://github.com/mesonbuild/meson-python).
- Development: use PDM, Nox and Pixi.

## [0.7.4] (2023-10-05)

Expand Down Expand Up @@ -318,3 +322,5 @@ Merge with geofluidsim (Ashwin Vishnu Mohanan repository)
[0.7.2]: https://foss.heptapod.net/fluiddyn/fluidsim/-/compare/0.7.1...0.7.2
[0.7.3]: https://foss.heptapod.net/fluiddyn/fluidsim/-/compare/0.7.2...0.7.3
[0.7.4]: https://foss.heptapod.net/fluiddyn/fluidsim/-/compare/0.7.3...0.7.4
[0.8.0]: https://foss.heptapod.net/fluiddyn/fluidsim/-/compare/0.7.4...0.8.0
[unreleased changes]: https://foss.heptapod.net/fluiddyn/fluidsim/-/compare/0.8.0...branch%2Fdefault
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ MPI_NUM_PROCS ?= 2

.PHONY: black black_check clean clean_pyc clean_so cleantransonic coverage_short develop dist lint _report_coverage shortlog tests _tests_coverage tests_mpi

develop:
pdm sync --clean --no-self
develop: sync
pdm run pip install -e . -v --no-build-isolation --no-deps

sync:
pdm sync --clean --no-self

lock:
pdm lock -G :all

dist:
pip install build
cd lib && python -m build
Expand Down
1 change: 0 additions & 1 deletion bench/profiling/simul_profile2d_vmprof.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"""


from simul_profile2d import sim

sim.time_stepping.start()
3 changes: 2 additions & 1 deletion bench/spectraldns/bench_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
mpirun -np 2 fluidsim-bench 1152 -d 2 -s ns2d -it 10
"""

import time
import numpy as np
from spectralDNS import config, get_solver, solve
Expand Down Expand Up @@ -68,7 +69,7 @@ def update(context):
"T": 1e-11, # Should run 10 iterations
"write_result": 100,
"L": [L, L],
"M": [10, 10] # Mesh size is pow(2, M[i]) in direction i
"M": [10, 10], # Mesh size is pow(2, M[i]) in direction i
# 2**9 == 512
},
"doublyperiodic",
Expand Down
1 change: 1 addition & 0 deletions bench/spectraldns/bench_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
mpirun -np 2 fluidsim-bench 128 -d 3 -s ns3d -it 10
"""

import time
import numpy as np
from numpy import zeros, sum, float64, sin, cos, prod, asscalar
Expand Down
3 changes: 2 additions & 1 deletion bench/spectraldns/profile_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"""

import time
import numpy as np

Expand Down Expand Up @@ -71,7 +72,7 @@ def update(context):
"T": 11 * dt, # Should run 10 iterations
"write_result": 100,
"L": [L, L],
"M": [10, 10] # Mesh size is pow(2, M[i]) in direction i
"M": [10, 10], # Mesh size is pow(2, M[i]) in direction i
# 2**9 == 512
},
"doublyperiodic",
Expand Down
1 change: 1 addition & 0 deletions bench/spectraldns/profile_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
fluidsim-bench 128 -d 3 -s ns3d -it 10
"""

import time
import numpy as np
from numpy import zeros, sum, float64, sin, cos, prod, asscalar
Expand Down
1 change: 1 addition & 0 deletions doc/examples/simul_ns2dbouss_initfields_in_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
The field initialization is done in the script.
"""

import os

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions doc/examples/simul_ns2dstrat_forcing_const_energy_rate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Script for a short simulation with the solver ns2d.strat
"""

import numpy as np

from fluiddyn.util import mpi
Expand Down
1 change: 1 addition & 0 deletions doc/examples/simul_ns2dstrat_forcing_in_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Note how is used the user-defined forcing maker...
"""

from math import pi
import os

Expand Down
1 change: 1 addition & 0 deletions doc/examples/simul_ns2dstrat_initfields_in_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
The field initialization is done in the script.
"""

import os
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions doc/examples/simul_ns3dbouss_initfields_in_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
mpirun -np 4 python simul_ns3dbouss_initfields_in_script.py
"""

import os

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions doc/examples/simul_ns3dstrat_waves.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
mpirun -np 4 python simul_ns3dstrat_waves.py
"""

import os
from math import pi

Expand Down
1 change: 1 addition & 0 deletions doc/examples/time_stepping/3d/run_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
```
"""

from pathlib import Path
import sys

Expand Down
36 changes: 8 additions & 28 deletions doc/release_process.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,22 @@
# Release process

- [ ] Extended tests in doc/examples (`make tests` and `make tests_mpi`)
- [ ] Extended tests in doc/examples (<https://foss.heptapod.net/fluiddyn/fluidsim/-/pipeline_schedules>)

- [ ] Check builds of the "official" articles in <https://foss.heptapod.net/fluiddyn/fluiddyn_papers>

- [ ] Topic for the release candidate
- [ ] Topic/MR for the release candidate

- [ ] Change version in `lib/fluidsim_core/_version.py` (`0.6.1rc0`)
- [ ] Change versions in `pyproject.toml` AND `lib/pyproject.toml` (`0.6.1rc0`)

- [ ] Update changelog in `CHANGES.rst`
- [ ] Update changelog in `CHANGES.md`

- Take into account `doc/newsfragments` + remove the fragments

- Visit <https://foss.heptapod.net/fluiddyn/fluidsim/-/compare/0.6.0...branch%2Fdefault>

- Study `hg log -G -r "tag(0.6.0):tip"`

- [ ] Tag `0.6.1rc0` in the repo

- [ ] Push `fluidsim-core` release candidates to PyPI

```bash
cd lib
rm -rf dist
python -m build
twine upload dist/*
```

- [ ] Push `fluidsim` release candidates to PyPI (no wheel!)

```bash
cd ..
rm -rf dist
python -m build -s
twine upload dist/*
```
- [ ] Once merged, update, tag and push with `nox -s add-tag-for-release`.

- [ ] PR on <https://github.com/conda-forge/fluidsim-core-feedstock> (rc channel)

Expand Down Expand Up @@ -66,18 +48,16 @@
Create new environment with

```bash
conda create -n env_fluidsim_rc \
mamba create -n env_fluidsim_rc \
-c conda-forge/label/fluidsim-core_rc -c conda-forge/label/fluidsim_rc \
fluidsim "fluidfft[build=mpi*]" "h5py[build=mpi*]"
```

- [ ] Communicate to the community...

- [ ] Topic for the release of the stable version (delete "rc0" in `lib/fluidsim_core/_version.py`)

- [ ] Tag `0.6.1` in the repo
- [ ] Topic/MR for the release of the stable version (delete "rc0" in the `pyproject.toml` files)

- [ ] Push to PyPI (no wheel for fluidsim!)
- [ ] New tag with `nox -s add-tag-for-release`

- [ ] PR on <https://github.com/conda-forge/fluidsim-core-feedstock>

Expand Down
1 change: 1 addition & 0 deletions fluidsim/base/forcing/kolmogorov.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
:private-members:
"""

from warnings import warn

import numpy as np
Expand Down
6 changes: 3 additions & 3 deletions fluidsim/base/output/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,9 @@ def _compute_mean_values(self, tmin, tmax):
lengths = self.spectra.compute_length_scales(data=data_spectra)
result.update(lengths)

result[
"I_dissipation"
] = self.spect_energy_budg.compute_isotropy_dissipation(tmin)
result["I_dissipation"] = (
self.spect_energy_budg.compute_isotropy_dissipation(tmin)
)

return result

Expand Down
1 change: 0 additions & 1 deletion fluidsim/base/output/cross_corr3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"""


import itertools

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions fluidsim/base/output/horiz_means.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
:undoc-members:
"""

import numpy as np
import h5py
import matplotlib.pyplot as plt
Expand Down
8 changes: 2 additions & 6 deletions fluidsim/base/output/spatiotemporal_spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -1164,9 +1164,7 @@ def plot_kzkhomega(
omega_disp = ikh / np.sqrt(ikh**2 + dkz_over_dkh**2 * xaxis**2)
ax.plot(xaxis, omega_disp, "k-", linewidth=2)
elif equation.startswith(r"$k_z"):
omega_disp = xaxis / np.sqrt(
xaxis**2 + dkz_over_dkh**2 * ikz**2
)
omega_disp = xaxis / np.sqrt(xaxis**2 + dkz_over_dkh**2 * ikz**2)
ax.plot(xaxis, omega_disp, "k-", linewidth=2)
else:
raise ValueError("wrong equation for dispersion relation")
Expand Down Expand Up @@ -1375,9 +1373,7 @@ def plot_temporal_spectra(
aspect_ratio = self.sim.oper.Lx / self.sim.oper.Ly

def modes(nx, nz):
return np.sqrt(
nx**2 / (nx**2 + aspect_ratio**2 * nz**2)
)
return np.sqrt(nx**2 / (nx**2 + aspect_ratio**2 * nz**2))

nxs = np.arange(1, 11)
modes_nz1 = modes(nxs, 1)
Expand Down
1 change: 0 additions & 1 deletion fluidsim/base/output/spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"""


import os

import numpy as np
Expand Down
1 change: 0 additions & 1 deletion fluidsim/base/output/spectra3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"""


import os
from textwrap import dedent
from math import sqrt, tau
Expand Down
16 changes: 7 additions & 9 deletions fluidsim/base/output/time_signals_fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ def _init_save(self, sim):
for ishell, kh_s in enumerate(self.kh_shell):
angle = -np.pi / 2
for ikps in range(self.nb_k_per_shell):
kx_array_ik_approx[
ishell * self.nb_shells + ikps
] = kh_s * np.cos(angle)
ky_array_ik_approx[
ishell * self.nb_shells + ikps
] = kh_s * np.sin(angle)
kx_array_ik_approx[ishell * self.nb_shells + ikps] = (
kh_s * np.cos(angle)
)
ky_array_ik_approx[ishell * self.nb_shells + ikps] = (
kh_s * np.sin(angle)
)
angle += delta_angle

self.ik0_array_ik = np.empty([self.nb_k_tot], dtype=np.int32)
Expand Down Expand Up @@ -161,9 +161,7 @@ def _init_save(self, sim):
self.ky_array_ik[ik] = ky_1k

if mpi.rank == 0:
self.kh_array_ik = np.sqrt(
self.kx_array_ik**2 + self.ky_array_ik**2
)
self.kh_array_ik = np.sqrt(self.kx_array_ik**2 + self.ky_array_ik**2)

self.omega_array_ik = self.output.omega_from_wavenumber(
self.kh_array_ik
Expand Down
1 change: 1 addition & 0 deletions fluidsim/base/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"""

from fluidsim_core.params import Parameters
from fluidsim.base.solvers.info_base import InfoSolverBase

Expand Down
1 change: 1 addition & 0 deletions fluidsim/base/preprocess/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
:private-members:
"""

from fluidsim_core.params import iter_complete_params


Expand Down
4 changes: 1 addition & 3 deletions fluidsim/base/preprocess/pseudo_spect.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,7 @@ def calcul_viscosity(
nu = length_scale**order / time_scale
v.append(nu)
if verbose:
kolmo_len.append(
(nu**3 / epsilon) ** (1.0 / (3 * order - 2))
)
kolmo_len.append((nu**3 / epsilon) ** (1.0 / (3 * order - 2)))
else:
v.append(0.0)

Expand Down
1 change: 1 addition & 0 deletions fluidsim/base/solvers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
:private-members:
"""

from time import time
import atexit
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions fluidsim/base/solvers/info_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:private-members:
"""

from copy import deepcopy

from fluidsim_core.info import InfoSolverCore, create_info_simul # noqa
Expand Down
Loading

0 comments on commit 51e02ae

Please sign in to comment.