Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.1.0 Normalize canonical expressions #68

Merged
merged 56 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
87b17c5
init simplification by canonical
remi-dupre Feb 4, 2025
184e20c
manipulate range instead of their bounds
remi-dupre Feb 5, 2025
2820c06
banger
remi-dupre Feb 5, 2025
6d20f9b
fix lints
remi-dupre Feb 6, 2025
4f29e7b
wip: add more tests
remi-dupre Feb 7, 2025
aef663d
simplify: fix "fallback" behavior of normal operators
remi-dupre Feb 11, 2025
f3f6a1f
simplify: lighter code to only manipulate selectors
remi-dupre Feb 11, 2025
ed7262e
normalize: various fixes & new fuzzer
remi-dupre Feb 11, 2025
dc3677d
fix weeknums wrapping end of the year
remi-dupre Feb 12, 2025
62d1119
fix weeknum when current week started previous year
remi-dupre Feb 12, 2025
34e51e5
move fuzz corpus into a submodule
remi-dupre Feb 12, 2025
ff7ed59
fix matching of wrapping weeknum
remi-dupre Feb 12, 2025
c292b35
plug fuzzing corpus to tests
remi-dupre Feb 12, 2025
0022f05
fix(parser): start offset not copied to end for monthday ranges
remi-dupre Feb 13, 2025
4090721
more tests about fuzzing
remi-dupre Feb 13, 2025
b4592f4
fix(parser): start offset not copied to end for monthday ranges
remi-dupre Feb 13, 2025
eab7fbd
add bounds to supported input time
remi-dupre Feb 13, 2025
2c34e3f
move fuzzing tests to fuzz package
remi-dupre Feb 13, 2025
3ea68cb
tests: detect slowness through deterministic statistics
remi-dupre Feb 13, 2025
f4c9b90
fix(parser): regular time should not allow 24:01 to 24:59
remi-dupre Feb 14, 2025
ad8fe81
fix(parser): regular time should not allow 24:01 to 24:59
remi-dupre Feb 14, 2025
fb2008b
edition 2024
remi-dupre Feb 22, 2025
d867f81
add approx_bound_interval_size optimization
remi-dupre Feb 22, 2025
1482bee
update dependancies
remi-dupre Feb 22, 2025
1bbe6f0
rename simplify into normalize
remi-dupre Feb 22, 2025
e16adb4
disable doctests in coverage 😢
remi-dupre Feb 22, 2025
bc64044
add naïve benchmarks for normalization
remi-dupre Feb 22, 2025
ff30c42
add `next_change_from_bounds` as an attempt to simplify implementation
remi-dupre Feb 22, 2025
751ec1e
normalize: add the "Frame" abstraction
remi-dupre Feb 23, 2025
e40b311
newtype abuse
remi-dupre Feb 23, 2025
37c3490
add MakeCanonical trait
remi-dupre Feb 23, 2025
7eb3f6a
a few optimisation in normalization
remi-dupre Feb 23, 2025
91a40d4
a bit of doc
remi-dupre Feb 23, 2025
606a1aa
normalization for a mix of rule kinds
remi-dupre Feb 23, 2025
80d6203
normalize: invert sequence priority
remi-dupre Feb 23, 2025
6b36507
attempt to revert to edition 2021 to fix CI
remi-dupre Feb 23, 2025
d8ef805
update fuzz corpus
remi-dupre Feb 23, 2025
06fe597
remove dead code
remi-dupre Feb 23, 2025
234bf88
add Python binding for `.normalize()`
remi-dupre Feb 23, 2025
1263997
fix a few todos
remi-dupre Feb 23, 2025
743c6d7
update Readme
remi-dupre Feb 23, 2025
799b4da
update holidays database
remi-dupre Feb 23, 2025
94666c3
fix: some open ends were not parsed
remi-dupre Feb 24, 2025
508dc49
fix: open ends being left out by normalization
remi-dupre Feb 24, 2025
5c33840
only normalize the canonical *prefix* of the expression
remi-dupre Feb 24, 2025
1f9d31e
fix stringifying comments, first operator of normalized & time space
remi-dupre Feb 24, 2025
4c2c67e
aled
remi-dupre Feb 24, 2025
9e5ba60
better handling of comments in normalization
remi-dupre Feb 25, 2025
f21f31b
use normal operators as much as possible during normalization
remi-dupre Feb 25, 2025
d475be2
reorder mods a bit and remove helper DimFromBack
remi-dupre Feb 25, 2025
b330d13
more tests for leap years
remi-dupre Feb 26, 2025
1ebb7c5
fix inverted offsets
remi-dupre Feb 26, 2025
10e9bcc
update benchmarking suite
remi-dupre Feb 26, 2025
9880384
add consts ExtendedTime::MIDNIGHT_XX
remi-dupre Feb 26, 2025
c9599c9
update changelog
remi-dupre Feb 26, 2025
e097ee4
fuzz: minimize corpus
remi-dupre Feb 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ jobs:
strategy:
matrix:
crate:
[".", "compact-calendar", "opening-hours-py", "opening-hours-syntax"]
- .
- compact-calendar
- opening-hours-py
- opening-hours-syntax
- fuzz
features: [""]
include:
- { crate: ".", features: "log" }
Expand All @@ -29,6 +33,9 @@ jobs:
working-directory: ${{ matrix.crate }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
Expand Down Expand Up @@ -102,17 +109,20 @@ jobs:
image: xd009642/tarpaulin:develop-nightly
options: --security-opt seccomp=unconfined
steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/checkout@v2
with:
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Python library
run: apt-get update && apt-get install -yy python3-dev && apt-get clean
- name: Generate code coverage
run: >-
cargo +nightly tarpaulin --out xml
--ignore-panics --ignore-tests
--workspace
--all-features
--run-types Tests --run-types Doctests
-p opening-hours -p opening-hours-syntax -p compact-calendar -p opening-hours-py
--run-types Tests
--run-types Doctests
- name: Upload to codecov.io
uses: codecov/codecov-action@v2
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ docs
fuzz/artifacts
opening-hours/data/osm_examples.txt
__pycache__
tarpaulin-report.html

**/target
30 changes: 23 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@
# Changelog

## 1.0.3
## 1.1.0

### Python
### General

- stub: fix variants casing for `State`
- Allow to normalize "canonical" expressions (expressions expressed as simple
intervals over each dimension).
- Weird expressions equivalent to "24/7" should generally be evaluated faster.
- Fixed a lot of bugs. This comes from the fuzzer being super happy of the
addition of a normalization which acts as a sort of concurrent implementation
of the evaluation rules.

## 1.0.2
### Rust

- Add `approx_bound_interval_size` option to context to allow optimizing calls
to `next_change` over long periods of time.

### Fixes

- NaN values are now ignored in coordinates inputs.
- Empty expressions are no longer allowed.
- Monthday "0" is no no longer allowed.

## 1.0.3

### Python

- Fix deployment.
- stub: fix variants casing for `State`

## 1.0.1
## 1.0.2

### Python

Expand All @@ -27,7 +43,7 @@ That's not really a huge milestone, but:

### General

- Add easter support
- Add Easter support

## 0.11.1

Expand Down
Loading