yta-video-frame-time 0.0.19__py3-none-any.whl → 0.0.24__py3-none-any.whl

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.
@@ -112,6 +112,7 @@ class TimeInterval:
112
112
  end: Number,
113
113
  start_limit: Union[Number, None] = None,
114
114
  end_limit: Union[Number, None] = None,
115
+ duration_limit: Union[Number, None] = None,
115
116
  fps: Union[Number, None] = None
116
117
  ):
117
118
  """
@@ -129,6 +130,7 @@ class TimeInterval:
129
130
  ParameterValidator.validate_mandatory_positive_number('end', end, do_include_zero = False)
130
131
  ParameterValidator.validate_positive_number('start_limit', start_limit, do_include_zero = True)
131
132
  ParameterValidator.validate_positive_number('end_limit', end_limit, do_include_zero = False)
133
+ ParameterValidator.validate_positive_number('duration_limit', end_limit, do_include_zero = False)
132
134
 
133
135
  self.fps: Union[Number, None] = fps
134
136
  """
@@ -159,11 +161,23 @@ class TimeInterval:
159
161
  end_limit
160
162
  )
161
163
 
164
+ duration_limit = self._truncate(
165
+ TIME_INTERVAL_SYSTEM_LIMITS[1]
166
+ if duration_limit is None else
167
+ duration_limit
168
+ )
169
+
162
170
  if start_limit < TIME_INTERVAL_SYSTEM_LIMITS[0]:
163
- raise Exception(f'The `start_limit` provided ({str(float(start_limit))}) is lower than the system limit ({str(float(TIME_INTERVAL_SYSTEM_LIMITS[0]))})')
171
+ raise Exception(f'The `start_limit` ({str(float(start_limit))}) is lower than the system limit ({str(float(TIME_INTERVAL_SYSTEM_LIMITS[0]))})')
164
172
 
165
173
  if end_limit > TIME_INTERVAL_SYSTEM_LIMITS[1]:
166
- raise Exception(f'The `end_limit` provided ({str(float(end_limit))}) is greater than the system limit ({str(float(TIME_INTERVAL_SYSTEM_LIMITS[1]))})')
174
+ raise Exception(f'The `end_limit` ({str(float(end_limit))}) is greater than the system limit ({str(float(TIME_INTERVAL_SYSTEM_LIMITS[1]))})')
175
+
176
+ if end_limit < start_limit:
177
+ raise Exception(f'The `end_limit` ({str(float(end_limit))}) is greater than the `start_limit` ({str(float(start_limit))})')
178
+
179
+ if duration_limit > TIME_INTERVAL_SYSTEM_LIMITS[1]:
180
+ raise Exception(f'The `duration_limit` ({str(float(duration_limit))}) is greater than the system limit ({str(float(TIME_INTERVAL_SYSTEM_LIMITS[1]))})')
167
181
 
168
182
  self.start_limit: Fraction = start_limit
169
183
  """
@@ -181,6 +195,17 @@ class TimeInterval:
181
195
  will be used to raise exceptions if any of the `end`
182
196
  values goes beyond this limit.
183
197
 
198
+ See the `TIME_INTERVAL_SYSTEM_LIMITS[1]` variable to
199
+ know the limit defined by the system that will be
200
+ applied if the user doesn't provided his own limit.
201
+ """
202
+ self.duration_limit: Fraction = duration_limit
203
+ """
204
+ The limit for the `duration` of this time interval,
205
+ which will be used to raise exceptions if this
206
+ duration is exceeded when modifying the `start` and/or
207
+ `end` values of this time interval.
208
+
184
209
  See the `TIME_INTERVAL_SYSTEM_LIMITS[1]` variable to
185
210
  know the limit defined by the system that will be
186
211
  applied if the user doesn't provided his own limit.
@@ -195,12 +220,13 @@ class TimeInterval:
195
220
  The current `end` value of this time interval.
196
221
  """
197
222
 
198
- self._validate_start(self.start)
199
- self._validate_end(self.end)
223
+ self._validate_start()
224
+ self._validate_end()
225
+ self._validate_duration()
200
226
 
