Commit 328c8d55 authored by Duggan, John's avatar Duggan, John
Browse files

Merge branch '31-add-enum-based-dropdown-options-to-episodes-5-7' into 'main'

Add Enum-based dropdown options to episodes 5 & 7

Closes #31

See merge request !37
parents f8e67157 f9e09972
Loading
Loading
Loading
Loading
Loading
+1369 −631

File changed.

Preview size limit exceeded, changes collapsed.

+9 −2
Original line number Diff line number Diff line
import os
from base64 import b64encode
from enum import Enum

from pydantic import BaseModel, Field
from nova.galaxy import Connection, Parameters, Tool


class FractalTypeOptions(str, Enum):
    mandelbrot = "mandelbrot"
    julia = "julia"
    random = "random"
    markus = "markus"


class Fractal(BaseModel):
    fractal_type_options: list[str] = ["mandelbrot", "julia", "random", "markus"]
    fractal_type: str = Field(default="mandelbrot")
    fractal_type: FractalTypeOptions = Field(default=FractalTypeOptions.mandelbrot)
    galaxy_url: str = Field(default_factory=lambda: os.getenv("GALAXY_URL"), description="NDIP Galaxy URL")
    galaxy_key: str = Field(default_factory=lambda: os.getenv("GALAXY_API_KEY"), description="NDIP Galaxy API Key")
    image_data: str = Field(default="", description="Base64 encoded PNG")
+1 −6
Original line number Diff line number Diff line
@@ -11,11 +11,6 @@ class FractalTab:
        self.create_ui()

    def create_ui(self) -> None:
        InputField(
            v_model="config.fractal.fractal_type",
            classes="mb-2",
            items="config.fractal.fractal_type_options",
            type="select",
        )
        InputField(v_model="config.fractal.fractal_type", classes="mb-2", type="select")
        vuetify.VProgressCircular(v_if="running", indeterminate=True)
        vuetify.VImg(v_else=True, src=("config.fractal.image_data",), height="400", width="400")
+1007 −701

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ packages = [
python = "^3.10"
nova-galaxy = "^0.7.0"
nova-mvvm = "0.9.0"
nova-trame = "0.14.0"
nova-trame = "0.16.0"
pandas = "^2.2.3"
plotly = "^5.24.1"
pyvista = "^0.44.2"
Loading