Skip to content

Commit

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

See merge request fluiddyn/fluidimage!105
  • Loading branch information
paugier committed Apr 30, 2024
2 parents 3b97c3e + fc36588 commit f0a1c8a
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 11 deletions.
10 changes: 9 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# Release notes

See also the
[unreleased changes](https://foss.heptapod.net/fluiddyn/fluidimage/-/compare/0.4.5...branch%2Fdefault).
[unreleased changes](https://foss.heptapod.net/fluiddyn/fluidimage/-/compare/0.5.0...branch%2Fdefault).

## [0.5.0] (2024-05-0?)

- UVmat compatibility (launching in "local" mode).
- Change defaults and exact meaning for parameters. `params.multipass.smoothing_coef`
(=2) and `params.multipass.threshold_tps` (=1.5).
- PIV saving: use float32 and save "smooth" displacement fields.

## [0.4.6] (2024-04-20)

Expand Down Expand Up @@ -203,3 +210,4 @@ This version contains incompatible API changes documented here.
[0.4.4]: https://foss.heptapod.net/fluiddyn/fluidimage/-/compare/0.4.3...0.4.4
[0.4.5]: https://foss.heptapod.net/fluiddyn/fluidimage/-/compare/0.4.4...0.4.5
[0.4.6]: https://foss.heptapod.net/fluiddyn/fluidimage/-/compare/0.4.5...0.4.6
[0.5.0]: https://foss.heptapod.net/fluiddyn/fluidimage/-/compare/0.4.6...0.5.0
28 changes: 23 additions & 5 deletions doc/autosum.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
API reference
-------------

Fluidimage contains the following subpackages

.. autosummary::
:toctree: _generated/

Expand All @@ -9,13 +11,29 @@ API reference
fluidimage.data_objects
fluidimage.works
fluidimage.calcul
fluidimage.bos
fluidimage.optical_flow
fluidimage.piv
fluidimage.preproc
fluidimage.image2image
fluidimage.calibration
fluidimage.reconstruct
fluidimage.postproc
fluidimage.util
fluidimage.gui

We have also few utility modules:

.. autosummary::
:toctree: _generated/

fluidimage.config
fluidimage.run_from_xml
fluidimage.synthetic
fluidimage.uvmat

Finally, there are few modules to improve the API for common processing:

.. autosummary::
:toctree: _generated/

fluidimage.bos
fluidimage.optical_flow
fluidimage.piv
fluidimage.preproc
fluidimage.image2image
2 changes: 1 addition & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ platforms = ["linux-64", "win-64", "osx-64", "osx-arm64"]
# use as `pixi run install-editable`
install-dependencies = "pixi install"
install-editable = {cmd = "pip install -e . -v --no-build-isolation --no-deps", depends_on = ["install-dependencies"]}
test = "export OMP_NUM_THREADS=1 && pytest src -v"
test = "export OMP_NUM_THREADS=1 && pytest src -v -s"

[dependencies]
python = ">=3.9,<3.11"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build-backend = 'mesonpy'

[project]
name = "fluidimage"
version = "0.4.6"
version = "0.5.0"
description = "Fluid image processing with Python."
authors = [
{name = "Pierre Augier", email = "[email protected]"},
Expand Down
8 changes: 6 additions & 2 deletions src/fluidimage/config.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
"""Handle Fluidimage configuration"""

import os
from configparser import ConfigParser


def get_config():
"""Get configuration from .fluidimagerc"""
config = ConfigParser()

home = os.path.expanduser("~")
path_config = os.path.join(home, ".fluidimagerc")

if os.path.exists(path_config):
config.read(path_config)
if not os.path.exists(path_config):
return {}
config.read(path_config)

config_dict = {}
for section in config.sections():
Expand Down
1 change: 1 addition & 0 deletions src/fluidimage/executors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ def handler_signals(signal_number, stack):
signal.signal(12, handler_signals)

self._start_processes()
self.nb_processes = len(self.processes)
self._wait_for_all_processes()
self._finalize_compute()

Expand Down
3 changes: 3 additions & 0 deletions src/fluidimage/synthetic.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Production of synthetic images"""

import numpy as np


Expand All @@ -9,6 +11,7 @@ def make_synthetic_images(
epsilon=0.0,
part_size=np.sqrt(1 / 0.5),
):
"""Produce synthetic images for testing PIV"""
ny, nx = tuple(shape_im0)

displacement_x, displacement_y = tuple(displacements)
Expand Down
7 changes: 6 additions & 1 deletion src/fluidimage/topologies/piv.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,14 @@ def make_text_at_exit(self, time_since_start):
except AttributeError:
nb_results = None
if nb_results is not None and nb_results > 0:
try:
num_processes = self.executor.nb_processes
except AttributeError:
num_processes = self.executor.nb_max_workers
num_cores_used = min(nb_cores, num_processes)
txt += (
f" ({nb_results} piv fields, {time_since_start / nb_results:.2f} s/field,"
f" {time_since_start * nb_cores / nb_results:.2f} s.CPU/field)."
f" {time_since_start * num_cores_used / nb_results:.2f} s.CPU/field)."
)
else:
txt += "."
Expand Down

0 comments on commit f0a1c8a

Please sign in to comment.