201
227
  def _validate_start(
202
228
  self,
203
- start: Union[Number, None]
229
+ start: Union[Number, None] = None
204
230
  ) -> None:
205
231
  """
206
232
  *For internal use only*
@@ -209,18 +235,27 @@ class TimeInterval:
209
235
  time interval and the system based on the limits and the
210
236
  value of the `end` parameter also.
211
237
 
238
+ If the `start` parameter provided is None, the current `start`
239
+ value will be used instead.
240
+
212
241
  This method will raise an exception if the provided value is
213
242
  not valid.
214
243
  """
244
+ start = (
245
+ self.start
246
+ if start is None else
247
+ start
248
+ )
249
+
215
250
  if start >= self.end:
216
- raise Exception(f'The `start` value provided ({str(float(start))}) is greater or equal to the current`end` value ({str(float(self.end))}).')
251
+ raise Exception(f'The `start` value ({str(float(start))}) is greater or equal to the current `end` value ({str(float(self.end))}).')
217
252
 
218
253
  if start < self.start_limit:
219
- raise Exception(f'The `start` value provided ({str(float(start))}) is lower than the `start_limit` ({str(float(self.start_limit))}).')
254
+ raise Exception(f'The `start` value ({str(float(start))}) is lower than the `start_limit` ({str(float(self.start_limit))}).')
220
255
 
221
256
  def _validate_end(
222
257
  self,
223
- end: Union[Number, None]
258
+ end: Union[Number, None] = None
224
259
  ) -> None:
225
260
  """
226
261
  *For internal use only*
@@ -229,14 +264,49 @@ class TimeInterval:
229
264
  time interval and the system based on the limits and the
230
265
  value of the `start` parameter also.
231
266
 
267
+ If the `end` parameter provided is None, the current `end`
268
+ value will be used instead.
269
+
232
270
  This method will raise an exception if the provided value is
233
271
  not valid.
234
272
  """
273
+ end = (
274
+ self.end
275
+ if end is None else
276
+ end
277
+ )
278
+
235
279
  if end <= self.start:
236
- raise Exception(f'The `end` value provided ({str(float(end))}) is lower or equal to the current`start` value ({str(float(self.start))}).')
280
+ raise Exception(f'The `end` value ({str(float(end))}) is lower or equal to the current `start` value ({str(float(self.start))}).')
237
281
 
238
282
  if end > self.end_limit:
239
- raise Exception(f'The `end` value provided ({str(float(end))}) is greater than the `end_limit` ({str(float(self.end_limit))}).')
283
+ raise Exception(f'The `end` value ({str(float(end))}) is greater than the `end_limit` ({str(float(self.end_limit))}).')
284
+
285
+ def _validate_duration(
286
+ self,
287
+ duration: Union[Number, None] = None
288
+ ) -> None:
289
+ """
290
+ *For internal use only*
291
+
292
+ Validate that the `duration` value provided is accepted by
293
+ the time interval and the system based on the limit set
294
+ when creating this instance.
295
+
296
+ If the `duration` parameter provided is None, the current
297
+ `duration` value will be used instead.
298
+
299
+ This method will raise an exception if the provided value is
300
+ not valid.
301
+ """
302
+ duration = (
303
+ self.duration
304
+ if duration is None else
305
+ duration
306
+ )
307
+
308
+ if duration > self.duration_limit:
309
+ raise Exception(f'The `duration` ({str(float(duration))}) is greater than the `duration_limit` ({str(float(self.duration_limit))}).')
240
310
 
