Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
henhuy committed Dec 3, 2024
2 parents 71e4c30 + a794e24 commit fe154b5
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.bumpversion]
current_version = "2.5.0"
current_version = "2.5.1"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project tries to adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.5.1] - 2024-12-03
### Changed
- removed MODEX source for uploads

### Fixed
- CSV upload

## [2.5.0] - 2024-12-03
### Added
- databus source to import SEDOS results from databus
Expand Down
2 changes: 1 addition & 1 deletion django_comparison_dashboard/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pathlib
from enum import IntEnum

VERSION = "2.5.0"
VERSION = "2.5.1"

USE_DUMMY_DATA = os.environ.get("USE_DUMMY_DATA", "False") == "True"
SKIP_TS = os.environ.get("SKIP_TS", "False") == "True"
Expand Down
2 changes: 0 additions & 2 deletions django_comparison_dashboard/sources/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from .core import SourceRegistry
from .csv import CSVDataSource
from .databus import DatabusDataSource
from .modex import ModexDataSource

SOURCES = SourceRegistry()
SOURCES.register(ModexDataSource)
SOURCES.register(CSVDataSource)
SOURCES.register(DatabusDataSource)
11 changes: 8 additions & 3 deletions django_comparison_dashboard/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from io import StringIO

from django.forms.formsets import formset_factory
from django.http.response import HttpResponse
from django.shortcuts import render
Expand Down Expand Up @@ -83,7 +84,7 @@ def get_chart_and_table_from_request(request, as_html=True) -> tuple:
chart = chart_function(df, graph_filter_set)
if as_html:
table = df.to_html()
chart = chart.to_html(config = {'toImageButtonOptions': {'format': 'svg'}})
chart = chart.to_html(config={"toImageButtonOptions": {"format": "svg"}})
else:
table = df
return chart, table
Expand Down Expand Up @@ -283,7 +284,11 @@ def get_source(self):

def get_form_class(self):
form = self.get_source().form
if scenario_list := self.get_source().list_scenarios():
try:
scenario_list = self.get_source().list_scenarios()
except NotImplementedError:
scenario_list = []
if scenario_list:
form.base_fields["scenario_id"].choices = [(scenario.id, scenario.id) for scenario in scenario_list]
return form

Expand All @@ -293,4 +298,4 @@ def form_valid(self, form):
if models.Result.objects.filter(source__name=source.name, name=scenario.id).exists():
return HttpResponse("Scenario already present in database.")
scenario.download()
return HttpResponse(f"Uploaded scenario '{scenario}'.")
return HttpResponse(f"Uploaded scenario '{scenario}'.")
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "django-comparison-dashboard"
version = "2.5.0"
version = "2.5.1"
description = "Django app to compare scenarios in a dashboard"
authors = ["Hendrik Huyskens <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit fe154b5

Please sign in to comment.