Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty appointments bug fix #153

Merged
merged 8 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [1.5.1] - 2024-12-23

### Added
- Error warmings incase no appointments are provided


## [1.5.0] - 2024-12-10

Expand Down
2 changes: 2 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ do
fi
done

export SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt

read -p "What do you want to deploy? Options: 'admin-dash'/1 ; 'calling-dash'/2 ; 'calling-dash-test'/3 ; 'api'/4 ; 'api-test'/5 " APPLICATION
APPLICATION=${APPLICATION:-N}

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "noshow"
version = "1.5.0"
version = "1.5.1"
authors = [
{ name="Ruben Peters", email="[email protected]" },
{ name="Eric Wolters", email="[email protected]" }
Expand Down
8 changes: 8 additions & 0 deletions src/noshow/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,18 @@ async def predict(
project_path = Path(__file__).parents[3]
start_time = datetime.now()

if len(input) == 0:
logger.error("No appointments provided")
return [{}]

input_df = load_appointment_pydantic(input)
appointments_df = process_appointments(input_df, CLINIC_CONFIG, start_date)
all_postalcodes = process_postal_codes(project_path / "data" / "raw" / "NL.txt")

if appointments_df.empty:
logger.error("No appointments for the given start date and filters")
return [{}]

model = load_model()
prediction_df = create_prediction(
model,
Expand Down
Loading