Skip to content

Commit

Permalink
Merge pull request #1869 from OpenEnergyPlatform/release-v1.0.2
Browse files Browse the repository at this point in the history
Release v1.0.2
  • Loading branch information
jh-RLI authored Sep 24, 2024
2 parents 31dfb91 + f0ff6bd commit b311716
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.0.1
current_version = 1.0.2

[bumpversion:file:VERSION]

Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ authors:
title: "Open Energy Family - Open Energy Platform (OEP)"
type: software
license: AGPL-3.0-or-later
version: 1.0.1
version: 1.0.2
doi:
date-released: 2024-09-23
date-released: 2024-09-24
url: "https://github.com/OpenEnergyPlatform/oeplatform/"
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.1
1.0.2
2 changes: 2 additions & 0 deletions api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
StreamingHttpResponse,
)
from django.utils import timezone
from django.views.decorators.cache import never_cache
from omi.dialects.oep.compiler import JSONCompiler
from omi.structure import OEPMetadata
from rest_framework import generics, status
Expand Down Expand Up @@ -276,6 +277,7 @@ def __create_sequence(self, request, schema, sequence, jsn):

class Metadata(APIView):
@api_exception
@never_cache
def get(self, request, schema, table):
metadata = actions.get_table_metadata(schema, table)
return JsonResponse(metadata)
Expand Down
53 changes: 37 additions & 16 deletions dataedit/templates/dataedit/table_permissions.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,29 +178,50 @@ <h4>User Permissions</h4>
let validSelection = false;
let autocompleteSource = []; // This will be filled with your autocomplete data

