Skip to content

Commit

Permalink
Merge pull request #53 from BattMoTeam/input
Browse files Browse the repository at this point in the history
Added feature to upload JSON LD input files, solves #42
  • Loading branch information
LorenaH84 authored Dec 16, 2024
2 parents 57bd521 + c0d3e69 commit 7cd8c23
Show file tree
Hide file tree
Showing 45 changed files with 3,889 additions and 3,303 deletions.
47 changes: 1 addition & 46 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
restart: always
ports:
- "8081:8081"
- "8080:8080"
- "8080:8082"
networks:
- app-network
volumes:
Expand Down Expand Up @@ -39,51 +39,6 @@ services:
command: streamlit run app.py --global.disableWidgetStateDuplicationWarning true --server.port=8501


nginx:
build: ./nginx
container_name: nginx
restart: always
ports:
- "80:80"
networks:
- app-network
volumes:
- /etc/letsencrypt:/etc/letsencrypt
- /usr/share/nginx/html/.well-known:/usr/share/nginx/html/.well-known
command: nginx -g 'daemon off;'

# umami:
# image: docker.umami.is/umami-software/umami:postgresql-latest
# container_name: umami
# restart: always
# environment:
# DATABASE_URL: postgres://umami:password@umami-db/umami
# DATABASE_TYPE: postgres
# HASH_SALT: ${HASH_SALT} # Replace this with a secure, random hash salt
# ports:
# - "3000:3000"
# networks:
# - app-network
# depends_on:
# - umami-db

# umami-db:
# image: postgres:13
# container_name: umami-db
# restart: always
# environment:
# POSTGRES_USER: umami
# POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} # Replace with a strong password
# POSTGRES_DB: umami
# networks:
# - app-network
# volumes:
# - umami_db_data:/var/lib/postgresql/data

# Define volumes at the root level, outside of services
# volumes:
# umami_db_data:

networks:
app-network:
driver: bridge
9 changes: 1 addition & 8 deletions gui/app_pages/Results.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@
if "success" not in st.session_state:
st.session_state.success = None

if "transfer_results" not in st.session_state:
st.session_state.transfer_results = None

if "hdf5_upload" not in st.session_state:
st.session_state.hdf5_upload = None

Expand All @@ -95,11 +92,7 @@
app.set_hdf5_upload().set_results_uploader()
selected_data_sets = app.set_data_set_selector().set_selector()

if (
st.session_state.transfer_results == True
or st.session_state.hdf5_upload == True
or selected_data_sets
):
if st.session_state.success == True or st.session_state.hdf5_upload == True or selected_data_sets:
session_temp_folder = st.session_state["temp_dir"]
file_names = [
f
Expand Down
1 change: 1 addition & 0 deletions gui/app_scripts/app_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def setup_linked_data_structure():
#####################################


@st.cache_data
def get_images():
return view.LoadImages(app_access.get_path_to_images_dir())

Expand Down
7 changes: 6 additions & 1 deletion gui/app_scripts/app_parameter_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ def __init__(
parameter_display_names=None,
parameter_set_id=None,
reference_url=None,
context_type=None,
):
self.display_name = parameter_set_display_name
self.name = parameter_set_name
Expand All @@ -348,6 +349,7 @@ def __init__(
self.parameter_names = parameter_names
self.parameter_values = parameter_values
self.parameter_display_names = parameter_display_names
self.context_type = context_type


class Option_parameter(object):
Expand Down Expand Up @@ -386,6 +388,7 @@ def format_parameter_sets(
materials,
material_display_names,
reference_urls,
context_types,
parameter_sets,
material_parameter_sets_name_by_id,
raw_template_parameters,
Expand All @@ -401,12 +404,13 @@ def format_parameter_sets(
for parameter_set in parameter_sets:
(
parameter_set_id,
parameter_set,
parameter_set_name,
*_,
) = parameter_set

material_display_name = material_display_names[parameter_set_id]
reference_url = reference_urls[parameter_set_id]
material_context_type = context_types[parameter_set_id]

raw_parameters_set = raw_parameters[parameter_set_id]

Expand Down Expand Up @@ -517,6 +521,7 @@ def format_parameter_sets(
parameter_values=values,
parameter_display_names=parameter_display_names,
reference_url=reference_url,
context_type=material_context_type,
)
# template_parameter.set_selected_value(formatted_value)
formatted_material.add_option(parameter_set_id, new_option)
Expand Down
Loading

0 comments on commit 7cd8c23

Please sign in to comment.