241
311
  """
242
312
  Apparently, the professional video editors use always
@@ -448,6 +518,39 @@ class TimeInterval:
448
518
  )
449
519
 
450
520
  # Modifying 'start' and 'end' below
521
+ def shift(
522
+ self,
523
+ delta: Number
524
+ ) -> 'TimeInterval':
525
+ """
526
+ (!) This method will modify this instance.
527
+
528
+ Move the `start` and the `end` by applying the `delta`
529
+ amount (that will be forced to be a multiple of `1/fps`)
530
+ but modifying not the duration.
531
+
532
+ This can only be done if the new `start` and `end` values
533
+ are in between the limits.
534
+ """
535
+ delta = self._truncate(delta)
536
+
537
+ if delta == 0:
538
+ return self
539
+
540
+ new_start = self.start + delta
541
+ new_end = self.end + delta
542
+
543
+ if delta > 0:
544
+ self._validate_end(new_end)
545
+ self._validate_start(new_start)
546
+ else:
547
+ self._validate_start(new_start)
548
+ self._validate_end(new_end)
549
+
550
+ self.start = new_start
551
+ self.end = new_end
552
+
553
+ return self
451
554
 
452
555
  def get_cuts(
453
556
  self,
@@ -533,16 +636,16 @@ class TimeInterval:
533
636
  # TODO: Rename, please
534
637
  def get_trim_starts(
535
638
  self,
536
- t_variation: Number
639
+ delta: Number
537
640
  ) -> tuple['TimeInterval', 'TimeInterval']:
538
641
  """
539
642
  Get a tuple containing the 2 new `TimeInterval` instances
540
643
  generated by trimming this one's start the amount of seconds
541
- provided as the `t_variation` parameter. The first tuple is
644
+ provided as the `delta` parameter. The first tuple is
542
645
  the remaining, and the second one is the new time interval
543
646
  requested by the user.
544
647
 
545
- (!) The `t_variation` value provided will be transformed into
648
+ (!) The `delta` value provided will be transformed into
546
649
  a multiple of `1/fps` of this instance, and truncated to fit
547
650
  the `start` of the time interval the new segments will belong
548
651
  to, if the `fps` is set.
@@ -552,24 +655,24 @@ class TimeInterval:
552
655
  `limit`, that must be greater than the `start` and lower
553
656
  than the time interval `end` value.
554
657
 
555
- The `t_variation` must be a positive value, the amount of
658
+ The `delta` must be a positive value, the amount of
556
659
  seconds to be trimmed.
557
660
  """
558
661
  return self._cutter.trim_start(
559
662
  time_interval = self,
560
- t_variation = self._truncate(t_variation)
663
+ delta = self._truncate(delta)
561
664
  )
562
665
 
563
666
  # TODO: Rename, please
564
667
  def get_trim_start(
565
668
  self,
566
- t_variation: Number
669
+ delta: Number
567
670
  ) -> 'TimeInterval':
568
671
  """
569
672
  Get this time interval instance but trimmed from the `start`
570
- the `t_variation` amount of seconds provided.
673
+ the `delta` amount of seconds provided.
571
674
 
572
- (!) The `t_variation` value provided will be transformed into
675
+ (!) The `delta` value provided will be transformed into
573
676
  a multiple of `1/fps` of this instance, and truncated to fit
574
677
  the `start` of the time interval the new segments will belong
575
678
  to, if the `fps` is set.
@@ -578,65 +681,68 @@ class TimeInterval:
578
681
  returns a new one.
579
682
  """
580
683
  return self.get_trim_starts(
581
- t_variation = t_variation
684
+ delta = delta
582
685
  )[1]
583
686
 
584
687
  def _trim_start(
585
688
  self,
586
- t_variation: Number
689
+ delta: Number
587
690
  ) -> 'TimeInterval':
588
691
  """
589
692
  (!) This method will modify this instance.
590
693
 
591
694
  Transform this time interval into a new one in which
592
- the `start` has been trimmed the `t_variation` provided
695
+ the `start` has been trimmed the `delta` provided
593
696
  if the result respected the also given `limit`.
594
697
 
595
698
  This method returns this same instance but modified.
596
699
  """
597
700
  cut = self.get_trim_start(
598
- t_variation = t_variation
701
+ delta = delta
599
702
  )
600
703
 
704
+ self._validate_start(cut.start)
705
+ self._validate_duration(cut.end - cut.start)
706
+
601
707
  self.start = cut.start
602
- self.end = cut.end
708
+ #self.end = cut.end
603
709
 
604
710
  return self
605
711
 
606
712
  def get_trim_ends(
607
713
  self,
608
- t_variation: Number
714
+ delta: Number
609
715
  ) -> tuple['TimeInterval', 'TimeInterval']:
610
716
  """
611
717
  Get a tuple containing the 2 new `TimeInterval` instances
612
718
  generated by trimming this one's end the amount of seconds
