Skip to content

Commit

Permalink
Merge branch 'issue-interactive' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederikLizakJohansen committed Aug 28, 2024
2 parents 9a768cc + d1d53c1 commit 7bb25e5
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 4 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions debyecalculator/debye_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ def update_example_files(change):
file_list = '<strong>Uploaded Files:</strong><br>'

# CIF Example
with importlib.resources.open_binary('data', 'AntiFluorite_Co2O.cif') as f:
with importlib.resources.open_binary('debyecalculator.data', 'AntiFluorite_Co2O.cif') as f:
example_dict = {}
example_dict['content'] = f.read()
example_dict['name'] = 'AntiFluorite_Co2O.cif'
Expand All @@ -1185,7 +1185,7 @@ def update_example_files(change):
create_file_widgets(example_dict, file_widgets)

# XYZ Example
with importlib.resources.open_binary('data', 'AntiFluorite_Co2O_r10.xyz') as f:
with importlib.resources.open_binary('debyecalculator.data', 'AntiFluorite_Co2O_r10.xyz') as f:
example_dict = {}
example_dict['content'] = f.read()
example_dict['name'] = 'AntiFluorite_Co2O_r10.xyz'
Expand Down Expand Up @@ -1464,7 +1464,7 @@ def update_example_files(change):
""" Plotting Options """

# Load display display_assets
with importlib.resources.open_binary('debyecalculator.display_assets', 'qstep.png') as f:
with importlib.resources.open_binary('debyecalculator.display_assets', 'iq_scaling.png') as f:
iq_scaling_img = f.read()
with importlib.resources.open_binary('debyecalculator.display_assets', 'show_hide.png') as f:
show_hide_img = f.read()
Expand Down Expand Up @@ -1876,7 +1876,7 @@ def update_parameters(b=None):
name = upload_file['name']
suffix = name.split('.')[-1]
if checkboxes[name].value:
with tempfile.NamedTemporaryFile(delete=True, suffix='.' + suffix, mode = 'w') as temp_file:
with tempfile.NamedTemporaryFile(delete=False, suffix='.' + suffix, mode = 'w') as temp_file:
temp_content = BytesIO(upload_file['content']).read().decode()
temp_filename = temp_file.name
temp_file.write(temp_content)
Expand Down

0 comments on commit 7bb25e5

Please sign in to comment.