Skip to content

Commit

Permalink
More Spring cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
olokobayusuf committed Aug 21, 2024
1 parent aee116a commit 7d61a88
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 385 deletions.
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.0.37
+ Added `fxn --explore` CLI action to explore predictions on [fxn.ai](https://fxn.ai/explore).

## 0.0.36
+ Added `Acceleration.Default` enumeration constant.
+ Added `Acceleration.GPU` enumeration constant for running predictions on the GPU.
Expand Down
14 changes: 10 additions & 4 deletions fxn/cli/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,24 @@

from ..version import __version__

def _learn_callback (value: bool):
def _explore (value: bool):
if value:
open_browser("https://fxn.ai/explore")
raise Exit()

def _learn (value: bool):
if value:
open_browser("https://docs.fxn.ai")
raise Exit()

def _version_callback (value: bool):
def _version (value: bool):
if value:
print(__version__)
raise Exit()

def cli_options (
learn: bool = Option(None, "--learn", callback=_learn_callback, help="Learn about Function."),
version: bool = Option(None, "--version", callback=_version_callback, help="Get the Function CLI version.")
explore: bool = Option(None, "--explore", callback=_explore, help="Explore predictors on Function."),
learn: bool = Option(None, "--learn", callback=_learn, help="Learn about Function."),
version: bool = Option(None, "--version", callback=_version, help="Get the Function CLI version.")
):
pass
15 changes: 5 additions & 10 deletions fxn/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from os import environ

from .api import GraphClient
from .services import EnvironmentVariableService, PredictionService, PredictorService, StorageService, UserService
from .services import PredictionService, PredictorService, UserService

class Function:
"""
Expand All @@ -26,16 +26,11 @@ class Function:
users: UserService
predictors: PredictorService
predictions: PredictionService
#environment_variables: EnvironmentVariableService
#storage: StorageService

def __init__ (self, access_key: str=None, api_url: str=None):
access_key = access_key or environ.get("FXN_ACCESS_KEY", None)
api_url = api_url or environ.get("FXN_API_URL", "https://api.fxn.ai")
client = GraphClient(access_key, api_url)
storage = StorageService(client)
self.client = client
self.users = UserService(client)
self.predictors = PredictorService(client, storage)
self.predictions = PredictionService(client)
#self.environment_variables = EnvironmentVariableService(self.client)
self.client = GraphClient(access_key, api_url)
self.users = UserService(self.client)
self.predictors = PredictorService(self.client)
self.predictions = PredictionService(self.client)
35 changes: 0 additions & 35 deletions fxn/magic.py

This file was deleted.

4 changes: 1 addition & 3 deletions fxn/services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@

from .user import UserService, PROFILE_FIELDS, USER_FIELDS
from .predictor import PredictorService, PREDICTOR_FIELDS
from .prediction import PredictionService, PREDICTION_FIELDS
from .environment import EnvironmentVariableService, ENVIRONMENT_VARIABLE_FIELDS
from .storage import StorageService
from .prediction import PredictionService, PREDICTION_FIELDS
111 changes: 0 additions & 111 deletions fxn/services/environment.py

This file was deleted.

4 changes: 1 addition & 3 deletions fxn/services/predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@

from ..api import GraphClient
from ..types import Predictor, PredictorStatus
from .storage import StorageService
from .user import PROFILE_FIELDS

class PredictorService:

def __init__ (self, client: GraphClient, storage: StorageService) -> None:
def __init__ (self, client: GraphClient) -> None:
self.client = client
self.storage = storage

def retrieve (self, tag: str) -> Predictor:
"""
Expand Down
Loading

0 comments on commit 7d61a88

Please sign in to comment.