From 6c2d1fe1b511cd0537c16688358067c19ff270a5 Mon Sep 17 00:00:00 2001 From: MarcoGorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Thu, 15 Feb 2024 09:29:34 +0000 Subject: [PATCH 1/6] Bump version to 0.12.3 --- Cargo.toml | 2 +- pyproject.toml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d5b7e80..2b50107 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polars_xdt" -version = "0.12.2" +version = "0.12.3" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/pyproject.toml b/pyproject.toml index 7c746b4..c166486 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -requires = ["maturin>=1.0,<2.0", "polars>=0.26.0"] +requires = ["maturin>=1.0,<2.0", "polars>=0.20.6"] build-backend = "maturin" [project] name = "polars-xdt" -description = "Time Series Extras (e.g. business day utilities) for Polars" +description = "eXtra stuff for Dates and Times in Polars" readme = "README.md" authors = [ { name="Marco Gorelli", email="33491632+MarcoGorelli@users.noreply.github.com" }, @@ -88,4 +88,4 @@ line-length = 80 module = [ "pandas" ] -ignore_missing_imports = true \ No newline at end of file +ignore_missing_imports = true From 17cf2b587b3288923dfd8ad4259c14550af6d9f1 Mon Sep 17 00:00:00 2001 From: MarcoGorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Thu, 15 Feb 2024 10:04:52 +0000 Subject: [PATCH 2/6] Bump version to 0.12.4 --- Cargo.toml | 2 +- pyproject.toml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2b50107..b4a9c16 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polars_xdt" -version = "0.12.3" +version = "0.12.4" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/pyproject.toml b/pyproject.toml index c166486..0284020 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,10 +31,10 @@ module-name = "polars_xdt._internal" docstring-code-format = true [tool.ruff] -select = [ +lint.select = [ "ALL", ] -ignore = [ +lint.ignore = [ 'A003', 'ANN101', 'ANN401', @@ -69,7 +69,7 @@ ignore = [ ] # Allow autofix for all enabled rules (when `--fix`) is provided. -fixable = ["ALL"] +lint.fixable = ["ALL"] # Exclude a variety of commonly ignored directories. exclude = [ From e94f9dcbc970500f3967553394015a0c6444b98d Mon Sep 17 00:00:00 2001 From: MarcoGorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Thu, 15 Feb 2024 10:09:56 +0000 Subject: [PATCH 3/6] Bump version to 0.12.5 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index b4a9c16..3d2c2c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polars_xdt" -version = "0.12.4" +version = "0.12.5" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From ff028ecf809a311d6f7d1a228d1f8f749853960a Mon Sep 17 00:00:00 2001 From: MarcoGorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Thu, 15 Feb 2024 10:18:01 +0000 Subject: [PATCH 4/6] Bump version to 0.12.6 --- Cargo.toml | 2 +- polars_xdt/functions.py | 10 ++++++++++ polars_xdt/ranges.py | 1 + polars_xdt/utils.py | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 3d2c2c5..ef6c7ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polars_xdt" -version = "0.12.5" +version = "0.12.6" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/polars_xdt/functions.py b/polars_xdt/functions.py index 8b5edf8..366d7a8 100644 --- a/polars_xdt/functions.py +++ b/polars_xdt/functions.py @@ -146,6 +146,7 @@ def offset_by( │ 2023-09-01 ┆ 2bd ┆ 2023-09-05 │ │ 2024-01-04 ┆ -3bd ┆ 2024-01-01 │ └────────────┴──────┴──────────────┘ + """ expr = parse_into_expr(expr) if ( @@ -237,6 +238,7 @@ def is_workday( │ 2023-05-01 ┆ true │ │ 2023-09-09 ┆ false │ └────────────┴────────────┘ + """ expr = parse_into_expr(expr) weekmask = get_weekmask(weekend) @@ -323,6 +325,7 @@ def from_local_datetime( │ 2020-10-10 02:00:00 ┆ Africa/Kigali ┆ 2020-10-10 00:00:00 UTC │ │ 2020-10-09 20:00:00 ┆ America/New_York ┆ 2020-10-10 00:00:00 UTC │ └─────────────────────┴──────────────────┴─────────────────────────┘ + """ expr = parse_into_expr(expr) from_tz = parse_into_expr(from_tz, str_as_lit=True) @@ -389,6 +392,7 @@ def to_local_datetime( │ 2020-10-10 00:00:00 UTC ┆ Africa/Kigali ┆ 2020-10-10 02:00:00 │ │ 2020-10-10 00:00:00 UTC ┆ America/New_York ┆ 2020-10-09 20:00:00 │ └─────────────────────────┴──────────────────┴─────────────────────┘ + """ expr = parse_into_expr(expr) time_zone = parse_into_expr(time_zone, str_as_lit=True) @@ -447,6 +451,7 @@ def format_localized( │ 2024-08-24 00:00:00 ┆ субота, 24 серпня 2024 │ │ 2024-10-01 00:00:00 ┆ вівторок, 01 жовтня 2024 │ └─────────────────────┴──────────────────────────┘ + """ expr = parse_into_expr(expr) return expr.register_plugin( @@ -485,6 +490,7 @@ def to_julian_date(expr: str | pl.Expr) -> pl.Expr: │ 2013-01-01 00:30:00 ┆ 2456293.5208333335 │ │ 2024-01-07 13:18:51 ┆ 2460317.0547569445 │ └─────────────────────┴────────────────────┘ + """ expr = parse_into_expr(expr) return expr.register_plugin( @@ -554,6 +560,7 @@ def ceil( │ 2024-08-24 00:00:00 ┆ 2024-09-01 00:00:00 │ │ 2024-10-01 00:00:00 ┆ 2024-10-01 00:00:00 │ └─────────────────────┴─────────────────────┘ + """ expr = parse_into_expr(expr) truncated = expr.dt.truncate(every) @@ -600,6 +607,7 @@ def day_name(expr: str | pl.Expr, locale: str | None = None) -> pl.Expr: │ 2020-10-25 00:00:00 ┆ Sunday ┆ dimanche ┆ неділя │ │ 2020-10-26 00:00:00 ┆ Monday ┆ lundi ┆ понеділок │ └─────────────────────┴──────────────────┴─────────────────┴────────────────────┘ + """ expr = parse_into_expr(expr) if locale is None: @@ -645,6 +653,7 @@ def month_name(expr: str | pl.Expr, locale: str | None = None) -> pl.Expr: │ 2020-10-25 00:00:00 ┆ October ┆ octobre ┆ жовтня │ │ 2020-11-26 00:00:00 ┆ November ┆ novembre ┆ листопада │ └─────────────────────┴────────────────────┴───────────────────┴──────────────────────┘ + """ expr = parse_into_expr(expr) if locale is None: @@ -701,6 +710,7 @@ def workday_count( │ 2023-05-01 ┆ 2023-05-02 ┆ 1 │ │ 2023-09-09 ┆ 2023-12-30 ┆ 80 │ └────────────┴────────────┴─────────────────┘ + """ start_dates = parse_into_expr(start_dates) end_dates = parse_into_expr(end_dates) diff --git a/polars_xdt/ranges.py b/polars_xdt/ranges.py index 1192b75..1d820c2 100644 --- a/polars_xdt/ranges.py +++ b/polars_xdt/ranges.py @@ -136,6 +136,7 @@ def date_range( # noqa: PLR0913 │ 2023-01-09 │ │ 2023-01-10 │ └────────────┘ + """ if weekend == ("Sat", "Sun"): weekend_int = [6, 7] diff --git a/polars_xdt/utils.py b/polars_xdt/utils.py index 73f7a19..d7aacda 100644 --- a/polars_xdt/utils.py +++ b/polars_xdt/utils.py @@ -35,6 +35,7 @@ def parse_into_expr( Returns ------- polars.Expr + """ if isinstance(expr, pl.Expr): pass From 2bff9c21fe28071279e82caf1744c4eed6955798 Mon Sep 17 00:00:00 2001 From: Marco Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Fri, 16 Feb 2024 18:19:04 +0000 Subject: [PATCH 5/6] Bump version to 0.12.7 --- Cargo.toml | 4 ++-- bump_version.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ef6c7ad..1ad0650 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polars_xdt" -version = "0.12.6" +version = "0.12.7" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -9,7 +9,7 @@ name = "polars_xdt" crate-type = ["cdylib"] [dependencies] -pyo3 = { version = "0.20.0", features = ["extension-module"] } +pyo3 = { version = "0.20.0", features = ["extension-module", "abi3-py38"] } pyo3-polars = { version = "0.11.1", features = ["derive"] } serde = { version = "1", features = ["derive"] } chrono = { version = "0.4.31", default-features = false, features = ["std", "unstable-locales"] } diff --git a/bump_version.py b/bump_version.py index 2e20141..a93fb82 100644 --- a/bump_version.py +++ b/bump_version.py @@ -7,7 +7,7 @@ # Docs are in a a separate repo cause I couldn't figure out # how to deploy from readthedocs -subprocess.run(["make", "install"]) +subprocess.run(["make", "install", "--release"]) subprocess.run(["make", "clean"], cwd="docs") subprocess.run(["make", "html"], cwd="docs") os.system("cp docs/_build/html/* ../docs-polars-xdt/ -r") From e6d5203f28bd6b5f8bfd72e82f6c25f371faed26 Mon Sep 17 00:00:00 2001 From: Marco Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Fri, 16 Feb 2024 18:19:58 +0000 Subject: [PATCH 6/6] Bump version to 0.12.8 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 1ad0650..8a47ff2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polars_xdt" -version = "0.12.7" +version = "0.12.8" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html