$('#user_field').bind('input', function() {
var dfd = new $.Deferred();
var request = $.ajax({type: 'GET',
url:'/api/usrprop/', dataType:'json',
data: {
name: $(this).val()
}
});
request.done(function(users)
{
console.log(users);
$('#user_field').autocomplete({
source: users
// $('#user_field').bind('input', function() {
// var dfd = new $.Deferred();
// var request = $.ajax({type: 'GET',
// url:'/api/usrprop/', dataType:'json',
// data: {
// name: $(this).val()
// },
// success: function(data) {
// autocompleteSource = data; // Assuming 'data' is an array of strings
// }
// });
// request.done(function(users)
// {
// console.log(users);
// $('#user_field').autocomplete({
// source: users
// });
// dfd.resolve({})
// });
// });

$('#user_field').autocomplete({
source: function(request, response) {
$.ajax({
url: '/api/usrprop/',
dataType: 'json',
data: { name: request.term },
success: function(data) {
autocompleteSource = data; // Assuming 'data' is an array of strings
response(data);
}
});
dfd.resolve({})
});
},
select: function(event, ui) {
validSelection = true;
}
});

$('#addUserForm').on('submit', function(e) {
var inputValue = $('#user_field').val();
console.log(autocompleteSource, inputValue);
if (!validSelection || !autocompleteSource.includes(inputValue)) {
e.preventDefault(); // Prevent form submission
alert('Please select a valid group name from the list that appears after you start typing.');
alert('Please select a valid user name from the list that appears after you start typing.');
}
});
});
Expand Down
30 changes: 19 additions & 11 deletions factsheet/frontend/src/components/comparisonBoardMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const ComparisonBoardMain = (props) => {
const [selectedCategories, setSelectedCategories] = React.useState([]);
const [selectedGas, setSelectedGas] = React.useState([]);
const [selectedScenarios, setSelectedScenarios] = React.useState([]);
const [visualizationRows, addVisualizationRows] = React.useState(0);
const [visualizationRows, addVisualizationRows] = React.useState(1);
const [inputTableNames, setInputTableNames] = React.useState([]);
const [outputTableNames, setoutputTableNames] = React.useState([]);
const [selectedInputDatasets, setSelectedInputDatasets] = React.useState([]);
Expand Down Expand Up @@ -1197,12 +1197,17 @@ const sendQuery = async (index) => {

<Grid container spacing={2}>
<Grid item lg={6} sx={{ borderLeft: variables.border.light, px: 2 }}>
<Chip label="Early Access" color="error" />

<Alert severity="warning">
<Chip label="Early Access" color="error" />
<p>
The quantitative scenario projection comparison below is an early access research prototype and serves illustration purposes:
It shows for selected <a href="https://openenergyplatform.org/scenario-bundles/id/6ddf7ede-c3a5-93c8-4385-b975c628d610" target="_blank" rel="noopener noreferrer">case study tables</a>
how projection data can in principle be automatically compared on the Open Energy Platform. It is a proof of concept.
It shows for selected <a href="https://openenergyplatform.org/scenario-bundles/id/6ddf7ede-c3a5-93c8-4385-b975c628d610" target="_blank" rel="noopener noreferrer">
case study tables</a> how projection data can in principle be automatically compared on the Open Energy Platform. It is a proof of concept.
</p>
<p>
Please keep in mind that the resulting visualization is still in a beta phase and may contain some minor errors. However, we are
working actively to improve it. We aim to make it more robust in the near future.
</p>
</Alert>
</Grid>
Expand All @@ -1213,12 +1218,15 @@ const sendQuery = async (index) => {
enables this comparison, based on the <a href="https://github.com/OpenEnergyPlatform/ontology" target="_blank" rel="noopener noreferrer">
ontological annotation</a> of the <a href="https://github.com/OpenEnergyPlatform/oemetadata" target="_blank" rel="noopener noreferrer">
OEMetadata</a> of the datasets that are part of the scenarios you selected initially to start this comparison.


</p>
<p>
The dropdown fields below are populated with data from the datasets. These values will change depending on the previous
scenario selection. To create a visualization you must select at lest one option for all fields. You can select multiple
Output datasets for comparison but if you do you should not select multiple Sectors. If you only select one dataset
you can also select multiple sectors, in this case the plot will change to a stacked bar chart style.
The dropdown fields below are populated with data from the datasets. These values will change depending on the previous
scenario selection. To generate a visualization, please select at least one option for each field. You can choose multiple output datasets for comparison,
but if you do, selecting multiple sectors is not allowed. However, if you select only one dataset, you can also choose multiple sectors,
and the plot will change to a stacked bar chart style.

</p>
</Alert>
</Grid>
Expand Down Expand Up @@ -1315,7 +1323,7 @@ const sendQuery = async (index) => {
</Select>
</FormControl>
<FormControl sx={{ m: 1, width: '48%' }} size="small">
<InputLabel id="demo-multiple-checkbox-label">Gas(es)</InputLabel>
<InputLabel id="demo-multiple-checkbox-label">Gas</InputLabel>
<Select
labelId="demo-select-small-label"
id="demo-select-small"
Expand Down Expand Up @@ -1420,7 +1428,7 @@ const sendQuery = async (index) => {
{loading == true && <Box sx={{ paddingTop: "10px" }}>
<LinearProgress />
</Box>}
<Box display="flex" justifyContent="flex-end">
{/* <Box display="flex" justifyContent="flex-end">
<IconButton
color="primary"
aria-label="add"
Expand All @@ -1429,7 +1437,7 @@ const sendQuery = async (index) => {
>
<AddIcon />
</IconButton>
</Box>
</Box> */}
</Grid>
<Grid item xs={12} >
<Snackbar
Expand Down
2 changes: 1 addition & 1 deletion oeplatform/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.1"
__version__ = "1.0.2"
4 changes: 2 additions & 2 deletions ontology/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
TemplateView.as_view(template_name="ontology/oeo-steering-committee.html"),
),
url(
r"^(?P<ontology>[\w_-]+)\/releases/latest?$",
r"^(?P<ontology>[\w_-]+)\/releases/latest$",
views.OntologyStatics.as_view(),
{"full": True},
name="oeo-latest-full-zip",
),
url(
r"^(?P<ontology>[\w_-]+)\/releases/latest/glossary?$",
r"^(?P<ontology>[\w_-]+)\/releases/latest/glossary$",
views.OntologyStatics.as_view(),
{"glossary": True},
name="oeo-latest-glossary",
Expand Down
8 changes: 8 additions & 0 deletions ontology/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,14 +358,22 @@ def get(
else:
file_path = onto_base_path / version / OPEN_ENERGY_ONTOLOGY_FULL_OWL_NAME

if file in ["oeo-closure"]:
file_path = onto_base_path / version / f"{file}.{extension}"

if os.path.exists(file_path):
with open(file_path, "br") as f:
response = HttpResponse(
f, content_type="application/rdf+xml; charset=utf-8"
)

if not file:
file = "oeo-full"

response[
"Content-Disposition"
] = f'attachment; filename="{file}.{extension}"'

return response
else:
file_path = onto_base_path / version / "modules" / f"{file}.{extension}"
Expand Down
11 changes: 11 additions & 0 deletions versions/changelogs/1_0_2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changes to the oeplatform code

## Changes

## Features

## Bugs

- Fix various bugs: Fix incorrect urls and download results on the oeo page, remove cache headers from metadata api view, fix bug on table permission page that prevented adding other users to the table [(#1867)](https://github.com/OpenEnergyPlatform/oeplatform/pull/1867)

## Documentation updates

0 comments on commit b311716

Please sign in to comment.