polars-sgt 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. polars_sgt-0.1.0/.github/workflows/CI.yml +190 -0
  2. polars_sgt-0.1.0/.gitignore +12 -0
  3. polars_sgt-0.1.0/.python-version +1 -0
  4. polars_sgt-0.1.0/.readthedocs.yaml +32 -0
  5. polars_sgt-0.1.0/CODE_OF_CONDUCT.md +128 -0
  6. polars_sgt-0.1.0/Cargo.lock +3656 -0
  7. polars_sgt-0.1.0/Cargo.toml +22 -0
  8. polars_sgt-0.1.0/LICENSE +21 -0
  9. polars_sgt-0.1.0/Makefile +31 -0
  10. polars_sgt-0.1.0/PKG-INFO +205 -0
  11. polars_sgt-0.1.0/README.md +185 -0
  12. polars_sgt-0.1.0/assets/.DS_Store +0 -0
  13. polars_sgt-0.1.0/assets/polars-business.png +0 -0
  14. polars_sgt-0.1.0/bump_version.py +43 -0
  15. polars_sgt-0.1.0/docs/API.rst +16 -0
  16. polars_sgt-0.1.0/docs/Makefile +20 -0
  17. polars_sgt-0.1.0/docs/conf.py +54 -0
  18. polars_sgt-0.1.0/docs/index.rst +16 -0
  19. polars_sgt-0.1.0/docs/installation.rst +19 -0
  20. polars_sgt-0.1.0/docs/requirements-docs.txt +8 -0
  21. polars_sgt-0.1.0/dprint.json +17 -0
  22. polars_sgt-0.1.0/licenses/NUMPY_LICENSE.txt +30 -0
  23. polars_sgt-0.1.0/licenses/PANDAS_LICENSE.txt +31 -0
  24. polars_sgt-0.1.0/polars_sgt/.mypy.ini +2 -0
  25. polars_sgt-0.1.0/polars_sgt/__init__.py +35 -0
  26. polars_sgt-0.1.0/polars_sgt/_internal.pyi +1 -0
  27. polars_sgt-0.1.0/polars_sgt/functions.py +859 -0
  28. polars_sgt-0.1.0/polars_sgt/namespace.py +23 -0
  29. polars_sgt-0.1.0/polars_sgt/py.typed +0 -0
  30. polars_sgt-0.1.0/polars_sgt/ranges.py +162 -0
  31. polars_sgt-0.1.0/polars_sgt/typing.py +17 -0
  32. polars_sgt-0.1.0/polars_sgt/utils.py +49 -0
  33. polars_sgt-0.1.0/pyproject.toml +98 -0
  34. polars_sgt-0.1.0/requirements.txt +11 -0
  35. polars_sgt-0.1.0/rust-toolchain.toml +3 -0
  36. polars_sgt-0.1.0/src/arg_previous_greater.rs +42 -0
  37. polars_sgt-0.1.0/src/expressions.rs +145 -0
  38. polars_sgt-0.1.0/src/format_localized.rs +90 -0
  39. polars_sgt-0.1.0/src/lib.rs +19 -0
  40. polars_sgt-0.1.0/src/month_delta.rs +154 -0
  41. polars_sgt-0.1.0/src/sgt_transform.rs +304 -0
  42. polars_sgt-0.1.0/src/timezone.rs +149 -0
  43. polars_sgt-0.1.0/src/to_julian.rs +91 -0
  44. polars_sgt-0.1.0/tests/__init__.py +0 -0
  45. polars_sgt-0.1.0/tests/ceil_test.py +20 -0
  46. polars_sgt-0.1.0/tests/julian_date_test.py +36 -0
  47. polars_sgt-0.1.0/tests/test_benchmark.py +182 -0
  48. polars_sgt-0.1.0/tests/test_date_range.py +93 -0
  49. polars_sgt-0.1.0/tests/test_format_localized.py +95 -0
  50. polars_sgt-0.1.0/tests/test_is_busday.py +86 -0
  51. polars_sgt-0.1.0/tests/test_month_delta.py +134 -0
  52. polars_sgt-0.1.0/tests/test_sgt_transform.py +406 -0
  53. polars_sgt-0.1.0/tests/test_timezone.py +131 -0
  54. polars_sgt-0.1.0/uv.lock +292 -0
