Merge branch 'feature/signature_type' into 'master'

Added return type for functions that have variable annotations

See merge request cara/caimira!413
This commit is contained in:
Luis Aleixo 2022-11-21 17:11:20 +01:00
commit b836f608cc
4 changed files with 6 additions and 6 deletions

View file

@ -92,7 +92,7 @@ class Missing404Handler(BaseRequestHandler):
class ConcentrationModel(BaseRequestHandler): class ConcentrationModel(BaseRequestHandler):
async def post(self): async def post(self) -> None:
requested_model_config = { requested_model_config = {
name: self.get_argument(name) for name in self.request.arguments name: self.get_argument(name) for name in self.request.arguments
} }
@ -137,7 +137,7 @@ class ConcentrationModelJsonResponse(BaseRequestHandler):
""" """
pass pass
async def post(self): async def post(self) -> None:
""" """
Expects algorithm input in HTTP POST request body in JSON format. Expects algorithm input in HTTP POST request body in JSON format.
Returns report data (algorithm output) in HTTP POST response body in JSON format. Returns report data (algorithm output) in HTTP POST response body in JSON format.
@ -168,7 +168,7 @@ class ConcentrationModelJsonResponse(BaseRequestHandler):
class StaticModel(BaseRequestHandler): class StaticModel(BaseRequestHandler):
async def get(self): async def get(self) -> None:
form = model_generator.FormData.from_dict(model_generator.baseline_raw_form_data()) form = model_generator.FormData.from_dict(model_generator.baseline_raw_form_data())
base_url = self.request.protocol + "://" + self.request.host base_url = self.request.protocol + "://" + self.request.host
report_generator: ReportGenerator = self.settings['report_generator'] report_generator: ReportGenerator = self.settings['report_generator']

View file

@ -901,7 +901,7 @@ class CAIMIRAStateBuilder(state.StateBuilder):
class ExpertApplication(Controller): class ExpertApplication(Controller):
def __init__(self): def __init__(self) -> None:
self._debug_output = widgets.Output() self._debug_output = widgets.Output()
#: A list of scenario name and ModelState instances. This is intended to be #: A list of scenario name and ModelState instances. This is intended to be

View file

@ -53,7 +53,7 @@ class DataclassState(typing.Generic[Datamodel_T]):
yield yield
object.__setattr__(self, '_use_base_setattr', False) object.__setattr__(self, '_use_base_setattr', False)
def dcs_instance(self) -> Datamodel_T: def dcs_instance(self) -> typing.Union[None, Datamodel_T]:
""" """
Return the instance that this state represents. The instance returned Return the instance that this state represents. The instance returned
is immutable, so it is advised to call this method each time that is immutable, so it is advised to call this method each time that

View file

@ -11,7 +11,7 @@ from caimira.apps.calculator.report_generator import ReportGenerator, readable_m
import caimira.apps.calculator.report_generator as rep_gen import caimira.apps.calculator.report_generator as rep_gen
def test_generate_report(baseline_form): def test_generate_report(baseline_form) -> None:
# This is a simple test that confirms that given a model, we can actually # This is a simple test that confirms that given a model, we can actually
# generate a report for it. Because this is what happens in the caimira # generate a report for it. Because this is what happens in the caimira
# calculator, we confirm that the generation happens within a reasonable # calculator, we confirm that the generation happens within a reasonable