diff --git a/lib/galaxy/datatypes/molecules.py b/lib/galaxy/datatypes/molecules.py index 4ab22726e5e1..a4cc26b549d2 100644 --- a/lib/galaxy/datatypes/molecules.py +++ b/lib/galaxy/datatypes/molecules.py @@ -1010,6 +1010,9 @@ def sniff_prefix(self, file_prefix: FilePrefix) -> bool: >>> fname = get_test_fname('1.star') >>> CIF().sniff(fname) False + >>> fname = get_test_fname('LaMnO3.cif') + >>> CIF().sniff(fname) + True """ # check for optional CIF version marker '#\#CIF_' at start of file @@ -1020,7 +1023,7 @@ def sniff_prefix(self, file_prefix: FilePrefix) -> bool: # first non-comment line must begin with 'data_' # and '_atom_site_fract_(x|y|z)' must be specified somewhere in the file for line in file_prefix.line_iterator(): - if not line: + if not line.rstrip(): continue elif line[0] == "#": # comment so skip continue diff --git a/lib/galaxy/datatypes/sniff.py b/lib/galaxy/datatypes/sniff.py index a3fcf6e0dc50..6fae059a47c6 100644 --- a/lib/galaxy/datatypes/sniff.py +++ b/lib/galaxy/datatypes/sniff.py @@ -398,6 +398,9 @@ def guess_ext(fname_or_file_prefix: Union[str, "FilePrefix"], sniff_order, is_bi >>> fname = get_test_fname('Si.cif') >>> guess_ext(fname, sniff_order) 'cif' + >>> fname = get_test_fname('LaMnO3.cif') + >>> guess_ext(fname, sniff_order) + 'cif' >>> fname = get_test_fname('Si.xyz') >>> guess_ext(fname, sniff_order) 'xyz' diff --git a/lib/galaxy/datatypes/test/LaMnO3.cif b/lib/galaxy/datatypes/test/LaMnO3.cif new file mode 100644 index 000000000000..6ff5b3dea6e6 --- /dev/null +++ b/lib/galaxy/datatypes/test/LaMnO3.cif @@ -0,0 +1,66 @@ +####################################################################### +# +# This file contains crystal structure data downloaded from the +# Cambridge Structural Database (CSD) hosted by the Cambridge +# Crystallographic Data Centre (CCDC) in cooperation with FIZ Karlsruhe. +# +# Please note that these data are only for research purposes or private use. +# For detailed information please see under Terms & Conditions. +# Full information about CCDC and FIZ Karlsruhe data access policies and +# citation guidelines are available at http://www.ccdc.cam.ac.uk/access/V1 +# +# Audit and citation data items may have been added by FIZ Karlsruhe. +# Please retain this information to preserve the provenance of +# this file and to allow appropriate attribution of the data. +# +####################################################################### + +data_150259-ICSD +_database_code_depnum_ccdc_archive 'CCDC 1667441' +loop_ +_citation_id +_citation_doi +_citation_year +1 10.1006/jssc.2001.9440 2002 +_audit_update_record +; +2018-02-27 deposited with the CCDC. 2024-01-08 downloaded from the CCDC. +; +_database_code_ICSD 150259 +_chemical_name_systematic 'Lanthanum Manganate' +_chemical_formula_sum 'La1 Mn1 O3' +_cell_length_a 5.486 +_cell_length_b 7.761 +_cell_length_c 5.487 +_cell_angle_alpha 90 +_cell_angle_beta 90 +_cell_angle_gamma 90.01 +_cell_volume 233.62 +_cell_formula_units_Z 4 +_symmetry_space_group_name_H-M 'I 1 1 2/b' +_symmetry_Int_Tables_number 15 +_symmetry_cell_setting monoclinic +_refine_ls_R_factor_all 0.03 +loop_ +_symmetry_equiv_pos_site_id +_symmetry_equiv_pos_as_xyz +1 '-x, -y+1/2, z' +2 'x, y+1/2, -z' +3 '-x, -y, -z' +4 'x, y, z' +5 '-x+1/2, -y, z+1/2' +6 'x+1/2, y, -z+1/2' +7 '-x+1/2, -y+1/2, -z+1/2' +8 'x+1/2, y+1/2, z+1/2' +loop_ +_atom_site_label +_atom_site_type_symbol +_atom_site_fract_x +_atom_site_fract_y +_atom_site_fract_z +La1 La3+ 0 0.25 0.5052 +Mn1 Mn3+ 0 0 0 +O1 O2- 0 0.25 0.0015 +O2 O2- 0.2682 0.0015 0.2427 + +#End of data_150259-ICSD diff --git a/lib/galaxy/webapps/base/webapp.py b/lib/galaxy/webapps/base/webapp.py index fbf80fc1da97..c2151b942517 100644 --- a/lib/galaxy/webapps/base/webapp.py +++ b/lib/galaxy/webapps/base/webapp.py @@ -665,6 +665,7 @@ def _ensure_valid_session(self, session_cookie: str, create: bool = True) -> Non galaxy_session = self.__create_new_session(prev_galaxy_session, user_for_new_session) galaxy_session_requires_flush = True self.galaxy_session = galaxy_session + self.get_or_create_default_history() self.__update_session_cookie(name=session_cookie) else: self.galaxy_session = galaxy_session