Skip to content

Commit

Permalink
Merge pull request #48 from OpenCOMPES/spell_check
Browse files Browse the repository at this point in the history
Spell check
  • Loading branch information
rettigl authored Jul 13, 2024
2 parents dba6448 + c5409b9 commit 400021f
Show file tree
Hide file tree
Showing 26 changed files with 264 additions and 90 deletions.
148 changes: 148 additions & 0 deletions .cspell/custom-dictionary.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# Custom Dictionary Words
allclose
ALLUSERSPROFILE
amperemeter
arange
archiver
argwhere
ARPES
astype
autoclass
automodule
autoreload
autosummary
axhline
AXISNAME
axvline
basepath
bitshift
bysource
calib
checkscan
clim
codemirror
coeff
COLLECTIONCOLUMN
colorbar
COMPES
configpath
cropit
damatrix
dapolymatrix
dataconverter
dataframe
delaystage
dtype
dxda
dxde
dyda
dyde
Ekin
electronanalyser
elems
endstation
energydispersion
eshift
faddr
Faradayweg
fftshift
filt
fluence
fspath
FWHM
genindex
hline
ifftshift
IMAGEJ
imgj
imread
imshow
imutils
imwrite
Interp
ipykernel
ipympl
ipython
ipywidgets
irfft
kernelspec
kwds
labview
Laurenz
lensmodes
lineh
linev
listf
literalinclude
loadtxt
matplotlib
maxdepth
mbar
meshgrid
modindex
mpes
nanos
nbagg
nbconvert
nbformat
nbsphinx
ndarray
ndarrays
ndim
ndimage
ndims
ndmin
nesteddict
nestedentry
numpy
nxdl
Nxpix
Nxpixels
Nypixels
OPCPA
pcolormesh
Phoibos
polyfit
polyval
pyenv
pygments
pynxtools
pyplot
pyproject
quickstart
RAWDATA
Rettig
rfft
rrvec
rtol
rtype
scanvector
specsanalyzer
Specslab
specsscan
stype
tempa
tifffile
tmpdirname
toctree
tomlkit
topfloor
tqdm
typehints
TZCYXS
undoc
venv
vline
vmax
vmin
xarray
xarrays
xdata
xgrid
Xmpes
xpos
Xuser
ydata
ygrid
ypos
zinner
11 changes: 9 additions & 2 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,22 @@ jobs:
python-version: 3.8
poetry-version: 1.2.2

# Linting steps, excute all linters even if one fails
# Linting steps, execute all linters even if one fails
- name: ruff
run:
poetry run ruff specsanalyzer specsscan tests
- name: ruff formating
- name: ruff formatting
if: ${{ always() }}
run:
poetry run ruff format --check specsanalyzer specsscan tests
- name: mypy
if: ${{ always() }}
run:
poetry run mypy specsanalyzer specsscan tests
- name: spellcheck
if: ${{ always() }}
uses: streetsidesoftware/cspell-action@v6
with:
check_dot_files: false
incremental_files_only: false
config: './cspell.json'
2 changes: 1 addition & 1 deletion .github/workflows/update_dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Update depencies in poetry lockfile
name: Update dependencies in poetry lockfile

on:
schedule:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,7 @@ dmypy.json
*.h5
*.tiff
*.nxs
*.pxp

# poetry
poetry.toml
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ repos:
rev: 0.6.0
hooks:
- id: nbstripout
- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v6.31.1
hooks:
- id: cspell
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This is the package `specsanalyzer` for conversion and handling of SPECS Phoibos

This package contains two modules:
`specsanalyzer` is a package to import and convert MCP analyzer images from SPECS Phoibos analyzers into energy and emission angle/physical coordinates.
`specsscan` is a Python package for loading Specs Phoibos scans accquired with the labview software developed at FHI/EPFL
`specsscan` is a Python package for loading Specs Phoibos scans acquired with the labview software developed at FHI/EPFL

