-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from phobson/update-readme
update example figure for readme
- Loading branch information
Showing
14 changed files
with
53 additions
and
101 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
[run] | ||
source = probscale | ||
branch = True | ||
include = probscale/*.py | ||
omit = | ||
probscale/tests/* | ||
|
||
|
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,13 +1,10 @@ | ||
name: black | ||
name: Lint with Black | ||
|
||
on: [pull_request] | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
black: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Black Code Formatter | ||
uses: lgeiger/[email protected] | ||
with: | ||
args: ". --check --exclude=docs/*" | ||
- uses: actions/checkout@v3 | ||
- uses: psf/black@stable |
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
This file was deleted.
Oops, something went wrong.
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,38 @@ | ||
# %% | ||
from pathlib import Path | ||
|
||
from matplotlib import pyplot | ||
from scipy import stats | ||
import probscale # nothing else needed | ||
|
||
beta = stats.beta(a=3, b=4) | ||
weibull = stats.weibull_min(c=5) | ||
scales = [ | ||
{"scale": {"value": "linear"}, "label": "Linear (built-in)"}, | ||
{"scale": {"value": "log", "base": 10}, "label": "Log. Base 10 (built-in)"}, | ||
{"scale": {"value": "log", "base": 2}, "label": "Log. Base 2 (built-in)"}, | ||
{"scale": {"value": "logit"}, "label": "Logit (built-in)"}, | ||
{"scale": {"value": "prob"}, "label": "Standard Normal Probability (this package)"}, | ||
{ | ||
"scale": {"value": "prob", "dist": weibull}, | ||
"label": "Weibull probability scale, c=5 (this package)", | ||
}, | ||
{ | ||
"scale": {"value": "prob", "dist": beta}, | ||
"label": "Beta probability scale, α=3 & β=4 (this package)", | ||
}, | ||
] | ||
|
||
N = len(scales) | ||
fig, axes = pyplot.subplots(nrows=N, figsize=(9, N - 1), constrained_layout=True) | ||
for scale, ax in zip(scales, axes.flat): | ||
ax.set_xscale(**scale["scale"]) | ||
ax.text(0.0, 0.1, scale["label"] + " →", transform=ax.transAxes) | ||
ax.set_xlim(left=0.5, right=99.5) | ||
ax.set_yticks([]) | ||
ax.spines.left.set_visible(False) | ||
ax.spines.right.set_visible(False) | ||
ax.spines.top.set_visible(False) | ||
|
||
outpath = Path(__file__).parent.joinpath("../img/example.png").resolve() | ||
fig.savefig(outpath, dpi=300) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,14 +0,0 @@ | ||
from pkg_resources import resource_filename | ||
|
||
import probscale | ||
|
||
|
||
def test(*args): | ||
try: | ||
import pytest | ||
except ImportError: | ||
raise ImportError("`pytest` is required to run the test suite") | ||
|
||
options = [resource_filename("probscale", "tests")] | ||
options.extend(list(args)) | ||
return pytest.main(options) | ||
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