Skip to content

Commit 6d88ac9

Browse files
committed
Renamed package to lilio. Deleted unneeded files
1 parent 26378b2 commit 6d88ac9

38 files changed

+66
-5458
lines changed

.githooks/pre-commit

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ fi
1717
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
1818
echo "Starting isort analysis using configuration from setup.cfg..."
1919

20-
# recursively run isort on s2spy/ directory, don't try to automatically fix anything
21-
isort --recursive --check-only s2spy
20+
# recursively run isort on lilio/ directory, don't try to automatically fix anything
21+
isort --recursive --check-only lilio
2222

2323
if [ $? != "0" ]; then
2424
echo "Commit aborted."
25-
echo " Run 'isort --recursive --check-only --diff s2spy' to see what's wrong."
26-
echo " Run 'isort --recursive s2spy' to let isort fix problems automatically."
25+
echo " Run 'isort --recursive --check-only --diff lilio' to see what's wrong."
26+
echo " Run 'isort --recursive lilio' to let isort fix problems automatically."
2727
exit 1
2828
fi
2929

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ jobs:
6161
- name: Check style against standards using prospector
6262
run: prospector
6363
- name: Check import order
64-
run: isort --check-only s2spy --diff
64+
run: isort --check-only lilio --diff

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# YAML 1.2
22
---
33
cff-version: "1.1.0"
4-
title: "s2spy"
4+
title: "lilio"
55
authors:
66
-
77
family-names: Liu
@@ -34,7 +34,7 @@ authors:
3434

3535
date-released: 2022-09-02
3636
version: "0.2.1"
37-
repository-code: "https://github.com/AI4S2S/s2spy"
37+
repository-code: "https://github.com/AI4S2S/lilio"
3838
keywords:
3939
- s2s
4040
- ai

