Skip to content

Commit

Permalink
linting with new rules
Browse files Browse the repository at this point in the history
  • Loading branch information
renecotyfanboy committed Apr 15, 2024
1 parent 6f5d333 commit 1ad72bd
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-added-large-files
args: ["--maxkb=5000"]
Expand All @@ -14,7 +14,7 @@ repos:
- --unsafe
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.14
rev: v0.3.7
hooks:
- id: ruff
args: ["--fix", "--no-unsafe-fixes"]
Expand Down
1 change: 1 addition & 0 deletions docs/examples/advanced_examples/plot_0_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
the order of the parameters is not preserved in the dictionary.
"""

import numpy as np
import pandas as pd

Expand Down
1 change: 1 addition & 0 deletions docs/examples/advanced_examples/plot_1_blinding.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
or give it a string (or list of strings) detailing the specific parameters you want blinded!
"""

from chainconsumer import Chain, ChainConsumer, PlotConfig, make_sample

df = make_sample(num_dimensions=4, seed=1)
Expand Down
1 change: 1 addition & 0 deletions docs/examples/advanced_examples/plot_2_kde.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
increses the width of the marginal distributions.
"""

from chainconsumer import Chain, ChainConsumer, PlotConfig, make_sample

df = make_sample(num_dimensions=2, seed=3, num_points=1000)
Expand Down
1 change: 1 addition & 0 deletions docs/examples/advanced_examples/plot_3_divide_chains.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
In this toy example, all the chains are from the same random generator,
so they're on top of each other. Except MCMC chains to not be as perfect.
"""

from chainconsumer import Chain, ChainConsumer, PlotConfig, make_sample

df = make_sample(num_dimensions=2, seed=3, num_points=40000)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Rather than having one example for each option, let's condense things.
"""

# %%
# Shade Gradient
# --------------
Expand Down
1 change: 1 addition & 0 deletions docs/examples/plot_0_contours.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
handle the defaults and display.
"""

from chainconsumer import Chain, ChainConfig, ChainConsumer, PlotConfig, Truth, make_sample

# Here's what you might start with
Expand Down
1 change: 1 addition & 0 deletions docs/examples/plot_1_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
To show you how they work, let's make some sample data that all
has the same average.
"""

from chainconsumer import Chain, ChainConfig, ChainConsumer, PlotConfig, Truth, make_sample

# Here's what you might start with
Expand Down
1 change: 1 addition & 0 deletions docs/examples/plot_2_textual_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Because typing those things out is a **massive pain in the ass.**
"""

from chainconsumer import Chain, ChainConsumer, Truth, make_sample

# Here's a sample dataset
Expand Down
1 change: 1 addition & 0 deletions docs/examples/plot_3_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
To show you how they work, let's make some sample data that all
has the same average.
"""

from chainconsumer import Chain, ChainConsumer, Truth, make_sample

# Here's what you might start with
Expand Down
1 change: 1 addition & 0 deletions docs/examples/plot_4_walks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Want to see if your chain is behaving nicely? Use a walk!
"""

from chainconsumer import Chain, ChainConsumer, Truth, make_sample

# Here's a sample dataset
Expand Down
1 change: 1 addition & 0 deletions docs/examples/plot_6_custom_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Here's an example, noting that there are also `plot_point`, `plot_surface` available
that I haven't explicitly shown.
"""

import matplotlib.pyplot as plt

from chainconsumer import Chain, Truth, make_sample
Expand Down
6 changes: 3 additions & 3 deletions src/chainconsumer/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class Bound(BetterBase):
def array(self) -> np.ndarray:
return np.array(
[
self.lower if self.lower is not None else np.NaN,
self.center if self.center is not None else np.NaN,
self.upper if self.upper is not None else np.NaN,
self.lower if self.lower is not None else np.nan,
self.center if self.center is not None else np.nan,
self.upper if self.upper is not None else np.nan,
]
)

Expand Down
1 change: 1 addition & 0 deletions src/chainconsumer/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
There are also a few helper functions and objects in here, like the `MaxPosterior` class which
provides the log posterior and the coordinate at which it can be found for the chain."""

from __future__ import annotations

import logging
Expand Down

0 comments on commit 1ad72bd

Please sign in to comment.