Skip to content

Commit

Permalink
Final updates - release v3.0.0 (#499)
Browse files Browse the repository at this point in the history
* Version number update and some Changelog updates

* Changelog updates completed

* Fixed chi2 in residuals and Signal

* Version number changed to 3.0.0

* All the tutorials rerun, except Global Surface Emission

* Global Surface Emission rerun (with 1 code block commented out)

* Changelog adjustments

---------

Co-authored-by: lmauviard <lucien@mauviard.fr>
  • Loading branch information
thjsal and lmauviard authored Dec 19, 2024
1 parent 6774015 commit 6c7a025
Show file tree
Hide file tree
Showing 17 changed files with 737 additions and 735 deletions.
80 changes: 76 additions & 4 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,90 @@ and this project adheres to
.. ^^^^^^^^^^^
[v2.3.0-b] - 2024-12-06
~~~~~~~~~~~~~~~~~~~~~~~~~
[v3.0.0] - 2024-12-19
~~~~~~~~~~~~~~~~~~~~~

Summary
^^^^^^^

* Updates done during the 2024 hack week. Including making X-PSI Cython3 compatible.
* This release upgrades X-PSI to be Cython3 compatible and provides many new features and examples, such as UltraNest sampling, Simulation-Based Inference, and reading data and instrument files that are in FITS format. A few deprecated features were also removed.

Fixed
^^^^^

* Fixed Python3.12 related syntax warnings when installing X-PSI were fixed by adding 'r' in front of strings that contain a backslash.

* The default value for ``image_order_limit`` in the module generator was set to match what is said in the docstring (i.e. the default being ``None``).

Added
^^^^^

* Added UltraNest as an example to the modelling tutorial and installation instructions.

* Added some docstrings to ``mesh_tools.pyx`` and ``effective_gravity_universal.pyx``.

* Added new optional plots for clustering of residuals.

* Added the possibility to print a user-defined credible level.

* Data (event list or spectrum) and responses (RMF, ARF, RSP) can now be loaded from FITS files.

* Added Simulation-Based Inference examples in the documentation, and wrapper class in the utilities.

* Added a new option ``star_shape`` for the Spacetime class to allow pulse calculation and inference with a spherical star (instead of an oblate spheroid).

* Added background, convergence, and "P-P" plots in the Post-processing tutorial.

* Multi-mode plotting was made possible in the corner plots (different modes from a MultiNest run done with ``multimodal=True`` can be now plotted separately).

* Added bolometric pulse and blurring of the residuals options in ``xpsi/PostProcessing/_residual.py``.

* Added a possibility to use a parameter vector instead of a random set of samples in all post-processing functions.

* Added a chi-squared calculation property to the Signal class.

Changed
^^^^^^^

* X-PSI was upgraded to support Cython3 by updating the syntax and the structure of all the Cython files. Installation instructions were also updated. Using Cython3 is now recommended. The code seems to still run also with Cython version 0.29, but its functioning correctly and efficiently is not guaranteed.

* Residual plotting was updated to fix issues when using a logarithmic scale and including channel 0.

* Updated the installation instructions for Helios and Snellius, and updated the example job script.

* The desired precision of credible intervals can now be defined already when loading the runs.

* The Photosphere class atmosphere setter can now load by default atmosphere table files similar to those of NSX model used in NICER analyses (without the need for writing a CustomPhotosphere for this).

* Future plans, publications, etc. were updated in the documentation.

* The counts are **not divided by 2 anymore** for signal plots when 2 cycles are shown. The label was changed to "counts per cycle" to denote this change.

Removed
^^^^^^^

* X-PSI Python 2 documentation (v1.x and earlier) was retired from the main online documentation (but can still be accessed via GitHub).

* Removed the deprecated ``is_secondary`` argument from the HotRegion class. **Note that setting ``is_secondary=True`` has now no effect, and will lead to wrong likelihood values if not replacing it with ``is_antiphased=True``**.

* Removed the ``TwoHotRegions`` class that nobody was known to be using.

Attribution
^^^^^^^^^^^

X-PSI team
Devarshi Choudhury,
Bas Dorsman,
Denis Gonzalez-Caniulef,
Sebastien Guillot,
Mariska Hoogkamer,
Daniela Huppenkothen,
Christine Kazantsev,
Yves Kini,
Lucien Mauviard-Haag,
Evert Rol,
Tuomo Salmi,
Pierre Stammler,
Anna Watts


[v2.2.7] - 2024-07-13
Expand Down
303 changes: 116 additions & 187 deletions docs/source/Emitting_patterns_2Dprojection.ipynb

Large diffs are not rendered by default.

284 changes: 123 additions & 161 deletions docs/source/Global_surface_emission.ipynb

Large diffs are not rendered by default.

169 changes: 66 additions & 103 deletions docs/source/Hot_region_complexity.ipynb

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions docs/source/Importance_sampling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"/=============================================\\\n",
"| X-PSI: X-ray Pulse Simulation and Inference |\n",
"|---------------------------------------------|\n",
"| Version: 2.3.0-b |\n",
"| Version: 3.0.0 |\n",
"|---------------------------------------------|\n",
"| https://xpsi-group.github.io/xpsi |\n",
"\\=============================================/\n",
Expand Down Expand Up @@ -164,7 +164,7 @@
"\n",
"# Commenting this as it takes a bit of time to run\n",
"######################\n",
"#importance(new_model.likelihood,\n",
"# importance(new_model.likelihood,\n",
"# old_model.likelihood,\n",
"# '../../examples/examples_fast/Outputs/ST_live_1000_eff_0.3_seed42',\n",
"# names = names,\n",
Expand Down Expand Up @@ -747,7 +747,7 @@
"/=============================================\\\n",
"| X-PSI: X-ray Pulse Simulation and Inference |\n",
"|---------------------------------------------|\n",
"| Version: 2.3.0-b |\n",
"| Version: 3.0.0 |\n",
"|---------------------------------------------|\n",
"| https://xpsi-group.github.io/xpsi |\n",
"\\=============================================/\n",
Expand Down Expand Up @@ -876,11 +876,16 @@
"source": [
"This will create exactly the same importance sampled output file as the prior-change example above."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "xpsi",
"language": "python",
"name": "python3"
},
Expand All @@ -894,7 +899,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.2"
"version": "3.12.8"
}
},
"nbformat": 4,
Expand Down
30 changes: 15 additions & 15 deletions docs/source/Instrument_synergy.ipynb

