Skip to content

Commit 6bd752c

Browse files
committed
update project template
1 parent b1dce61 commit 6bd752c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+218
-184
lines changed

.gitignore

+3-7
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ target/
7171
# Jupyter Notebook
7272
.ipynb_checkpoints
7373

74+
# Dask worker cache
75+
dask-worker-space/
76+
7477
# pyenv
7578
.python-version
7679

@@ -105,10 +108,3 @@ ENV/
105108
.vscode/
106109
.idea/
107110

108-
#
109-
tests/data/*
110-
*.h5
111-
*.hdf
112-
*DS_Store
113-
*.tif
114-
*.png

CODE_OF_CONDUCT.rst

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
====================================
2+
Contributor Covenant Code of Conduct
3+
====================================
4+
5+
Our Pledge
6+
----------
7+
8+
In the interest of fostering an open and welcoming environment, we as
9+
contributors and maintainers pledge to make participation in our project and
10+
our community a harassment-free experience for everyone, regardless of age, body
11+
size, disability, ethnicity, sex characteristics, gender identity and expression,
12+
level of experience, education, socio-economic status, nationality, personal
13+
appearance, race, religion, or sexual identity and orientation.
14+
15+
Our Standards
16+
-------------
17+
18+
Examples of behavior that contributes to creating a positive environment
19+
include:
20+
21+
* Using welcoming and inclusive language
22+
* Being respectful of differing viewpoints and experiences
23+
* Gracefully accepting constructive criticism
24+
* Focusing on what is best for the community
25+
* Showing empathy towards other community members
26+
27+
Examples of unacceptable behavior by participants include:
28+
29+
* The use of sexualized language or imagery and unwelcome sexual attention or
30+
advances
31+
* Trolling, insulting/derogatory comments, and personal or political attacks
32+
* Public or private harassment
33+
* Publishing others' private information, such as a physical or electronic
34+
address, without explicit permission
35+
* Other conduct which could reasonably be considered inappropriate in a
36+
professional setting
37+
38+
Our Responsibilities
39+
--------------------
40+
41+
Project maintainers are responsible for clarifying the standards of acceptable
42+
behavior and are expected to take appropriate and fair corrective action in
43+
response to any instances of unacceptable behavior.
44+
45+
Project maintainers have the right and responsibility to remove, edit, or
46+
reject comments, commits, code, wiki edits, issues, and other contributions
47+
that are not aligned to this Code of Conduct, or to ban temporarily or
48+
permanently any contributor for other behaviors that they deem inappropriate,
49+
threatening, offensive, or harmful.
50+
51+
Scope
52+
-----
53+
54+
This Code of Conduct applies within all project spaces, and it also applies when
55+
an individual is representing the project or its community in public spaces.
56+
Examples of representing a project or community include using an official
57+
project e-mail address, posting via an official social media account, or acting
58+
as an appointed representative at an online or offline event. Representation of
59+
a project may be further defined and clarified by project maintainers.
60+
61+
Enforcement
62+
-----------
63+
64+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
65+
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
66+
complaints will be reviewed and investigated and will result in a response that
67+
is deemed necessary and appropriate to the circumstances. The project team is
68+
obligated to maintain confidentiality with regard to the reporter of an incident.
69+
Further details of specific enforcement policies may be posted separately.
70+
71+
Project maintainers who do not follow or enforce the Code of Conduct in good
72+
faith may face temporary or permanent repercussions as determined by other
73+
members of the project's leadership.
74+
75+
Attribution
76+
-----------
77+
78+
This Code of Conduct is adapted from the `Contributor Covenant`_, version 1.4,
79+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
80+
81+
For answers to common questions about this code of conduct, see
82+
https://www.contributor-covenant.org/faq
83+
84+
.. _`Contributor Covenant`: https://www.contributor-covenant.org

CONTRIBUTING.rst

+12-3
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ Ready to contribute? Here's how to set up `pysimplemask` for local development.
7979
5. When you're done making changes, check that your changes pass flake8 and the
8080
tests, including testing other Python versions with tox::
8181

82-
$ flake8 pysimplemask tests
83-
$ python setup.py test or pytest
84-
$ tox
82+
$ make lint
83+
$ make test
84+
Or
85+
$ make test-all
8586

8687
To get flake8 and tox, just pip install them into your virtualenv.
8788

@@ -126,3 +127,11 @@ $ git push
126127
$ git push --tags
127128

128129
Travis will then deploy to PyPI if tests pass.
130+
131+
Code of Conduct
132+
---------------
133+
134+
Please note that this project is released with a `Contributor Code of Conduct`_.
135+
By participating in this project you agree to abide by its terms.
136+
137+
.. _`Contributor Code of Conduct`: CODE_OF_CONDUCT.rst

HISTORY.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
History
33
=======
44

5-
0.0.1 (2021-10-22)
5+
0.1.0 (2024-12-19)
66
------------------
77

88
* First release on PyPI.

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021, Miaoqi Chu
3+
Copyright (c) 2024, Miaoqi Chu
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
.PHONY: clean clean-test clean-pyc clean-build docs help
1+
.PHONY: clean clean-build clean-pyc clean-test coverage dist docs help install lint lint/flake8
2+
23
.DEFAULT_GOAL := help
34

45
define BROWSER_PYSCRIPT
@@ -50,6 +51,7 @@ clean-test: ## remove test and coverage artifacts
5051
lint/flake8: ## check style with flake8
5152
flake8 pysimplemask tests
5253

54+
5355
lint: lint/flake8 ## check style
5456

5557
test: ## run tests quickly with the default Python

README.rst

+2-55
Original file line numberDiff line numberDiff line change
@@ -16,70 +16,17 @@ pySimpleMask
1616

1717

1818

19-
A GUI tool to create mask and qmap for xarea detectors used in xray experiments
19+
A GUI for creating mask and q-partition maps for scattering patterns in preparation for SAXS/WAXS/XPCS data reduction
2020

2121

2222
* Free software: MIT license
2323
* Documentation: https://pysimplemask.readthedocs.io.
2424

25-
Installation
26-
--------
27-
Step 1. create your virtual environement::
28-
29-
conda create -n YOUR_ENV_NAME python==3.9.7
30-
31-
Step 2. activate your newly created environment::
32-
33-
conda activate YOUR_ENV_NAME
34-
35-
Step 3. clone pysimple to your local disk::
36-
37-
git clone https://github.com/AdvancedPhotonSource/pySimpleMask.git
38-
39-
Step 4. install it::
40-
41-
cd pySimpleMask
42-
pip install .
43-
44-
You may also need to install magic-bin on windows systems,
45-
46-
pip install python-magic-bin
47-
48-
Step 5. run simplemask, open a terminal and activate your virtual environment, ::
49-
50-
pysimplemask
51-
pysimplemask --path YOUR_HDF_PATH
52-
5325

5426
Features
5527
--------
56-
Main layout
57-
58-
.. image:: docs/figures/main.png
59-
60-
Create a mask by importing a blemish file or masks from other files
61-
62-
.. image:: docs/figures/mask_files.png
63-
64-
Create a mask by drawing on the scattering pattern.
65-
66-
.. image:: docs/figures/mask_draw.png
67-
68-
Set a threshold to make the scattering image binary.
69-
70-
.. image:: docs/figures/mask_binary.png
71-
72-
Manually set the the coordinates of bad pixels on the area detector. This can be done in 3 ways now. 1. import from a file (either CSV or white space separated). 2. mannaul input the coordinates. 3. use the mouse the double clicke the bad pixels. Other pixels with similar counts can also be selected.
73-
74-
.. image:: docs/figures/mask_manual.png
75-
76-
Some bad pixels can be hard to detect. By doing azimuthal grouping, we can compute the statistics of photon counts on the pixels that have similar momentum transfer. The pixels that deviate from the average more than the cutoff will be masked out.
77-
78-
.. image:: docs/figures/mask_outlier.png
79-
80-
Create a qmap partition for SAXS and XPCS analysis.
8128

82-
.. image:: docs/figures/qpartition.png
29+
* TODO
8330

8431
Credits
8532
-------

docs/conf.py

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
# General information about the project.
4949
project = 'pySimpleMask'
50-
copyright = "2021, Miaoqi Chu"
50+
copyright = "2024, Miaoqi Chu"
5151
author = "Miaoqi Chu"
5252

5353
# The version info for the project you're documenting, acts as replacement

docs/figures/after_masking.png

-44.5 KB
Binary file not shown.

docs/figures/main.png

-1.36 MB
Binary file not shown.

docs/figures/mask_binary.png

-65.7 KB
Binary file not shown.

docs/figures/mask_draw.png

-91.7 KB
Binary file not shown.

docs/figures/mask_files.png

-92.3 KB
Binary file not shown.

docs/figures/mask_manual.png

-92.9 KB
Binary file not shown.

docs/figures/mask_outlier.png

-80.9 KB
Binary file not shown.

docs/figures/qpartition.png

-569 KB
Binary file not shown.

docs/figures/readme

-1
This file was deleted.

docs/make.bat

+36-36
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
@ECHO OFF
2-
3-
pushd %~dp0
4-
5-
REM Command file for Sphinx documentation
6-
7-
if "%SPHINXBUILD%" == "" (
8-
set SPHINXBUILD=python -msphinx
9-
)
10-
set SOURCEDIR=.
11-
set BUILDDIR=_build
12-
set SPHINXPROJ=pysimplemask
13-
14-
if "%1" == "" goto help
15-
16-
%SPHINXBUILD% >NUL 2>NUL
17-
if errorlevel 9009 (
18-
echo.
19-
echo.The Sphinx module was not found. Make sure you have Sphinx installed,
20-
echo.then set the SPHINXBUILD environment variable to point to the full
21-
echo.path of the 'sphinx-build' executable. Alternatively you may add the
22-
echo.Sphinx directory to PATH.
23-
echo.
24-
echo.If you don't have Sphinx installed, grab it from
25-
echo.http://sphinx-doc.org/
26-
exit /b 1
27-
)
28-
29-
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
30-
goto end
31-
32-
:help
33-
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
34-
35-
:end
36-
popd
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=python -msphinx
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
set SPHINXPROJ=pysimplemask
13+
14+
if "%1" == "" goto help
15+
16+
%SPHINXBUILD% >NUL 2>NUL
17+
if errorlevel 9009 (
18+
echo.
19+
echo.The Sphinx module was not found. Make sure you have Sphinx installed,
20+
echo.then set the SPHINXBUILD environment variable to point to the full
21+
echo.path of the 'sphinx-build' executable. Alternatively you may add the
22+
echo.Sphinx directory to PATH.
23+
echo.
24+
echo.If you don't have Sphinx installed, grab it from
25+
echo.http://sphinx-doc.org/
26+
exit /b 1
27+
)
28+
29+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
30+
goto end
31+
32+
:help
33+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
34+
35+
:end
36+
popd

pyproject.toml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "pysimplemask"
7+
version = "0.1.0"
8+
description = "A GUI for creating mask and q-partition maps for scattering patterns in preparation for SAXS/WAXS/XPCS data reduction"
9+
readme = "README.rst"
10+
authors = [
11+
{name = "Miaoqi Chu", email = "[email protected]"}
12+
]
13+
maintainers = [
14+
{name = "Miaoqi Chu", email = "[email protected]"}
15+
]
16+
classifiers = [
17+
18+
]
19+
license = {text = "MIT license"}
20+
dependencies = [
21+
22+
]
23+
24+
[project.optional-dependencies]
25+
dev = [
26+
"coverage", # testing
27+
"mypy", # linting
28+
"pytest", # testing
29+
"ruff" # linting
30+
]
31+
32+
[project.scripts]
33+
pysimplemask = "pysimplemask.cli:main"
34+
35+
[project.urls]
36+
37+
bugs = "https://github.com/AZjk/pysimplemask/issues"
38+
changelog = "https://github.com/AZjk/pysimplemask/blob/master/changelog.md"
39+
homepage = "https://github.com/AZjk/pysimplemask"
40+
41+
[tool.setuptools]
42+
package-dir = {"" = "src"}
43+
44+
[tool.setuptools.package-data]
45+
"*" = ["*.*"]
46+
47+
48+
# Mypy
49+
# ----
50+
51+
[tool.mypy]
52+
files = "."
53+
54+
# Use strict defaults
55+
strict = true
56+
warn_unreachable = true
57+
warn_no_return = true
58+
59+
[[tool.mypy.overrides]]
60+
# Don't require test functions to include types
61+
module = "tests.*"
62+
allow_untyped_defs = true
63+
disable_error_code = "attr-defined"
64+

requirements.txt

-10
This file was deleted.

0 commit comments

Comments
 (0)