Tutorials for usage and the API documentation can be found in the [Documentation](https://opencompes.github.io/specsanalyzer/)

Expand Down Expand Up @@ -47,9 +47,9 @@ python -m ipykernel install --user --name=specs_kernel
```

#### Configuration and calib2d file
The conversion procedures require to set up several configuration parameters in a config file. An example config file is provided as part of the package (see documentation). Configuration files can either be passed to the class constructures, or are read from system-wide or user-defined locations (see documentation).
The conversion procedures require to set up several configuration parameters in a config file. An example config file is provided as part of the package (see documentation). Configuration files can either be passed to the class constructors, or are read from system-wide or user-defined locations (see documentation).

Most importantly, conversion of analyzer data to energy/angular coordinates requires detector calibration data provided by the manufacturer. The corresponding *.calib2d file (e.g. phoibos150.calbid2d) are provided together with the spectrometer software, and need to be set in the config file.
Most importantly, conversion of analyzer data to energy/angular coordinates requires detector calibration data provided by the manufacturer. The corresponding *.calib2d file (e.g. phoibos150.calib2d) are provided together with the spectrometer software, and need to be set in the config file.

### For Contributors

Expand Down
23 changes: 23 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"version": "0.2",
"ignorePaths": [
"./tests/data/*",
"*.toml",
"Makefile",
"*.bat",
"*.pxp"
],
"dictionaryDefinitions": [
{
"name": "custom-dictionary",
"path": "./.cspell/custom-dictionary.txt",
"addWords": true
}
],
"dictionaries": [
"custom-dictionary"
],
"words": [],
"ignoreWords": [],
"import": []
}
2 changes: 0 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ def _get_project_meta():
"sphinx.ext.autosummary",
"sphinx.ext.coverage",
"sphinx_autodoc_typehints",
# "bokeh.sphinxext.bokeh_autodoc",
# "bokeh.sphinxext.bokeh_plot",
"nbsphinx",
"myst_parser",
]
Expand Down
10 changes: 0 additions & 10 deletions docs/requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion docs/specsanalyzer/config.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Config
===================================================
The config module contains a mechanis to collect configuration parameters from various sources and configuration files, and to combine them in a hierachical manner into a single, consistent configuration dictionary.
The config module contains a mechanics to collect configuration parameters from various sources and configuration files, and to combine them in a hierarchical manner into a single, consistent configuration dictionary.
It will load an (optional) provided config file, or alternatively use a passed python dictionary as initial config dictionary, and subsequently look for the following additional config files to load:

* ``folder_config``: A config file of name :file:`specs_config.yaml` in the current working directory. This is mostly intended to pass calibration parameters of the workflow between different notebook instances.
Expand Down
4 changes: 2 additions & 2 deletions specsanalyzer/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ def load_config(config_path: str) -> dict:
def save_config(config_dict: dict, config_path: str, overwrite: bool = False):
"""Function to save a given config dictionary to a json or yaml file. Normally, it loads any
existing file of the given name, and keeps any existing dictionary keys not present in the
provided dictionary. The overwrite option creates a fully empty dictionry first.
provided dictionary. The overwrite option creates a fully empty dictionary first.
Args:
config_dict (dict): The dictionry to save.
config_dict (dict): The dictionary to save.
config_path (str): A string containing the path to the file where to save the dictionary
to.
overwrite (bool, optional): Option to overwrite an existing file with the given dictionary.
Expand Down
2 changes: 1 addition & 1 deletion specsanalyzer/config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ magnification: 4.54
angle_offset_px: 0
# offset in pixels along the energy dispersing axis
energy_offset_px: 0
# flag controlling the application of a Fourier filter to remove grid artefacts
# flag controlling the application of a Fourier filter to remove grid artifacts
apply_fft_filter: false
Loading

0 comments on commit 400021f

Please sign in to comment.