Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,35 +244,6 @@ Add multiple metric data points to the database.

Return a list of metrics that had at least one transition in the given [`start_at`, `end_at`) interval. All metrics are returned if no `start_at` and `end_at` are given.

## `get_modeling_metrics(?start_at, ?end_at)`

Fetch modeling metrics from the modeling database. This method returns a list of available modeling metrics that had transitions in the specified time range.

- `start_at`: Optional start date for the query range (uses class default if not specified)
- `end_at`: Optional end date for the query range (uses class default if not specified)

Returns a list of `Metric` objects containing modeling metrics.

## `get_modeling_metrics_data(?names, ?start_at, ?end_at)`

Fetch actual data values from modeling metrics within a time range. This method returns the actual data points (values) for the specified modeling metrics, similar to `get_metric_data()` but for the modeling database.

- `names`: Optional list of modeling metric names to filter by
- `start_at`: Optional start time for the query (uses class default if not specified)
- `end_at`: Optional end time for the query (uses class default if not specified)

Returns a list of `MetricDataPoint` objects containing the actual data values.

## `get_modeling_metrics_data_arrow(?names, ?start_at, ?end_at)`

Fetch actual data values from modeling metrics within a time range in Apache Arrow format. This method returns the actual data points (values) for the specified modeling metrics in Arrow IPC format, which is more efficient for large datasets.

- `names`: Optional list of modeling metric names to filter by
- `start_at`: Optional start time for the query (uses class default if not specified)
- `end_at`: Optional end time for the query (uses class default if not specified)

Returns Arrow IPC format data that can be read using `pyarrow.ipc.open_file()`.

## `get_eav_tables()`

Get all EAV (Entity-Attribute-Value) tables for the tenant. EAV tables store semi-structured data where each row represents an entity with flexible attributes.
Expand Down
26 changes: 0 additions & 26 deletions examples/get_modeling_metrics_data_arrow_example.py

This file was deleted.

33 changes: 0 additions & 33 deletions examples/get_modeling_metrics_data_example.py

This file was deleted.

18 changes: 0 additions & 18 deletions examples/get_modeling_metrics_example.py

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "cvec"
version = "1.5.3"
version = "2.0.0"
description = "SDK for CVector Energy"
authors = [{ name = "CVector", email = "support@cvector.energy" }]
readme = "README.md"
Expand Down
91 changes: 0 additions & 91 deletions src/cvec/cvec.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,97 +405,6 @@ def add_metric_data(
]
self._make_request("POST", endpoint, json_data=data_dicts) # type: ignore[arg-type]

def get_modeling_metrics(
self,
start_at: Optional[datetime] = None,
end_at: Optional[datetime] = None,
) -> List[Metric]:
"""
Return a list of modeling metrics that had at least one transition in the given [start_at, end_at) interval.
All metrics are returned if no start_at and end_at are given.

Args:
start_at: Optional start time for the query (uses class default if not specified)
end_at: Optional end time for the query (uses class default if not specified)

Returns:
List of Metric objects containing modeling metrics
"""
_start_at = start_at or self.default_start_at
_end_at = end_at or self.default_end_at

params: Dict[str, Any] = {
"start_at": _start_at.isoformat() if _start_at else None,
"end_at": _end_at.isoformat() if _end_at else None,
}

response_data = self._make_request(
"GET", "/api/modeling/metrics", params=params
)
return [Metric.model_validate(metric_data) for metric_data in response_data]

def get_modeling_metrics_data(
self,
names: Optional[List[str]] = None,
start_at: Optional[datetime] = None,
end_at: Optional[datetime] = None,
) -> List[MetricDataPoint]:
"""
Return all data-points within a given [start_at, end_at) interval,
optionally selecting a given list of modeling metric names.
Returns a list of MetricDataPoint objects, one for each metric value transition.

Args:
names: Optional list of modeling metric names to filter by
start_at: Optional start time for the query
end_at: Optional end time for the query
"""
_start_at = start_at or self.default_start_at
_end_at = end_at or self.default_end_at

params: Dict[str, Any] = {
"start_at": _start_at.isoformat() if _start_at else None,
"end_at": _end_at.isoformat() if _end_at else None,
"names": ",".join(names) if names else None,
}

response_data = self._make_request(
"GET", "/api/modeling/metrics/data", params=params
)
return [
MetricDataPoint.model_validate(point_data) for point_data in response_data
]

def get_modeling_metrics_data_arrow(
self,
names: Optional[List[str]] = None,
start_at: Optional[datetime] = None,
end_at: Optional[datetime] = None,
) -> bytes:
"""
Return all data-points within a given [start_at, end_at) interval,
optionally selecting a given list of modeling metric names.
Returns Arrow IPC format data that can be read using pyarrow.ipc.open_file.

Args:
names: Optional list of modeling metric names to filter by
start_at: Optional start time for the query
end_at: Optional end time for the query
"""
_start_at = start_at or self.default_start_at
_end_at = end_at or self.default_end_at

params: Dict[str, Any] = {
"start_at": _start_at.isoformat() if _start_at else None,
"end_at": _end_at.isoformat() if _end_at else None,
"names": ",".join(names) if names else None,
}

endpoint = "/api/modeling/metrics/data/arrow"
result = self._make_request("GET", endpoint, params=params)
assert isinstance(result, bytes)
return result

def add_agent_post(
self,
title: str,
Expand Down
163 changes: 0 additions & 163 deletions tests/test_modeling.py

This file was deleted.

2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.