Skip to content

Commit 00d33a4

Browse files
authored
Merge pull request #4 from xraysoftmat/main
Merge main to dev
2 parents b195255 + 910bd5e commit 00d33a4

File tree

6 files changed

+354
-73
lines changed

6 files changed

+354
-73
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,5 +162,5 @@ cython_debug/
162162
# Datafiles
163163
.asc
164164

165-
test*
165+
tests/archive*
166166
.vscode*

.pre-commit-config.yaml

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,37 @@
1+
## `Pre-commit` module configuration file
2+
## Can be installed using `pip install pre-commit`
3+
## The pre-commit hooks can then be installed using `pre-commit install`
4+
## All checks are run by default when `git commit` is run.
5+
16
repos:
2-
- repo: https://github.com/psf/black
3-
rev: 24.8.0
4-
hooks:
5-
- id: black
7+
# Pre-commit hooks for basic Python processing
8+
- repo: https://github.com/pre-commit/pre-commit-hooks
9+
rev: v5.0.0
10+
hooks:
11+
- id: check-added-large-files
12+
- id: check-toml
13+
- id: check-yaml
14+
- id: end-of-file-fixer
15+
- id: mixed-line-ending
16+
- id: trailing-whitespace
17+
18+
# Black - for standard code formatting
19+
- repo: https://github.com/psf/black
20+
rev: 24.10.0
21+
hooks:
22+
- id: black
623

7-
- repo: https://github.com/pre-commit/pre-commit-hooks
8-
rev: v4.6.0
9-
hooks:
10-
- id: trailing-whitespace
11-
- id: end-of-file-fixer
12-
- id: check-yaml
13-
- id: check-added-large-files
24+
# NumPyDoc - for docstring validation
25+
- repo: https://github.com/numpy/numpydoc
26+
rev: v1.8.0
27+
hooks:
28+
- id: numpydoc-validation
1429

15-
# - repo: https://github.com/numpy/numpydoc
16-
# rev: v1.6.0
17-
# hooks:
18-
# - id: numpydoc-validation
30+
# Python Semantic Release & commitizen - for automatic versioning
31+
- repo: https://github.com/commitizen-tools/commitizen
32+
rev: v4.1.0
33+
hooks:
34+
- id: commitizen
35+
stages: [commit-msg]
36+
- id: commitizen-branch
37+
stages: [pre-push]

pyNexafs/__main__.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""
2+
Main entry point for the pyNexafs package.
3+
4+
Runs the GUI for the package if the dependencies are met.
5+
Can be run from the command line with the command `python -m pyNexafs`.
6+
"""
7+
8+
if __name__ == "__main__":
9+
# Check if the dependencies are met
10+
try:
11+
import PyQt6
12+
except ImportError as e:
13+
print(
14+
"PyQt6 is not installed. Please install PyQt6 to run the GUI."
15+
+ f"\nTraceback: {e}"
16+
)
17+
exit()
18+
19+
from pyNexafs.gui.data_browser import gui
20+
21+
# Create and run the app
22+
gui()

pyproject.toml

Lines changed: 72 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,77 @@
1+
## What system to build the project with? I.e. Setuptools, Wheel, Poetry, etc.
2+
## Using `setuptools` here.
3+
14
[build-system]
2-
requires = [
3-
"setuptools>=60",
4-
"setuptools-scm>=8.0"
5-
]
6-
build-backend = "setuptools.build_meta"
5+
requires = [
6+
"setuptools>=60",
7+
"setuptools-scm>=8.0"
8+
]
9+
build-backend = "setuptools.build_meta"
710

811
[project]
9-
name = "pyNexafs"
10-
# https://packaging.python.org/en/latest/specifications/version-specifiers/#version-specifiers
11-
# Use Major.Minor.Micro versioning.
12-
# version = "0.1.0"
13-
# https://pypi.org/project/setuptools-scm/ Generate a dynamic version based on .git information.
14-
dynamic = ["version"]
15-
dependencies = [
16-
"scipy",
17-
"numpy",
18-
"pandas",
19-
"overrides",
20-
"xdrlib3" # for reading binary mda files
21-
]
22-
description = "A package for processing and analyzing NEXAFS data."
23-
license = {file = "LICENSE"}
24-
authors = [
25-
{name = "Matthew Gebert", email="[email protected]"},
26-
]
27-
maintainers = [
28-
{name = "Matthew Gebert", email="[email protected]"},
29-
]
30-
readme = "README.md"
31-
keywords = ["NEXAFS", "XAS", "synchrotron"]
32-
33-
[tool.setuptools.packages.find] # All the following settings are optional:
34-
where = ["."] # Root directory
35-
include = ["pyNexafs*"]
36-
exclude = []
12+
# Project information
13+
name = "pyNexafs"
14+
version = "0.1.0"
15+
description = "A package for processing and analysing NEXAFS data."
16+
readme = "README.md"
17+
license = {file = "LICENSE"}
18+
keywords = ["NEXAFS", "XANES", "Near", "Edge", "X-ray", "Absorption", "Fine", "Structure", "Spectroscopy", "Optical Data", "XAS", "Synchrotron"]
19+
authors = [
20+
{name = "Matthew Gebert", email="[email protected]"},
21+
]
22+
maintainers = [
23+
{name = "Matthew Gebert", email="[email protected]"},
24+
]
25+
26+
# Project compatibility:
27+
requires-python = ">=3.10"
28+
dependencies = [
29+
"numpy",
30+
"overrides", # for type hinting
31+
"scipy",
32+
"xdrlib3" # function bindings for reading binary data from mda files
33+
]
34+
35+
[project.urls]
36+
# Website, documentation and other continuous integration URLS.
37+
code = "https://github.com/mattgebert/pyNexafs"
38+
documentation = "https://pyNexafs.readthedocs.io/en/latest/"
39+
40+
[project.optional-dependencies]
41+
gui = [
42+
"matplotlib",
43+
"pandas",
44+
"pyqt6",
45+
"pyyaml",
46+
]
47+
dev = [
48+
"commitizen",
49+
"numpydoc",
50+
"pre-commit",
51+
"pytest",
52+
"python-semantic-release",
53+
"sphinx",
54+
"sphinx-rtd-theme",
55+
]
56+
docs = [
57+
"sphinx",
58+
"sphinx-rtd-theme",
59+
"numpydoc",
60+
]
61+
62+
# [tool.setuptools.packages.find] # All the following settings are optional:
63+
# where = ["."] # Root directory
64+
# include = ["pyNexafs*"]
65+
# exclude = []
3766

3867
[tool.numpydoc_validation]
39-
checks = [
40-
"all", # report on all checks, except the below
41-
"EX01",
42-
"SA01",
43-
"ES01",
44-
]
45-
46-
# namespaces = true # true by default
47-
48-
### Example dependency usage
49-
# example <= 0.4
50-
# allowed operators <, >, <=, >=, == or !=,
51-
52-
### Example inlcude
53-
# ["*"] by default
54-
55-
### Example exclude
56-
# [] by default
57-
# "pyNexafs.tests*",
58-
# "pyNexafs.test_data*,
68+
checks = [
69+
"all", # report on all checks, except the below
70+
"EX01",
71+
"SA01",
72+
"ES01",
73+
]
74+
75+
exclude = [
76+
'tests*',
77+
]

setup.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)