613
- provided as the `t_variation` parameter. The first tuple is
719
+ provided as the `delta` parameter. The first tuple is
614
720
  the one requested by the user, and the second one is the
615
721
  remaining.
616
722
 
617
- (!) The `t_variation` value provided will be transformed into
723
+ (!) The `delta` value provided will be transformed into
618
724
  a multiple of `1/fps` of this instance, and truncated to fit
619
725
  the `start` of the time interval the new segments will belong
620
726
  to, if the `fps` is set.
621
727
 
622
- The `t_variation` must be a positive value, the amount of
728
+ The `delta` must be a positive value, the amount of
623
729
  seconds to be trimmed.
624
730
  """
625
731
  return self._cutter.trim_end(
626
732
  time_interval = self,
627
- t_variation = self._truncate(t_variation)
733
+ delta = self._truncate(delta)
628
734
  )
629
735
 
630
736
  # TODO: Rename, please
631
737
  def get_trim_end(
632
738
  self,
633
- t_variation: Number
739
+ delta: Number
634
740
  ) -> 'TimeInterval':
635
741
  """
636
742
  Get this time interval instance but trimmed from the `end`
637
- the `t_variation` amount of seconds provided.
743
+ the `delta` amount of seconds provided.
638
744
 
639
- (!) The `t_variation` value provided will be transformed into
745
+ (!) The `delta` value provided will be transformed into
640
746
  a multiple of `1/fps` of this instance, and truncated to fit
641
747
  the `end` of the time interval the new segments will belong
642
748
  to, if the `fps` is set.
@@ -645,27 +751,30 @@ class TimeInterval:
645
751
  returns a new one.
646
752
  """
647
753
  return self.get_trim_ends(
648
- t_variation = t_variation
754
+ delta = delta
649
755
  )[0]
650
756
 
651
757
  def _trim_end(
652
758
  self,
653
- t_variation: Number
759
+ delta: Number
654
760
  ) -> 'TimeInterval':
655
761
  """
656
762
  (!) This method will modify this instance.
657
763
 
658
764
  Transform this time interval into a new one in which
659
- the `end` has been trimmed the `t_variation` provided
765
+ the `end` has been trimmed the `delta` provided
660
766
  if the result respected the also given `limit`.
661
767
 
662
768
  This method returns this same instance but modified.
663
769
  """
664
770
  cut = self.get_trim_end(
665
- t_variation = t_variation
771
+ delta = delta
666
772
  )
667
773
 
668
- self.start = cut.start
774
+ self._validate_end(cut.end)
775
+ self._validate_duration(cut.end - cut.start)
776
+
777
+ #self.start = cut.start
669
778
  self.end = cut.end
670
779
 
671
780
  return self
@@ -736,28 +845,34 @@ class TimeInterval:
736
845
 
737
846
  def _extend_end(
738
847
  self,
739
- t_variation: Number
848
+ delta: Number
740
849
  ) -> 'TimeInterval':
741
850
  """
742
851
  (!) This method will modify this instance.
743
852
 
744
853
  Transform this time interval into a new one in which
745
- the `end` has been extended the `t_variation` provided
854
+ the `end` has been extended the `delta` provided
746
855
  if the result respected the also given `limit`.
747
856
 
748
857
  This method returns this same instance but modified.
858
+
859
+ This method will raise an exception if the new duration
860
+ exceeds the `duration_limit`.
749
861
  """
750
- ParameterValidator.validate_mandatory_positive_number('t_variation', t_variation, do_include_zero = False)
862
+ ParameterValidator.validate_mandatory_positive_number('delta', delta, do_include_zero = False)
751
863
 
752
864
  extended = self._extender.extend_end(
753
865
  time_interval = self,
754
- t_variation = (
755
- self._truncate(t_variation)
866
+ delta = (
867
+ self._truncate(delta)
756
868
  if self.fps is not None else
757
- t_variation
869
+ delta
758
870
  )
759
871
  )
760
872
 
873
+ self._validate_end(extended.end)
874
+ self._validate_duration(extended.end - self.start)
875
+
761
876
  # TODO: Is this above a bit useless (?)
762
877
  self.end = extended.end
763
878
 
@@ -765,46 +880,52 @@ class TimeInterval:
765
880
 
766
881
  def _extend_start(
767
882
  self,
768
- t_variation: Number
883
+ delta: Number
769
884
  ) -> 'TimeInterval':
770
885
  """
