diff --git a/.codecov.yml b/.codecov.yml index 04dd6510..5a94096e 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,34 +1,14 @@ -# codecov can find this file anywhere in the repo, so we don't need to clutter -# the root folder. -#comment: false - -codecov: - notify: - require_ci_to_pass: no - coverage: status: - patch: + project: # more options at https://docs.codecov.com/docs/commit-status default: - target: '70' - if_no_uploads: error - if_not_found: success - if_ci_failed: failure - project: - default: false - library: - target: auto - if_no_uploads: error - if_not_found: success - if_ci_failed: error - paths: '!*/tests/.*' - - tests: - target: 97.9% - paths: '*/tests/.*' - if_not_found: success - -flags: - tests: - paths: - - tests/ + target: auto # use the coverage from the base commit, fail if coverage is lower + threshold: 0% # allow the coverage to drop by + +comment: + layout: " diff, flags, files" + behavior: default + require_changes: false + require_base: false # [true :: must have a base report to post] + require_head: false # [true :: must have a head report to post] + hide_project_coverage: false # [true :: only show coverage on the git diff aka patch coverage] diff --git a/.codespell/ignore_lines.txt b/.codespell/ignore_lines.txt new file mode 100644 index 00000000..07fa7c8c --- /dev/null +++ b/.codespell/ignore_lines.txt @@ -0,0 +1,2 @@ +;; Please include filenames and explanations for each ignored line. +;; See https://docs.openverse.org/meta/codespell.html for docs. diff --git a/.codespell/ignore_words.txt b/.codespell/ignore_words.txt new file mode 100644 index 00000000..bf5b7379 --- /dev/null +++ b/.codespell/ignore_words.txt @@ -0,0 +1,20 @@ +;; Please include explanations for each ignored word (lowercase). +;; See https://docs.openverse.org/meta/codespell.html for docs. + +;; abbreviation for "materials" often used in a journal title +mater + +;; alternative use of socioeconomic +socio-economic + +;; Frobenius norm used in np.linalg.norm +fro + +;; abbreviation for "structure" +struc + +;; method name within JournalPanel class +onText + +;; a method name within JournalPanel class +delt diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 77556cdf..00000000 --- a/.coveragerc +++ /dev/null @@ -1,13 +0,0 @@ -[run] -source = - diffpy.pdfgui -[report] -omit = - */python?.?/* - */site-packages/nose/* - # ignore _version.py and versioneer.py - .*version.* - *_version.py - -exclude_lines = - if __name__ == '__main__': diff --git a/.github/ISSUE_TEMPLATE/release_checklist.md b/.github/ISSUE_TEMPLATE/release_checklist.md index a87a44a8..11df804d 100644 --- a/.github/ISSUE_TEMPLATE/release_checklist.md +++ b/.github/ISSUE_TEMPLATE/release_checklist.md @@ -6,17 +6,41 @@ labels: "release" assignees: "" --- -### Release checklist for GitHub contributors +### PyPI/GitHub rc-release preparation checklist: - [ ] All PRs/issues attached to the release are merged. - [ ] All the badges on the README are passing. - [ ] License information is verified as correct. If you are unsure, please comment below. - [ ] Locally rendered documentation contains all appropriate pages, including API references (check no modules are - missing), tutorials, and other human written text is up-to-date with any changes in the code. -- [ ] Installation instructions in the README, documentation and on the website (e.g., diffpy.org) are updated and - tested -- [ ] Successfully run any tutorial examples or do functional testing in some other way. -- [ ] Grammar and writing quality have been checked (no typos). - -Please mention @sbillinge when you are ready for release. Include any additional comments necessary, such as -version information and details about the pre-release. + missing), tutorials, and other human-written text is up-to-date with any changes in the code. +- [ ] Installation instructions in the README, documentation, and the website (e.g., diffpy.org) are updated. +- [ ] Successfully run any tutorial examples or do functional testing with the latest Python version. +- [ ] Grammar and writing quality are checked (no typos). +- [ ] Install `pip install build twine`, run `python -m build` and `twine check dist/*` to ensure that the package can be built and is correctly formatted for PyPI release. + +Please mention @sbillinge here when you are ready for PyPI/GitHub release. Include any additional comments necessary, such as version information and details about the pre-release here: + +### PyPI/GitHub full-release preparation checklist: + +- [ ] Create a new conda environment and install the rc from PyPI (`pip install ==??`) +- [ ] License information on PyPI is correct. +- [ ] Docs are deployed successfully to `https://www.diffpy.org/`. +- [ ] Successfully run all tests, tutorial examples or do functional testing. + +Please let @sbillinge know that all checks are done and the package is ready for full release. + +### conda-forge release preparation checklist: + + + +- [ ] Ensure that the full release has appeared on PyPI successfully. +- [ ] New package dependencies listed in `conda.txt` and `test.txt` are added to `meta.yaml` in the feedstock. +- [ ] Close any open issues on the feedstock. Reach out to @bobleesj if you have questions. +- [ ] Tag @sbillinge and @bobleesj for conda-forge release. + +### Post-release checklist + + + +- [ ] Run tutorial examples and conduct functional testing using the installation guide in the README. Attach screenshots/results as comments. +- [ ] Documentation (README, tutorials, API references, and websites) is deployed without broken links or missing figures. diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index 86fd9ddb..41507c5b 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -1,4 +1,4 @@ -name: Release (GitHub/PyPI) +name: Release (GitHub/PyPI) and Deploy Docs on: workflow_dispatch: diff --git a/.github/workflows/check-news-item.yml b/.github/workflows/check-news-item.yml index 3982a783..03bb7d1d 100644 --- a/.github/workflows/check-news-item.yml +++ b/.github/workflows/check-news-item.yml @@ -6,7 +6,7 @@ on: - main jobs: - build: + check-news-item: uses: Billingegroup/release-scripts/.github/workflows/_check-news-item.yml@v0 with: project: diffpy.pdfgui diff --git a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml index 23dd9d8f..3034fdf7 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -12,10 +12,61 @@ on: jobs: coverage: - uses: Billingegroup/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 - with: - project: diffpy.pdfgui - c_extension: false - headless: true - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + defaults: + run: + shell: bash -l {0} + + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-13, macos-14] + python-version: ["3.11", "3.12"] + env: + LATEST_PYTHON_VERSION: "3.12" + steps: + - name: Check out diffpy.pdfgui + uses: actions/checkout@v4 + + - name: Initialize miniconda + uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: test + auto-update-conda: true + environment-file: environment.yml + auto-activate-base: false + python-version: ${{ matrix.python-version }} + + - name: Conda config + run: >- + conda config --set always_yes yes + --set changeps1 no + + - name: Install diffpy.pdfgui and requirements + run: | + conda install --file requirements/test.txt + conda install wxpython diffpy.utils matplotlib-base + pip install diffpy.pdffit2==1.4.4rc6 + python -m pip install . --no-deps + + - name: Start Xvfb for ubuntu-latest only + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get install -y xvfb + export DISPLAY=:99 + Xvfb :99 -screen 0 1024x768x16 & + + - name: Validate diffpy.pdfgui + run: | + if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then + export DISPLAY=:99 + fi + pytest --cov + coverage report -m + codecov + + - name: Upload coverage to Codecov + if: matrix.os == 'ubuntu-latest' && matrix.python-version == env.LATEST_PYTHON_VERSION + uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml index 51215241..e56e7010 100644 --- a/.github/workflows/publish-docs-on-release.yml +++ b/.github/workflows/publish-docs-on-release.yml @@ -1,9 +1,8 @@ -name: Build and Deploy Docs +name: Deploy Documentation on Release on: release: - types: - - published + types: [published] workflow_dispatch: jobs: @@ -12,3 +11,5 @@ jobs: with: project: diffpy.pdfgui c_extension: false + headless: true + python_version: 3.12 diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index a5fb414f..218ec327 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -9,8 +9,52 @@ on: jobs: validate: - uses: Billingegroup/release-scripts/.github/workflows/_tests-on-pr.yml@v0 - with: - project: diffpy.pdfgui - c_extension: false - headless: true + defaults: + run: + shell: bash -l {0} + + runs-on: ubuntu-latest + steps: + - name: Check out diffpy.pdfgui + uses: actions/checkout@v4 + + - name: Initialize miniconda + uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: test + auto-update-conda: true + environment-file: environment.yml + auto-activate-base: false + python-version: 3.12 + + - name: Conda config + run: >- + conda config --set always_yes yes + --set changeps1 no + + - name: Install diffpy.pdfgui and requirements + run: | + conda install --file requirements/test.txt + conda install wxpython diffpy.utils matplotlib-base + pip install diffpy.pdffit2==1.4.4rc6 + python -m pip install . --no-deps + + - name: Start Xvfb + run: | + sudo apt-get install -y xvfb + export DISPLAY=:99 + Xvfb :99 -screen 0 1024x768x16 & + + - name: Validate diffpy.pdfgui + run: | + export DISPLAY=:99 + pytest --cov + coverage report -m + codecov + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + verbose: true + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3070e199..9cf0556f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -44,3 +44,9 @@ repos: name: Prevent Commit to Main Branch args: ["--branch", "main"] stages: [pre-commit] + - repo: https://github.com/codespell-project/codespell + rev: v2.3.0 + hooks: + - id: codespell + additional_dependencies: + - tomli diff --git a/README.rst b/README.rst index 694fa749..8ad9c35d 100644 --- a/README.rst +++ b/README.rst @@ -132,7 +132,7 @@ trying to commit again. Improvements and fixes are always appreciated. -Before contribuing, please read our `Code of Conduct `_. +Before contributing, please read our `Code of Conduct `_. Contact ------- diff --git a/doc/manual/html/readme.txt b/doc/manual/html/readme.txt index e1100ec8..cf60cf43 100644 --- a/doc/manual/html/readme.txt +++ b/doc/manual/html/readme.txt @@ -1,2 +1,2 @@ -This directory need to be relativly the same as doc/build/html/manual from +This directory need to be relatively the same as doc/build/html/manual from doc/source/_static/images diff --git a/doc/manual/pdfgui.texinfo b/doc/manual/pdfgui.texinfo index 587a214e..8c79bbe7 100644 --- a/doc/manual/pdfgui.texinfo +++ b/doc/manual/pdfgui.texinfo @@ -243,7 +243,7 @@ requirements. This can be done either for all atoms in the structure or for an arbitrary subset - for example when it is known that only a certain species show a local distortion. The code for space group definitions was provided by the Python Macromolecular Library (mmLib, -@url{http://pymmlib.sourceforge.net}). This was extened to include +@url{http://pymmlib.sourceforge.net}). This was extended to include non-standard space groups using the Computational Crystallography Toolbox (cctbx, @uref{https://cctbx.github.io}). PDFgui also supports supercell expansion of a normal unit cell. diff --git a/news/codecov.rst b/news/codecov.rst new file mode 100644 index 00000000..2329edfc --- /dev/null +++ b/news/codecov.rst @@ -0,0 +1,24 @@ +**Added:** + +* Codecov coverage report in PRs +* Spelling check with Codespell in pre-commit + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/pyproject.toml b/pyproject.toml index 2f5dc4e6..796a10af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ maintainers = [ description = "GUI for PDF simulation and structure refinement." keywords = ['PDF structure refinement GUI'] readme = "README.rst" -requires-python = ">=3.10" +requires-python = ">=3.11, <3.13" classifiers = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', @@ -25,7 +25,6 @@ classifiers = [ 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX', 'Operating System :: Unix', - 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', 'Topic :: Scientific/Engineering :: Physics', @@ -54,6 +53,11 @@ namespaces = false # to disable scanning PEP 420 namespaces (true by default) [tool.setuptools.dynamic] dependencies = {file = ["requirements/pip.txt"]} +[tool.codespell] +exclude-file = ".codespell/ignore_lines.txt" +ignore-words = ".codespell/ignore_words.txt" +skip = "*.cif,*.dat,*.html,*.m,*.textinfo" + [tool.black] line-length = 115 include = '\.pyi?$' diff --git a/src/diffpy/pdfgui/control/calculation.py b/src/diffpy/pdfgui/control/calculation.py index ec6928f9..27f98dc2 100644 --- a/src/diffpy/pdfgui/control/calculation.py +++ b/src/diffpy/pdfgui/control/calculation.py @@ -252,7 +252,7 @@ def load(self, z, subpath): z -- zipped project file subpath -- path to its own storage within project file - returns a tree of internal hierachy + returns a tree of internal hierarchy """ config = pickle.loads(z.read(subpath + "config"), encoding="latin1") self.rmin = config["rmin"] diff --git a/src/diffpy/pdfgui/control/fitstructure.py b/src/diffpy/pdfgui/control/fitstructure.py index 515fdec5..6d12c840 100644 --- a/src/diffpy/pdfgui/control/fitstructure.py +++ b/src/diffpy/pdfgui/control/fitstructure.py @@ -35,7 +35,7 @@ class FitStructure(PDFStructure): Class data members: symposeps -- tolerance for recognizing site as symmetry position - Data members (in adition to those in PDFStructure): + Data members (in addition to those in PDFStructure): owner -- instance of parent Fitting (set in Organizer.add()) initial -- initial structure, same as self refined -- refined structure when available or None diff --git a/src/diffpy/pdfgui/control/fitting.py b/src/diffpy/pdfgui/control/fitting.py index 0c534c8f..e89e0fcb 100644 --- a/src/diffpy/pdfgui/control/fitting.py +++ b/src/diffpy/pdfgui/control/fitting.py @@ -73,7 +73,7 @@ class Fitting(Organizer): Fitting will start a new thread to interact with the PdfFit server. rw: fitness parameter - tolerancy: accurancy requirement + tolerancy: accuracy requirement step: current refinement step res: fitting result string parameters: parameter dictionary @@ -200,7 +200,7 @@ def load(self, z, subpath): z -- zipped project file subpath -- path to its own storage within project file - returns a tree of internal hierachy + returns a tree of internal hierarchy """ # subpath = projName/fitName/ subs = subpath.split("/") @@ -349,7 +349,7 @@ def configure(self): for key, var in struc.constraints.items(): self.server.constrain(key, var.formula) - # phase paramters configured + # phase parameters configured for dataset in self.datasets: dataset.clearRefined() @@ -493,7 +493,7 @@ def outputBondLengthAtoms(self, struc, i, j): return def outputBondLengthTypes(self, struc, a1, a2, lb, ub): - """Output all a1-a2 bond lenghts within specified range. + """Output all a1-a2 bond lengths within specified range. struc -- instance of PDFStructure a1 -- symbol of the first element in pair or "ALL" @@ -589,7 +589,7 @@ def buildNameDict(self): """build up a data name dictionary, which will map data name to a unique index - The private dataNameDict has such strcture: + The private dataNameDict has such structure: { 'd_data1':{'Gobs':12, 'Gcalc':11, ....}, 'd_data2':{'Gobs':10, 'Gcalc':9, ....}, ... @@ -660,7 +660,7 @@ def appendStep(self, source): snapshot[nameDict["crw"]] = dataset.crw seq += 1 - # udpate strucs + # update strucs seq = 1 for struc in self.strucs: id = struc._getStrId() diff --git a/src/diffpy/pdfgui/control/organizer.py b/src/diffpy/pdfgui/control/organizer.py index d44dfb41..51898fb7 100644 --- a/src/diffpy/pdfgui/control/organizer.py +++ b/src/diffpy/pdfgui/control/organizer.py @@ -157,7 +157,7 @@ def load(self, z, subpath): z -- zipped project file subpath -- path to its own storage within project file - returns a tree of internal hierachy + returns a tree of internal hierarchy """ # subpath = projName/myName/ from urllib.parse import unquote_plus @@ -223,7 +223,7 @@ def copy(self, other=None): def organization(self): """get internal organization - returns a tree of internal hierachy + returns a tree of internal hierarchy """ org = [None] * 4 org[0] = self diff --git a/src/diffpy/pdfgui/control/parameter.py b/src/diffpy/pdfgui/control/parameter.py index 06e89b02..a162b96c 100644 --- a/src/diffpy/pdfgui/control/parameter.py +++ b/src/diffpy/pdfgui/control/parameter.py @@ -137,7 +137,7 @@ def __getLinkedValue(self): srcfit = self.__findLinkedFitting() if srcfit is None: raise ControlKeyError("Fitting '%s' does not exist" % fitname) - # Check to see if srcfit has paramter srcidx + # Check to see if srcfit has parameter srcidx try: srcpar = srcfit.parameters[srcidx] except KeyError: diff --git a/src/diffpy/pdfgui/control/pdfdataset.py b/src/diffpy/pdfgui/control/pdfdataset.py index 6caa978a..d7d76725 100644 --- a/src/diffpy/pdfgui/control/pdfdataset.py +++ b/src/diffpy/pdfgui/control/pdfdataset.py @@ -229,7 +229,7 @@ def readStr(self, datastring): if res: self.metadata["doping"] = float(res.groups()[0]) - # parsing gerneral metadata + # parsing general metadata if metadata: regexp = r"\b(\w+)\ *=\ *(%(f)s)\b" % rx while True: @@ -374,7 +374,7 @@ def copy(self, other=None): class PDFDataFormatError(Exception): - """Exception class marking failure to proccess PDF data string.""" + """Exception class marking failure to process PDF data string.""" pass diff --git a/src/diffpy/pdfgui/control/plotter.py b/src/diffpy/pdfgui/control/plotter.py index 39359cbd..6fa5594c 100644 --- a/src/diffpy/pdfgui/control/plotter.py +++ b/src/diffpy/pdfgui/control/plotter.py @@ -90,7 +90,7 @@ def _buildStyle(plotter, name, group, yNames): name -- what is to be plotted (y name) group -- which group the curve is in (group = -1 means it is the only group) yNames -- all y to be plotted - return: style dictionay + return: style dictionary """ if name in ("Gcalc", "Gdiff", "crw"): style = plotter.buildLineStyle() @@ -639,7 +639,7 @@ def export(self, filename): def _exportCompactData(fp, xylist, xynames=None): """Write the xylist data in a text format to the file object fp. - The curves with the same x are groupped in the same datasets. + The curves with the same x are grouped in the same datasets. The datasets are marked with "#S 1", "#S 2", etc. labels according to the spec format http://www.certif.com/cplot_manual/ch0c_C_11_3.html diff --git a/src/diffpy/pdfgui/gui/DesignNotes.txt b/src/diffpy/pdfgui/gui/DesignNotes.txt index 13862e76..1f24a270 100644 --- a/src/diffpy/pdfgui/gui/DesignNotes.txt +++ b/src/diffpy/pdfgui/gui/DesignNotes.txt @@ -3,7 +3,7 @@ Copying and Pasting: The project is going to allow copying and pasting on all levels of the fit tree. By default, when changing the metadata or constraints of a copied -data set or structure, the change will be local. The same is true of chaning a +data set or structure, the change will be local. The same is true of changing a structure. If, however, many identical copies are selected simultaneously, changes will take place to all of them. If many items are highlighted, but are not identical, the display only shows information for the first item. If the @@ -26,6 +26,6 @@ the tree. Future Options: * Highlight many items, copy from one to all others from right click. * Remember history of constraints. -* Hava a "Link to results" copy option in the right click menu. +* Have a "Link to results" copy option in the right click menu. * Be able to describe a parameter. Hovering over the parameter in the windows where it appears will show user's description as a tool tip diff --git a/src/diffpy/pdfgui/gui/aboutdialog.py b/src/diffpy/pdfgui/gui/aboutdialog.py index f0700cbb..a15c0d7f 100644 --- a/src/diffpy/pdfgui/gui/aboutdialog.py +++ b/src/diffpy/pdfgui/gui/aboutdialog.py @@ -120,7 +120,7 @@ def __init__(self, *args, **kwds): # setup acknowledgement and copyright text labels self.label_acknowledgement.SetLabel(_acknowledgement) self.label_copyright.SetLabel(_copyright) - # display version and svn revison numbers + # display version and svn revision numbers verwords = __version__.split(".post", 1) version = verwords[0] revision = "0" if len(verwords) == 1 else verwords[1] diff --git a/src/diffpy/pdfgui/gui/calculationpanel.py b/src/diffpy/pdfgui/gui/calculationpanel.py index 4c8b0041..70b3ae1a 100644 --- a/src/diffpy/pdfgui/gui/calculationpanel.py +++ b/src/diffpy/pdfgui/gui/calculationpanel.py @@ -156,7 +156,7 @@ def __init__(self, *args, **kwds): # USER CONFIGURATION CODE ################################################# def __customProperties(self): - """Set up the custom properites.""" + """Set up the custom properties.""" self._focusedText = None self.calculation = None self.stypeMap = {0: "N", 1: "X"} diff --git a/src/diffpy/pdfgui/gui/errorwrapper.py b/src/diffpy/pdfgui/gui/errorwrapper.py index de99d93b..1757bcdb 100644 --- a/src/diffpy/pdfgui/gui/errorwrapper.py +++ b/src/diffpy/pdfgui/gui/errorwrapper.py @@ -110,7 +110,7 @@ def catchObjectErrors(obj, exclude=None): instance, which contains information about how and when to display errors. exclude -- An iterable of additional function names to exclude. These are - excluded in addtion to names in _EXCLUDED_METHODS defined above. + excluded in addition to names in _EXCLUDED_METHODS defined above. All functions starting with '_' are excluded. """ diff --git a/src/diffpy/pdfgui/gui/fittree.py b/src/diffpy/pdfgui/gui/fittree.py index afd0fcc8..03abeb01 100644 --- a/src/diffpy/pdfgui/gui/fittree.py +++ b/src/diffpy/pdfgui/gui/fittree.py @@ -44,7 +44,7 @@ class FitTree(wx12.TreeCtrl): _ fit (*) | |____ phase (5) - |____ datset (*) + |____ dataset (*) |____ calculation (*) Fits are at the top level. Under fits there are phases, datasets, and @@ -760,7 +760,7 @@ def __copyLabel(self, oldlabel, entrypoint): return label def __InsertBranch(self, cdata, entrypoint, label, insertafter=None, prepend=False): - """Instert control data into the tree. + """Insert control data into the tree. cdata -- The control data that goes with the branch entrypoint -- The subbranch (fit root) to paste into @@ -859,7 +859,7 @@ def ExtendProjectTree(self, treelist, clear=True, paste=False): Note that node[1] should be empty if the node is a calculation. - Returns the last insterted fit or calculation node + Returns the last inserted fit or calculation node """ # Clean slate if clear: diff --git a/src/diffpy/pdfgui/gui/gui_organization.txt b/src/diffpy/pdfgui/gui/gui_organization.txt index e79140e6..8bc18cdb 100644 --- a/src/diffpy/pdfgui/gui/gui_organization.txt +++ b/src/diffpy/pdfgui/gui/gui_organization.txt @@ -12,7 +12,7 @@ pdfpanel.py). PDFPanel is a 'mix-in' class that contains variables and methods needed by dynamic panels. The most important of these is the refresh() method. The dynamic panel's refresh() method is called by MainPanel whenever a given dynamic panel is made visible (it becomes the rightPanel). refresh() must be -redefined in a sublass of PDFPanel otherwise a NotImplementedError will be +redefined in a subclass of PDFPanel otherwise a NotImplementedError will be thrown whenever refresh() is called. MainPanel only calls refresh() for the rightPanel, not any of its children. It is up to a dynamic panel to take care of its children. @@ -48,7 +48,7 @@ selected phase in the FitTree. The information must be shared with the children by rightPanel (perhaps as part of the refresh() method.) Objects given to the rightPanel in these cases is as follows. -_configuration - The configuation data for the panel. This is either a +_configuration - The configuration data for the panel. This is either a dictionary or other object that tells how to set up the configuration window. _constraints - The constraints data for the panel. diff --git a/src/diffpy/pdfgui/gui/mainframe.py b/src/diffpy/pdfgui/gui/mainframe.py index 1e96261a..efd2de05 100644 --- a/src/diffpy/pdfgui/gui/mainframe.py +++ b/src/diffpy/pdfgui/gui/mainframe.py @@ -227,7 +227,7 @@ def __cmdLineLoad(self): def __defineLocalIds(self): """Several user functions are duplicated many times throughout the gui. - This occurrs mostly between the main menu, the right-click menu, and the + This occurs mostly between the main menu, the right-click menu, and the many buttons in the gui. This method defines local Ids that can be used for all of these. """ @@ -1217,7 +1217,7 @@ def onTreeSelChanging(self, event): # wxGlade: MainPanel. "dseries" mode: * can only select fit items """ - # THIS DOESNT WORK ON WINDOWS! + # THIS DOESN'T WORK ON WINDOWS! node = event.GetItem() if not node: return @@ -1918,7 +1918,7 @@ def onRun(self, event): This also runs calculations that are children of a running fit. """ - # Make sure that the tree is focued. This will trigger the KILL_FOCUS + # Make sure that the tree is focused. This will trigger the KILL_FOCUS # events of the other panels. self.treeCtrlMain.SetFocus() @@ -2164,7 +2164,7 @@ def onRequest(self, event): return def onCommunity(self, event): - """Open the brower and go to the diffpy-users Google Group.""" + """Open the browser and go to the diffpy-users Google Group.""" import webbrowser try: @@ -2223,7 +2223,7 @@ def onOpen(self, event): def onSave(self, event): """Save the project to a predetermined location.""" - # Make sure that the tree is focued. This will trigger the KILL_FOCUS + # Make sure that the tree is focused. This will trigger the KILL_FOCUS # events of the other panels. self.treeCtrlMain.SetFocus() @@ -2239,7 +2239,7 @@ def onSave(self, event): def onSaveAs(self, event): """Open a save dialog so the current project can be saved.""" - # Make sure that the tree is focued. This will trigger the KILL_FOCUS + # Make sure that the tree is focused. This will trigger the KILL_FOCUS # events of the other panels. self.treeCtrlMain.SetFocus() @@ -2334,7 +2334,7 @@ def onExportRes(self, event): if d.ShowModal() == wx.ID_OK: path = d.GetPath() self.workpath, savename = os.path.split(path) - # Add the right extention if it doesn't already have it. + # Add the right extension if it doesn't already have it. if len(savename) < 3 or savename[-3:] != "res": savename += ".res" path = os.path.join(self.workpath, savename) @@ -2397,7 +2397,7 @@ def onExportNewStruct(self, event): i = d.GetFilterIndex() path = d.GetPath() self.workpath, savename = os.path.split(path) - # Add the right extention if the file needs it. + # Add the right extension if the file needs it. if len(savename) < 3 or (extlist[i] and savename[-3:] != extlist[i][-3:]): savename += ".%s" % extlist[i] path = os.path.join(self.workpath, savename) @@ -2443,7 +2443,7 @@ def onExportStruct(self, event): i = d.GetFilterIndex() path = d.GetPath() self.workpath, savename = os.path.split(path) - # Add the right extention if the file needs it. + # Add the right extension if the file needs it. if len(savename) < 3 or (extlist[i] and savename[-3:] != extlist[i][-3:]): savename += ".%s" % extlist[i] path = os.path.join(self.workpath, savename) @@ -2479,7 +2479,7 @@ def onExportPDF(self, event): if d.ShowModal() == wx.ID_OK: path = d.GetPath() self.workpath, savename = os.path.split(path) - # Add the right extention if it doesn't already have it. + # Add the right extension if it doesn't already have it. if len(savename) < 3 or savename[-3:] != "fgr": savename += ".fgr" path = os.path.join(self.workpath, savename) @@ -2511,7 +2511,7 @@ def onSaveCalc(self, event): if d.ShowModal() == wx.ID_OK: path = d.GetPath() self.workpath, savename = os.path.split(path) - # Add the right extention if it doesn't already have it. + # Add the right extension if it doesn't already have it. if len(savename) < 3 or savename[-3:] != "cgr": savename += ".cgr" path = os.path.join(self.workpath, savename) diff --git a/src/diffpy/pdfgui/gui/phaseconfigurepanel.py b/src/diffpy/pdfgui/gui/phaseconfigurepanel.py index d5d44ed4..1050ef42 100644 --- a/src/diffpy/pdfgui/gui/phaseconfigurepanel.py +++ b/src/diffpy/pdfgui/gui/phaseconfigurepanel.py @@ -39,8 +39,8 @@ class PhaseConfigurePanel(wx.Panel, PDFPanel): structure -- reference to PDFStructure _focusedText -- value of a cell or textctrl before it changes lConstraintsMap -- map of TextCtrl name to parameter name - _row -- row, where rightclick occured - _col -- column, where rightclick occured + _row -- row, where rightclick occurred + _col -- column, where rightclick occurred """ def __init__(self, *args, **kwds): diff --git a/src/diffpy/pdfgui/gui/phasepanelutils.py b/src/diffpy/pdfgui/gui/phasepanelutils.py index 8459294e..50f348b2 100644 --- a/src/diffpy/pdfgui/gui/phasepanelutils.py +++ b/src/diffpy/pdfgui/gui/phasepanelutils.py @@ -161,7 +161,7 @@ def showSelectAtomsDialog(panel): No return value. """ - # do nothing for non-existant or empty structure + # do nothing for non-existent or empty structure if not panel.structure: return msg = "\n".join( diff --git a/src/diffpy/pdfgui/gui/plotpanel.py b/src/diffpy/pdfgui/gui/plotpanel.py index 8aaaec39..f6a6d918 100644 --- a/src/diffpy/pdfgui/gui/plotpanel.py +++ b/src/diffpy/pdfgui/gui/plotpanel.py @@ -140,7 +140,7 @@ def updateWidgets(self): xdata.append("step") break - # index is added if mutiple selections are chosen from different fits + # index is added if multiple selections are chosen from different fits if len(fits) > 1: xdata.append("index") diff --git a/src/diffpy/pdfgui/gui/sgconstraindialog.py b/src/diffpy/pdfgui/gui/sgconstraindialog.py index 5c8ecbc3..d676dc4f 100644 --- a/src/diffpy/pdfgui/gui/sgconstraindialog.py +++ b/src/diffpy/pdfgui/gui/sgconstraindialog.py @@ -233,7 +233,7 @@ def onSGSelect(self, event): # wxGlade: SGConstrainDialog. return def onOk(self, event): # wxGlade: SGConstrainDialog. - # check to see if the space group is consistant + # check to see if the space group is consistent if not self.structure.isSpaceGroupPossible(self.spacegroup): message = "The chosen space group is not consistent\n" message += "with the lattice parameters.\n" diff --git a/src/diffpy/pdfgui/gui/sgstructuredialog.py b/src/diffpy/pdfgui/gui/sgstructuredialog.py index 7819579a..1e2daffa 100644 --- a/src/diffpy/pdfgui/gui/sgstructuredialog.py +++ b/src/diffpy/pdfgui/gui/sgstructuredialog.py @@ -227,7 +227,7 @@ def onOZTextEnter(self, event): # wxGlade: SGStructureDialog. return def onOk(self, event): # wxGlade: SGStructureDialog. - # check to see if the space group is consistant + # check to see if the space group is consistent if not self.structure.isSpaceGroupPossible(self.spacegroup): message = "The chosen space group is not consistent\n" message += "with the lattice parameters.\n" diff --git a/src/diffpy/pdfgui/gui/temperatureseriespanel.py b/src/diffpy/pdfgui/gui/temperatureseriespanel.py index 66956fc2..14d9ce31 100644 --- a/src/diffpy/pdfgui/gui/temperatureseriespanel.py +++ b/src/diffpy/pdfgui/gui/temperatureseriespanel.py @@ -225,7 +225,7 @@ def onAdd(self, event): # wxGlade: TemperatureSeriesPanel. rx = {"f": r"(?:\d+(?:\.\d*)?|\d*\.\d+)"} # Search for T123, t123, Temp123, temp123, 123k, 123K. # Some filenames fool this, e.g. "test1.dat" will match '1' since it - # is preceeded by a 't'. + # is preceded by a 't'. # Is there a better regexp? Probably... regexp = ( r"""(?:[Tt](?:emp(?:erature)?)?(%(f)s))| diff --git a/src/diffpy/pdfgui/gui/wxextensions/autowidthlabelsgrid.py b/src/diffpy/pdfgui/gui/wxextensions/autowidthlabelsgrid.py index 77d3f891..154f1fae 100644 --- a/src/diffpy/pdfgui/gui/wxextensions/autowidthlabelsgrid.py +++ b/src/diffpy/pdfgui/gui/wxextensions/autowidthlabelsgrid.py @@ -23,7 +23,7 @@ class AutoWidthLabelsGrid(wx.grid.Grid): - """wx grid which allows lables auto sizing""" + """wx grid which allows labels auto sizing""" # def __init__(self, parent, state, size): # wx.grid.Grid.__init__(self, parent, state, size) diff --git a/src/diffpy/pdfgui/gui/wxextensions/listctrls.py b/src/diffpy/pdfgui/gui/wxextensions/listctrls.py index c6cfc588..0d7ef8a3 100644 --- a/src/diffpy/pdfgui/gui/wxextensions/listctrls.py +++ b/src/diffpy/pdfgui/gui/wxextensions/listctrls.py @@ -68,7 +68,7 @@ class ColumnSortListCtrl(AutoWidthListCtrl, listmix.ColumnSorterMixin): is pressed. This ListCtrl requires an itemDataMap member dictionary to be initialized - before the sorting capabilites can be realized. This dictionary simply references + before the sorting capabilities can be realized. This dictionary simply references the ListCtrl's entries by a unique number. This number must be stored as the ItemData (with SetItemData) of the entry. The member data must be in the form of a tuple, where the tuple has a number of entries as the ListCtrl has