Skip to content

Commit

Permalink
switch to github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
aeturrell committed Oct 29, 2022
1 parent 0b271c7 commit 9658372
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
interval: daily
2 changes: 1 addition & 1 deletion .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ pip==22.3
nox==2022.8.7
nox-poetry==1.0.1
poetry==1.2.2
virtualenv==20.16.5
virtualenv==20.16.5
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ jobs:
publish: ${{ steps.check-version.outputs.tag != '' }}
tag: ${{ steps.check-version.outputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ jobs:
run: |
nox --force-color --session=coverage -- xml
- name: Upload coverage report
uses: codecov/[email protected]
uses: codecov/[email protected]
21 changes: 0 additions & 21 deletions .readthedocs.yml

This file was deleted.

7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Specification Curve is a Python package that performs specification curve analys
[![Status](https://img.shields.io/pypi/status/specification_curve.svg)](https://pypi.org/project/specification_curve/)
[![Python Version](https://img.shields.io/pypi/pyversions/specification_curve)](https://pypi.org/project/specification_curve)
[![License](https://img.shields.io/pypi/l/specification_curve)](https://opensource.org/licenses/MIT)
[![Read the documentation at https://specification_curve.readthedocs.io/](https://img.shields.io/readthedocs/specification_curve/latest.svg?label=Read%20the%20Docs)](https://specification_curve.readthedocs.io/)
[![Tests](https://github.com/aeturrell/specification_curve/workflows/Tests/badge.svg)](https://github.com/aeturrell/specification_curve/actions?workflow=Tests)
[![Codecov](https://codecov.io/gh/aeturrell/specification_curve/branch/main/graph/badge.svg)](https://codecov.io/gh/aeturrell/specification_curve)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
Expand All @@ -19,9 +18,9 @@ Specification Curve is a Python package that performs specification curve analys
[![macOS](https://svgshare.com/i/ZjP.svg)](https://svgshare.com/i/ZjP.svg)
[![Windows](https://svgshare.com/i/ZhY.svg)](https://svgshare.com/i/ZhY.svg)

[![Soure](https://img.shields.io/badge/source%20code-github-lightgrey?style=for-the-badge)](https://github.com/aeturrell/specification_curve)
[![Source](https://img.shields.io/badge/source%20code-github-lightgrey?style=for-the-badge)](https://github.com/aeturrell/specification_curve)

[Go to the full documentation for **Specification Curve**](https://specification_curve.readthedocs.io/).
[Go to the full documentation for **Specification Curve**](https://aeturrell.github.io/specification_curve/).

## Quickstart

Expand All @@ -41,7 +40,7 @@ import pandas as pd
# Set seed for random numbers
seed_for_prng = 78557
# prng=probabilistic random number generator
prng = np.random.default_rng(seed_for_prng)
prng = np.random.default_rng(seed_for_prng)
n_samples = 400
# Number of dimensions
n_dim = 4
Expand Down
10 changes: 6 additions & 4 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,21 @@ repository:
path_to_book: docs # Optional path to your book, relative to the repository root
branch: master # Which branch of the repository should be used when creating links (optional)

launch_buttons:
colab_url : "https://colab.research.google.com" # The URL of Google Colab


# Add GitHub buttons to your book
# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository
html:
use_issues_button: true
use_repository_button: true
extra_navbar: ""
home_page_in_navbar: false # Whether to include your home page in the left Navigation Bar
baseurl: "https://specification-curve.readthedocs.io/"
favicon: "favicon.ico"
baseurl: "https://aeturrell.github.io/specification_curve"
# favicon: "favicon.ico"

sphinx:
config:
html_theme: furo
extra_extensions:
- 'sphinx.ext.autodoc'
- 'sphinx.ext.napoleon' # for google-style docstrings
Expand Down
20 changes: 19 additions & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ and pull requests.
Here is a list of important resources for contributors:

- [Source Code](https://github.com/aeturrell/specification_curve)
- [Documentation](https://specification_curve.readthedocs.io/)
- [Documentation](https://aeturrell.github.io/specification_curve/)
- [Issue Tracker](https://github.com/aeturrell/specification_curve/issues)

## How to report a bug
Expand Down Expand Up @@ -115,3 +115,21 @@ To upload the documentation, it’s
```bash
poetry run ghp-import -n -p -f docs/_build/html
```

## How to create a package release

- Open a new branch with the version name

- Change the version in pyproject.toml

- Commit the change with a new version label as the commit message (checking the tests pass)

- Head to github and merge into main

- Draft a new release based on that most recent merge commit, using the new version as the tag

- Run `poetry build` to produce the distributable files

- Confirm the release draft on gitub

- The automatic release github action will push to PyPI.
9 changes: 4 additions & 5 deletions docs/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"[![Status](https://img.shields.io/pypi/status/specification_curve.svg)](https://pypi.org/project/specification_curve/)\n",
"[![Python Version](https://img.shields.io/pypi/pyversions/specification_curve)](https://pypi.org/project/specification_curve)\n",
"[![License](https://img.shields.io/pypi/l/specification_curve)](https://opensource.org/licenses/MIT)\n",
"[![Read the documentation at https://specification_curve.readthedocs.io/](https://img.shields.io/readthedocs/specification_curve/latest.svg?label=Read%20the%20Docs)](https://specification_curve.readthedocs.io/)\n",
"[![Tests](https://github.com/aeturrell/specification_curve/workflows/Tests/badge.svg)](https://github.com/aeturrell/specification_curve/actions?workflow=Tests)\n",
"[![Codecov](https://codecov.io/gh/aeturrell/specification_curve/branch/main/graph/badge.svg)](https://codecov.io/gh/aeturrell/specification_curve)\n",
"[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)\n",
Expand All @@ -43,17 +42,17 @@
"\n",
"Typically this happens when there isn’t a clear way to do \"feature engineering\" on the data or the data are imperfect in some way. For example, you have a high frequency time series which needs to be aggregated to a lower frequency: you could take the maximum, the minimum, or the average over each high frequency time period. A different choice may be appropriate in different settings.\n",
"\n",
"There's formal evidence that researchers really do make different decisions; one study {cite:ps}`silberzahn2018many` gave the same research question---whether soccer referees are more likely to give red cards to players with dark skin tones than to players with light skin tones---to 29 different teams. From the abstract of that paper:\n",
"There's formal evidence that researchers really do make different decisions; one study {cite:p}`silberzahn2018many` gave the same research question---whether soccer referees are more likely to give red cards to players with dark skin tones than to players with light skin tones---to 29 different teams. From the abstract of that paper:\n",
"\n",
"> Analytic approaches varied widely across the teams, and the estimated effect sizes ranged from 0.89 to 2.93 (Mdn = 1.31) in odds-ratio units. Twenty teams (69%) found a statistically significant positive effect, and 9 teams (31%) did not observe a significant relationship. Overall, the 29 different analyses used 21 unique combinations of covariates. Neither analysts’ prior beliefs about the effect of interest nor their level of expertise readily explained the variation in the outcomes of the analyses. Peer ratings of the quality of the analyses also did not account for the variability.\n",
"\n",
"So not only can different decisions made, but there seems to be no clearly identifiable reason for them!\n",
"\n",
"There have since been a number of papers that find similar conclusions {cite:ps}`huntington2021influence`.\n",
"There have since been a number of papers that find similar conclusions {cite:p}`huntington2021influence`.\n",
"\n",
"Specification curves have been invented {cite:ps}`simonsohn2020specification` as a way to better grasp the garden of forking paths that analysts face, and help them show how sensitive their results are to alternative specifications.\n",
"Specification curves have been invented {cite:p}`simonsohn2020specification` as a way to better grasp the garden of forking paths that analysts face, and help them show how sensitive their results are to alternative specifications.\n",
"\n",
"More than one piece of software {cite:ps}`masur2019specr` has appeared to help researchers and analysts use this technique: **specification curve** is one such package!"
"More than one piece of software {cite:p}`masur2019specr` has appeared to help researchers and analysts use this technique: **specification curve** is one such package!"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ description = "Specification_Curve"
authors = ["aeturrell <[email protected]>"]
license = "MIT"
readme = "README.md"
homepage = "https://github.com/aeturrell/specification_curve"
homepage = "https://aeturrell.github.io/specification_curve/"
repository = "https://github.com/aeturrell/specification_curve"
documentation = "https://specification_curve.readthedocs.io"
documentation = "https://aeturrell.github.io/specification_curve/"
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3.8",
Expand Down Expand Up @@ -43,6 +43,7 @@ ghp-import = "^2.1.0"
xdoctest = "^1.1.0"
mypy = "^0.982"
reorder-python-imports = "^3.9.0"
sphinxcontrib-bibtex = "^2.5.0"

[tool.poetry.scripts]
specification_curve = "specification_curve.__main__:main"
Expand Down
12 changes: 6 additions & 6 deletions src/specification_curve/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import pkg_resources
import statsmodels.api as sm


EXAMPLE_FILE = pkg_resources.resource_filename(
"specification_curve", os.path.join("data", "example_data.csv")
)
Expand Down Expand Up @@ -144,12 +145,11 @@ def __init__(
self.cat_expand = cat_expand
self.always_include = always_include

def fit(self, estimator=sm.OLS):
"""
Fits a specification curve.
def fit(self, estimator=sm.OLS) -> None:
"""Fits a specification curve by performing regressions.
:statsmodels.regression.linear_model estimator: statsmodels estimator
object. Default is OLS.
Args:
estimator (statsmodels.regression.linear_model or statsmodels.discrete.discrete_model, optional): statsmodels estimator. Defaults to sm.OLS.
"""
self.estimator = estimator
self.controls = _single_list_check_str(self.controls)
Expand Down Expand Up @@ -418,7 +418,7 @@ def plot(self, save_path=None, pretty_plots=True, preferred_spec=[]):
loc_y = loc_y.values[0]
cn_styl = "angle3,angleA=0,angleB=-90"
axarr[0].annotate(
f"Preferred\nspecification: {loc_y:+.2f}",
f"Preferred specification: {loc_y:+.2f}",
xy=(loc_x, loc_y),
xycoords="data",
xytext=(-30, 60),
Expand Down

0 comments on commit 9658372

Please sign in to comment.