Skip to content
Open
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
2,164 changes: 0 additions & 2,164 deletions code/episode_2/poetry.lock

This file was deleted.

66 changes: 41 additions & 25 deletions code/episode_2/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,64 @@
[tool.poetry]
[project]
name = "nova-tutorial"
version = "0.1.0"
description = "Nova Tutorial Project"
authors = []
readme = "README.md"
license = "MIT"
keywords = ["NDIP", "NOVA", "python"]
requires-python = ">=3.10,<3.14"

packages = [
{ include = "nova_tutorial", from = "src" }
]
[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["linux-64", "osx-64"]

[tool.pixi.environments]
default = {features = ["dev"], solve-group = "default"}
production = {features = [], solve-group = "default"}

[tool.pixi.dependencies]

[tool.poetry.dependencies]
python = "^3.10"
[tool.pixi.pypi-dependencies]
nova-tutorial = { path = ".", editable = true }
hatch = "*"
gitpython = ">=3.1.40,<4"
python-gitlab = ">=5.6.0,<6"
nova-trame = "*"
trame-datagrid = ">=0.2.2"


[tool.pixi.feature.dev.pypi-dependencies]
mypy = ">=1.10.0"
pre-commit = ">=2.20.0"
coverage = ">=6.4.3"
pytest = "*"
ruff = ">=0.6.2"
copier=">=9.3"
sphinx = "*"
sphinx-rtd-theme = "*"
sphinxcontrib-napoleon ="*"
tomli = "*"

[tool.pixi.tasks]
app = "python -m src.nova_tutorial.app"
init-repo = "python -m scripts.git_utils"
deploy-production = "python -m scripts.xml_utils"
deploy-prototype = "python -m scripts.xml_utils_prototype"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["src/nova_tutorial"]

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test*.py"]
norecursedirs = [".git", "tmp*", "_tmp*", "__pycache__"]

[tool.ruff]
extend-exclude = [".pixi"]
line-length = 120

[tool.ruff.lint]
Expand All @@ -50,8 +83,6 @@ ignore = [
[tool.ruff.lint.extend-per-file-ignores]
'__init__.py' = ['D104'] # Missing docstring in public package



[tool.ruff.lint.pydocstyle]
convention = "numpy"

Expand All @@ -72,18 +103,3 @@ omit = [
[tool.coverage.run]
command_line = "-m pytest --junit-xml=reports/junit.xml"
data_file = "reports/.coverage"

[tool.poetry.dev-dependencies]
mypy = ">=1.10.0"
pre-commit = ">=2.20.0"
coverage = ">=6.4.3"
pytest = "*"
ruff = ">=0.6.2"
copier=">=9.3"
sphinx = "*"
sphinx-rtd-theme = "*"
sphinxcontrib-napoleon ="*"
tomli = "*"

[tool.poetry.scripts]
app = "nova_tutorial.app:main"
Empty file modified code/episode_2/src/nova_tutorial/__init__.py
100755 → 100644
Empty file.
Empty file modified code/episode_2/src/nova_tutorial/app/__init__.py
100755 → 100644
Empty file.
Empty file modified code/episode_2/src/nova_tutorial/app/__main__.py
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion code/episode_2/src/nova_tutorial/app/main.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

def main() -> None:
kwargs = {}
from .views.main import MainApp
from .views.main_view import MainApp

app = MainApp()
for arg in sys.argv[2:]:
Expand Down
Empty file modified code/episode_2/src/nova_tutorial/app/models/__init__.py
100755 → 100644
Empty file.
Empty file modified code/episode_2/src/nova_tutorial/app/models/main_model.py
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion code/episode_2/src/nova_tutorial/app/mvvm_factory.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from nova.mvvm.interface import BindingInterface

from .models.main_model import MainModel
from .view_models.main import MainViewModel
from .view_models.main_view_model import MainViewModel


def create_viewmodels(binding: BindingInterface) -> dict:
Expand Down
Empty file modified code/episode_2/src/nova_tutorial/app/view_models/__init__.py
100755 → 100644
Empty file.
30 changes: 0 additions & 30 deletions code/episode_2/src/nova_tutorial/app/view_models/main.py

This file was deleted.

Empty file modified code/episode_2/src/nova_tutorial/app/views/__init__.py
100755 → 100644
Empty file.
44 changes: 0 additions & 44 deletions code/episode_2/src/nova_tutorial/app/views/main.py

This file was deleted.

4 changes: 3 additions & 1 deletion code/episode_2/src/nova_tutorial/app/views/sample_tab_1.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Module for the Sample Tab 1."""

from nova.trame.view.components import InputField
from nova.trame.view.layouts import VBoxLayout


class SampleTab1:
Expand All @@ -10,4 +11,5 @@ def __init__(self) -> None:
self.create_ui()

def create_ui(self) -> None:
InputField(v_model="config.username")
with VBoxLayout():
InputField(v_model="config.username")
4 changes: 3 additions & 1 deletion code/episode_2/src/nova_tutorial/app/views/sample_tab_2.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Module for the Sample Tab 2."""

from nova.trame.view.components import InputField
from nova.trame.view.layouts import VBoxLayout


class SampleTab2:
Expand All @@ -10,4 +11,5 @@ def __init__(self) -> None:
self.create_ui()

def create_ui(self) -> None:
InputField(v_model="config.password")
with VBoxLayout():
InputField(v_model="config.password")
16 changes: 6 additions & 10 deletions code/episode_2/src/nova_tutorial/app/views/tab_content_panel.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Module for the Tab Content panel."""

from trame.widgets import vuetify3 as vuetify
from nova.trame.view.layouts import VBoxLayout
from trame_server import Server

from ..view_models.main import MainViewModel
from ..view_models.main_view_model import MainViewModel
from .sample_tab_1 import SampleTab1
from .sample_tab_2 import SampleTab2

Expand All @@ -18,11 +18,7 @@ def __init__(self, server: Server, view_model: MainViewModel) -> None:
self.create_ui()

def create_ui(self) -> None:
with vuetify.VForm(ref="form") as self.f:
with vuetify.VContainer(classes="pa-0", fluid=True):
with vuetify.VCard():
with vuetify.VWindow(v_model="active_tab"):
with vuetify.VWindowItem(value=1):
SampleTab1()
with vuetify.VWindowItem(value=2):
SampleTab2()
with VBoxLayout(v_show="view_state.active_tab == 0", stretch=True):
SampleTab1()
with VBoxLayout(v_show="view_state.active_tab == 1", stretch=True):
SampleTab2()
11 changes: 7 additions & 4 deletions code/episode_2/src/nova_tutorial/app/views/tabs_panel.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""Module for the Tab panel."""

from trame.widgets import client
from trame.widgets import vuetify3 as vuetify

from ..view_models.main import MainViewModel
from ..view_models.main_view_model import MainViewModel


class TabsPanel:
Expand All @@ -11,9 +12,11 @@ class TabsPanel:
def __init__(self, view_model: MainViewModel):
self.view_model = view_model
self.view_model.config_bind.connect("config")
self.view_model.view_state_bind.connect("view_state")
self.create_ui()

def create_ui(self) -> None:
with vuetify.VTabs(v_model=("active_tab", 0), classes="pl-5"):
vuetify.VTab("Sample Tab 1", value=1)
vuetify.VTab("Sample Tab 2", value=2)
with client.DeepReactive("view_state"):
with vuetify.VTabs(v_model="view_state.active_tab", classes="pl-5"):
vuetify.VTab("Sample Tab 1", value=0)
vuetify.VTab("Sample Tab 2", value=1)
Loading