Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganisation into wpandas and lpandas #280

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6980b13
wpandas refactor
williamjameshandley Mar 22, 2023
23faf4a
Updated modules
williamjameshandley Mar 30, 2023
d4bf52c
Updated documentation
williamjameshandley Mar 30, 2023
43bc825
Merge branch 'master' into wpandas_reorg
williamjameshandley Apr 9, 2023
076cdd4
Tests now pass
williamjameshandley Apr 9, 2023
44f90d5
documentation update weighted_pandas -> wpandas
williamjameshandley Apr 9, 2023
a5bc9e7
Removed :show-inheritance: from wpandas to match master behaviour
williamjameshandley Apr 9, 2023
f8c0ac5
Sphinx actually fixed now
williamjameshandley Apr 9, 2023
167b23e
missing brackets after super()
AdamOrmondroyd Apr 10, 2023
0ea16a0
Merge branch 'master' into wpandas_reorg
williamjameshandley Apr 11, 2023
fbf4a7a
Moved anesthetic.samples to anesthetic.core
williamjameshandley Apr 11, 2023
6fe2183
Merge branch 'master' into wpandas_reorg
AdamOrmondroyd Apr 11, 2023
ca022cb
version bump
AdamOrmondroyd Apr 11, 2023
e9fba58
Refactored wpandas
williamjameshandley Apr 12, 2023
354f665
Merge branch 'wpandas_reorg' of github.com:handley-lab/anesthetic int…
williamjameshandley Apr 12, 2023
8f37ed7
remove show-inheritance from anesthetic.core to see if this fixes docs
AdamOrmondroyd Apr 17, 2023
5611c58
attempt to correct wpandas.utils docs
AdamOrmondroyd Apr 17, 2023
1f8c516
put utils docs in right place
AdamOrmondroyd Apr 17, 2023
8e7548a
just get rid of wpandas utils
AdamOrmondroyd Apr 17, 2023
53f486d
separate wpandas.core module
AdamOrmondroyd Apr 17, 2023
fe08bf1
reinstate :show-inheritance:
AdamOrmondroyd Apr 17, 2023
a2c6d03
run sphinx-apidoc on anesthetic, wpandas and lpandas separately, then…
AdamOrmondroyd Apr 21, 2023
536a56f
add wpandas.core.groupby.rst and wpandas.core.util.rst
AdamOrmondroyd Apr 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
anesthetic: nested sampling post-processing
===========================================
:Authors: Will Handley and Lukas Hergt
:Version: 2.0.0-beta.28
:Version: 2.0.0-beta.29
:Homepage: https://github.com/handley-lab/anesthetic
:Documentation: http://anesthetic.readthedocs.io/

Expand Down Expand Up @@ -130,8 +130,12 @@ and view the documentation by opening ``docs/build/html/index.html`` in a browse

.. code:: bash

sphinx-apidoc -fM -t docs/templates/ -o docs/source/ wpandas/
sphinx-apidoc -fM -t docs/templates/ -o docs/source/ lpandas/
sphinx-apidoc -fM -t docs/templates/ -o docs/source/ anesthetic/

and modify/revert ``docs/source/modules.rst`` accordingly with any new modules.

Citation
--------

Expand Down
45 changes: 6 additions & 39 deletions anesthetic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,46 +1,13 @@
"""Anesthetic: nested sampling post-processing."""
import anesthetic.samples
import anesthetic.core
import anesthetic.plot
import anesthetic.read.chain
import anesthetic._version

import pandas
import pandas.plotting._core
import pandas.plotting._misc
from anesthetic._format import _DataFrameFormatter
from anesthetic._version import __version__ # noqa: F401


def _anesthetic_override(_get_plot_backend):
"""Override the default backend.

When _get_plot_backend asks for 'matplotlib' it will be directed to
'anesthetic.plotting._matplotlib'. This is necessary since any users of
:class:`anesthetic.weighted_pandas.WeightedSamples` should not be using the
original backend.
"""
def wrapper(backend=None):
if backend == 'matplotlib':
return _get_plot_backend('anesthetic.plotting._matplotlib')
return _get_plot_backend(backend)
return wrapper


# Override the two places where _get_plot_backend is defined
pandas.plotting._core._get_plot_backend = \
_anesthetic_override(pandas.plotting._core._get_plot_backend)
pandas.plotting._misc._get_plot_backend = \
_anesthetic_override(pandas.plotting._misc._get_plot_backend)

# Set anesthetic.plotting._matplotlib as the actual backend
pandas.options.plotting.backend = 'anesthetic.plotting._matplotlib'

pandas.io.formats.format.DataFrameFormatter = _DataFrameFormatter
pandas.options.display.max_colwidth = 14

Samples = anesthetic.samples.Samples
MCMCSamples = anesthetic.samples.MCMCSamples
NestedSamples = anesthetic.samples.NestedSamples
__version__ = anesthetic._version.__version__
Samples = anesthetic.core.Samples
MCMCSamples = anesthetic.core.MCMCSamples
NestedSamples = anesthetic.core.NestedSamples
make_2d_axes = anesthetic.plot.make_2d_axes
make_1d_axes = anesthetic.plot.make_1d_axes

read_chains = anesthetic.read.chain.read_chains
34 changes: 0 additions & 34 deletions anesthetic/_code_utils.py

This file was deleted.

2 changes: 1 addition & 1 deletion anesthetic/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.0.0b28'
__version__ = '2.0.0b29'
2 changes: 1 addition & 1 deletion anesthetic/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def to_getdist(samples):

Parameters
----------
samples : :class:`anesthetic.samples.Samples`
samples : :class:`anesthetic.core.Samples`
anesthetic samples to be converted

Returns
Expand Down
Loading