Skip to content

Commit

Permalink
add snowline to some docs, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnitz committed Dec 14, 2023
1 parent 7d5a006 commit 16f3618
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
15 changes: 15 additions & 0 deletions docs/inference/examples/sampler_platter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,21 @@ or an external package (multinest).
.. literalinclude:: ../../../examples/inference/samplers/multinest_stub.ini
:language: ini

============================================================
`Snowline <https://johannesbuchner.github.io/snowline/>`_
============================================================

.. literalinclude:: ../../../examples/inference/samplers/snowline_stub.ini
:language: ini


============================================================
`nessai <https://github.com/mj-will/nessai>`_
============================================================

.. literalinclude:: ../../../examples/inference/samplers/nessai_stub.ini
:language: ini

If we run these samplers, we create the following plot:

.. image:: ../../_include/sample.png
Expand Down
32 changes: 32 additions & 0 deletions pycbc/inference/io/snowline.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (C) 2019 Collin Capano, Sumit Kumar, Alex Nitz
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# self.option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


#
# =============================================================================
#
# Preamble
#
# =============================================================================
#
"""Provides IO for the ultranest sampler.
"""
from .posterior import PosteriorFile


class SnowlineFile(PosteriorFile):
"""Class to handle file IO for the ``ultranest`` sampler."""

name = 'snowline_file'
1 change: 0 additions & 1 deletion pycbc/inference/sampler/snowline.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ def model_stats(self):
def samples(self):
samples = self.result['samples']
params = list(self.model.variable_params)
print(samples)
samples_dict = {p: samples[:, i] for i, p in enumerate(params)}
return samples_dict

Expand Down

0 comments on commit 16f3618

Please sign in to comment.