771
886
  (!) This method will modify this instance.
772
887
 
773
888
  Transform this time interval into a new one in which
774
- the `start` has been extended the `t_variation` provided
889
+ the `start` has been extended the `delta` provided
775
890
  if the result respected the also given `limit`.
776
891
 
777
892
  This method returns this same instance but modified.
893
+
894
+ This method will raise an exception if the new duration
895
+ exceeds the `duration_limit`.
778
896
  """
779
- ParameterValidator.validate_mandatory_positive_number('t_variation', t_variation, do_include_zero = False)
897
+ ParameterValidator.validate_mandatory_positive_number('delta', delta, do_include_zero = False)
780
898
 
781
899
  extended = self._extender.extend_start(
782
900
  time_interval = self,
783
- t_variation = (
784
- self._truncate(t_variation)
901
+ delta = (
902
+ self._truncate(delta)
785
903
  if self.fps is not None else
786
- t_variation
904
+ delta
787
905
  )
788
906
  )
789
907
 
908
+ self._validate_start(extended.start)
909
+ self._validate_duration(self.end - extended.start)
910
+
790
911
  # TODO: Is this above a bit useless (?)
791
912
  self.start = extended.start
792
913
 
793
914
  return self
794
915
 
795
- def modify_start(
916
+ def shift_start(
796
917
  self,
797
- t_variation: Number
918
+ delta: Number
798
919
  ) -> 'TimeInterval':
799
920
  """
800
921
  (!) This method will modify this instance.
801
922
 
802
- Giving a negative `t_variation` value will make the
923
+ Giving a negative `delta` value will make the
803
924
  time interval longer, extending the `start` value.
804
925
 
805
926
  Transform this time interval into a new one in which
806
927
  the `start` has been extended or trimmed the
807
- `t_variation` value provided if the result respects
928
+ `delta` value provided if the result respects
808
929
  the also given `limit`.
809
930
 
810
931
  The new `start` can never be lower than the original
@@ -812,28 +933,28 @@ class TimeInterval:
812
933
 
813
934
  This method returns this same instance but modified.
814
935
  """
815
- ParameterValidator.validate_mandatory_number(t_variation, t_variation, do_include_zero = False)
936
+ ParameterValidator.validate_mandatory_number(delta, delta, do_include_zero = False)
816
937
 
817
938
  return (
818
939
  self._trim_start(
819
- t_variation = abs(t_variation)
940
+ delta = abs(delta)
820
941
  )
821
- if t_variation > 0 else
942
+ if delta > 0 else
822
943
  self._extend_start(
823
- t_variation = abs(t_variation)
944
+ delta = abs(delta)
824
945
  )
825
946
  )
826
947
 
827
- def modify_start_to(
948
+ def set_start(
828
949
  self,
829
- start: Number
950
+ t: Number
830
951
  ) -> 'TimeInterval':
831
952
  """
832
953
  (!) This method will modify this instance.
833
954
 
834
955
  Transform this time interval into a new one in which
835
956
  the `start` has been extended or trimmed until
