From bb2928867a31e5d39b8ed0ab339cae06a8848536 Mon Sep 17 00:00:00 2001 From: Max <14039563+maxbriel@users.noreply.github.com> Date: Wed, 27 Nov 2024 10:05:49 +0100 Subject: [PATCH] Change installation instructions to specifically request v1.0.4 (#450) * change installation instructions to specifically request v1.0.4 for installation (this version) * update index.rst year * add licence date change * add change in conf.py of year * year change in LICENSE.md * publish only to anaconda on releases * fix found typos in v1 documentation --- .github/workflows/publish-to-anaconda.yml | 5 ++- LICENSE.md | 2 +- conda/meta.yaml | 2 +- docs/about/licence.rst | 2 +- docs/conf.py | 2 +- docs/index.rst | 2 +- docs/install/install.rst | 41 ++++++++++++++--------- docs/visualization/plot1D/plot1D.rst | 2 +- docs/visualization/plot2D/plot2D.rst | 2 +- posydon/grids/post_processing.py | 22 ++++++------ posydon/grids/psygrid.py | 12 +++---- posydon/interpolation/IF_interpolation.py | 2 +- 12 files changed, 53 insertions(+), 43 deletions(-) diff --git a/.github/workflows/publish-to-anaconda.yml b/.github/workflows/publish-to-anaconda.yml index 7e40fbe95..9b8cde4d6 100644 --- a/.github/workflows/publish-to-anaconda.yml +++ b/.github/workflows/publish-to-anaconda.yml @@ -1,9 +1,8 @@ name: publish_conda on: - push: - branches: - - main + release: + types: [published] jobs: publish: diff --git a/LICENSE.md b/LICENSE.md index accf365dc..9f086551c 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2022, Tassos Fragos +Copyright (c) 2024, Tassos Fragos All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/conda/meta.yaml b/conda/meta.yaml index 49fbcfa8a..fe887e051 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -1,5 +1,5 @@ {% set name = "posydon" %} -{% set version = "1.0.3" %} +{% set version = "1.0.4" %} package: name: "{{ name|lower }}" diff --git a/docs/about/licence.rst b/docs/about/licence.rst index a7827a63a..6634930b8 100644 --- a/docs/about/licence.rst +++ b/docs/about/licence.rst @@ -6,7 +6,7 @@ Licence BSD 3-Clause License -Copyright (c) 2022, Tassos Fragos +Copyright (c) 2024, Tassos Fragos All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/docs/conf.py b/docs/conf.py index 2cd40f727..2675427ad 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -105,7 +105,7 @@ # General information about the project. project = u'posydon' -copyright = u'2022, Tassos Fragos' +copyright = u'2024, Tassos Fragos' author = u'POSYDON Collaboration' # The version info for the project you're documenting, acts as replacement for diff --git a/docs/index.rst b/docs/index.rst index ab2905858..8365a9ccf 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -73,7 +73,7 @@ Table of Contents License & Attribution --------------------- -Copyright (c) 2022, Tassos Fragos +Copyright (c) 2024, Tassos Fragos If you make use of POSYDON in your work, please cite our paper (`arXiv `_, diff --git a/docs/install/install.rst b/docs/install/install.rst index 2726aa561..ce687c8ea 100644 --- a/docs/install/install.rst +++ b/docs/install/install.rst @@ -4,6 +4,15 @@ Installation ############ +.. warning:: + + **POSYDON v1** + + You are currently viewing the documentation for POSYDON v1.0.4. If you are + looking for the documentation of the latest version of POSYDON, please + visit the `latest documentation `_. + + The easiest way to start with POSYDON is to install it from Anaconda (Recommended way), and call an executable script that downloads the grid data automatically. @@ -13,7 +22,7 @@ POSYDON manually through `github` (Manual Installation). Below we describe both ways. ========================================================= -Installing POSYDON v1.0.0 from Anaconda (Recommended way) +Installing POSYDON v1.0.4 from Anaconda (Recommended way) ========================================================= Installation @@ -22,25 +31,25 @@ Installation We recommend using Anaconda and to install POSYDON in a virtual environment. We have created a package which can be accessed through conda-forge. On Linux, the new conda environment can be created (we have named our environment -posydon-example, but you can choose any name), the conda-forge channel added, +posydon_conda, but you can choose any name), the conda-forge channel added, and the required library installation can all be completed in one line using the terminal or command line: .. code-block:: - conda create --name posydon-example -c posydon -c conda-forge posydon + conda create --name posydon_conda -c posydon -c conda-forge posydon=1.0.4 On Mac (or if you have problems with the above command on Linux), these steps likely need to be separately run: .. code-block:: - conda create -n posydon-conda python=3.7 - conda activate posydon-conda + conda create -n posydon_conda python=3.7 + conda activate posydon_conda conda config --add channels conda-forge conda config --add channels posydon conda config --set channel_priority false - conda install posydon + conda install posydon=1.0.4 In case of OSX-ARM architectures, where many packages of Python 3.7 are not available, please use the following commands: @@ -53,20 +62,20 @@ available, please use the following commands: conda config --add channels conda-forge conda config --add channels posydon conda install python=3.7 - conda install posydon + conda install posydon=1.0.4 Now, you can activate the environment with .. code-block:: - conda activate posydon + conda activate posydon_conda Downloading the POSYDON data ---------------------------- Because the data is large, ~10 GB, it must be downloaded with an explicit command. Export the path to where you want -to clone the data, e.g. `/home/`, and download the data from +to clone the data, e.g. ``/home/``, and download the data from ZENODO with the following commands .. code-block:: @@ -79,7 +88,7 @@ ZENODO with the following commands ========================================================== -Installing POSYDON v.1.0 from GitHub (Manual Installation) +Installing POSYDON v.1.0.4 from GitHub (Manual Installation) ========================================================== Creating a conda environment @@ -87,7 +96,7 @@ Creating a conda environment As above, we recommend using Anaconda to install POSYDON in a virtual environment. After creating the environment (you can choose any name, e.g., -`posydon`, or `posydon_env`) like this: +``posydon``, or ``posydon_env``) like this: .. code-block:: @@ -102,11 +111,11 @@ proceed with the installation, you will need to activate the environment: Cloning POSYDON --------------- -Clone the repository in a local directory, e.g. `/home/POSYDON/`, with +Clone the repository in a local directory, e.g. ``/home/POSYDON/``, with .. code-block:: - git clone https://github.com/POSYDON-code/POSYDON.git + git clone https://github.com/POSYDON-code/POSYDON.git --branch v1.0.4 The directory will contain the following structure: @@ -132,11 +141,13 @@ Export the path to the cloned POSYDON code (you can add this line to your Installing the package ~~~~~~~~~~~~~~~~~~~~~~ From the cloned POSYDON directory execute the commands to install POSYDON and -the `mpi4py` dependency (first make sure you are on the main branch!) +the ``mpi4py`` dependency. +With the git cloning command above, you should have downloaded the v1.0.4 version of +POSYDON. .. code-block:: - git checkout main + cd $PATH_TO_POSYDON pip install -e . conda install mpi4py diff --git a/docs/visualization/plot1D/plot1D.rst b/docs/visualization/plot1D/plot1D.rst index ab69f1339..f8c91d057 100644 --- a/docs/visualization/plot1D/plot1D.rst +++ b/docs/visualization/plot1D/plot1D.rst @@ -1,7 +1,7 @@ .. _plot1D: ############################################## -1D plotting functionalities for POSYON GRIDS +1D plotting functionalities for POSYDON GRIDS ############################################## diff --git a/docs/visualization/plot2D/plot2D.rst b/docs/visualization/plot2D/plot2D.rst index f3b243d2c..8a7428e66 100644 --- a/docs/visualization/plot2D/plot2D.rst +++ b/docs/visualization/plot2D/plot2D.rst @@ -1,7 +1,7 @@ .. _plot2D: ############################################## -2D plotting functionalities for POSYON GRIDS +2D plotting functionalities for POSYDON GRIDS ############################################## Similar to our 1D plotting functions, we provide a series of 2D plotting diff --git a/posydon/grids/post_processing.py b/posydon/grids/post_processing.py index 3e7b99fd5..71708ca34 100644 --- a/posydon/grids/post_processing.py +++ b/posydon/grids/post_processing.py @@ -47,8 +47,8 @@ def post_process_grid(grid, index=None, star_2_CO=True, MODEL=MODEL, single_star=False, verbose=False): """Compute post processed quantitiy of any grid. - This function post process any supported grid and computes: - - Core collpase quantities for 5 prescritions given the fiducial POSYDON + This function post processes any supported grid and computes: + - Core collapse quantities for 5 prescriptions given the fiducial POSYDON assumption given in MODEL plus: A: direct collapse B: Fryer+12-rapid @@ -58,13 +58,13 @@ def post_process_grid(grid, index=None, star_2_CO=True, MODEL=MODEL, for each prescrition we store the compact object state (WD/NS/BH), SN type (WD, ECSN, CCSN, PISN, PPISN), fallback mass fraction f_gb, compact object mass and spin. - - Core masses at he-depletion (used in Patton core collpase) - - Mass envelopes for common ennvelope step. + - Core masses at he-depletion (used in Patton core collapse) + - Mass envelopes for common envelope step. Parameters ---------- grid : PSyGrid - MESA gri in PSyGrid format. + MESA grid in PSyGrid format. index : None, touple or int If None, loop over all indicies otherwise provide a range, e.g. [10,20] or a index, e.g. 42. @@ -75,7 +75,7 @@ def post_process_grid(grid, index=None, star_2_CO=True, MODEL=MODEL, single_star : bool If `True` the PSyGrid contains single stars. verbose : bool - If `True` print on screen the results of each core collpase. + If `True` print the results of each core collapse on screen. Returns ------- @@ -84,7 +84,7 @@ def post_process_grid(grid, index=None, star_2_CO=True, MODEL=MODEL, processed values. This is used to ensure one to one mapping when appending the extra columns back to a grid. EXTRA_COLUMNS: dict - Dictionary containing all post processe quantities. + Dictionary containing all post processed quantities. """ CORE_COLLAPSES = [['direct', ''], ['Fryer+12-rapid', ''], @@ -227,7 +227,7 @@ def post_process_grid(grid, index=None, star_2_CO=True, MODEL=MODEL, EXTRA_COLUMNS['S%s_center_other' % (j+1)].append(None) if not single_star: - # core collpase quantities + # core collapse quantities if interpolation_class in ['no_MT', 'stable_MT']: if star_2_CO or TF1 == 'Primary has depleted central carbon': star = binary.star_1 @@ -364,7 +364,7 @@ def add_post_processed_quantities(grid, MESA_dirs_EXTRA_COLUMNS, EXTRA_COLUMNS, """Append post processed quantity to a grid. This function appends the quantities computed in post_process_grid to any - grid. Note that this function ensure you can append the quantities only if + grid. Note that this function ensures you can append the quantities only if the grid follows the order of MESA_dirs_EXTRA_COLUMNS. Parameters @@ -376,9 +376,9 @@ def add_post_processed_quantities(grid, MESA_dirs_EXTRA_COLUMNS, EXTRA_COLUMNS, processed values. This is used to ensure one to one mapping when appending the extra columns back to a grid. EXTRA_COLUMNS: dict - Dictionary containing all post processe quantities. + Dictionary containing all post processed quantities. verbose : bool - If `True` print on screen the results of each core collpase. + If `True` print the results of each core collapse on screen. """ # check correspondance of EXTRA_COLUMNS with grid diff --git a/posydon/grids/psygrid.py b/posydon/grids/psygrid.py index fdcdb7e2d..3cd084c8c 100644 --- a/posydon/grids/psygrid.py +++ b/posydon/grids/psygrid.py @@ -26,7 +26,7 @@ NOTE: you can use a family of HDF5 files in case of file size restrictions. For example, using `mygrid.h5.%d` for the path when creating/loading grids, - implied that split files will be `mygrid.h5.0`, `mygrid.h5.1`, and so on. + implies that split files will be `mygrid.h5.0`, `mygrid.h5.1`, and so on. When overwriting the file, all the family is overwritten (effectively, the files are emptied to avoid remainder split files from previous operations.) @@ -90,8 +90,8 @@ to select the exact set of columns, provide them in a tuple instead of list. -II. READING DATA FROM GRID --------------------------- +II. READING DATA FROM A GRID +---------------------------- mygrid = PSyGrid("thegrid.h5") # opens a stored grid # Indexing... @@ -125,7 +125,7 @@ for run in mygrid: print(run) -c) Getting number of runs: +c) Getting the number of runs: n_runs = len(psygrid) @@ -159,8 +159,8 @@ myrun.history1.star_mass + myrun.history1.star_mass -loads the table two times! To reduce reading times, store in local variables -all the tables that are going to be needed more than once: +loads the table two times! To reduce reading times, store all the tables +that are going to be needed more than once in local variables: myhistory1 = myrun.history1 myhistory1.star_mass + myhistory1.star_mass diff --git a/posydon/interpolation/IF_interpolation.py b/posydon/interpolation/IF_interpolation.py index 9e7a5007f..58bac8106 100644 --- a/posydon/interpolation/IF_interpolation.py +++ b/posydon/interpolation/IF_interpolation.py @@ -1,4 +1,4 @@ -"""Module for performing initial-final inteprolation. +"""Module for performing initial-final interpolation. We showcase the initial-final interpolator which plays a critical role in the evolving binary populations. To use the initial-final interpolator we first