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

IntervalTree: Null Interval objects not allowed in IntervalTree #20

Open
jmlich opened this issue Dec 14, 2021 · 2 comments
Open

IntervalTree: Null Interval objects not allowed in IntervalTree #20

jmlich opened this issue Dec 14, 2021 · 2 comments

Comments

@jmlich
Copy link
Contributor

jmlich commented Dec 14, 2021

I have seen following exception:

+ ./bbb-render/make-xges.py --start 21315 --end 30730 --backdrop ./output/so-4-15-00-pavel-pisa-michal-lenc-diskuze.png --opening-credits /home/jmlich/workspace/openalt2021/bbb-batch-render/output2/so-4-15-00-pavel-pisa-michal-lenc-diskuze.png --opening-credits /home/jmlich/workspace/openalt2021/bbb-batch-render/1.png --closing-credits /home/jmlich/workspace/openalt2021/bbb-batch-render/2.png --closing-credits /home/jmlich/workspace/openalt2021/bbb-batch-render/3.png --annotations -- /home/jmlich/Desktop/openalt2021-zaznamy/openalt4_sobota_2021/presentation/b530a151c013923f4321a0661de8e344a2d77b0c-1636183223742 /home/jmlich/workspace/openalt2021/bbb-batch-render/tmp/so-4-15-00-pavel-pisa-michal-lenc-diskuze.xges
Error
Traceback (most recent call last):
  File "/home/jmlich/workspace/openalt2021/bbb-batch-render/./bbb-render/make-xges.py", line 471, in <module>
    sys.exit(main(sys.argv))
  File "/home/jmlich/workspace/openalt2021/bbb-batch-render/./bbb-render/make-xges.py", line 466, in main
    p = Presentation(opts)
  File "/home/jmlich/workspace/openalt2021/bbb-batch-render/./bbb-render/make-xges.py", line 52, in __init__
    self.add_slides(self.opts.annotations)
  File "/home/jmlich/workspace/openalt2021/bbb-batch-render/./bbb-render/make-xges.py", line 272, in add_slides
    t.addi(start, end, [(index, shape)])
  File "/usr/lib/python3.10/site-packages/intervaltree/intervaltree.py", line 343, in addi
    return self.add(Interval(begin, end, data))
  File "/usr/lib/python3.10/site-packages/intervaltree/intervaltree.py", line 324, in add
    raise ValueError(
ValueError: IntervalTree: Null Interval objects not allowed in IntervalTree: Interval(30322100000000, 30322100000000, [(0, <Element '{http://www.w3.org/2000/svg}g' at 0x7f3fa34875b0>)])

I decided not to insert slides when start time is a same as end time. I am not sure if this is a good solution.

diff --git a/make-xges.py b/make-xges.py
index 4df2d9d..4f4eb2f 100755
--- a/make-xges.py
+++ b/make-xges.py
@@ -267,6 +267,8 @@ class Presentation:
                 if end < self.start_time or start > self.end_time:
                     continue
 
+                if start == end: # Null Interval objects not allowed in IntervalTree
+                    continue
                 t.addi(start, end, [(index, shape)])
 
             t.split_overlaps()
@jmlich jmlich changed the title ValueError: IntervalTree: Null Interval objects not allowed in IntervalTree: Interval(30322100000000, 30322100000000, [(0, <Element '{http://www.w3.org/2000/svg}g' at 0x7f3fa34875b0>)]) ValueError: IntervalTree: Null Interval objects not allowed in IntervalTree Dec 14, 2021
@jmlich jmlich changed the title ValueError: IntervalTree: Null Interval objects not allowed in IntervalTree IntervalTree: Null Interval objects not allowed in IntervalTree Dec 14, 2021
@ak4off
Copy link

ak4off commented Jul 8, 2024

Did you find a solution ?

@jmlich
Copy link
Contributor Author

jmlich commented Jul 8, 2024

Diff is above ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants