Skip to content

Commit

Permalink
(PR #41) Redesign Aurora package structure
Browse files Browse the repository at this point in the history
This PR represents the first step of a redesign of package modules and their interoperability. Here, modules have been repackaged to better represent the upcoming redesign.

- Models were placed under the common module
- The experiment submission widget was renamed to ExperimentBuilder and moved to root under the experiment module
- Sample selection, protocol construction, and tomato settings widgets were added to the experiment module as submodule
- The manage samples widget was placed under a InventoryManager wrapper and moved to root under the inventory module
- The results visualizer widget was moved to root under the visualizer module
  • Loading branch information
edan-bainglass authored Jul 26, 2023
2 parents f96d8c6 + 12e4f0b commit 419a165
Show file tree
Hide file tree
Showing 29 changed files with 56 additions and 22 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions aurora/experiment/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .submit_experiment import ExperimentBuilder

__all__ = [
"ExperimentBuilder",
]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from aiida_aurora.schemas.utils import (dict_to_formatted_json,
remove_empties_from_dict_decorator)

from aurora.models.battery_experiment import BatteryExperimentModel
from aurora.common.models.battery_experiment import BatteryExperimentModel


class SampleFromId(ipw.VBox):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
from aiida_aurora.schemas.battery import BatterySample
from aiida_aurora.schemas.utils import dict_to_formatted_json

from aurora.common.models import AvailableSamplesModel, BatteryExperimentModel
from aurora.engine import submit_experiment
from aurora.interface.cycling import CyclingCustom, CyclingStandard
from aurora.interface.sample import (SampleFromId, SampleFromRecipe,
SampleFromSpecs)
from aurora.interface.tomato import TomatoSettings
from aurora.models import AvailableSamplesModel, BatteryExperimentModel

from .protocols import CyclingCustom, CyclingStandard
from .samples import SampleFromId, SampleFromRecipe, SampleFromSpecs
from .tomato import TomatoSettings

CODE_NAME = "ketchup-0.2rc2"

Expand Down
File renamed without changes.
File renamed without changes.
Empty file removed aurora/interface/__init__.py
Empty file.
9 changes: 0 additions & 9 deletions aurora/interface/menus/__init__.py

This file was deleted.

5 changes: 5 additions & 0 deletions aurora/inventory/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .manager import InventoryManager

__all__ = [
"InventoryManager",
]
22 changes: 22 additions & 0 deletions aurora/inventory/manager.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import ipywidgets as ipw

from .samples import ManageSamplesMenu


class InventoryManager(ipw.VBox):
"""
An inventory manager of experiment components. Includes managing
samples, groups, specs, and protocols.
"""

def __init__(self) -> None:
"""docstring"""

samples_manager = ManageSamplesMenu()

super().__init__(
layout={},
children=[
samples_manager,
],
)
5 changes: 5 additions & 0 deletions aurora/inventory/samples/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .manage_samples import ManageSamplesMenu

__all__ = [
"ManageSamplesMenu",
]
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import ipywidgets as ipw
from ipyfilechooser import FileChooser

from aurora.interface.sample.sample_filter import SampleFilterWidget
from aurora.models import AvailableSamplesModel, BatteryExperimentModel
from aurora.common.models import AvailableSamplesModel, BatteryExperimentModel

from .sample_filter import SampleFilterWidget


class ManageSamplesMenu(ipw.VBox):
Expand Down
File renamed without changes.
7 changes: 4 additions & 3 deletions aurora/main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import ipywidgets as ipw

from aurora import __version__
from aurora.interface.menus import (CyclingResultsWidget, ExperimentBuilder,
ManageSamplesMenu)
from aurora.experiment import ExperimentBuilder
from aurora.inventory import InventoryManager
from aurora.results import CyclingResultsWidget


class MainPanel(ipw.VBox):
Expand Down Expand Up @@ -59,7 +60,7 @@ def _build_tabs(self) -> ipw.Tab:
"""

experiment = ExperimentBuilder()
manager = ManageSamplesMenu()
manager = InventoryManager()
visualizer = CyclingResultsWidget()

tabs = ipw.Tab(
Expand Down
5 changes: 5 additions & 0 deletions aurora/results/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .visualize_results import CyclingResultsWidget

__all__ = [
"CyclingResultsWidget",
]
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import ipywidgets as ipw

from aurora.interface.analyze import (OutputExplorerComponent,
ResultsPlotterComponent)
from .analyze import OutputExplorerComponent, ResultsPlotterComponent


class CyclingResultsWidget(ipw.VBox):
Expand Down

0 comments on commit 419a165

Please sign in to comment.