@@ -0,0 +1,190 @@
1
+ # This file is based on the autogenerated one by maturin v1.7.8 with:
2
+ #
3
+ # maturin generate-ci github
4
+ #
5
+ # Differences are:
6
+ # - removed x86, armv7, s390x, ppc64le targets from Linux
7
+ # - removed free-threaded wheels
8
+ # - removed musllinux
9
+ # - have separate linux-just-test and linux-min-versions-just-test jobs
10
+ # - add the `RUSTFLAGS: "-Dwarnings"` env variable
11
+ # - Updated for polars-sgt package
12
+
13
+ name: polars-sgt CI
14
+
15
+ on:
16
+ push:
17
+ tags:
18
+ - "*"
19
+ pull_request:
20
+ workflow_dispatch:
21
+
22
+ permissions:
23
+ contents: read
24
+
25
+ # Make sure CI fails on all warnings, including Clippy lints
26
+ env:
27
+ RUSTFLAGS: "-Dwarnings"
28
+
29
+ jobs:
30
+ linux-just-test:
31
+ runs-on: ubuntu-latest
32
+ strategy:
33
+ matrix:
34
+ target: [x86_64]
35
+ python-version: ["3.9", "3.11", "3.13"]
36
+ steps:
37
+ - uses: actions/checkout@v5
38
+ - uses: actions/setup-python@v6
39
+ with:
40
+ python-version: ${{ matrix.python-version }}
41
+
42
+ - name: Set up Rust
43
+ run: rustup show
44
+ - uses: mozilla-actions/sccache-action@v0.0.6
45
+ - run: make venv
46
+ - run: make pre-commit
47
+ - run: make install
48
+ - run: make test
49
+
50
+ linux-min-versions-just-test:
51
+ runs-on: ubuntu-latest
52
+ strategy:
53
+ matrix:
54
+ target: [x86_64]
55
+ python-version: ["3.10"]
56
+ steps:
57
+ - uses: actions/checkout@v5
58
+ - uses: actions/setup-python@v6
59
+ with:
60
+ python-version: ${{ matrix.python-version }}
61
+
62
+ - name: Set up Rust
63
+ run: rustup show
64
+ - uses: mozilla-actions/sccache-action@v0.0.6
65
+ - run: make venv
66
+ - run: .venv/bin/python -m pip install polars==1.5.0 # min version
67
+ - run: make install
68
+ - run: make test
69
+
70
+ linux:
71
+ runs-on: ${{ matrix.platform.runner }}
72
+ strategy:
73
+ matrix:
74
+ platform:
75
+ - runner: ubuntu-22.04
76
+ target: x86_64
77
+ - runner: ubuntu-22.04
78
+ target: aarch64
79
+ steps:
80
+ - uses: actions/checkout@v5
81
+ - uses: actions/setup-python@v6
82
+ with:
83
+ python-version: 3.x
84
+ - name: Build wheels
85
+ uses: PyO3/maturin-action@v1
86
+ with:
87
+ target: ${{ matrix.platform.target }}
88
+ args: --release --out dist
89
+ sccache: "true"
90
+ manylinux: auto
91
+ - name: Upload wheels
92
+ uses: actions/upload-artifact@v4
93
+ with:
94
+ name: wheels-linux-${{ matrix.platform.target }}
95
+ path: dist
96
+
97
+ windows:
98
+ runs-on: ${{ matrix.platform.runner }}
99
+ strategy:
100
+ matrix:
101
+ platform:
102
+ - runner: windows-latest
103
+ target: x64
104
+ steps:
105
+ - uses: actions/checkout@v5
106
+ - uses: actions/setup-python@v6
107
+ with:
108
+ python-version: 3.x
109
+ architecture: ${{ matrix.platform.target }}
110
+ - name: Build wheels
111
+ uses: PyO3/maturin-action@v1
112
+ with:
113
+ target: ${{ matrix.platform.target }}
114
+ args: --release --out dist
115
+ sccache: "true"
116
+ - name: Upload wheels
117
+ uses: actions/upload-artifact@v4
118
+ with:
119
+ name: wheels-windows-${{ matrix.platform.target }}
120
+ path: dist
121
+
122
+ macos:
123
+ runs-on: ${{ matrix.platform.runner }}
124
+ strategy:
125
+ matrix:
126
+ platform:
127
+ - runner: macos-14
128
+ target: x86_64
129
+ - runner: macos-14
130
+ target: aarch64
131
+ steps:
132
+ - uses: actions/checkout@v5
133
+ - uses: actions/setup-python@v6
134
+ with:
135
+ python-version: 3.x
136
+ - name: Build wheels
137
+ uses: PyO3/maturin-action@v1
138
+ with:
139
+ target: ${{ matrix.platform.target }}
140
+ args: --release --out dist
141
+ sccache: "true"
142
+ - name: Upload wheels
143
+ uses: actions/upload-artifact@v4
144
+ with:
145
+ name: wheels-macos-${{ matrix.platform.target }}
146
+ path: dist
147
+
148
+ sdist:
149
+ runs-on: ubuntu-latest
150
+ steps:
151
+ - uses: actions/checkout@v5
152
+ - name: Build sdist
153
+ uses: PyO3/maturin-action@v1
154
+ with:
155
+ command: sdist
156
+ args: --out dist
157
+ - name: Upload sdist
158
+ uses: actions/upload-artifact@v4
159
+ with:
160
+ name: wheels-sdist
161
+ path: dist
162
+
163
+ release:
164
+ name: Release
165
+ runs-on: ubuntu-latest
166
+ if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
167
+ needs: [linux, windows, macos, sdist]
168
+ environment: pypi
169
+ permissions:
170
+ # Use to sign the release artifacts
171
+ id-token: write
172
+ # Used to upload release artifacts
173
+ contents: write
174
+ # Used to generate artifact attestation
175
+ attestations: write
176
+ steps:
177
+ - uses: actions/download-artifact@v5
178
+ - name: Merge wheels
179
+ run: |
180
+ mkdir -p dist
181
+ mv wheels-*/* dist/
182
+ - name: Generate artifact attestation
183
+ uses: actions/attest-build-provenance@v3
184
+ with:
185
+ subject-path: "dist/*"
186
+ - name: Publish to PyPI
187
+ if: ${{ startsWith(github.ref, 'refs/tags/') }}
188
+ uses: pypa/gh-action-pypi-publish@release/v1
189
+ with:
190
+ skip-existing: true
@@ -0,0 +1,12 @@
1
+ /pyo3-polars/target
2
+ .idea/
3
+ venv/
4
+ target/
5
+ *.pyc
6
+ .hypothesis/
7
+ *.html
8
+ *.bat
9
+ *.js
10
+ docs/_build
11
+ docs/api/*
12
+ *.so
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,32 @@
1
+ # .readthedocs.yaml
2
+ # Read the Docs configuration file
3
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4
+
5
+ # Required
6
+ version: 2
7
+
8
+ # Set the OS, Python version and other tools you might need
9
+ build:
10
+ os: ubuntu-22.04
11
+ tools:
12
+ python: "3.11"
13
+ # You can also specify other tool versions:
14
+ # nodejs: "19"
15
+ # rust: "1.64"
16
+ # golang: "1.19"
17
+
18
+ # Build documentation in the "docs/" directory with Sphinx
19
+ sphinx:
20
+ configuration: polars_xdt/docs/conf.py
21
+
22
+ # Optionally build your docs in additional formats such as PDF and ePub
23
+ # formats:
24
+ # - pdf
25
+ # - epub
26
+
27
+ # Optional but recommended, declare the Python requirements required
28
+ # to build your documentation
29
+ # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
30
+ python:
31
+ install:
32
+ - requirements: polars_xdt/docs/requirements-docs.txt
@@ -0,0 +1,128 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ https://www.linkedin.com/in/marcogorelli/.
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series
86
+ of actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or
93
+ permanent ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within
113
+ the community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.0, available at
119
+ https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120
+
121
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
+ enforcement ladder](https://github.com/mozilla/diversity).
123
+
124
+ [homepage]: https://www.contributor-covenant.org
125
+
126
+ For answers to common questions about this code of conduct, see the FAQ at
127
+ https://www.contributor-covenant.org/faq. Translations are available at
128
+ https://www.contributor-covenant.org/translations.