From f40fc204e4179391f34f5a29a84c7de2f63f2185 Mon Sep 17 00:00:00 2001 From: Diogo Almeida Date: Fri, 27 Jun 2025 14:57:05 +0100 Subject: [PATCH 1/2] fix dictionary referencing Had an issue with the Constraints object not having a 'Phase' key. The only key in Constraints is 'data' and the corresponding value is a dictionary with the 'Phase' key. Fixed by specifying 'data' key. --- GSASII/GSASIIscriptable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GSASII/GSASIIscriptable.py b/GSASII/GSASIIscriptable.py index 1732da932..db4e8e544 100644 --- a/GSASII/GSASIIscriptable.py +++ b/GSASII/GSASIIscriptable.py @@ -1391,7 +1391,7 @@ def add_phase(self, phasefile=None, phasename=None, histograms=[], # process constraints, currently generated only from ISODISTORT CIFs if phasereader.Constraints: - Constraints = self.data['Constraints'] + Constraints = self.data['Constraints']['data'] for i in phasereader.Constraints: if isinstance(i, dict): if '_Explain' not in Constraints: From 254de1caa3670629aa945bb3e38bd0dd779efdbe Mon Sep 17 00:00:00 2001 From: Diogo Almeida Date: Sat, 28 Jun 2025 17:23:51 +0100 Subject: [PATCH 2/2] fix abspath arguments issue Had error mentioning abspath only takes 1 (positional) argument and two were given, related to the calling of "abspath(path2GSAS2, 'G2.py')". Assumed that this should be the path to 'G2.py' in the path2GSAS2 directory, so used os.path.join(path2GSAS2, 'G2.py') to join them together so that is the argument in abspath. Worked fine after this change, with the following console output: Python installed at /mnt/ceph/home/f1118524/.conda/envs/G2env/bin/python3.13 GSAS-II installed at /mnt/ceph/home/f1118524/.conda/envs/G2env/G2/GSASII G2.py at /mnt/ceph/home/f1118524/.conda/envs/G2env/G2/GSASII/G2.py GSASII icon at /mnt/ceph/home/f1118524/.conda/envs/G2env/G2/GSASII/icons/gsas2.png Created Desktop shortcut calling gnome-terminal as file /home/f1118524/Desktop/GSASII.desktop Created Menu shortcut calling gnome-terminal as file /home/f1118524/.local/share/applications/GSASII.desktop Created '/mnt/ceph/home/f1118524/.conda/envs/G2env/Reset2FreshGSASII.sh' to reset GSAS-II installation when all else fails... --- GSASII/install/makeLinux.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GSASII/install/makeLinux.py b/GSASII/install/makeLinux.py index 5584d2f9f..32ebfe4fb 100644 --- a/GSASII/install/makeLinux.py +++ b/GSASII/install/makeLinux.py @@ -45,7 +45,7 @@ def Usage(): # find the main GSAS-II script if not on command line path2GSAS2 = os.path.dirname(os.path.dirname(__file__)) path2repo = os.path.dirname(path2GSAS2) - G2script = os.path.abspath(path2GSAS2,"G2.py") + G2script = os.path.abspath(os.path.join(path2GSAS2,"G2.py")) elif __file__.endswith("makeLinux.py") and len(sys.argv) == 2: G2script = os.path.abspath(sys.argv[1]) path2GSAS2 = os.path.dirname(G2script)