Skip to content

Commit 5f3a9cf

Browse files
committed
revise for master2main
1 parent 4e23cec commit 5f3a9cf

File tree

4 files changed

+82
-24
lines changed

4 files changed

+82
-24
lines changed

webdocs/developers.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ against the latest distribution. See the web page on
2121
`Installing GSAS-II for code development <install_dev.html>`_ for more
2222
details.
2323

24+
----------------------------------------------------------
25+
Developer's documentation
26+
----------------------------------------------------------
27+
2428
The Sphinx documentation for the GSAS-II source code will be of
2529
significant value for people attempting to work their way through the
2630
codebase. This is found on the wonderful “Read The Docs” web
@@ -39,3 +43,26 @@ the command for this is::
3943

4044
More on this is in the `Installing GSAS-II for code development <install_dev.html>`_
4145
web page, which discusses changing the origin to your forked copy of GSAS-II.
46+
47+
----------------------------------------------------------
48+
Developing GSAS-II inside VSCode
49+
----------------------------------------------------------
50+
51+
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
52+
`make GSAS-II run in the VSCode debugger <https://iris2020.net/2025-04-21-gsasii_dev_new/>`_.
53+
54+
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+
Mac/Linux, ``/Users/toby/G2/g2main/bin/python``;
56+
Windows, ``c:\Users\toby\g2main\python.exe``)
57+
to run the debugger rather than install a new conda environment as he does.
58+
59+
----------------------------------------------------------
60+
IPython Code development tip
61+
----------------------------------------------------------
62+
63+
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)::
64+
65+
conda install ipython
66+
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.

webdocs/index.rst

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@
99
GSAS-II Home Page
1010
====================================
1111

12+
.. tip::
13+
14+
As of April 22, 2025, the default branch for GSAS-II has been
15+
changed from ``master`` to a branch called ``main``. If the
16+
gsas2full self-installer was used for GSAS-II use of the
17+
Help/Update process should make the transition from the ``master``
18+
to the new ``main`` version. Other types of installations will
19+
likely require that GSAS-II be reinstalled (as described
20+
below). Details about what has been changed in this transition can
21+
be found in the :ref:`section on this transition <master2main>`,
22+
also below.
23+
1224
Welcome to the home page for GSAS-II, a unique and comprehensive open
1325
source Python project for determination of crystal structures and
1426
diffraction-based materials characterization for crystalline solids on
@@ -33,6 +45,7 @@ well as extensive visualization capabilities.
3345
developers.rst
3446
compile.rst
3547
misc.rst
48+
master2main.rst
3649

3750
.. tip::
3851
Please help us by citing:
@@ -150,4 +163,8 @@ Other things related to GSAS-II can be found here.
150163

151164
.. toctree::
152165

153-
misc.rst
166+
misc.rst
167+
168+
.. toctree::
169+
170+
master2main.rst

webdocs/install_dev.rst

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -207,26 +207,3 @@ By default, the commands above will install and run GSAS-II with Python 3.13 (at
207207
``pixi run -e py311 ui`` or
208208
``pixi shell -e py311``.
209209

210-
211-
==============================================
212-
Developing GSAS-II inside VSCode
213-
==============================================
214-
215-
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
216-
`make GSAS-II run in the VSCode debugger <https://iris2020.net/2025-04-21-gsasii_dev_new/>`_.
217-
218-
Note that if you have used the gsas2main installer to place GSAS-II at ``~/g2main`` then you can use the Python installation there (examples:
219-
Mac/Linux, ``/Users/toby/G2/g2main/bin/python``;
220-
Windows, ``c:\Users\toby\g2main\python.exe``)
221-
to run the debugger rather than install a new conda environment as he does.
222-
223-
==============================================
224-
IPython Code development tip
225-
==============================================
226-
227-
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)::
228-
229-
conda install ipython
230-
231-
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
232-
``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.

