removed voila and pytest-mypy pins

This commit is contained in:
Luis Aleixo 2023-04-19 15:57:01 +02:00
parent f6abd5f6fd
commit 997344fa5d
2 changed files with 8 additions and 14 deletions

View file

@ -319,7 +319,7 @@ class ModelWidgets(View):
])], title="Infected")
def _build_room_volume(self, node):
room_volume = widgets.IntText(value=node.volume, min=10, max=500, step=5)
room_volume = widgets.BoundedIntText(value=node.volume, min=10, max=500, step=5)
def on_volume_change(change):
node.volume = change['new']
@ -331,8 +331,8 @@ class ModelWidgets(View):
def _build_room_area(self, node):
room_surface = widgets.IntText(value=25, min=1, max=200, step=10)
room_ceiling_height = widgets.IntText(value=3, min=1, max=20, step=1)
room_surface = widgets.BoundedIntText(value=25, min=1, max=200, step=10)
room_ceiling_height = widgets.BoundedIntText(value=3.5, min=1, max=10, step=0.1)
displayed_volume=widgets.Label('75')
def on_room_surface_change(change):
@ -365,7 +365,6 @@ class ModelWidgets(View):
room_w = widgets.RadioButtons(
options= list(zip(['Volume', 'Room area and height'], room_widgets.keys())),
button_style='info',
layout=widgets.Layout(height='auto', width='auto'),
)
@ -452,7 +451,6 @@ class ModelWidgets(View):
window_w = widgets.RadioButtons(
options= list(zip(['Sliding window', 'Hinged window'], window_widgets.keys())),
button_style='info',
layout=widgets.Layout(height='auto', width='auto'),
)
@ -470,7 +468,7 @@ class ModelWidgets(View):
window_w.observe(lambda event: toggle_window(event['new']), 'value')
toggle_window(window_w.value)
number_of_windows= widgets.IntText(value= 1, min= 0, max= 5, step=1)
number_of_windows= widgets.BoundedIntText(value=1, min=1, max=10, step=1)
period = widgets.IntSlider(value=node.active.period, min=0, max=240)
interval = widgets.IntSlider(value=node.active.duration, min=0, max=240)
opening_length = widgets.FloatSlider(value=node.opening_length, min=0, max=3, step=0.1)
@ -581,9 +579,8 @@ class ModelWidgets(View):
for name, widget in mechanical_widgets.items():
widget.layout.visible = False
mechanival_w = widgets.RadioButtons(
mechanical_w = widgets.RadioButtons(
options=list(zip(['Air supply flow rate (m³/h)', 'Air changes per hour (h⁻¹)'], mechanical_widgets.keys())),
button_style='info',
)
def toggle_mechanical(value):
@ -811,7 +808,7 @@ class ModelWidgets(View):
break
virus_choice = widgets.Dropdown(options=list(models.Virus.types.keys()), value=name)
transmissibility_factor = widgets.FloatSlider(value=node.transmissibility_factor, min=0, max=1, step=0.1)
infectious_dose = widgets.FloatText(value=node.infectious_dose, placeholder='50', disabled=False)
infectious_dose = widgets.FloatText(value=node.infectious_dose, disabled=False)
def on_virus_change(change):
virus = models.Virus.types[change['new']]
@ -934,8 +931,6 @@ class CAIMIRAStateBuilder(state.StateBuilder):
class ExpertApplication(Controller):
def __init__(self) -> None:
self._debug_output = widgets.Output()
#: A list of scenario name and ModelState instances. This is intended to be
#: mutated. Any mutation should notify the appropriate Views for handling.
self._model_scenarios: typing.List[ScenarioType] = []
@ -946,7 +941,6 @@ class ExpertApplication(Controller):
self._results_tab = widgets.Tab(children=(
self.current_scenario_figure.widget,
self.comparison_view.widget,
# self._debug_output,
))
for i, title in enumerate(['Current scenario', 'Scenario comparison', "Debug"]):
self._results_tab.set_title(i, title)

View file

@ -37,12 +37,12 @@ REQUIREMENTS: dict = {
'timezonefinder',
'tornado',
'types-retry',
'voila <= 0.2.16',
'voila',
],
'app': [],
'test': [
'pytest',
'pytest-mypy != v0.10.1',
'pytest-mypy',
'mypy',
'pytest-tornasync',
'numpy-stubs @ git+https://github.com/numpy/numpy-stubs.git',