836
- reaching the new `start` parameter value provided (if
957
+ reaching the new `t` parameter value provided (if
837
958
  valid).
838
959
 
839
960
  The new `start` can never be lower than the limit
@@ -842,27 +963,28 @@ class TimeInterval:
842
963
 
843
964
  This method returns this same instance but modified.
844
965
  """
845
- ParameterValidator.validate_mandatory_number(start, start, do_include_zero = True)
966
+ ParameterValidator.validate_mandatory_number(t, t, do_include_zero = True)
846
967
 
847
- if start != self.start:
848
- self._validate_start(start)
849
- self.start = start
968
+ if t != self.start:
969
+ self._validate_start(t)
970
+ self._validate_duration(self.end - t)
971
+ self.start = t
850
972
 
851
973
  return self
852
974
 
853
- def modify_end(
975
+ def shift_end(
854
976
  self,
855
- t_variation: Number
977
+ delta: Number
856
978
  ) -> 'TimeInterval':
857
979
  """
858
980
  (!) This method will modify this instance.
859
981
 
860
- Giving a positive `t_variation` value will make the
982
+ Giving a positive `delta` value will make the
861
983
  time interval longer, extending the `end` value.
862
984
 
863
985
  Transform this time interval into a new one in which
864
986
  the `end` has been extended or trimmed the
865
- `t_variation` value provided if the result respects
987
+ `delta` value provided if the result respects
866
988
  the also given `limit`.
867
989
 
868
990
  The new `end` can never be greater than the original
@@ -870,19 +992,19 @@ class TimeInterval:
870
992
 
871
993
  This method returns this same instance but modified.
872
994
  """
873
- ParameterValidator.validate_mandatory_number(t_variation, t_variation, do_include_zero = False)
995
+ ParameterValidator.validate_mandatory_number(delta, delta, do_include_zero = False)
874
996
 
875
997
  return (
876
998
  self._trim_end(
877
- t_variation = abs(t_variation)
999
+ delta = abs(delta)
878
1000
  )
879
- if t_variation < 0 else
1001
+ if delta < 0 else
880
1002
  self._extend_end(
881
- t_variation = abs(t_variation)
1003
+ delta = abs(delta)
882
1004
  )
883
1005
  )
884
1006
 
885
- def modify_end_to(
1007
+ def set_end(
886
1008
  self,
887
1009
  t: Number
888
1010
  ) -> 'TimeInterval':
@@ -901,9 +1023,10 @@ class TimeInterval:
901
1023
  """
902
1024
  ParameterValidator.validate_mandatory_number(t, t, do_include_zero = True)
903
1025
 
904
- if end != self.end:
905
- self._validate_end(end)
906
- self.end = end
1026
+ if t != self.end:
1027
+ self._validate_end(t)
1028
+ self._validate_duration(t - self.start)
1029
+ self.end = t
907
1030
 
908
1031
  return self
909
1032
 
@@ -1131,23 +1254,23 @@ class TimeIntervalCutter:
1131
1254
  @parameter_to_time_interval('time_interval')
1132
1255
  def trim_end(
1133
1256
  time_interval: TimeIntervalType,
1134
- t_variation: Number
1257
+ delta: Number
1135
1258
  ) -> tuple['TimeInterval', 'TimeInterval']:
1136
1259
  """
1137
1260
  Get a tuple containing the 2 new `TimeInterval` instances
1138
1261
  generated by trimming the `time_interval` end the amount
1139
- of seconds provided as the `t_variation` parameter. The
1262
+ of seconds provided as the `delta` parameter. The
1140
1263
  first tuple is the requested by the user, and the second one
1141
1264
  is the remaining.
1142
1265
 
1143
- The `t_variation` must be a positive value, the amount of
1266
+ The `delta` must be a positive value, the amount of
1144
1267
  seconds to be trimmed.
1145
1268
  """
1146
- ParameterValidator.validate_mandatory_positive_number('t_variation', t_variation, do_include_zero = False)
1269
+ ParameterValidator.validate_mandatory_positive_number('delta', delta, do_include_zero = False)
1147
1270
 
1148
1271
  return TimeIntervalCutter.trim_end_to(
1149
1272
  time_interval = time_interval,
1150
- t = time_interval.end - t_variation
1273
+ t = time_interval.end - delta
1151
1274
  )
1152
1275
 
1153
1276
  @staticmethod
@@ -1188,23 +1311,23 @@ class TimeIntervalCutter:
1188
1311
  @parameter_to_time_interval('time_interval')
1189
1312
  def trim_start(
1190
1313
  time_interval: TimeIntervalType,
1191
- t_variation: Number
1314
+ delta: Number
1192
1315
  ) -> tuple['TimeInterval', 'TimeInterval']:
1193
1316
  """
1194
1317
  Get a tuple containing the 2 new `TimeInterval` instances
1195
1318
  generated by trimming the `time_interval` start the amount
1196
- of seconds provided as the `t_variation` parameter. The
1319
+ of seconds provided as the `delta` parameter. The
1197
1320
  first tuple is the remaining, and the second one is the
1198
1321
  new time interval requested by the user.
1199
1322
 
1200
- The `t_variation` must be a positive value, the amount of
1323
+ The `delta` must be a positive value, the amount of
1201
1324
  seconds to be trimmed.
1202
1325
  """
1203
- ParameterValidator.validate_mandatory_positive_number('t_variation', t_variation, do_include_zero = False)
1326
+ ParameterValidator.validate_mandatory_positive_number('delta', delta, do_include_zero = False)
1204
1327
 
1205
1328
  return TimeIntervalCutter.trim_start_to(
1206
1329
  time_interval = time_interval,
1207
- t = time_interval.start + t_variation
1330
+ t = time_interval.start + delta
1208
1331
  )
1209
1332
 
1210
1333
  @staticmethod
@@ -1348,7 +1471,7 @@ class TimeIntervalCutter:
1348
1471
  t <= time_interval.start or
1349
1472
  t >= time_interval.end
1350
1473
  ):