webdocs/master2main.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
April 2025: Transition from Master to Main Branch
2+
==================================================
3+
4+
.. _master2main:
5+
6+
On April 22, 2025 GSAS-II made a transition from development on a branch named "master" to a branch named "main". Several months of changes are behind this transition, which is documented below.
7+
8+
* Meson for building: Prior to this transition, the scons utility had been used to compile GSAS-II source code (written in Fortran, cython and C) into binaries. This broke with Python 3.12. A new compilation mechanism based on meson was implemented. The initial work on this was done by Jerome Kieffer (ESRF) and additional help was obtained from Tom Caswell (NSLS-II/BNL). GSAS-II is now provided with Python 3.12 and 3.13 binaries.
9+
10+
* Rework of self-installers: The GSAS-II self-installer, previously called gsas2full and now renamed as gsas2main, was revisited and streamlined. There is also now a conda package, also named gsas2main (on channel briantoby), but this is intended only for internal use in the self-installer.
11+
12+
* self-tests: there is now a suite of scripts that test the GSAS-II compiled binaries as well as significant portions of the GSAS-II crystallographic computations. These are run automatically when changes are checked into the main branch. They are also used to test binaries created with meson and are used to test self-installers (gsas2main).
13+
14+
* GitHub actions: there are a series of scripts for `the source code repository< https://github.com/AdvancedPhotonSource/GSAS-II/actions>`_
15+
and for `the build repository<https://github.com/AdvancedPhotonSource/GSAS-II-buildtools/actions>`_ for these tasks:
16+
17+
(1) Run the self-tests (smoke test, ``smoke_test.yml``). This is run whenever there are code check-ins to main.
18+
(2) Create and test self-installers (build & test self-installers, ``matrix_g2main-test.yml``). At present this is triggered manually.
19+
(3) Compile GSAS-II binaries (compile & test binaries, ``matrix_comp-test.yml``). At present this is triggered manually.
20+
(4) Create and test a self-installer for RHEL (Build & test (RHEL) gsas2main self-installer, ``g2main-redhat.yml``). At present this is triggered manually.
21+
(5) Build the GSAS-II conda package, (build gsas2pkg, ``gsas2pkg.yml``). Work on this is not yet complete.
22+
23+
* Internal file reorganization: The GSAS-II Python files have been reorganized so that GSAS-II can be installed into Python's normal installation location (site-packages) and so that routines can be accessed using ``import GSASII`` (or ``import GSASII.G2-module``). This required revision of internal imports from ``import GSASIIobj as G2obj`` to ``from . import GSASIIobj as G2obj`` (or ``from .. import...`` in the ``imports`` and ``exports`` subdirectories.) Tom Caswell (NSLS-II/BNL) did much of this.
24+
25+
* External packages previously included in GSAS-II (PyCifRW and baselines) are now installed as Python packages
26+
27+
* A new "update" routine has be included in master that installs newly required Python packages (such as PyCifRW and baselines) and then switches branches and reinstalls shortcuts. This is called when one attempts to update the "master" branch once the last update to that branch has been installed.
28+
29+
* A file named ``GSASII.py`` was previously used to start the GUI. Having a file sharing a name with a package does not work, so that file was renamed as ``GSASIIGUI.py`` and a new file named ``G2.py`` is now used to start GSAS-II.
30+
31+
* Citations to software used in GSAS-II is now tracked in a centralized location and a new Help command provides a list of those references.
32+
33+
* The configuration settings, which were previously saved in a Python source file, ``config.py`` are now saved in a file named ``config.ini``. That file is located in a "user" area (``~/.GSASII``) rather than with the GSAS-II source code. When the new "main" version of GSAS-II is started, if no ``config.ini`` file is found then the contents of ``config.py`` is used to initialize ``config.ini``.
34+
35+
* Obsolete code removed. This includes the code previously used for subversion (svn).
36+
37+
* Scripting: several commands now can read input files supplied as a URL; preferred orientation correction now are available in the API.

0 commit comments

Comments
 (0)