-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into post_2_deprecate
- Loading branch information
Showing
17 changed files
with
51,585 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '2.2.0' | ||
__version__ = '2.4.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""Read NestedSamples from Nested_Fit chains.""" | ||
import os | ||
import numpy as np | ||
from anesthetic.read.getdist import read_paramnames | ||
from anesthetic.samples import NestedSamples | ||
|
||
|
||
def read_nestedfit(root, *args, **kwargs): | ||
"""Read Nested_Fit chain files. | ||
Parameters | ||
---------- | ||
root : str | ||
root specify the directory only, no specific roots, | ||
The files read files are ``nf_output_points.txt`` | ||
and ``nf_output_diag.txt``. | ||
""" | ||
dead_file = os.path.join(root, 'nf_output_points.txt') | ||
birth_file = os.path.join(root, 'nf_output_diag.dat') | ||
data_dead = np.loadtxt(dead_file) | ||
data_birth = np.loadtxt(birth_file) | ||
weight, logL, data = np.split(data_dead, [1, 2], axis=1) | ||
logL_birth = data_birth[:, 0] | ||
root_getdist = os.path.join(root, 'nf_output_points') | ||
columns, labels = read_paramnames(root_getdist) | ||
# No specific labeling is implemented in nested_fit | ||
labels = columns | ||
columns = kwargs.pop('columns', columns) | ||
labels = kwargs.pop('labels', labels) | ||
kwargs['label'] = kwargs.get('label', os.path.basename(root)) | ||
|
||
return NestedSamples(data=data, columns=columns, | ||
logL=logL, logL_birth=logL_birth, | ||
labels=labels, *args, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ authors = [ | |
{ name="Stefan Heimersheim", email="[email protected]" }, | ||
{ name="Pablo Lemos", email="[email protected]" }, | ||
{ name="Toby Lovick", email="[email protected]"}, | ||
{ name="Deborah Odunuyi", email="[email protected]"}, | ||
{ name="Aleksandr Petrosyan", email="[email protected]" }, | ||
{ name="Liangliang Su", email="[email protected]"}, | ||
{ name="David Yallup", email="[email protected]" }, | ||
|
@@ -58,7 +59,7 @@ classifiers = [ | |
"JOSS paper" = "https://joss.theoj.org/papers/10.21105/joss.01414" | ||
|
||
[project.optional-dependencies] | ||
docs = ["sphinx", "sphinx_rtd_theme", "sphinx-copybutton", "numpydoc"] | ||
docs = ["sphinx>=4.2.0", "sphinx_rtd_theme>=1.2.2", "sphinx-copybutton", "numpydoc"] | ||
test = ["pytest", "pytest-cov", "flake8", "pydocstyle", "packaging", "pre-commit"] | ||
ultranest = ["h5py"] | ||
astropy = ["astropy"] | ||
|
Oops, something went wrong.