pyintervals 1.0.0__tar.gz → 1.0.2__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.
@@ -1,8 +1,7 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: pyintervals
3
- Version: 1.0.0
3
+ Version: 1.0.2
4
4
  Summary: Efficient interval operations.
5
- Home-page: https://github.com/serkankalay/pyintervals
6
5
  License: MIT
7
6
  Keywords: interval,timespan
8
7
  Author: Serkan Kalay
@@ -14,7 +13,7 @@ Classifier: Programming Language :: Python :: 3.9
14
13
  Classifier: Programming Language :: Python :: 3.10
15
14
  Classifier: Programming Language :: Python :: 3.11
16
15
  Classifier: Programming Language :: Python :: 3.12
17
- Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.13
18
17
  Requires-Dist: importlib-metadata (>=1,<5) ; python_version < "3.8"
19
18
  Requires-Dist: sortedcontainers (>=2.4.0,<3.0.0)
20
19
  Requires-Dist: sortedcontainers-stubs (>=2.4.2,<3.0.0)
@@ -126,7 +125,7 @@ If you want to programatically check whether the shop is open at a given time **
126
125
  you need to iterate over `all (in the worst case)` the time intervals the patisserie is open
127
126
  for the time you are curious about, 12:30 in this case. This will take `O(n)` time.
128
127
 
129
- Linear time is nice but can we not improve it? Well, with **pyintervals**, you can! `(with an upcoming feature)`
128
+ Linear time is nice but can we not improve it? Well, with **pyintervals**, you can!
130
129
  What we essentially are curious about is the status of that beautiful store at a given time.
131
130
  **pintervals** `will` allow you fetch this value in `O(log n)` time.
132
131
 
@@ -103,7 +103,7 @@ If you want to programatically check whether the shop is open at a given time **
103
103
  you need to iterate over `all (in the worst case)` the time intervals the patisserie is open
104
104
  for the time you are curious about, 12:30 in this case. This will take `O(n)` time.
105
105
 
106
- Linear time is nice but can we not improve it? Well, with **pyintervals**, you can! `(with an upcoming feature)`
106
+ Linear time is nice but can we not improve it? Well, with **pyintervals**, you can!
107
107
  What we essentially are curious about is the status of that beautiful store at a given time.
108
108
  **pintervals** `will` allow you fetch this value in `O(log n)` time.
109
109
 
@@ -1,15 +1,15 @@
1
1
  [tool.poetry]
2
2
  name = "pyintervals"
3
- version = "1.0.0"
3
+ version = "1.0.2"
4
4
  description = "Efficient interval operations."
5
5
  authors = ["Serkan Kalay <serkanosmankalay@gmail.com>"]
6
6
  license = "MIT"
7
7
  classifiers = [
8
- "Programming Language :: Python :: 3.8",
9
8
  "Programming Language :: Python :: 3.9",
10
9
  "Programming Language :: Python :: 3.10",
11
10
  "Programming Language :: Python :: 3.11",
12
11
  "Programming Language :: Python :: 3.12",
12
+ "Programming Language :: Python :: 3.13",
13
13
  ]
14
14
  readme = "README.rst"
15
15
  packages = [
@@ -67,11 +67,9 @@ def overlaps(interval: Interval, other: Interval) -> bool:
67
67
 
68
68
 
69
69
  def contains(interval: Interval, other: Interval) -> bool:
70
- # If at least one is degenerate, then we can check with overlaps.
71
- if interval.is_degenerate() or other.is_degenerate():
70
+ # If the other interval is degenerate, then we can check with overlaps.
71
+ if other.is_degenerate():
72
72
  return overlaps(interval, other)
73
73
 
74
- # We have 2 non-degenerate intervals. We take them in order
75
- # and check whether first includes other.
76
- first, second = _get_ordered(interval, other)
77
- return first.start <= other.start and first.end >= second.end
74
+ # We have at least one non-degenerate interval.
75
+ return interval.start <= other.start and interval.end >= other.end
File without changes
File without changes