Large diffs are not rendered by default.

197 changes: 98 additions & 99 deletions docs/source/Modeling.ipynb

Large diffs are not rendered by default.

19 changes: 12 additions & 7 deletions docs/source/Modeling_without_statistics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,14 @@
"/=============================================\\\n",
"| X-PSI: X-ray Pulse Simulation and Inference |\n",
"|---------------------------------------------|\n",
"| Version: 2.3.0-b |\n",
"| Version: 3.0.0 |\n",
"|---------------------------------------------|\n",
"| https://xpsi-group.github.io/xpsi |\n",
"\\=============================================/\n",
"\n",
"Check your emcee installation.\n",
"Check your installation of emcee if using the EnsembleSampler\n",
"Imported emcee version: 3.1.6\n",
"Imported PyMultiNest.\n",
"Check your UltraNest installation.\n",
"Check your installation of UltraNest if using the UltranestSampler\n",
"Warning: Cannot import torch and test SBI_wrapper.\n",
"Imported UltraNest.\n",
"Imported GetDist version: 1.5.3\n",
"Imported nestcheck version: 0.2.1\n"
]
Expand Down Expand Up @@ -1776,7 +1773,15 @@
"cell_type": "code",
"execution_count": 48,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"mkdir: cannot create directory ‘images/frames_twospots’: File exists\r\n"
]
}
],
"source": [
"!mkdir images/frames_twospots\n",
"!mv images/*.png images/frames_twospots/."
Expand Down
26 changes: 5 additions & 21 deletions docs/source/Polarization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,15 @@
"/=============================================\\\n",
"| X-PSI: X-ray Pulse Simulation and Inference |\n",
"|---------------------------------------------|\n",
"| Version: 2.2.7 |\n",
"| Version: 3.0.0 |\n",
"|---------------------------------------------|\n",
"| https://xpsi-group.github.io/xpsi |\n",
"\\=============================================/\n",
"\n",
"Imported emcee version: 3.1.6\n",
"Check your PyMultiNest installation.\n",
"Check your installation of PyMultiNest if using the NestedSampler\n",
"Check your UltraNest installation.\n",
"Check your installation of UltraNest if using the UltranestSampler\n",
"Imported GetDist version: 1.5.2\n",
"Imported PyMultiNest.\n",
"Imported UltraNest.\n",
"Imported GetDist version: 1.5.3\n",
"Imported nestcheck version: 0.2.1\n",
"Creating parameter:\n",
" > Named \"frequency\" with fixed value 6.000e+02.\n",
Expand Down Expand Up @@ -406,7 +404,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Time spent in integration (unpolarized): 3.311354875564575\n"
"Time spent in integration (unpolarized): 3.8012921810150146\n"
]
},
{
Expand Down Expand Up @@ -541,13 +539,6 @@
"plot_QUplane()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -575,13 +566,6 @@
"source": [
"Modeling X-ray polarized data using Bayesian inference is not yet part of this tutorial. However, a preliminary example of a such procedure can be found in this example script: [TestRun_PolNum_split_inference.py](https://github.com/xpsi-group/xpsi/blob/main/examples/examples_modeling_tutorial/TestRun_PolNum_split_inference.py)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
197 changes: 149 additions & 48 deletions docs/source/Post-processing.ipynb

Large diffs are not rendered by default.

59 changes: 25 additions & 34 deletions docs/source/Surface_radiation_field_tools.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@
# built documents.
#
# The short X.Y version.
version = '2.3-b'
version = '3.0-b'
# The full version, including alpha/beta/rc tags.
release = '2.3.0-b'
release = '3.0.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
Loading

0 comments on commit 6c7a025

Please sign in to comment.