Skip to content

Commit

Permalink
setting up the initial class documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
brifordwylie committed Dec 24, 2023
1 parent 821c967 commit 7887b07
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
python-version: '3.x'

- name: Install dependencies
run: pip install mkdocs mkdocs-material
run: pip install mkdocs mkdocs-material mkdocstrings mkdocstrings-python

- name: Build the MkDocs site
run: mkdocs build
Expand Down
4 changes: 0 additions & 4 deletions docs/README.md

This file was deleted.

File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions docs/sageworks_classes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SageWorks API Classes

::: sageworks.api
6 changes: 6 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
site_name: SageWorks
theme:
name: material
plugins:
- search
- mkdocstrings:
handlers:
python:
paths: [src]
10 changes: 10 additions & 0 deletions src/sageworks/api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Welcome to the sageworks.api module.
This module provides high-level APIs for the SageWorks package, offering easy access to its core classes: data_source, feature_set, model, and endpoint.
"""
from .data_source import DataSource
from .feature_set import FeatureSet
from .model import Model
from .endpoint import Endpoint

__all__ = ["DataSource", "FeatureSet", "Model", "Endpoint"]
30 changes: 19 additions & 11 deletions src/sageworks/api/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,24 @@
class DataSource(AthenaSource):
"""DataSource: SageWorks DataSource API Class
Common Usage:
**Common Usage:**
```
my_data = DataSource(name_of_source)
my_data.summary()
my_data.details()
my_data.to_features()
my_features = my_data.to_features()
```
"""

def __init__(self, source, name: str = None, tags: list = None):
"""DataSource Initialization
"""
Initializes a new DataSource object.
Args:
source (str): The source of the data (S3, File, Dataframe or Existing DataSource)
name (str): Set the name of the data source (optional)
tags (list): Set the tags for the data source (optional)
source (str): The source of the data. This can be an S3 bucket, file path,
DataFrame object, or an existing DataSource object.
name (str): The name of the data source. If not specified, an automatic name will be generated.
tags (list of str): A list of tags associated with the data source. If not specified automatic tags will be generated.
"""
self.log = logging.getLogger("sageworks")

Expand All @@ -47,12 +52,15 @@ def __init__(self, source, name: str = None, tags: list = None):
def to_features(
self, name: str = None, tags: list = None, id_column: str = None, event_time_column: str = None
) -> FeatureSet:
"""Convert the DataSource to a FeatureSet
"""
Convert the DataSource to a FeatureSet
Args:
name (str): Set the name for feature set (optional)
tags (list): Set the tags for the feature set (optional)
id_column (str): Set the id column for the feature set (optional)
event_time_column (str): Set the event time column for the feature set (optional)
name (str): Set the name for feature set. If not specified, an automatic name will be generated
tags (list): Set the tags for the feature set. If not specified automatic tags will be generated.
id_column (str): Set the id column for the feature set. If not specified one will be generated.
event_time_column (str): Set the event time column for the feature set. If not specified one will be generated.
Returns:
FeatureSet: The FeatureSet created from the DataSource
"""
Expand Down
2 changes: 1 addition & 1 deletion src/sageworks/api/feature_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class FeatureSet(FeatureSetCore):
"""FeatureSet: SageWorks FeatureSet API Class
Common Usage:
Common Usage
my_features = FeatureSet(name)
my_features.summary()
my_features.details()
Expand Down

0 comments on commit 7887b07

Please sign in to comment.