Skip to content

Commit 6e13f7a

Browse files
committed
Merge branch 'master' into release
2 parents 359761d + 1f251bd commit 6e13f7a

File tree

25 files changed

+2104
-1730
lines changed

25 files changed

+2104
-1730
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
matrix:
1212
platform: [ubuntu-latest, macos-latest, windows-latest]
13-
python-version: ['3.8', '3.10', '3.11', '3.12']
13+
python-version: ['3.10', '3.11', '3.12', '3.13']
1414
defaults:
1515
run:
1616
shell: bash

.github/workflows/publish-pypi.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
deploy:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v4
1212
- name: Set up Python
13-
uses: actions/setup-python@v2
13+
uses: actions/setup-python@v5
1414
with:
15-
python-version: '3.8'
15+
python-version: '3.12'
1616
- name: Install dependencies
1717
run: |
1818
python -m pip install poetry

docs/_static/custom.css

Lines changed: 50 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,51 @@
1-
2-
:root {
3-
/* Use softer blue from bootstrap's default info color */
4-
--pst-color-primary: 0, 108, 133;
5-
--pst-color-active-navigation: 0, 108, 133;
6-
--pst-color-navbar-link: 255, 255, 255;
7-
--pst-color-navbar-link-hover: 200, 255, 255;
8-
--pst-color-navbar-link-active: 255, 255, 255;
9-
}
10-
11-
.navbar-light .navbar-nav>.active>.nav-link {
12-
font-weight: 800;
13-
color: rgba(var(--pst-color-navbar-link-active),1);
14-
}
15-
16-
dt:target, span.highlighted {
17-
background-color: rgba(var(--pst-color-primary),1);
18-
}
19-
20-
.sig {
21-
color: #ffffff;
22-
padding-left: 10px;
23-
background-color: rgba(var(--pst-color-primary),1);
24-
}
25-
26-
.sig-name {
27-
color: #ffffff;
28-
}
29-
30-
31-
nav.bg-light {
32-
background-color: rgba(var(--pst-color-primary),1) !important;
33-
}
34-
35-
36-
.container-xl{max-width: 1400px }
37-
38-
.btn-block {
39-
text-align: left;
40-
font-weight: 600;
41-
color: rgba(var(--pst-color-primary),1);
42-
border-color: rgba(var(--pst-color-primary),1);
43-
}
44-
45-
46-
.btn-block[href^="case_studies/index.html"] {
1+
html {
2+
/* Use softer blue from bootstrap's default info color */
3+
--pst-color-primary: 0, 108, 133;
4+
--pst-color-active-navigation: 0, 108, 133;
5+
--pst-color-navbar-link: 255, 255, 255;
6+
--pst-color-navbar-link-hover: 200, 255, 255;
7+
--pst-color-navbar-link-active: 255, 255, 255;
8+
--pst-color-on-background: #006d85;
9+
10+
}
11+
12+
h1 {
13+
--pst-color-heading: #006d85;
14+
}
15+
16+
h2 {
17+
--pst-color-heading: #006d85;
18+
}
19+
20+
h3 {
21+
--pst-color-heading: #006d85;
22+
}
23+
24+
.sd-btn{
25+
border-color: #006d85;
26+
width: 100%;
4727
text-align: left;
48-
font-weight: 600;
49-
color: #ffffff;
50-
background-color:rgba(var(--pst-color-primary),1);
51-
border-color: rgba(var(--pst-color-primary),1);
52-
}
53-
54-
.btn-block[href^="case_studies/index.html"]:hover {
55-
text-align: left;
56-
font-weight: 600;
57-
color:rgba(var(--pst-color-primary),1);
58-
background-color:#ffffff;
59-
border-color: rgba(var(--pst-color-primary),1);
60-
}
61-
62-
.btn-block:hover {
63-
color:#ffffff;
64-
background-color:rgba(var(--pst-color-primary),1);
65-
border-color: rgba(var(--pst-color-primary),1);
66-
}
67-
68-
code {
69-
font-size: 95% !important;
70-
}
28+
}
29+
30+
p .sd-btn:hover{
31+
background-color: #006d85;
32+
color: #ffffff
33+
}
34+
35+
.bd-header {
36+
--pst-color-text-muted: #ffffff;
37+
--pst-color-on-background: #006d85;
38+
}
39+
.bd-header ul.navbar-nav > li.nav-item.current > .nav-link{
40+
color:#c8ffff;
41+
--pst-color-secondary:#c8ffff;
42+
}
43+
44+
.bd-header ul.navbar-nav > li.nav-item > .nav-link:hover{
45+
color:#c8ffff;
46+
--pst-color-secondary:#c8ffff;
47+
}
48+
49+
.search-button-field{
50+
color: #5c5c5c
51+
}

