Skip to content

Commit e0d9adb

Browse files
authored
fix dictionary referencing (#194)
* 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. * 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...
1 parent 634f4b1 commit e0d9adb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

GSASII/GSASIIscriptable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,7 @@ def add_phase(self, phasefile=None, phasename=None, histograms=[],
13911391

13921392
# process constraints, currently generated only from ISODISTORT CIFs
13931393
if phasereader.Constraints:
1394-
Constraints = self.data['Constraints']
1394+
Constraints = self.data['Constraints']['data']
13951395
for i in phasereader.Constraints:
13961396
if isinstance(i, dict):
13971397
if '_Explain' not in Constraints:

GSASII/install/makeLinux.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def Usage():
4545
# find the main GSAS-II script if not on command line
4646
path2GSAS2 = os.path.dirname(os.path.dirname(__file__))
4747
path2repo = os.path.dirname(path2GSAS2)
48-
G2script = os.path.abspath(path2GSAS2,"G2.py")
48+
G2script = os.path.abspath(os.path.join(path2GSAS2,"G2.py"))
4949
elif __file__.endswith("makeLinux.py") and len(sys.argv) == 2:
5050
G2script = os.path.abspath(sys.argv[1])
5151
path2GSAS2 = os.path.dirname(G2script)

0 commit comments

Comments
 (0)