mayutils 1.2.30__tar.gz → 1.2.32__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.
- {mayutils-1.2.30 → mayutils-1.2.32}/PKG-INFO +1 -1
- {mayutils-1.2.30 → mayutils-1.2.32}/pyproject.toml +1 -1
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/objects/dataframes.py +38 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/visualisation/graphs/plotly/charts.py +19 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/LICENSE +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/README.md +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/__init__.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/core/__init__.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/core/constants.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/data/__init__.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/data/analysis/__init__.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/data/cache/.gitkeep +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/data/live.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/data/local.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/data/queries/.gitkeep +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/data/queries/__init__.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/data/queries/examples/.gitkeep +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/data/read.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/environment/__init__.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/environment/benchmarking.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/environment/databases.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/environment/filesystem.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/environment/logging.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/environment/memoisation.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/environment/oauth.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/environment/secrets.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/environment/webdrivers.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/export/__init__.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/export/images.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/export/pdf.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/export/slides.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/interfaces/__init__.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/interfaces/google.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/interfaces/microsoft.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/interfaces/streamlit.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/mathematics/__init__.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/mathematics/numba.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/mathematics/numpy.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/objects/__init__.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/objects/classes.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/objects/colours.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/objects/datetime.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/objects/decorators.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/objects/dictionaries.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/objects/functions.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/objects/hashing.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/objects/numbers.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/objects/strings.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/objects/types.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/py.typed +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/scripts/__init__.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/scripts/clear_cache.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/scripts/versioning.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/testing/__init__.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/visualisation/__init__.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/visualisation/console.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/visualisation/graphs/__init__.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/visualisation/graphs/combine.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/visualisation/graphs/matplotlib/__init__.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/visualisation/graphs/matplotlib/template.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/visualisation/graphs/plotly/__init__.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/visualisation/graphs/plotly/templates.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/visualisation/graphs/plotly/traces.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/visualisation/graphs/plotly/utilities.py +0 -0
- {mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/visualisation/notebook.py +0 -0
|
@@ -27,6 +27,7 @@ from dataframe_image._pandas_accessor import (
|
|
|
27
27
|
)
|
|
28
28
|
import polars as pl
|
|
29
29
|
import numpy as np
|
|
30
|
+
from mayutils.objects.datetime import Interval
|
|
30
31
|
from mayutils.objects.colours import Colour
|
|
31
32
|
from mayutils.export import OUTPUT_FOLDER
|
|
32
33
|
|
|
@@ -411,6 +412,25 @@ class DataframeUtilsAccessor(object):
|
|
|
411
412
|
|
|
412
413
|
return self.df
|
|
413
414
|
|
|
415
|
+
def ground(
|
|
416
|
+
self,
|
|
417
|
+
interval: Optional[Interval] = None,
|
|
418
|
+
) -> DataFrame:
|
|
419
|
+
if interval is None:
|
|
420
|
+
return self.df
|
|
421
|
+
|
|
422
|
+
raise NotImplementedError("Grounding not implemented for DataFrames yet")
|
|
423
|
+
# if self.df.index.inferred_type == "datetime":
|
|
424
|
+
# grounding_value = self.df.loc[interval.as_slice].mean()
|
|
425
|
+
# elif self.df.index.inferred_type == "date":
|
|
426
|
+
# grounding_value = self.df.loc[interval.as_date_slice].mean()
|
|
427
|
+
# else:
|
|
428
|
+
# raise TypeError("Series index must be datetime or date type for grounding")
|
|
429
|
+
|
|
430
|
+
# grounded_series = self.series.div(grounding_value)
|
|
431
|
+
|
|
432
|
+
# return grounded_series
|
|
433
|
+
|
|
414
434
|
|
|
415
435
|
class SeriesUtilsAccessor(object):
|
|
416
436
|
def __init__(
|
|
@@ -428,6 +448,24 @@ class SeriesUtilsAccessor(object):
|
|
|
428
448
|
"Not implemented for series yet: leverage existing df methods"
|
|
429
449
|
)
|
|
430
450
|
|
|
451
|
+
def ground(
|
|
452
|
+
self,
|
|
453
|
+
interval: Optional[Interval] = None,
|
|
454
|
+
) -> Series:
|
|
455
|
+
if interval is None:
|
|
456
|
+
return self.series
|
|
457
|
+
|
|
458
|
+
if self.series.index.inferred_type == "datetime":
|
|
459
|
+
grounding_value = self.series.loc[interval.as_slice].mean()
|
|
460
|
+
elif self.series.index.inferred_type == "date":
|
|
461
|
+
grounding_value = self.series.loc[interval.as_date_slice].mean()
|
|
462
|
+
else:
|
|
463
|
+
raise TypeError("Series index must be datetime or date type for grounding")
|
|
464
|
+
|
|
465
|
+
grounded_series = self.series.div(grounding_value)
|
|
466
|
+
|
|
467
|
+
return grounded_series
|
|
468
|
+
|
|
431
469
|
|
|
432
470
|
class IndexUtilsAccessor(object):
|
|
433
471
|
def __init__(
|
|
@@ -14,6 +14,7 @@ from plotly._subplots import _build_subplot_title_annotations
|
|
|
14
14
|
|
|
15
15
|
from mayutils.objects.colours import TRANSPARENT, Colour
|
|
16
16
|
|
|
17
|
+
from mayutils.objects.datetime import Interval
|
|
17
18
|
from mayutils.objects.functions import set_inline
|
|
18
19
|
|
|
19
20
|
from mayutils.visualisation.graphs.plotly.templates import (
|
|
@@ -1276,6 +1277,24 @@ class Plot(go.Figure):
|
|
|
1276
1277
|
|
|
1277
1278
|
return self
|
|
1278
1279
|
|
|
1280
|
+
def add_interval(
|
|
1281
|
+
self,
|
|
1282
|
+
interval: Optional[Interval],
|
|
1283
|
+
**kwargs,
|
|
1284
|
+
) -> Self:
|
|
1285
|
+
if interval is None:
|
|
1286
|
+
return self
|
|
1287
|
+
|
|
1288
|
+
kwargs = {"line_width": 0, "opacity": 0.1} | kwargs
|
|
1289
|
+
|
|
1290
|
+
self.add_vrect(
|
|
1291
|
+
x0=interval.start.simple,
|
|
1292
|
+
x1=interval.end.simple,
|
|
1293
|
+
**kwargs,
|
|
1294
|
+
)
|
|
1295
|
+
|
|
1296
|
+
return self
|
|
1297
|
+
|
|
1279
1298
|
def __call__(
|
|
1280
1299
|
self,
|
|
1281
1300
|
save: bool = True,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/visualisation/graphs/matplotlib/__init__.py
RENAMED
|
File without changes
|
{mayutils-1.2.30 → mayutils-1.2.32}/src/mayutils/visualisation/graphs/matplotlib/template.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|