docs/case_studies/index.rst

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,45 @@
44
Case Studies
55
===================
66

7-
.. panels::
7+
.. grid:: 1 2 2 2
8+
:gutter: 4
89

9-
**Interval manipulation**
10+
.. grid-item-card:: Interval manipulation
1011

11-
This tutorial introduces the use of :mod:`staircase` for manipulating intervals. The ideas demonstrated form the basis for `the piso package <https://piso.readthedocs.io>`_.
12+
This tutorial introduces the use of :mod:`staircase` for manipulating intervals. The ideas demonstrated form the basis for `the piso package <https://piso.readthedocs.io>`_.
1213

13-
.. link-button:: intervals
14-
:type: ref
15-
:text:
16-
:classes: stretched-link
1714

18-
---
15+
.. button-ref:: casestudies.intervals
16+
:ref-type: ref
17+
:class: stretched-link
1918

20-
**Queue analysis**
19+
.. grid-item-card:: Queue analysis
2120

22-
This case study illustrates the use of :mod:`staircase` for queue analysis, including the exploration of the queue size distribution.
21+
This case study illustrates the use of :mod:`staircase` for queue analysis, including the exploration of the queue size distribution.
2322

24-
.. link-button:: queues
25-
:type: ref
26-
:text:
27-
:classes: stretched-link
23+
.. button-ref:: casestudies.queues
24+
:ref-type: ref
25+
:class: stretched-link
2826

29-
---
3027

31-
**Asset utilisation**
28+
.. grid-item-card:: Asset utilisationn
3229

33-
This case study demonstrates the use of :mod:`staircase` for quick calculation of asset utilisation over various time periods.
30+
This case study demonstrates the use of :mod:`staircase` for quick calculation of asset utilisation over various time periods.
3431

35-
.. link-button:: utilisation
36-
:type: ref
37-
:text:
38-
:classes: stretched-link
32+
.. button-ref:: casestudies.utilisation
33+
:ref-type: ref
34+
:class: stretched-link
3935

36+
.. grid-item-card:: Data leakage
4037

41-
---
38+
This case study shows how :mod:`staircase` can be used to simplify feature engineering, for machine learning models, while avoiding *data leakage*.
4239

43-
**Data leakage**
40+
.. button-ref:: casestudies.dataleakage
41+
:ref-type: ref
42+
:class: stretched-link
4443

45-
This case study shows how :mod:`staircase` can be used to simplify feature engineering, for machine learning models, while avoiding *data leakage*.
4644

47-
.. link-button:: dataleakage
48-
:type: ref
49-
:text:
50-
:classes: stretched-link
51-
52-
53-
.. toctree::
45+
.. toctree::
5446
:hidden:
5547
:maxdepth: 1
5648

docs/case_studies/utilisation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@ We begin by importing the asset data into a :class:`pandas.DataFrame` instance.
2121
import pandas as pd
2222
import staircase as sc
2323
24-
data = pd.read_csv(asset_data, parse_dates=['start', 'end'], dayfirst=True)
24+
data = pd.read_csv(asset_data, parse_dates=['start', 'end'])
2525
data
2626
2727
For the analysis we would like a :class:`staircase.Stairs` object for each asset. Each Stairs object will represent a step function which has a value of zero, when the asset is not in use, and a value of one when the asset is in use. We can pandas' groupby process (`"split-apply-combine" <https://pandas.pydata.org/docs/user_guide/groupby.html>`_) with the :class:`staircase.Stairs` constructor method to get a :class:`pandas.Series`, indexed by asset name, with :class:`staircase.Stairs` values:
2828

2929
.. ipython:: python
3030
31-
asset_use = data.groupby("asset").apply(sc.Stairs, start="start", end="end")
31+
asset_use = data.groupby("asset")[["start", "end"]].apply(sc.Stairs, start="start", end="end")
3232
asset_use
3333
3434
Note that since we want to examine 2020 we clip the step function at the year endpoints, making the functions undefined for any time outside of 2020 (see :ref:`user_guide.gotchas` for why this is a good idea). :meth:`pandas.Series.apply` is used here, rather than looping, for efficiency.
3535

3636
.. ipython:: python
3737
38-
asset_use = asset_use.apply(sc.Stairs.clip, (pd.Timestamp("2020"), pd.Timestamp("2021")))
38+
asset_use = asset_use.apply(sc.Stairs.clip, args=(pd.Timestamp("2020"), pd.Timestamp("2021")))
3939
4040
We can access an individual :class:`staircase.Stairs` object with the corresponding asset name. For example, to plot the step function corresponding to asset Z, for the first day:
4141

