You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Visual Studio Code (VSCode) is a free code development environment that is available on all major platforms where GSAS-II runs. Yuanpeng Zhang (ORNL) has written some notes on how to
51
+
Visual Studio Code (VSCode) is a code development environment that is
52
+
freely distributed on all major platforms where GSAS-II runs.
53
+
Yuanpeng Zhang (ORNL) has written some notes on how to
52
54
`make GSAS-II run in the VSCode debugger <https://iris2020.net/2025-04-21-gsasii_dev_new/>`_.
53
55
54
56
Note that if you have used the gsas2main installer to place GSAS-II at ``~/g2main`` then you can use the Python installation there (examples:
55
57
Mac/Linux, ``/Users/toby/G2/g2main/bin/python``;
56
58
Windows, ``c:\Users\toby\g2main\python.exe``)
57
-
to run the debugger rather than install a new conda environment as he does.
59
+
to run the debugger, rather than install a new conda environment as he does.
One nice trick for working with GSAS-II is that if you locate a place where you want to insert code into the program, you can run commands in that environment. To do this, two prerequisite steps are needed. First, use the conda command to install iPython (this assumes you have already used the activate command, as above)::
65
+
One nice trick for working with GSAS-II is that if you locate a place
66
+
where you want to insert code into the program, you can run commands
67
+
in that namespace environment. To do this, two prerequisite steps are
68
+
needed. First, use the conda command to install iPython (this assumes
69
+
you have already used the activate command, as above)::
64
70
65
71
conda install ipython
66
72
67
-
Then run GSAS-II and use the Preferences command (File menu or on MacOs on the first menu, named GSAS-II or python) and `set the debug option to True`. One can then place a
68
-
``breakpoint()`` statement into GSAS-II at a location where one wants to develop code. When that statement is executed, GSAS-II will enter iPython but in the local environment where your code will be executed, so you can see what variables and functions are defined and try running code that can then be placed into GSAS-II. Remember to remove the breakpoint statement when you are done.
73
+
Then run GSAS-II and use the Preferences command (File menu or on
74
+
MacOs on the first menu, named GSAS-II or python) and `set the debug
75
+
option to True`. One can then place a ``breakpoint()`` statement into
76
+
GSAS-II at a location where one wants to develop code. When that
77
+
statement is executed, GSAS-II will enter iPython but in the local
78
+
environment where your code will be executed, so you can see what
79
+
variables and functions are defined and try running code that can then
80
+
be placed into GSAS-II. Remember to remove the breakpoint statement
81
+
when you are done.
82
+
83
+
Note that when the ``debug`` configuration setting is set to True, that
84
+
also turns on some potentially useful print statements.
0 commit comments