1351
- raise Exception('The "t" value provided is not a valid value as it is a limit (or more than a limit).')
1474
+ raise Exception('The "t" value is not a valid value as it is a limit (or more than a limit).')
1352
1475
 
1353
1476
  return (
1354
1477
  TimeInterval(
@@ -1379,17 +1502,17 @@ class TimeIntervalExtender:
1379
1502
  @parameter_to_time_interval('time_interval')
1380
1503
  def extend_end(
1381
1504
  time_interval: 'TimeInterval',
1382
- t_variation: Number
1505
+ delta: Number
1383
1506
  ):
1384
1507
  """
1385
- Extend the end of the given `time_interval` the `t_variation`
1508
+ Extend the end of the given `time_interval` the `delta`
1386
1509
  amount of seconds provided.
1387
1510
  """
1388
- ParameterValidator.validate_mandatory_positive_number('t_variation', t_variation, do_include_zero = False)
1511
+ ParameterValidator.validate_mandatory_positive_number('delta', delta, do_include_zero = False)
1389
1512
 
1390
1513
  return TimeIntervalExtender.extend_end_to(
1391
1514
  time_interval = time_interval,
1392
- t = time_interval.end + t_variation
1515
+ t = time_interval.end + delta
1393
1516
  )
1394
1517
 
1395
1518
  @staticmethod
@@ -1405,7 +1528,7 @@ class TimeIntervalExtender:
1405
1528
  _validate_time_interval_original_limits(time_interval, t)
1406
1529
 
1407
1530
  if t < time_interval.end:
1408
- raise Exception('The "t" parameter provided is lower than the current time interval `end` and this method is to extend it.')
1531
+ raise Exception(f'The "t" value ({str(float(t))}) is lower than the current time interval `end` and this method is to extend it.')
1409
1532
 
1410
1533
  return TimeInterval(
1411
1534
  start = time_interval.start,
@@ -1419,19 +1542,19 @@ class TimeIntervalExtender:
1419
1542
  @parameter_to_time_interval('time_interval')
1420
1543
  def extend_start(
1421
1544
  time_interval: 'TimeInterval',
1422
- t_variation: Number
1545
+ delta: Number
1423
1546
  ):
1424
1547
  """
1425
- Extend the start of the given `time_interval` the `t_variation`
1548
+ Extend the start of the given `time_interval` the `delta`
1426
1549
  amount of seconds provided if the new `start` is greater than
1427
1550
  the `limit` provided and than the original (and min) `start`
1428
1551
  value of the time interval.
1429
1552
  """
1430
- ParameterValidator.validate_mandatory_positive_number('t_variation', t_variation, do_include_zero = False)
1553
+ ParameterValidator.validate_mandatory_positive_number('delta', delta, do_include_zero = False)
1431
1554
 
1432
1555
  return TimeIntervalExtender.extend_start_to(
1433
1556
  time_interval = time_interval,
1434
- t = time_interval.start - t_variation
1557
+ t = time_interval.start - delta
1435
1558
  )
1436
1559
 
1437
1560
  @staticmethod
@@ -1447,7 +1570,7 @@ class TimeIntervalExtender:
1447
1570
  _validate_time_interval_original_limits(time_interval, t)
1448
1571
 
1449
1572
  if t > time_interval.start:
1450
- raise Exception('The "t" parameter provided is greater than the current time interval `start` and this method is to extend it.')
1573
+ raise Exception(f'The "t" value ({str(float(t))}) is greater than the current time interval `start` and this method is to extend it.')
1451
1574
 
1452
1575
  return TimeInterval(
1453
1576
  start = t,
@@ -1474,7 +1597,7 @@ def _validate_time_interval_original_limits(
1474
1597
  t < time_interval.start_limit or
1475
1598
  t > time_interval.end_limit
1476
1599
  ):
1477
- raise Exception(f'The "t" parameter value provided ({str(float(t))}) is out of the time interval limits (min and max) [{str(float(time_interval.start_limit))}, {str(float(time_interval.end_limit))}].')
1600
+ raise Exception(f'The "t" value ({str(float(t))}) is out of the time interval limits (min and max) [{str(float(time_interval.start_limit))}, {str(float(time_interval.end_limit))}].')
1478
1601
 
1479
1602
  def _validate_time_interval_current_limits(
1480
1603
  time_interval: TimeInterval,
@@ -1497,5 +1620,5 @@ def _validate_time_interval_current_limits(
1497
1620
  t < time_interval.start or
1498
1621
  t > time_interval.end
1499
1622
  ):
1500
- raise Exception(f'The "t" parameter value provided ({str(float(t))}) is out of the time interval current limits [{str(float(time_interval.start))}, {str(float(time_interval.end))}].')
1623
+ raise Exception(f'The "t" value ({str(float(t))}) is out of the time interval current limits [{str(float(time_interval.start))}, {str(float(time_interval.end))}].')
1501
1624
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yta-video-frame-time
3
- Version: 0.0.19
3
+ Version: 0.0.24
4
4
  Summary: Youtube Autonomous Video Frame Time Module
5
5
  License-File: LICENSE
6
6
  Author: danialcala94
@@ -0,0 +1,8 @@
1
+ yta_video_frame_time/__init__.py,sha256=-YOa7lOKdiA3FwDEHHU1tHobnmhjFpTaVLfJQLZqoMI,22252
2
+ yta_video_frame_time/decorators.py,sha256=FDdHvJEo93VyS7SIq6RhQ8pwKS7LMfa1MM4URDSD-yY,1453
3
+ yta_video_frame_time/interval.py,sha256=6QVDmukDpXhp4TEm_rbcMlcwC6HGYnjiDgoKr9DM8Tk,55427
4
+ yta_video_frame_time/t_fraction.py,sha256=YBOnH-Shs2YKSKFvm84EbFfvzXmg4AyNnyKd_hzF3Uk,29216
5
+ yta_video_frame_time-0.0.24.dist-info/licenses/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
6
+ yta_video_frame_time-0.0.24.dist-info/METADATA,sha256=EHaFnRbREkaCyMyqrEhkhvlpHzqBGMVMogEXMWhbBbk,538
7
+ yta_video_frame_time-0.0.24.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
8
+ yta_video_frame_time-0.0.24.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- yta_video_frame_time/__init__.py,sha256=-YOa7lOKdiA3FwDEHHU1tHobnmhjFpTaVLfJQLZqoMI,22252
2
- yta_video_frame_time/decorators.py,sha256=FDdHvJEo93VyS7SIq6RhQ8pwKS7LMfa1MM4URDSD-yY,1453
3
- yta_video_frame_time/interval.py,sha256=btFgrGbo5Yu5AOkUisUbpk_MgIvuuGR6OtyZhUWyhiY,51866
4
- yta_video_frame_time/t_fraction.py,sha256=YBOnH-Shs2YKSKFvm84EbFfvzXmg4AyNnyKd_hzF3Uk,29216
5
- yta_video_frame_time-0.0.19.dist-info/licenses/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
6
- yta_video_frame_time-0.0.19.dist-info/METADATA,sha256=FYmTe64MaTE3BhToFdpssl-c_zAuP5dRdfAYl3aKDx4,538
7
- yta_video_frame_time-0.0.19.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
8
- yta_video_frame_time-0.0.19.dist-info/RECORD,,