otswap 0.2.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {otswap-0.2.0 → otswap-0.3.0}/.github/workflows/ci.yml +8 -5
- {otswap-0.2.0 → otswap-0.3.0}/.github/workflows/release.yml +5 -2
- {otswap-0.2.0 → otswap-0.3.0}/CHANGELOG.md +142 -0
- {otswap-0.2.0 → otswap-0.3.0}/CITATION.cff +3 -3
- {otswap-0.2.0 → otswap-0.3.0}/CMakeLists.txt +51 -4
- {otswap-0.2.0 → otswap-0.3.0}/PKG-INFO +18 -13
- {otswap-0.2.0 → otswap-0.3.0}/README.md +17 -12
- {otswap-0.2.0 → otswap-0.3.0}/app/otswap.cpp +43 -24
- {otswap-0.2.0 → otswap-0.3.0}/include/otswap/OT.h +88 -43
- {otswap-0.2.0 → otswap-0.3.0}/include/otswap/RSD.h +8 -4
- otswap-0.3.0/include/otswap/Random.h +107 -0
- {otswap-0.2.0 → otswap-0.3.0}/include/otswap/io.h +279 -42
- {otswap-0.2.0 → otswap-0.3.0}/pyproject.toml +6 -3
- {otswap-0.2.0 → otswap-0.3.0}/python/otswap/__init__.py +26 -2
- {otswap-0.2.0 → otswap-0.3.0}/python/otswap/__init__.pyi +89 -33
- otswap-0.3.0/python/otswap/io.py +96 -0
- {otswap-0.2.0 → otswap-0.3.0}/python/otswap/io.pyi +306 -36
- {otswap-0.2.0 → otswap-0.3.0}/python/otswap_python.cpp +349 -139
- {otswap-0.2.0 → otswap-0.3.0}/src/DistanceTable.cpp +4 -4
- {otswap-0.2.0 → otswap-0.3.0}/src/Lightcone.cpp +41 -23
- {otswap-0.2.0 → otswap-0.3.0}/src/Mask.cpp +71 -44
- {otswap-0.2.0 → otswap-0.3.0}/src/ParameterFile.cpp +2 -2
- {otswap-0.2.0 → otswap-0.3.0}/src/RSD.cpp +33 -31
- {otswap-0.2.0 → otswap-0.3.0}/src/Reconstruct.cpp +61 -28
- {otswap-0.2.0 → otswap-0.3.0}/src/Support.cpp +26 -9
- {otswap-0.2.0 → otswap-0.3.0}/src/Table.cpp +356 -96
- {otswap-0.2.0 → otswap-0.3.0}/src/Writers.cpp +388 -202
- {otswap-0.2.0 → otswap-0.3.0}/src/arc.h +14 -9
- {otswap-0.2.0 → otswap-0.3.0}/src/internal.h +31 -29
- {otswap-0.2.0 → otswap-0.3.0}/tests/cmake/install/CMakeLists.txt +1 -1
- otswap-0.3.0/tests/cmake/openmp/CMakeLists.txt +29 -0
- otswap-0.3.0/tests/cmake/openmp/check.py +153 -0
- otswap-0.3.0/tests/cmake/openmp/consumer.cpp +15 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/cpp_reference.cpp +18 -0
- otswap-0.3.0/tests/data/v0.2.1_mean_box.dat +530 -0
- otswap-0.3.0/tests/data/v0.2.1_mean_box.fits +129 -0
- otswap-0.3.0/tests/data/v0.2.1_mean_lightcone.dat +547 -0
- otswap-0.3.0/tests/data/v0.2.1_mean_lightcone.fits +177 -0
- otswap-0.3.0/tests/data/write_fixtures_v021.cpp +62 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/determinism_hashes.json +5 -5
- otswap-0.3.0/tests/executable/cases/empty_none_box.ini +23 -0
- otswap-0.3.0/tests/executable/cases/empty_none_lightcone.ini +29 -0
- otswap-0.3.0/tests/executable/cases/empty_random_file_box.ini +18 -0
- otswap-0.3.0/tests/executable/cases/empty_random_file_lightcone.ini +24 -0
- otswap-0.3.0/tests/executable/cases/empty_with_default.ini +16 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/id_column_duplicate.ini +1 -1
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/id_column_fits_name.ini +1 -1
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/id_column_index.ini +1 -1
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/id_column_index_zeros.ini +1 -1
- otswap-0.3.0/tests/executable/cases/mps_lightcone_alone.ini +26 -0
- otswap-0.3.0/tests/executable/cases/mps_lightcone_with_mean.ini +32 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/run_lightcone_dat.ini +4 -2
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/run_lightcone_dat_report.ini +6 -3
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/run_lightcone_fits.ini +0 -1
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/value_box_max_not_above.ini +1 -1
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/value_z_max_below.ini +1 -1
- otswap-0.3.0/tests/executable/check_example_keys.cmake +92 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/data/tracers_dup_id.dat +1 -1
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/example_box.ini +14 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/example_lightcone.ini +12 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/fixtures_v010.h +14 -5
- {otswap-0.2.0 → otswap-0.3.0}/tests/test_crossmodule.py +1 -1
- {otswap-0.2.0 → otswap-0.3.0}/tests/test_determinism.py +12 -10
- {otswap-0.2.0 → otswap-0.3.0}/tests/test_detmath.cpp +17 -16
- {otswap-0.2.0 → otswap-0.3.0}/tests/test_distance_table.cpp +12 -6
- {otswap-0.2.0 → otswap-0.3.0}/tests/test_mask.cpp +248 -76
- {otswap-0.2.0 → otswap-0.3.0}/tests/test_otswap.py +455 -39
- {otswap-0.2.0 → otswap-0.3.0}/tests/test_parameter_file.cpp +6 -6
- {otswap-0.2.0 → otswap-0.3.0}/tests/test_reconstruct.cpp +100 -28
- {otswap-0.2.0 → otswap-0.3.0}/tests/test_rsd.cpp +210 -46
- {otswap-0.2.0 → otswap-0.3.0}/tests/test_rsd.py +1 -1
- {otswap-0.2.0 → otswap-0.3.0}/tests/test_support.cpp +144 -36
- otswap-0.3.0/tests/test_table.cpp +1072 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/test_writers.cpp +556 -19
- {otswap-0.2.0 → otswap-0.3.0}/tools/wheels/build_deps.sh +45 -20
- {otswap-0.2.0 → otswap-0.3.0}/tools/wheels/check_dependencies.py +5 -1
- {otswap-0.2.0 → otswap-0.3.0}/tools/wheels/test_wheel.sh +8 -1
- otswap-0.2.0/python/otswap/io.py +0 -26
- otswap-0.2.0/tests/test_table.cpp +0 -551
- {otswap-0.2.0 → otswap-0.3.0}/.github/workflows/docs.yml +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/.gitignore +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/LICENSE +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/cmake/FindCFITSIO.cmake +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/cmake/otswapConfig.cmake.in +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/fdlibm/README.md +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/fdlibm/msun/src/e_asin.c +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/fdlibm/msun/src/e_atan2.c +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/fdlibm/msun/src/e_exp.c +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/fdlibm/msun/src/e_pow.c +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/fdlibm/msun/src/e_rem_pio2.c +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/fdlibm/msun/src/k_cos.c +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/fdlibm/msun/src/k_rem_pio2.c +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/fdlibm/msun/src/k_sin.c +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/fdlibm/msun/src/math_private.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/fdlibm/msun/src/s_atan.c +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/fdlibm/msun/src/s_cbrt.c +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/fdlibm/msun/src/s_cos.c +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/fdlibm/msun/src/s_log1p.c +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/fdlibm/msun/src/s_sin.c +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/fdlibm/otswap_fdlibm.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/fdlibm/shim/machine/endian.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/COPYING +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/Healpix_cxx/healpix_base.cc +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/Healpix_cxx/healpix_base.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/Healpix_cxx/healpix_map.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/Healpix_cxx/healpix_tables.cc +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/Healpix_cxx/healpix_tables.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/README.md +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/cxxsupport/alloc_utils.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/cxxsupport/arr.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/cxxsupport/datatypes.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/cxxsupport/error_handling.cc +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/cxxsupport/error_handling.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/cxxsupport/geom_utils.cc +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/cxxsupport/geom_utils.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/cxxsupport/lsconstants.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/cxxsupport/math_utils.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/cxxsupport/pointing.cc +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/cxxsupport/pointing.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/cxxsupport/rangeset.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/cxxsupport/string_utils.cc +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/cxxsupport/string_utils.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/cxxsupport/vec3.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/extern/healpix/cxxsupport/xcomplex.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/include/otswap/Maths.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/include/otswap/ParameterFile.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/python/otswap/py.typed +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/src/Maths.cpp +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/src/Pixel.cpp +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/src/Selection.cpp +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/src/detmath.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/src/pixel.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/check.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/cmake/consumer.cpp +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/cmake/subproject/CMakeLists.txt +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/crossmodule/crosstest.cpp +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/data/v0.1.0_box.dat +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/data/v0.1.0_box.fits +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/data/v0.1.0_lightcone.dat +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/data/v0.1.0_lightcone.fits +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/data/write_fixtures_v010.cpp +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/detmath_reference.h +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/cmdline_dashed_file.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/cmdline_help.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/cmdline_help_and_more.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/cmdline_missing_file.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/cmdline_no_argument.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/cmdline_two_arguments.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/cmdline_unknown_option.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/cmdline_version.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/geometry_cube.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/geometry_missing.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/id_column_ascii_name.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/irrelevant_box.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/irrelevant_box_no_random_file.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/irrelevant_box_no_recons.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/irrelevant_broken_value.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/irrelevant_lightcone.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/irrelevant_lightcone_no_recons.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/irrelevant_lightcone_no_reject.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/library_missing_tracer_file.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/no_output_box.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/no_output_lightcone.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/output_dir_file.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/output_dir_nested.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/output_overwrite.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/range_Nrec.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/range_Omega_matter.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/range_bias.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/range_bins.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/range_little_h.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/range_los_axis.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/range_mesh_cellsize.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/range_mps.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/range_redshift.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/range_rsd_smoothing_scale.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/range_threshold.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/recons_catalogue_false_box.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/recons_catalogue_false_lightcone.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/recons_without_catalogue_box.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/recons_without_catalogue_lightcone.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_box_column_tracer.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_box_output_dir.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_box_output_file.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_box_random_file_column_random.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_box_recons_Omega_matter.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_box_recons_bias.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_box_recons_little_h.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_box_recons_los_axis.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_box_recons_redshift.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_box_recons_rsd_smoothing_scale.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_box_tracer_file.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_lightcone_Omega_matter.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_lightcone_bins.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_lightcone_column_random.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_lightcone_column_tracer.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_lightcone_little_h.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_lightcone_output_dir.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_lightcone_output_file.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_lightcone_random_file.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_lightcone_recons_bias_file.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_lightcone_recons_rsd_smoothing_scale.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_lightcone_tracer_file.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_lightcone_units.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/required_lightcone_veto_mask_filename.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/run_box_dat.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/run_box_fits.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/run_defaults.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/run_report.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/unknown_cell_size.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/unknown_misspelt.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/unknown_printDispl.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/unknown_save_zspace_voids.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/unknown_several.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/value_box_max_alone.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/value_box_min_alone.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/value_box_min_count.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/value_column_count.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/value_output_file_empty.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/value_output_file_path.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/value_output_format.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/value_units.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/cases/value_verbosity.ini +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/data/box_ids.dat +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/executable/run_case.cmake +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tests/test_pixel.cpp +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tools/determinism/edge_values.py +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tools/determinism/record.py +0 -0
- {otswap-0.2.0 → otswap-0.3.0}/tools/wheels/select_omp.sh +0 -0
|
@@ -72,14 +72,17 @@ jobs:
|
|
|
72
72
|
- name: Test
|
|
73
73
|
run: ctest --test-dir build --output-on-failure
|
|
74
74
|
|
|
75
|
-
- name: Every translation unit is compiled without FP contraction
|
|
75
|
+
- name: Every translation unit is compiled without FP contraction or math errno
|
|
76
76
|
run: |
|
|
77
77
|
python3 - <<'PY'
|
|
78
78
|
import json, sys
|
|
79
79
|
entries = json.load(open("build/compile_commands.json"))
|
|
80
|
-
bad =
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
bad = 0
|
|
81
|
+
for flag in ("-ffp-contract=off", "-fno-math-errno"):
|
|
82
|
+
missing = [e["file"] for e in entries
|
|
83
|
+
if flag not in e.get("command", " ".join(e.get("arguments", [])))]
|
|
84
|
+
print(len(entries), "translation units;", len(missing), "without", flag)
|
|
85
|
+
bad += len(missing)
|
|
83
86
|
sys.exit(1 if bad or not entries else 0)
|
|
84
87
|
PY
|
|
85
88
|
|
|
@@ -116,7 +119,7 @@ jobs:
|
|
|
116
119
|
working-directory: ${{ runner.temp }}/moved
|
|
117
120
|
run: |
|
|
118
121
|
headers=$(find include -type f | LC_ALL=C sort | tr '\n' ' ')
|
|
119
|
-
expected="include/meshsearch/MeshGrid.h include/otswap/Maths.h include/otswap/OT.h include/otswap/ParameterFile.h include/otswap/RSD.h include/otswap/io.h "
|
|
122
|
+
expected="include/meshsearch/MeshGrid.h include/otswap/Maths.h include/otswap/OT.h include/otswap/ParameterFile.h include/otswap/RSD.h include/otswap/Random.h include/otswap/io.h "
|
|
120
123
|
if [ "$headers" != "$expected" ]; then
|
|
121
124
|
echo "installed headers: $headers"
|
|
122
125
|
exit 1
|
|
@@ -73,14 +73,17 @@ jobs:
|
|
|
73
73
|
with:
|
|
74
74
|
output-dir: wheelhouse
|
|
75
75
|
|
|
76
|
-
# The C++ install rules are off under scikit-build-core.
|
|
76
|
+
# The C++ install rules are off under scikit-build-core. The headers of
|
|
77
|
+
# the OpenMP runtime a macOS wheel ships are the one exception.
|
|
77
78
|
- name: The wheels hold no C++ library, header, CMake file or example
|
|
78
79
|
run: |
|
|
79
80
|
python3 - <<'PY'
|
|
80
81
|
import glob, sys, zipfile
|
|
81
82
|
wheels = glob.glob("wheelhouse/*.whl")
|
|
82
83
|
bad = [f"{w}: {name}" for w in wheels for name in zipfile.ZipFile(w).namelist()
|
|
83
|
-
if name.endswith((".a", ".h", ".cmake")) or "examples/" in name
|
|
84
|
+
if (name.endswith((".a", ".h", ".cmake")) or "examples/" in name)
|
|
85
|
+
and not ("-macosx_" in w
|
|
86
|
+
and name in ("otswap/openmp/include/omp.h", "otswap/openmp/include/ompx.h"))]
|
|
84
87
|
print(len(wheels), "wheels;", len(bad), "C++ library, header, CMake or example files")
|
|
85
88
|
print("\n".join(bad))
|
|
86
89
|
sys.exit(1 if bad or not wheels else 0)
|
|
@@ -1,5 +1,147 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.0 — 2026-11-05
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- The header `otswap/Random.h`: `otswap::uniformInt`, `uniformReal` and
|
|
8
|
+
`shuffle`, random draws over `std::mt19937` that give the same values on
|
|
9
|
+
every supported platform and compiler. Their algorithms are fixed: later
|
|
10
|
+
versions do not change them. `uniformReal` refuses a bound that is not
|
|
11
|
+
finite, a lower bound not below the upper one, or an infinite width, and
|
|
12
|
+
`shuffle` more than 2^32 − 1 elements, each with `otswap::Error`.
|
|
13
|
+
- `io::readDisplacementMean` (Python `io.read_displacement_mean`) reads a mean
|
|
14
|
+
displacement file, of this version or of otswap 0.2, into a `Result` of one
|
|
15
|
+
realization holding the mean, with the counts of valid realizations and
|
|
16
|
+
the number of realizations averaged.
|
|
17
|
+
- `Result::nRealizationsMean` (Python `Result.n_realizations_mean`), the
|
|
18
|
+
number of realizations averaged into a mean read from file; 1 otherwise.
|
|
19
|
+
The displacement writers record a value above 1 as the new keyword
|
|
20
|
+
NRECMEAN, with NREC = 1, and refuse 0, or a value above 1 with several
|
|
21
|
+
realizations. `validRealizations` is then the count of the realizations
|
|
22
|
+
averaged that were valid, always at most nRealizations x
|
|
23
|
+
nRealizationsMean; `rejectMaskCrossings` on such a result sets it to 0 for
|
|
24
|
+
the objects it rejects and keeps it for the others. `readDisplacementComplete`
|
|
25
|
+
reads NRECMEAN back, 1 when the file has none.
|
|
26
|
+
- `io::columnNames` (Python `io.column_names`): the names of the columns of
|
|
27
|
+
a table, those `io::read` finds.
|
|
28
|
+
- The mean displacement file of a lightcone holds the mps(z) profile and the
|
|
29
|
+
distance table, as the complete file does: FITS extensions MPSPROF and
|
|
30
|
+
DISTANCE, or ASCII twin files `.mps` and `.distances`, each with its own
|
|
31
|
+
PRODUCT, and the keywords MPSPART and DISTPART. `writeDisplacementMean`
|
|
32
|
+
(Python `write_displacement_mean`) takes `lightconeTables`
|
|
33
|
+
(`lightcone_tables`), true by default, to leave them out.
|
|
34
|
+
- `otswap.openmp_root()`: the directory of the OpenMP runtime a macOS wheel
|
|
35
|
+
ships, `otswap/openmp/` (`lib/libomp.dylib` with install name
|
|
36
|
+
`@rpath/libomp.dylib`, `include/omp.h`, `include/ompx.h`, LLVM's
|
|
37
|
+
`LICENSE.TXT`), or None. A package with OpenMP code of its own links that
|
|
38
|
+
file and loads the same runtime as otswap; "Linking the same OpenMP
|
|
39
|
+
runtime" in the Python reference says how.
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- `rejectMaskCrossings` (Python `reject_mask_crossings`), and the filter of
|
|
44
|
+
`reconstructLightcone` with a mask, judge a displacement by the longest run
|
|
45
|
+
of unobserved pixels its arc crosses one after another, no longer by the
|
|
46
|
+
number of distinct unobserved pixels: `maxUnobservedPixelsCrossed`
|
|
47
|
+
(`max_unobserved_pixels_crossed`, keywords CFMAXPIX and MAXPIXCR) is the
|
|
48
|
+
longest run tolerated. An arc crossing several small holes, each within the
|
|
49
|
+
threshold, is now kept. Results change for thresholds above 0; with 0, the
|
|
50
|
+
default, they are unchanged. The selection report says "unobserved pixels in
|
|
51
|
+
a row", and the comments of CFMAXPIX and MAXPIXCR say so too, now short
|
|
52
|
+
enough to be written whole in FITS.
|
|
53
|
+
- `io::read` (Python `io.read`) reads ASCII strictly: every line that is not
|
|
54
|
+
empty or a comment is a data row, and each requested field, and the first
|
|
55
|
+
field of each row, must be a number as a whole (decimal, hexadecimal,
|
|
56
|
+
`nan`, `inf`, `infinity`). Files that read before may now be refused where
|
|
57
|
+
a field was skipped or cut silently: `NA` (the columns after it shifted),
|
|
58
|
+
glued tokens such as `x12`, `1,5` with a blank delimiter (read as two
|
|
59
|
+
fields), `4.5abc`, `1e`, and a header line or any line of text that does
|
|
60
|
+
not start with the comment character, now an error where it was skipped.
|
|
61
|
+
The message names the file, the line and the field. A comment may follow
|
|
62
|
+
blanks, tabs or the delimiter: such a line, read as data before when it
|
|
63
|
+
held a number, is now skipped. A line starting with `###` is the names
|
|
64
|
+
line, skipped as data whatever the comment character, so columns are read
|
|
65
|
+
by name with any comment character. A carriage return ending a line is
|
|
66
|
+
ignored.
|
|
67
|
+
- Messages count as the file shows it, and say so: an ASCII line or FITS row
|
|
68
|
+
from 1 ("line 7 (from 1)"), a field from 1, a row `io::write` is given in
|
|
69
|
+
memory from 0. `readBiasTable` names an ASCII entry by its file line, no
|
|
70
|
+
longer its data row, and `readDisplacementComplete` names a row by its
|
|
71
|
+
file line or FITS row from 1, no longer from 0. The checks of coordinate
|
|
72
|
+
arrays and of a distance table built from arrays say "(from 0)". The
|
|
73
|
+
executable names a repeated ID by its file line or FITS row, from 1, no
|
|
74
|
+
longer its data row.
|
|
75
|
+
- The other messages that number something say from what too: an object,
|
|
76
|
+
an entry or a redshift bin of an array, from 0 ("object 3 (from 0)"), in
|
|
77
|
+
the coordinate conversions, the correction of redshift-space distortions,
|
|
78
|
+
the checks of a `Result` and the Python arguments; a line or an element of
|
|
79
|
+
a parameter file, from 1.
|
|
80
|
+
- `io::write` and `io::writeParts` (Python `io.write`, `io.write_parts`)
|
|
81
|
+
refuse a column description longer than 68 characters, an apostrophe
|
|
82
|
+
counting twice, and a keyword comment longer than the room its FITS card
|
|
83
|
+
leaves: 47 characters after a value within 20 columns, fewer after a
|
|
84
|
+
longer one. FITS cut both silently before; ASCII files are held to the
|
|
85
|
+
same limits. The comment of MPSREPR and the descriptions of lagrRA,
|
|
86
|
+
lagrDec and lagrRed, of displX, displY and displZ in the complete file,
|
|
87
|
+
and of nNeighbours, which FITS cut, are now shorter and written whole.
|
|
88
|
+
- Each line of a report is written as soon as its step finishes, the log
|
|
89
|
+
flushed after it, no longer all of them when the call ends; the text is
|
|
90
|
+
unchanged. A call that throws leaves the lines of the steps it finished.
|
|
91
|
+
Python prints each line to `sys.stdout` while the call runs, and Ctrl+C
|
|
92
|
+
stops a reconstruction, `measure_mps_profile` or a correction at its next
|
|
93
|
+
report line with `KeyboardInterrupt`.
|
|
94
|
+
- `rejectMaskCrossings` (Python `reject_mask_crossings`) requires finite
|
|
95
|
+
values only in the valid displacements, which it reads, so it accepts a
|
|
96
|
+
NaN in a cleared entry, as a mean read from file holds for a tracer
|
|
97
|
+
without valid realizations.
|
|
98
|
+
- `reconstructBox` and `reconstructLightcone` refuse more than 2^32 − 1
|
|
99
|
+
tracers.
|
|
100
|
+
- The executable writes the `MPS_` file of `printMps` only when neither
|
|
101
|
+
displacement file is written, those files holding the profile; in ASCII it
|
|
102
|
+
reports the twin files of the mean file too.
|
|
103
|
+
- The executable takes `key =`, with no value, as leaving the key out, for
|
|
104
|
+
the keys whose default is none: `id_column`, `random_file` (box), `z_min`,
|
|
105
|
+
`z_max`, `box_min`, `box_max` and `mps`. Every other key still needs a
|
|
106
|
+
value. The parameter files in `examples/executable/` set every key that
|
|
107
|
+
applies to their run, defaults included, and the keys without a default as
|
|
108
|
+
`key =`, instead of leaving them commented out.
|
|
109
|
+
- The macOS wheels hold libomp in `otswap/openmp/lib/`, where the module
|
|
110
|
+
finds it through its rpath, instead of `otswap/.dylibs/`, so that
|
|
111
|
+
another package can link the same file (see `openmp_root()`).
|
|
112
|
+
- The README and the citation files say that a version of otswap is
|
|
113
|
+
included in CosmoBolognaLib, and no longer ask to cite CosmoBolognaLib.
|
|
114
|
+
|
|
115
|
+
## 0.2.1 — 2026-10-28
|
|
116
|
+
|
|
117
|
+
### Added
|
|
118
|
+
|
|
119
|
+
- `io::readKeywords` (Python `io.read_keywords`) reads the keywords of a
|
|
120
|
+
table, ASCII or FITS, from the first extension or one named by EXTNAME.
|
|
121
|
+
- `io::writeParts`, `io::readPart`, `io::hasPart` and `io::twinFile` (Python
|
|
122
|
+
`io.write_parts`, `read_part`, `has_part`, `twin_file`, with `io.TablePart`)
|
|
123
|
+
write and read files of several tables: FITS extensions named by EXTNAME, or
|
|
124
|
+
ASCII twin files.
|
|
125
|
+
|
|
126
|
+
### Changed
|
|
127
|
+
|
|
128
|
+
- `reconstructBox` without box limits and with randoms given: `Result::box`
|
|
129
|
+
is now the bounding box of the tracers and the given randoms, not of the
|
|
130
|
+
tracers alone, so every random matched to a tracer lies inside it; also when
|
|
131
|
+
mps is given. A computed mps follows that box, so such runs give a slightly
|
|
132
|
+
different mps, and so different displacements, than in 0.2.0. Tracers that
|
|
133
|
+
span no volume themselves, all in one plane for example, are accepted when
|
|
134
|
+
the given randoms do. Drawn randoms and box limits are unchanged.
|
|
135
|
+
- Lengths are documented in coordinate units, the unit of the Cartesian
|
|
136
|
+
coordinates: that of the tracers in a box, that of the distance table in a
|
|
137
|
+
lightcone (Mpc/h from the cosmology constructor). The files otswap writes
|
|
138
|
+
give length columns no unit (no TUNIT, no `[Mpc/h]`) and say "in coordinate
|
|
139
|
+
units" in the comments of their length keywords; screen and error messages
|
|
140
|
+
say "in coordinate units". The values are unchanged.
|
|
141
|
+
- Every translation unit is compiled with `-fno-math-errno` as well as
|
|
142
|
+
`-ffp-contract=off` (except with MSVC). The functions it lets the compiler
|
|
143
|
+
inline are exact, so results are unchanged, bit for bit.
|
|
144
|
+
|
|
3
145
|
## 0.2.0 — 2026-10-23
|
|
4
146
|
|
|
5
147
|
### Added
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
cff-version: 1.2.0
|
|
2
|
-
message: "If you use otswap, please cite the paper below
|
|
2
|
+
message: "If you use otswap, please cite the paper below."
|
|
3
3
|
title: otswap
|
|
4
4
|
abstract: >-
|
|
5
5
|
Optimal transport reconstruction of the displacement field of a tracer
|
|
@@ -9,8 +9,8 @@ authors:
|
|
|
9
9
|
- family-names: Sartori
|
|
10
10
|
given-names: Simone
|
|
11
11
|
email: simone.sartori@inaf.it
|
|
12
|
-
version: 0.
|
|
13
|
-
date-released: 2026-
|
|
12
|
+
version: 0.3.0
|
|
13
|
+
date-released: 2026-11-05
|
|
14
14
|
license: GPL-2.0-or-later
|
|
15
15
|
repository-code: "https://github.com/SimoSartori/otswap"
|
|
16
16
|
url: "https://simosartori.github.io/otswap/"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
cmake_minimum_required(VERSION 3.16)
|
|
2
2
|
|
|
3
|
-
project(otswap VERSION 0.
|
|
3
|
+
project(otswap VERSION 0.3.0 LANGUAGES C CXX)
|
|
4
4
|
|
|
5
5
|
# PROJECT_IS_TOP_LEVEL needs CMake 3.21; this is the 3.16 equivalent, true
|
|
6
6
|
# for a standalone build and false under add_subdirectory or FetchContent.
|
|
@@ -34,6 +34,9 @@ endif()
|
|
|
34
34
|
option(OTSWAP_BUILD_TESTS "Build the C++ test suite" ${OTSWAP_IS_TOP_LEVEL})
|
|
35
35
|
option(OTSWAP_BUILD_PYTHON "Build the Python bindings" OFF)
|
|
36
36
|
option(OTSWAP_INSTALL "Generate the C++ install rules" ${OTSWAP_INSTALL_DEFAULT})
|
|
37
|
+
# macOS wheels only, set in pyproject.toml: the module's libomp, with its
|
|
38
|
+
# headers and licence, goes into the package (see the Python bindings below).
|
|
39
|
+
option(OTSWAP_BUNDLE_OPENMP "Install the module's libomp into the Python package" OFF)
|
|
37
40
|
|
|
38
41
|
# The otswap executable: built by a standalone build, not by the wheel nor
|
|
39
42
|
# as a subproject.
|
|
@@ -48,7 +51,7 @@ include(GNUInstallDirs)
|
|
|
48
51
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
|
49
52
|
|
|
50
53
|
# ---------------------------------------------------------------------------
|
|
51
|
-
# Floating-point contraction
|
|
54
|
+
# Floating-point contraction and math errno
|
|
52
55
|
#
|
|
53
56
|
# No a*b+c is fused into one FMA anywhere: compilers differ in what they
|
|
54
57
|
# contract by default, and so do the instruction sets, so contraction would
|
|
@@ -56,10 +59,14 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
|
|
56
59
|
# targets; this covers otswap's, fdlibm, a fetched meshsearch, the tests'
|
|
57
60
|
# Healpix and the extension module. It is not exported: all of otswap's
|
|
58
61
|
# arithmetic is in its own archive.
|
|
62
|
+
#
|
|
63
|
+
# -fno-math-errno lets the compiler inline the sqrt, floor and similar
|
|
64
|
+
# calls of the C library without setting errno, as Apple clang does by default. These
|
|
65
|
+
# functions are exact, so it changes speed only, never a result.
|
|
59
66
|
# ---------------------------------------------------------------------------
|
|
60
67
|
|
|
61
68
|
if (NOT MSVC)
|
|
62
|
-
add_compile_options(-ffp-contract=off)
|
|
69
|
+
add_compile_options(-ffp-contract=off -fno-math-errno)
|
|
63
70
|
endif()
|
|
64
71
|
|
|
65
72
|
# ---------------------------------------------------------------------------
|
|
@@ -241,6 +248,7 @@ if (OTSWAP_BUILD_EXECUTABLE)
|
|
|
241
248
|
set_target_properties(otswap_app PROPERTIES OUTPUT_NAME otswap)
|
|
242
249
|
target_compile_definitions(otswap_app PRIVATE OTSWAP_VERSION="${PROJECT_VERSION}")
|
|
243
250
|
target_link_libraries(otswap_app PRIVATE otswap)
|
|
251
|
+
target_include_directories(otswap_app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
|
244
252
|
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
|
|
245
253
|
target_compile_options(otswap_app PRIVATE -Wall -Wextra)
|
|
246
254
|
endif()
|
|
@@ -321,6 +329,17 @@ if (OTSWAP_BUILD_TESTS)
|
|
|
321
329
|
-DPROJECT_VERSION=${PROJECT_VERSION}
|
|
322
330
|
-P ${CMAKE_CURRENT_SOURCE_DIR}/tests/executable/run_case.cmake)
|
|
323
331
|
endforeach()
|
|
332
|
+
|
|
333
|
+
# The shipped parameter files set every key that applies to their run.
|
|
334
|
+
foreach (parameters examples/executable/box examples/executable/lightcone
|
|
335
|
+
tests/executable/example_box tests/executable/example_lightcone)
|
|
336
|
+
string(REPLACE "/" "_" parameters_name ${parameters})
|
|
337
|
+
add_test(NAME executable_keys_${parameters_name}
|
|
338
|
+
COMMAND ${CMAKE_COMMAND}
|
|
339
|
+
-DAPP=${CMAKE_CURRENT_SOURCE_DIR}/app/otswap.cpp
|
|
340
|
+
-DPARAMETERS=${CMAKE_CURRENT_SOURCE_DIR}/${parameters}.ini
|
|
341
|
+
-P ${CMAKE_CURRENT_SOURCE_DIR}/tests/executable/check_example_keys.cmake)
|
|
342
|
+
endforeach()
|
|
324
343
|
endif()
|
|
325
344
|
endif()
|
|
326
345
|
|
|
@@ -345,6 +364,34 @@ if (OTSWAP_BUILD_PYTHON)
|
|
|
345
364
|
target_link_libraries(otswap_python PRIVATE otswap)
|
|
346
365
|
install(TARGETS otswap_python LIBRARY DESTINATION otswap)
|
|
347
366
|
|
|
367
|
+
# With OTSWAP_BUNDLE_OPENMP, the libomp the module links, built by
|
|
368
|
+
# tools/wheels/build_deps.sh with install name @rpath/libomp.dylib, goes
|
|
369
|
+
# into the package as otswap/openmp/{lib,include}, the tree
|
|
370
|
+
# otswap.openmp_root() names, and the module finds it through its rpath.
|
|
371
|
+
# Otherwise the module keeps the directories of the libraries it links as
|
|
372
|
+
# its rpath, for a libomp whose install name is relative.
|
|
373
|
+
if (OTSWAP_BUNDLE_OPENMP)
|
|
374
|
+
set(otswap_omp_library "")
|
|
375
|
+
foreach (library IN LISTS OpenMP_CXX_LIBRARIES)
|
|
376
|
+
if (library MATCHES "/libomp\\.dylib$")
|
|
377
|
+
set(otswap_omp_library "${library}")
|
|
378
|
+
endif()
|
|
379
|
+
endforeach()
|
|
380
|
+
if (NOT APPLE OR NOT otswap_omp_library)
|
|
381
|
+
message(FATAL_ERROR "OTSWAP_BUNDLE_OPENMP needs macOS and a libomp.dylib, found through OpenMP_ROOT.")
|
|
382
|
+
endif()
|
|
383
|
+
get_filename_component(otswap_omp_library "${otswap_omp_library}" REALPATH)
|
|
384
|
+
get_filename_component(otswap_omp_root "${otswap_omp_library}" DIRECTORY)
|
|
385
|
+
get_filename_component(otswap_omp_root "${otswap_omp_root}" DIRECTORY)
|
|
386
|
+
install(FILES "${otswap_omp_library}" DESTINATION otswap/openmp/lib RENAME libomp.dylib)
|
|
387
|
+
install(FILES "${otswap_omp_root}/include/omp.h" "${otswap_omp_root}/include/ompx.h"
|
|
388
|
+
DESTINATION otswap/openmp/include)
|
|
389
|
+
install(FILES "${otswap_omp_root}/LICENSE.TXT" DESTINATION otswap/openmp)
|
|
390
|
+
set_target_properties(otswap_python PROPERTIES INSTALL_RPATH "@loader_path/openmp/lib")
|
|
391
|
+
else()
|
|
392
|
+
set_target_properties(otswap_python PROPERTIES INSTALL_RPATH_USE_LINK_PATH ON)
|
|
393
|
+
endif()
|
|
394
|
+
|
|
348
395
|
# _otswap_crosstest, for tests/test_crossmodule.py: a second module that
|
|
349
396
|
# takes and returns otswap's types as their C++ types, as a package built
|
|
350
397
|
# on otswap would. Built with the tests only, into crossmodule/ of the
|
|
@@ -363,7 +410,7 @@ endif()
|
|
|
363
410
|
# ---------------------------------------------------------------------------
|
|
364
411
|
# Install and export
|
|
365
412
|
#
|
|
366
|
-
# find_package(otswap 0.
|
|
413
|
+
# find_package(otswap 0.3 CONFIG) then otswap::otswap. The archive holds
|
|
367
414
|
# fdlibm's objects; its other dependencies are found again on the consumer's
|
|
368
415
|
# machine by otswapConfig.cmake: meshsearch 0.2.1 or a later 0.2.x,
|
|
369
416
|
# cfitsio through the FindCFITSIO.cmake installed beside it, and OpenMP when
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: otswap
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Optimal transport reconstruction of the displacement field of a tracer catalogue, by local swapping
|
|
5
5
|
Author: Simone Sartori
|
|
6
6
|
License-Expression: GPL-2.0-or-later
|
|
@@ -52,8 +52,8 @@ C++17, with a Python package on the same code.
|
|
|
52
52
|
|
|
53
53
|
It is the middle of three packages: it depends on
|
|
54
54
|
[meshsearch](https://github.com/SimoSartori/meshsearch) for its neighbour
|
|
55
|
-
searches, and the Back-in-time Void Finder will be built on it.
|
|
56
|
-
CosmoBolognaLib
|
|
55
|
+
searches, and the Back-in-time Void Finder will be built on it. A version of
|
|
56
|
+
it is included in CosmoBolognaLib; otswap depends on nothing from it.
|
|
57
57
|
|
|
58
58
|
Documentation, for both APIs: **<https://simosartori.github.io/otswap/>**
|
|
59
59
|
|
|
@@ -97,7 +97,7 @@ in a system path. The options:
|
|
|
97
97
|
### Using it from CMake
|
|
98
98
|
|
|
99
99
|
```cmake
|
|
100
|
-
find_package(otswap 0.
|
|
100
|
+
find_package(otswap 0.3 CONFIG REQUIRED)
|
|
101
101
|
target_link_libraries(your_target PRIVATE otswap::otswap)
|
|
102
102
|
```
|
|
103
103
|
|
|
@@ -112,8 +112,10 @@ With a fixed seed, a reconstruction gives the same result whatever the number
|
|
|
112
112
|
of threads, bit for bit. The seed 0 draws one, and the seed used is recorded in
|
|
113
113
|
the result, so any run can be repeated. Every translation unit is compiled with
|
|
114
114
|
`-ffp-contract=off`, and the math functions the results depend on come from a
|
|
115
|
-
vendored copy of FreeBSD
|
|
116
|
-
inputs give the same bits on every supported platform and
|
|
115
|
+
vendored copy of the FreeBSD msun library rather than from the platform
|
|
116
|
+
library, so the same inputs give the same bits on every supported platform and
|
|
117
|
+
compiler. Every translation unit is also compiled with `-fno-math-errno`, which
|
|
118
|
+
makes the code faster without changing any result.
|
|
117
119
|
<!-- docs:reproducibility-end -->
|
|
118
120
|
|
|
119
121
|
## Tests
|
|
@@ -132,7 +134,7 @@ skipped without it.
|
|
|
132
134
|
```python
|
|
133
135
|
import otswap
|
|
134
136
|
|
|
135
|
-
tracers = otswap.io.read("tracers.dat", [0, 1, 2]).values # (N, 3)
|
|
137
|
+
tracers = otswap.io.read("tracers.dat", [0, 1, 2]).values # (N, 3)
|
|
136
138
|
|
|
137
139
|
result = otswap.reconstruct_box(tracers, config=otswap.Config(n_realizations=8, seed=12345))
|
|
138
140
|
print(result.mean_displacement[:3])
|
|
@@ -152,8 +154,10 @@ otswap examples/executable/box.ini
|
|
|
152
154
|
|
|
153
155
|
## Python
|
|
154
156
|
|
|
155
|
-
Coordinates are NumPy arrays of shape (N, 3). Cartesian coordinates
|
|
156
|
-
|
|
157
|
+
Coordinates are NumPy arrays of shape (N, 3). Cartesian coordinates, and
|
|
158
|
+
every length, are in coordinate units: the unit of the tracers given in a box,
|
|
159
|
+
that of the distance table in a lightcone (Mpc/h from `DistanceTable.flat`);
|
|
160
|
+
sky coordinates are ordered right ascension, declination, redshift, with
|
|
157
161
|
the angular unit given explicitly by `angle_unit`. Inputs are converted to
|
|
158
162
|
float64; the reconstruction works on its own copy of them. The number of
|
|
159
163
|
threads follows `OMP_NUM_THREADS`, and the reconstruction functions release the
|
|
@@ -162,9 +166,8 @@ GIL while they run. Tables are read and written by `otswap.io`.
|
|
|
162
166
|
## Citing
|
|
163
167
|
|
|
164
168
|
Please cite Sartori et al. 2026,
|
|
165
|
-
[arXiv:2601.15378](https://arxiv.org/abs/2601.15378)
|
|
166
|
-
|
|
167
|
-
`CITATION.cff` has the details.
|
|
169
|
+
[arXiv:2601.15378](https://arxiv.org/abs/2601.15378). `CITATION.cff` has the
|
|
170
|
+
details.
|
|
168
171
|
|
|
169
172
|
## Licence
|
|
170
173
|
|
|
@@ -172,7 +175,9 @@ GPL-2.0-or-later; see `LICENSE`. Vendored code keeps its own terms:
|
|
|
172
175
|
|
|
173
176
|
- `extern/fdlibm`: FreeBSD msun, under the Sun Microsystems notice in each file,
|
|
174
177
|
a permissive licence (see its README);
|
|
175
|
-
- `extern/healpix`: HEALPix 3.82, GPL-2.0-or-later, built only with the tests
|
|
178
|
+
- `extern/healpix`: HEALPix 3.82, GPL-2.0-or-later, built only with the tests;
|
|
179
|
+
- the macOS wheels: LLVM's libomp, under its own licence,
|
|
180
|
+
`otswap/openmp/LICENSE.TXT`.
|
|
176
181
|
|
|
177
182
|
The example data in `examples/data` are not covered by this licence: they may
|
|
178
183
|
be redistributed unchanged with the examples and used only to run them (see
|
|
@@ -35,8 +35,8 @@ C++17, with a Python package on the same code.
|
|
|
35
35
|
|
|
36
36
|
It is the middle of three packages: it depends on
|
|
37
37
|
[meshsearch](https://github.com/SimoSartori/meshsearch) for its neighbour
|
|
38
|
-
searches, and the Back-in-time Void Finder will be built on it.
|
|
39
|
-
CosmoBolognaLib
|
|
38
|
+
searches, and the Back-in-time Void Finder will be built on it. A version of
|
|
39
|
+
it is included in CosmoBolognaLib; otswap depends on nothing from it.
|
|
40
40
|
|
|
41
41
|
Documentation, for both APIs: **<https://simosartori.github.io/otswap/>**
|
|
42
42
|
|
|
@@ -80,7 +80,7 @@ in a system path. The options:
|
|
|
80
80
|
### Using it from CMake
|
|
81
81
|
|
|
82
82
|
```cmake
|
|
83
|
-
find_package(otswap 0.
|
|
83
|
+
find_package(otswap 0.3 CONFIG REQUIRED)
|
|
84
84
|
target_link_libraries(your_target PRIVATE otswap::otswap)
|
|
85
85
|
```
|
|
86
86
|
|
|
@@ -95,8 +95,10 @@ With a fixed seed, a reconstruction gives the same result whatever the number
|
|
|
95
95
|
of threads, bit for bit. The seed 0 draws one, and the seed used is recorded in
|
|
96
96
|
the result, so any run can be repeated. Every translation unit is compiled with
|
|
97
97
|
`-ffp-contract=off`, and the math functions the results depend on come from a
|
|
98
|
-
vendored copy of FreeBSD
|
|
99
|
-
inputs give the same bits on every supported platform and
|
|
98
|
+
vendored copy of the FreeBSD msun library rather than from the platform
|
|
99
|
+
library, so the same inputs give the same bits on every supported platform and
|
|
100
|
+
compiler. Every translation unit is also compiled with `-fno-math-errno`, which
|
|
101
|
+
makes the code faster without changing any result.
|
|
100
102
|
<!-- docs:reproducibility-end -->
|
|
101
103
|
|
|
102
104
|
## Tests
|
|
@@ -115,7 +117,7 @@ skipped without it.
|
|
|
115
117
|
```python
|
|
116
118
|
import otswap
|
|
117
119
|
|
|
118
|
-
tracers = otswap.io.read("tracers.dat", [0, 1, 2]).values # (N, 3)
|
|
120
|
+
tracers = otswap.io.read("tracers.dat", [0, 1, 2]).values # (N, 3)
|
|
119
121
|
|
|
120
122
|
result = otswap.reconstruct_box(tracers, config=otswap.Config(n_realizations=8, seed=12345))
|
|
121
123
|
print(result.mean_displacement[:3])
|
|
@@ -135,8 +137,10 @@ otswap examples/executable/box.ini
|
|
|
135
137
|
|
|
136
138
|
## Python
|
|
137
139
|
|
|
138
|
-
Coordinates are NumPy arrays of shape (N, 3). Cartesian coordinates
|
|
139
|
-
|
|
140
|
+
Coordinates are NumPy arrays of shape (N, 3). Cartesian coordinates, and
|
|
141
|
+
every length, are in coordinate units: the unit of the tracers given in a box,
|
|
142
|
+
that of the distance table in a lightcone (Mpc/h from `DistanceTable.flat`);
|
|
143
|
+
sky coordinates are ordered right ascension, declination, redshift, with
|
|
140
144
|
the angular unit given explicitly by `angle_unit`. Inputs are converted to
|
|
141
145
|
float64; the reconstruction works on its own copy of them. The number of
|
|
142
146
|
threads follows `OMP_NUM_THREADS`, and the reconstruction functions release the
|
|
@@ -145,9 +149,8 @@ GIL while they run. Tables are read and written by `otswap.io`.
|
|
|
145
149
|
## Citing
|
|
146
150
|
|
|
147
151
|
Please cite Sartori et al. 2026,
|
|
148
|
-
[arXiv:2601.15378](https://arxiv.org/abs/2601.15378)
|
|
149
|
-
|
|
150
|
-
`CITATION.cff` has the details.
|
|
152
|
+
[arXiv:2601.15378](https://arxiv.org/abs/2601.15378). `CITATION.cff` has the
|
|
153
|
+
details.
|
|
151
154
|
|
|
152
155
|
## Licence
|
|
153
156
|
|
|
@@ -155,7 +158,9 @@ GPL-2.0-or-later; see `LICENSE`. Vendored code keeps its own terms:
|
|
|
155
158
|
|
|
156
159
|
- `extern/fdlibm`: FreeBSD msun, under the Sun Microsystems notice in each file,
|
|
157
160
|
a permissive licence (see its README);
|
|
158
|
-
- `extern/healpix`: HEALPix 3.82, GPL-2.0-or-later, built only with the tests
|
|
161
|
+
- `extern/healpix`: HEALPix 3.82, GPL-2.0-or-later, built only with the tests;
|
|
162
|
+
- the macOS wheels: LLVM's libomp, under its own licence,
|
|
163
|
+
`otswap/openmp/LICENSE.TXT`.
|
|
159
164
|
|
|
160
165
|
The example data in `examples/data` are not covered by this licence: they may
|
|
161
166
|
be redistributed unchanged with the examples and used only to run them (see
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
* that needs no data comes before any data is read. The keys are listed
|
|
31
31
|
* in docs/executable.md.
|
|
32
32
|
*
|
|
33
|
-
* Uses the public headers
|
|
33
|
+
* Uses the public headers, and src/internal.h to name a repeated ID by its
|
|
34
|
+
* ASCII line or FITS row.
|
|
34
35
|
*
|
|
35
36
|
* @author Simone Sartori <simone.sartori@inaf.it>
|
|
36
37
|
*/
|
|
@@ -51,6 +52,8 @@
|
|
|
51
52
|
#include "otswap/RSD.h"
|
|
52
53
|
#include "otswap/io.h"
|
|
53
54
|
|
|
55
|
+
#include "internal.h"
|
|
56
|
+
|
|
54
57
|
namespace {
|
|
55
58
|
|
|
56
59
|
const char* const kUsage = "usage: otswap <parameter-file>";
|
|
@@ -191,7 +194,15 @@ namespace {
|
|
|
191
194
|
return m_file + ":" + std::to_string(m_parameters.line(key)) + ": key '" + key + "': ";
|
|
192
195
|
}
|
|
193
196
|
|
|
194
|
-
std::string line (const std::string& key) const
|
|
197
|
+
std::string line (const std::string& key) const
|
|
198
|
+
{
|
|
199
|
+
return std::to_string(m_parameters.line(key)) + " (from 1)";
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
bool given (const std::string& key) const
|
|
203
|
+
{
|
|
204
|
+
return m_parameters.has(key) && !m_parameters.get<std::vector<std::string>>(key).empty();
|
|
205
|
+
}
|
|
195
206
|
|
|
196
207
|
[[noreturn]] void fail (const std::string& key, const std::string& message) const
|
|
197
208
|
{
|
|
@@ -339,7 +350,7 @@ namespace {
|
|
|
339
350
|
|
|
340
351
|
run.tracerFile = f.get<std::string>("tracer_file");
|
|
341
352
|
run.tracerColumns = p.three<std::string>("column_tracer");
|
|
342
|
-
if (
|
|
353
|
+
if (p.given("id_column")) {
|
|
343
354
|
run.idColumn = f.get<std::string>("id_column");
|
|
344
355
|
for (const std::string& c : run.tracerColumns)
|
|
345
356
|
if (same_column(*run.idColumn, c, is_fits(run.tracerFile)))
|
|
@@ -357,9 +368,9 @@ namespace {
|
|
|
357
368
|
|
|
358
369
|
if (lightcone) {
|
|
359
370
|
run.maskFile = f.get<std::string>("veto_mask_filename");
|
|
360
|
-
run.cut.min = f.get<double>("z_min"
|
|
361
|
-
run.cut.max = f.get<double>("z_max"
|
|
362
|
-
if (
|
|
371
|
+
if (p.given("z_min")) run.cut.min = f.get<double>("z_min");
|
|
372
|
+
if (p.given("z_max")) run.cut.max = f.get<double>("z_max");
|
|
373
|
+
if (p.given("z_min") && p.given("z_max") && run.cut.max < run.cut.min)
|
|
363
374
|
p.fail("z_max", p.written("z_max") + " is below z_min, " + p.written("z_min") + ", at line " +
|
|
364
375
|
p.line("z_min"));
|
|
365
376
|
}
|
|
@@ -391,18 +402,19 @@ namespace {
|
|
|
391
402
|
}
|
|
392
403
|
else {
|
|
393
404
|
std::vector<double> lower, upper;
|
|
394
|
-
|
|
395
|
-
if (
|
|
396
|
-
if (
|
|
397
|
-
|
|
405
|
+
const bool hasMin = p.given("box_min"), hasMax = p.given("box_max");
|
|
406
|
+
if (hasMin) lower = p.three<double>("box_min");
|
|
407
|
+
if (hasMax) upper = p.three<double>("box_max");
|
|
408
|
+
if (hasMin != hasMax) {
|
|
409
|
+
const bool min = hasMin;
|
|
398
410
|
p.fail(min ? "box_min" : "box_max", std::string(min ? "box_max" : "box_min") +
|
|
399
411
|
" is missing; give both or neither");
|
|
400
412
|
}
|
|
401
|
-
if (
|
|
413
|
+
if (hasMin) {
|
|
402
414
|
otswap::BoxLimits limits;
|
|
403
415
|
for (std::size_t k = 0; k < 3; ++k) {
|
|
404
416
|
if (!(upper[k] > lower[k]))
|
|
405
|
-
p.fail("box_max", "element " + std::to_string(k+1) + ", " + p.written("box_max", k) +
|
|
417
|
+
p.fail("box_max", "element " + std::to_string(k+1) + " (from 1), " + p.written("box_max", k) +
|
|
406
418
|
", is not above element " + std::to_string(k+1) + " of box_min, " +
|
|
407
419
|
p.written("box_min", k) + ", at line " + p.line("box_min"));
|
|
408
420
|
limits.lower[k] = lower[k];
|
|
@@ -410,7 +422,7 @@ namespace {
|
|
|
410
422
|
}
|
|
411
423
|
run.limits = limits;
|
|
412
424
|
}
|
|
413
|
-
if (
|
|
425
|
+
if (p.given("mps")) {
|
|
414
426
|
run.mps = f.get<double>("mps");
|
|
415
427
|
p.require("mps", *run.mps > 0., "positive");
|
|
416
428
|
}
|
|
@@ -460,16 +472,18 @@ namespace {
|
|
|
460
472
|
// The run
|
|
461
473
|
// ==========================================================================
|
|
462
474
|
|
|
463
|
-
/// The first ID met twice, in row order, with both
|
|
464
|
-
|
|
475
|
+
/// The first ID met twice, in row order, with both rows named as the
|
|
476
|
+
/// file numbers them: the ASCII line or the FITS row, from 1.
|
|
477
|
+
void check_ids (const otswap::internal::NumberedTable& table, const Run& run)
|
|
465
478
|
{
|
|
479
|
+
const std::vector<std::int64_t>& ids = table.table.integers;
|
|
466
480
|
std::unordered_map<std::int64_t, std::size_t> first;
|
|
467
481
|
for (std::size_t row = 0; row < ids.size(); ++row) {
|
|
468
482
|
const auto found = first.emplace(ids[row], row);
|
|
469
483
|
if (!found.second)
|
|
470
484
|
throw otswap::Error(run.tracerFile + ": the column " + *run.idColumn + " holds the ID " +
|
|
471
|
-
std::to_string(ids[row]) + " twice, at
|
|
472
|
-
|
|
485
|
+
std::to_string(ids[row]) + " twice, at " + table.row(found.first->second) +
|
|
486
|
+
" and " + table.row(row));
|
|
473
487
|
}
|
|
474
488
|
}
|
|
475
489
|
|
|
@@ -485,7 +499,7 @@ namespace {
|
|
|
485
499
|
Switches switches;
|
|
486
500
|
switches.lightcone = p.word("geometry", {"box", "lightcone"}) == "lightcone";
|
|
487
501
|
switches.performRecons = parameters.get<bool>("perform_recons", false);
|
|
488
|
-
switches.randomFile =
|
|
502
|
+
switches.randomFile = p.given("random_file");
|
|
489
503
|
if (switches.lightcone)
|
|
490
504
|
switches.rejectCrossings = parameters.get<bool>("reject_mask_crossings",
|
|
491
505
|
otswap::Config{}.rejectCrossings);
|
|
@@ -527,11 +541,12 @@ namespace {
|
|
|
527
541
|
std::vector<double> tracers, randoms;
|
|
528
542
|
std::vector<std::int64_t> ids;
|
|
529
543
|
if (run.idColumn) {
|
|
530
|
-
otswap::
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
544
|
+
otswap::internal::NumberedTable numbered =
|
|
545
|
+
otswap::internal::read_numbered(run.tracerFile, "", run.tracerColumns, {*run.idColumn},
|
|
546
|
+
run.delimiter, run.comment);
|
|
547
|
+
check_ids(numbered, run);
|
|
548
|
+
tracers = std::move(numbered.table.values);
|
|
549
|
+
ids = std::move(numbered.table.integers);
|
|
535
550
|
}
|
|
536
551
|
else
|
|
537
552
|
tracers = otswap::io::read(run.tracerFile, run.tracerColumns, run.delimiter, run.comment).values;
|
|
@@ -561,6 +576,10 @@ namespace {
|
|
|
561
576
|
if (run.printMean) {
|
|
562
577
|
otswap::io::writeDisplacementMean(path("displacement_mean_" + zspace), result);
|
|
563
578
|
wrote(path("displacement_mean_" + zspace));
|
|
579
|
+
if (run.switches.lightcone && run.extension == "dat") {
|
|
580
|
+
wrote(path("displacement_mean_" + zspace, ".mps"));
|
|
581
|
+
wrote(path("displacement_mean_" + zspace, ".distances"));
|
|
582
|
+
}
|
|
564
583
|
}
|
|
565
584
|
if (run.printComplete) {
|
|
566
585
|
otswap::io::writeDisplacementComplete(path("displacement_complete_" + zspace), result, true);
|
|
@@ -570,7 +589,7 @@ namespace {
|
|
|
570
589
|
wrote(path("displacement_complete_" + zspace, ".distances"));
|
|
571
590
|
}
|
|
572
591
|
}
|
|
573
|
-
if (run.printMps) {
|
|
592
|
+
if (run.printMps && !run.printMean && !run.printComplete) {
|
|
574
593
|
otswap::io::writeMpsProfile(path("MPS_" + zspace), result.mpsProfile);
|
|
575
594
|
wrote(path("MPS_" + zspace));
|
|
576
595
|
}
|