yta-video-frame-time 0.0.11__py3-none-any.whl → 0.0.12__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.

Potentially problematic release.


This version of yta-video-frame-time might be problematic. Click here for more details.

@@ -382,7 +382,7 @@ class _T:
382
382
  def truncated(
383
383
  self,
384
384
  t: Union[int, float, Fraction]
385
- ):
385
+ ) -> Fraction:
386
386
  """
387
387
  Get the 't' value provided but truncated.
388
388
 
@@ -392,10 +392,26 @@ class _T:
392
392
  """
393
393
  return round_t(t, Fraction(1, self._t_handler.fps), do_truncate = True)
394
394
 
395
+ def is_truncated(
396
+ self,
397
+ t: Union[int, float, Fraction]
398
+ ) -> bool:
399
+ """
400
+ Check if the `t` value provided is the truncated
401
+ value, which means that the `t` provided is the
402
+ `start` from the `[start, end)` range defined by
403
+ the fps.
404
+ """
405
+ return check_values_are_same(
406
+ value_a = t,
407
+ value_b = self.truncated(t),
408
+ tolerance = 0.000001
409
+ )
410
+
395
411
  def rounded(
396
412
  self,
397
413
  t: Union[int, float, Fraction]
398
- ):
414
+ ) -> Fraction:
399
415
  """
400
416
  Get the 't' value provided but rounded.
401
417
 
@@ -882,3 +898,17 @@ def parse_fraction(
882
898
 
883
899
  return fraction
884
900
 
901
+ def check_values_are_same(
902
+ value_a: Union[Fraction, float],
903
+ value_b: Union[Fraction, float],
904
+ tolerance: float = 1e-6
905
+ ) -> bool:
906
+ """
907
+ Check that the `value_a` and the `value_b` are the same
908
+ by applying the `tolerance` value, that is 0.000001 by
909
+ default.
910
+
911
+ For example, `0.016666666666666666` is the same value as
912
+ `1/60` with `tolerance=0.000001`.
913
+ """
914
+ return abs(float(value_a) - float(value_b)) < tolerance
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yta-video-frame-time
3
- Version: 0.0.11
3
+ Version: 0.0.12
4
4
  Summary: Youtube Autonomous Video Frame Time Module
5
5
  License-File: LICENSE
6
6
  Author: danialcala94
@@ -0,0 +1,6 @@
1
+ yta_video_frame_time/__init__.py,sha256=-YOa7lOKdiA3FwDEHHU1tHobnmhjFpTaVLfJQLZqoMI,22252
2
+ yta_video_frame_time/t_fraction.py,sha256=VrXKyRiSWno6ZJTI9sLd49d3uL9RFskXTNX6EtfnJQ4,24999
3
+ yta_video_frame_time-0.0.12.dist-info/licenses/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
4
+ yta_video_frame_time-0.0.12.dist-info/METADATA,sha256=-EszFRvNG1VatErNy6v0AWQKMv7g-LNrjB7VepR37Yc,538
5
+ yta_video_frame_time-0.0.12.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
6
+ yta_video_frame_time-0.0.12.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- yta_video_frame_time/__init__.py,sha256=-YOa7lOKdiA3FwDEHHU1tHobnmhjFpTaVLfJQLZqoMI,22252
2
- yta_video_frame_time/t_fraction.py,sha256=lH-rDL2ydoEZhrkgjNMiJpzL5dCy7FanLbTae79Pw1c,24045
3
- yta_video_frame_time-0.0.11.dist-info/licenses/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
4
- yta_video_frame_time-0.0.11.dist-info/METADATA,sha256=kxUqsrB1BwSwQMEc0dx_Bce5B85h7R5wyOWIE2q7vNo,538
5
- yta_video_frame_time-0.0.11.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
6
- yta_video_frame_time-0.0.11.dist-info/RECORD,,