docs/conf.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@
6969
# "sphinx.ext.linkcode",
7070
"numpydoc", # handle NumPy documentation formatted docstrings]
7171
"nbsphinx",
72-
"sphinx_panels",
72+
"sphinx_design",
7373
]
7474

75-
source_suffix = [".rst", ".ipynb"]
75+
source_suffix = [".rst"]
7676

7777
# Add any paths that contain templates here, relative to this directory.
7878
templates_path = ["_templates"]
@@ -98,7 +98,7 @@
9898

9999
# sphinx-panels shouldn't add bootstrap css since the pydata-sphinx-theme
100100
# already loads it
101-
panels_add_bootstrap_css = False
101+
# panels_add_bootstrap_css = False
102102

103103
# The name of the Pygments (syntax highlighting) style to use.
104104
pygments_style = "sphinx"
@@ -343,11 +343,14 @@ def get_items(self, names):
343343
# html_theme_path = guzzle_sphinx_theme.html_theme_path()
344344

345345
html_theme_options = {
346-
"google_analytics_id": "UA-27880019-2",
346+
# "google_analytics_id": "UA-27880019-2",
347347
"github_url": "https://github.com/staircase-dev/staircase",
348+
"navbar_end": ["navbar-icon-links"],
348349
}
349350

350351

352+
html_show_sourcelink = False
353+
351354
html_logo = "img/staircase-wide-inverse.svg"
352355
html_favicon = "img/favicon.ico"
353356

@@ -360,6 +363,11 @@ def get_items(self, names):
360363
"custom.css",
361364
]
362365

366+
html_context = {
367+
# ...
368+
"default_mode": "light"
369+
}
370+
363371

364372
def setup(app):
365373
# app.add_css_file("custom.css")

docs/getting_started/intro_tutorials/index.rst

Lines changed: 43 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,54 @@ Introductory tutorials
44
=======================
55

66

7-
.. link-button:: 00_stepfunction
8-
:type: ref
9-
:text: What is a step function?
10-
:classes: btn-outline-primary btn-block
11-
12-
.. link-button:: 01_domains
13-
:type: ref
14-
:text: What domains and range are possible?
15-
:classes: btn-outline-primary btn-block
16-
17-
.. link-button:: 02_creating
18-
:type: ref
19-
:text: How do I create my step function?
20-
:classes: btn-outline-primary btn-block
7+
.. button-ref:: intro_tutorials.stepfunction
8+
:ref-type: ref
9+
:class: btn-outline-primary btn-block
10+
11+
What is a step function?
12+
13+
.. button-ref:: intro_tutorials.domains
14+
:ref-type: ref
15+
:class: btn-outline-primary btn-block
16+
17+
What domains and range are possible?
18+
19+
.. button-ref:: intro_tutorials.creating
20+
:ref-type: ref
21+
:class: btn-outline-primary btn-block
2122

22-
.. link-button:: 03_plotting
23-
:type: ref
24-
:text: What does my step function look like?
25-
:classes: btn-outline-primary btn-block
23+
How do I create my step function?
24+
25+
.. button-ref:: intro_tutorials.plotting
26+
:ref-type: ref
27+
:class: btn-outline-primary btn-block
2628

27-
.. link-button:: 04_combining
28-
:type: ref
29-
:text: How do I combine step functions?
30-
:classes: btn-outline-primary btn-block
29+
What does my step function look like?
30+
31+
.. button-ref:: intro_tutorials.combining
32+
:ref-type: ref
33+
:class: btn-outline-primary btn-block
3134

32-
.. link-button:: 05_comparing
33-
:type: ref
34-
:text: How can I compare my step function?
35-
:classes: btn-outline-primary btn-block
35+
How do I combine step functions?
36+
37+
.. button-ref:: intro_tutorials.comparing
38+
:ref-type: ref
39+
:class: btn-outline-primary btn-block
3640

37-
.. link-button:: 06_stats
38-
:type: ref
39-
:text: What statistical properties are available?
40-
:classes: btn-outline-primary btn-block
41+
How can I compare my step function?
42+
43+
.. button-ref:: intro_tutorials.stats
44+
:ref-type: ref
45+
:class: btn-outline-primary btn-block
4146

42-
.. link-button:: 07_next
43-
:type: ref
44-
:text: What next?
45-
:classes: btn-outline-primary btn-block
47+
What statistical properties are available?
48+
49+
.. button-ref:: intro_tutorials.next
50+
:ref-type: ref
51+
:class: btn-outline-primary btn-block
52+
53+
What next?
54+
4655

4756
.. toctree::
4857
:maxdepth: 1

0 commit comments

Comments
 (0)