docs/CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ This section is for maintainers of the package.
5050
5. Make sure pre-commit hooks are green for all files by running ``pre-commit run --all-files``.
5151
6. Commit & push changes to GitHub.
5252
7. Wait for [GitHub
53-
actions](https://github.com/AI4S2S/s2spy/actions?query=branch%3Amain+)
53+
actions](https://github.com/AI4S2S/lilio/actions?query=branch%3Amain+)
5454
to be completed and green.
5555

56-
8. Create a [GitHub release](https://github.com/AI4S2S/s2spy/releases/new)
56+
8. Create a [GitHub release](https://github.com/AI4S2S/lilio/releases/new)
5757

5858
- Use version as title and tag version.
5959
- As description use intro text from README.md (to give context to
@@ -67,9 +67,9 @@ This section is for maintainers of the package.
6767

6868
10. Verify
6969

70-
1. Has [new Zenodo record](https://zenodo.org/search?page=1&size=20&q=s2spy) been created?
70+
1. Has [new Zenodo record](https://zenodo.org/search?page=1&size=20&q=lilio) been created?
7171
2. Has [stable](https://ai4s2s.readthedocs.io/en/stable/) ReadTheDocs been updated?
7272
3. Can new version be installed with pip using
73-
`python3 -m pip install s2spy==<new version>`?
73+
`python3 -m pip install lilio==<new version>`?
7474

7575
11. Celebrate

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You can set these variables from the command line.
55
SPHINXOPTS =
66
SPHINXBUILD = sphinx-build
7-
SPHINXPROJ = s2spy
7+
SPHINXPROJ = lilio
88
SOURCEDIR = .
99
BUILDDIR = _build
1010

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
# -- Project information -----------------------------------------------------
1919

20-
project = u"s2spy"
20+
project = u"lilio"
2121
copyright = u"2022, Netherlands eScience Center"
2222
author = u"Yang Liu"
2323

@@ -61,7 +61,7 @@
6161

6262
# -- Use autoapi.extension to run sphinx-apidoc -------
6363

64-
autoapi_dirs = ["../s2spy"]
64+
autoapi_dirs = ["../lilio"]
6565

6666
# -- Options for HTML output ----------------------------------------------
6767

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. s2spy documentation master file, created by
1+
.. lilio documentation master file, created by
22
sphinx-quickstart on Wed May 5 22:45:36 2021.
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.

docs/make.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if "%SPHINXBUILD%" == "" (
99
)
1010
set SOURCEDIR=.
1111
set BUILDDIR=_build
12-
set SPHINXPROJ=s2spy
12+
set SPHINXPROJ=lilio
1313

1414
if "%1" == "" goto help
1515

s2spy/__init__.py renamed to lilio/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@
77
import logging
88
from . import calendar_shifter
99
from . import time
10-
from . import traintest
11-
from .rgdr.rgdr import RGDR
12-
1310

1411
logging.getLogger(__name__).addHandler(logging.NullHandler())
1512

1613
__author__ = "Yang Liu"
1714
__email__ = "[email protected]"
1815
__version__ = "0.2.1"
1916

20-
__all__ = ["time", "traintest", "RGDR", "calendar_shifter"]
17+
__all__ = ["time", "calendar_shifter"]
File renamed without changes.
File renamed without changes.
File renamed without changes.

s2spy/_resample.py renamed to lilio/_resample.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99

1010
if TYPE_CHECKING:
11-
from s2spy.time import AdventCalendar
12-
from s2spy.time import Calendar
13-
from s2spy.time import MonthlyCalendar
14-
from s2spy.time import WeeklyCalendar
11+
from lilio.time import AdventCalendar
12+
from lilio.time import Calendar
13+
from lilio.time import MonthlyCalendar
14+
from lilio.time import WeeklyCalendar
1515
Calendars = Union[Calendar, AdventCalendar, WeeklyCalendar, MonthlyCalendar]
1616

1717

@@ -271,15 +271,15 @@ def resample(
271271
Assuming the input data is pd.DataFrame containing random values with index
272272
from 2021-11-11 to 2021-11-01 at daily frequency.
273273
274-
>>> import s2spy.time
274+
>>> import lilio.time
275275
>>> import pandas as pd
276276
>>> import numpy as np
277-
>>> cal = s2spy.time.AdventCalendar(anchor="12-31", freq="180d")
277+
>>> cal = lilio.time.AdventCalendar(anchor="12-31", freq="180d")
278278
>>> time_index = pd.date_range("20191201", "20211231", freq="1d")
279279
>>> var = np.arange(len(time_index))
280280
>>> input_data = pd.Series(var, index=time_index)
281281
>>> cal = cal.map_to_data(input_data)
282-
>>> bins = s2spy.time.resample(cal, input_data)
282+
>>> bins = lilio.time.resample(cal, input_data)
283283
>>> bins # doctest: +NORMALIZE_WHITESPACE
284284
anchor_year i_interval interval data target
285285
0 2019 -1 [2019-07-04, 2019-12-31) 14.5 False

s2spy/calendar_shifter.py renamed to lilio/calendar_shifter.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
from typing import List
44
from typing import Union
55
import xarray as xr
6-
import s2spy.time
6+
import lilio.time
77
from . import utils
88

99

1010
def _gap_shift(
11-
interval: s2spy.time.Interval, shift: Union[str, Dict[str, int]]
11+
interval: lilio.time.Interval, shift: Union[str, Dict[str, int]]
1212
) -> Dict[str, int]:
1313
"""
1414
Shift a calendar interval's gap property by the given amount.
@@ -43,8 +43,8 @@ def _gap_shift(
4343

4444

4545
def calendar_shifter(
46-
calendar: s2spy.time.Calendar, shift: Union[str, dict]
47-
) -> s2spy.time.Calendar:
46+
calendar: lilio.time.Calendar, shift: Union[str, dict]
47+
) -> lilio.time.Calendar:
4848
"""Shift a Calendar instance by a given time offset.
4949
5050
Instead of shifting the anchor date, this function shifts two things in reference
@@ -57,15 +57,15 @@ def calendar_shifter(
5757
calendar. This is important for train-test splitting at later stages.
5858
5959
Args:
60-
calendar: a s2spy.time.Calendar instance
60+
calendar: a lilio.time.Calendar instance
6161
shift: a pandas-like
6262
frequency string (e.g. "10d", "2W", or "3M"), or a pandas.DateOffset
6363
compatible dictionary such as {days=10}, {weeks=2}, or {months=1, weeks=2}
6464
6565
Example:
6666
Shift a calendar by a given dateoffset.
67-
>>> import s2spy.time
68-
>>> cal = s2spy.time.Calendar(anchor='07-01')
67+
>>> import lilio.time
68+
>>> cal = lilio.time.Calendar(anchor='07-01')
6969
>>> cal.add_intervals("target", "7d")
7070
>>> cal.add_intervals("precursor", "7d", gap="14d")
7171
>>> cal.add_intervals("precursor", "7d, n=3)
@@ -92,15 +92,15 @@ def calendar_shifter(
9292

9393

9494
def staggered_calendar(
95-
calendar: s2spy.time.Calendar, shift: Union[str, dict], n_shifts: int
96-
) -> List[s2spy.time.Calendar]:
95+
calendar: lilio.time.Calendar, shift: Union[str, dict], n_shifts: int
96+
) -> List[lilio.time.Calendar]:
9797
"""Shift a Calendar instance by a given time offset n times to create a list of
9898
shifted calendars.
9999
100100
We call this list a staggered calendar.
101101
102102
Args:
103-
calendar: an s2spy.time.Calendar instance
103+
calendar: an lilio.time.Calendar instance
104104
shift: a pandas-like
105105
frequency string (e.g. "10d", "2W", or "3M"), or a pandas.DateOffset
106106
compatible dictionary such as {days=10}, {weeks=2}, or {months=1, weeks=2}
@@ -109,8 +109,8 @@ def staggered_calendar(
109109
Example:
110110
Shift an input calendar n times by a given dateoffset and return a list of these
111111
shifted calendars.
112-
>>> import s2spy.time
113-
>>> cal = s2spy.time.Calendar(anchor="07-01")
112+
>>> import lilio.time
113+
>>> cal = lilio.time.Calendar(anchor="07-01")
114114
>>> cal.add_intervals("target", "7d")
115115
>>> cal.add_intervals("precursor", "7d", gap="14d")
116116
>>> cal.add_intervals("precursor", "7d", n=3)
@@ -171,7 +171,7 @@ def calendar_list_resampler(
171171
Returns:
172172
resampled xr.Dataset
173173
"""
174-
ds_r = xr.concat([s2spy.time.resample(cal, ds) for cal in cal_list], dim=dim_name)
174+
ds_r = xr.concat([lilio.time.resample(cal, ds) for cal in cal_list], dim=dim_name)
175175
ds_r = ds_r.assign_coords({dim_name: ds_r[dim_name].values})
176176

177177
return ds_r

s2spy/time.py renamed to lilio/time.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""s2spy time utils.
1+
"""lilio time utils.
22
33
Utilities designed to aid in seasonal-to-subseasonal prediction experiments in
44
which we search for skillful predictors preceding a certain event of interest.
@@ -9,10 +9,10 @@
99
between train and test sets.
1010
1111
Example:
12-
>>> import s2spy.time
12+
>>> import lilio.time
1313
>>>
1414
>>> # Countdown the weeks until New Year's Eve
15-
>>> calendar = s2spy.time.AdventCalendar(anchor="12-31", freq="7d")
15+
>>> calendar = lilio.time.AdventCalendar(anchor="12-31", freq="7d")
1616
>>> calendar # doctest: +NORMALIZE_WHITESPACE
1717
AdventCalendar(
1818
anchor='12-31',
@@ -24,15 +24,15 @@
2424
)
2525
2626
>>> # Get the 180-day periods leading up to New Year's eve for the year 2020
27-
>>> calendar = s2spy.time.AdventCalendar(anchor="12-31", freq="180d")
27+
>>> calendar = lilio.time.AdventCalendar(anchor="12-31", freq="180d")
2828
>>> calendar = calendar.map_years(2020, 2020)
2929
>>> calendar.show() # doctest: +NORMALIZE_WHITESPACE
3030
i_interval -1 1
3131
anchor_year
3232
2020 [2020-07-04, 2020-12-31) [2020-12-31, 2021-06-29)
3333
3434
>>> # Get the 180-day periods leading up to New Year's eve for 2020 - 2022 inclusive.
35-
>>> calendar = s2spy.time.AdventCalendar(anchor="12-31", freq="180d")
35+
>>> calendar = lilio.time.AdventCalendar(anchor="12-31", freq="180d")
3636
>>> calendar = calendar.map_years(2020, 2022)
3737
>>> # note the leap year:
3838
>>> calendar.show() # doctest: +NORMALIZE_WHITESPACE
@@ -124,8 +124,8 @@ def __init__(
124124
Instantiate a calendar counting down the weeks until new-year's
125125
eve.
126126
127-
>>> import s2spy.time
128-
>>> calendar = s2spy.time.AdventCalendar(anchor="12-31", freq="7d")
127+
>>> import lilio.time
128+
>>> calendar = lilio.time.AdventCalendar(anchor="12-31", freq="7d")
129129
>>> calendar
130130
AdventCalendar(
131131
anchor='12-31',
@@ -271,8 +271,8 @@ def __init__(
271271
Instantiate a calendar counting down the quarters (3 month periods) from
272272
december.
273273
274-
>>> import s2spy.time
275-
>>> calendar = s2spy.time.MonthlyCalendar(anchor='Dec', freq="3M")
274+
>>> import lilio.time
275+
>>> calendar = lilio.time.MonthlyCalendar(anchor='Dec', freq="3M")
276276
>>> calendar
277277
MonthlyCalendar(
278278
anchor='12',
@@ -393,8 +393,8 @@ def __init__(
393393
Example:
394394
Instantiate a calendar counting down the weeks from week number 40.
395395
396-
>>> import s2spy.time
397-
>>> calendar = s2spy.time.WeeklyCalendar(anchor="W40", freq="1W")
396+
>>> import lilio.time
397+
>>> calendar = lilio.time.WeeklyCalendar(anchor="W40", freq="1W")
398398
>>> calendar
399399
WeeklyCalendar(
400400
anchor='W40-1',
@@ -484,8 +484,8 @@ def __init__(
484484
Example:
485485
Instantiate a custom calendar and appending target/precursor periods.
486486
487-
>>> import s2spy.time
488-
>>> calendar = s2spy.time.CustomCalendar(anchor="12-31")
487+
>>> import lilio.time
488+
>>> calendar = lilio.time.CustomCalendar(anchor="12-31")
489489
>>> calendar
490490
CustomCalendar(
491491
anchor='12-31',
File renamed without changes.

0 commit comments

Comments
 (0)