Skip to content
Merged
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 changes: 1 addition & 1 deletion backend/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from waitress import serve

from web import App
from backend.app import App

app = App()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
from classification.model import SleepStagesClassifier
from classification.features.preprocessing import preprocess

sleep_stage_classifier = SleepStagesClassifier()


class AnalyzeSleep:
def __init__(self):
self.sleep_stage_classifier = SleepStagesClassifier()

@staticmethod
def _validate_file(file_content):
if file_content is None:
Expand Down Expand Up @@ -72,7 +73,7 @@ def on_post(self, request, response):
return

preprocessed_epochs = preprocess(classification_request)
predictions = sleep_stage_classifier.predict(preprocessed_epochs, classification_request)
predictions = self.sleep_stage_classifier.predict(preprocessed_epochs, classification_request)
spectrogram_generator = SpectrogramGenerator(preprocessed_epochs)
classification_response = ClassificationResponse(
classification_request, predictions, spectrogram_generator.generate()
Expand Down
4 changes: 2 additions & 2 deletions backend/web/__init__.py → backend/backend/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import falcon

from web.ping import Ping
from web.analyze_sleep import AnalyzeSleep
from backend.ping import Ping
from backend.analyze_sleep import AnalyzeSleep


def App():
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion backend/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ source venv/bin/activate
If you want to run the backend with hot reload enabled (you must have installed the development requirements), run the following command.

```bash
hupper -m waitress app:app
hupper -m app
```

## Run the tests
Expand Down