diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3345920..0f9ffa1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,19 +1,50 @@ repos: -- repo: https://github.com/ikamensh/flynt/ - rev: '0.77' + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: "v4.5.0" hooks: - - id: flynt -- repo: https://github.com/charliermarsh/ruff-pre-commit - rev: 'v0.0.239' + - id: check-added-large-files + - id: check-case-conflict + - id: check-merge-conflict + - id: check-symlinks + - id: check-yaml + - id: debug-statements + - id: end-of-file-fixer + - id: mixed-line-ending + - id: name-tests-test + args: ["--pytest-test-first"] + - id: requirements-txt-fixer + - id: trailing-whitespace + - repo: https://github.com/codespell-project/codespell + rev: v2.2.6 hooks: - - id: ruff -- repo: https://github.com/psf/black - rev: 22.10.0 + - id: codespell + args: ["--ignore-words-list=buil"] + - repo: https://github.com/ikamensh/flynt + rev: "1.0.1" hooks: - - id: black - language_version: python3.9 -- repo: https://github.com/keewis/blackdoc - rev: v0.3.8 + - id: flynt + args: [--verbose] + - repo: https://github.com/PyCQA/isort + rev: "5.13.2" hooks: - - id: blackdoc - language_version: python3.9 + - id: isort + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.1.14" + hooks: + - id: ruff-format + - id: ruff + - repo: https://github.com/adamchainz/blacken-docs + rev: 1.16.0 + hooks: + - id: blacken-docs + language_version: python3.9 + - repo: https://github.com/pre-commit/mirrors-prettier + rev: "v3.1.0" + hooks: + - id: prettier + - repo: https://github.com/pre-commit/pygrep-hooks + rev: "v1.10.0" + hooks: + - id: rst-backticks + - id: rst-directive-colons + - id: rst-inline-touching-normal diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 67ab8e5..58ec1de 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -8,23 +8,22 @@ In the interest of fostering an open and welcoming environment, we as contributo Examples of behavior that contributes to creating a positive environment include: -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members Examples of unacceptable behavior by participants include: -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others’ private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting +- The use of sexualized language or imagery and unwelcome sexual attention or advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others’ private information, such as a physical or electronic address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities - Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. @@ -35,7 +34,6 @@ This Code of Conduct applies within all project spaces, and it also applies when ## Enforcement - Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting Thomas Mansencal and Michael Mauderer via email at thomas@colour-science.org and michael@colour-science.org respectively. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project’s leadership. @@ -46,6 +44,5 @@ This Code of Conduct is adapted from the Contributor Covenant, version 1.4, avai For answers to common questions about this code of conduct, see [https://www.contributor-covenant.org/faq][faq]. - [homepage]: https://www.contributor-covenant.org/version/1/4/code-of-conduct.html -[faq]: https://www.contributor-covenant.org/faq \ No newline at end of file +[faq]: https://www.contributor-covenant.org/faq diff --git a/docs/CNAME b/docs/CNAME index 9f94dfc..9741094 100644 --- a/docs/CNAME +++ b/docs/CNAME @@ -1 +1 @@ -awesome-colour.org \ No newline at end of file +awesome-colour.org diff --git a/docs/index.md b/docs/index.md index e8ea4eb..3489926 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,16 +1,14 @@ # Awesome Colour [![Awesome](https://awesome.re/badge.svg)](https://awesome.re) -__A curated list of awesome colour science resources.__ - -Inspired by the __[awesome](https://github.com/sindresorhus/awesome)__ list. Please read the __[contribution guidelines](contributing.md)__ before contributing. +**A curated list of awesome colour science resources.** +Inspired by the **[awesome](https://github.com/sindresorhus/awesome)** list. Please read the **[contribution guidelines](contributing.md)** before contributing. ## Contents - - [Awesome Colour](#awesome-colour-) - [Contents](#contents) - [Applications](#applications) @@ -40,7 +38,6 @@ Inspired by the __[awesome](https://github.com/sindresorhus/awesome)__ list. Ple - ## Applications - [CIE Color Calculator](http://www.brucelindbloom.com/ColorCalculator.html) - Online conversion between most of the CIE color models. @@ -101,6 +98,7 @@ Inspired by the __[awesome](https://github.com/sindresorhus/awesome)__ list. Ple - [Akiyoshi's Illusion Pages](http://www.ritsumei.ac.jp/~akitaoka/index-e.html) - Optical illusions. - [Awesome Computer Vision](https://github.com/jbhuang0604/awesome-computer-vision) - Curated list of awesome computer vision resources. - [Bruce Lindbloom](http://brucelindbloom.com/) - Online resource for colour conversion mathematics. +- [CG Cinematography](https://chrisbrejon.com/cg-cinematography/) - Online book by chris brejon. - [CIE Termlist](https://cie.co.at/e-ilv) - Over 1400 definitions of colour science terms. - [Color: From Hexcodes to Eyeballs](http://jamie-wong.com/post/color/) - Article on how colour get from code values to your eyes. - [Color FAQ](http://poynton.ca/notes/colour_and_gamma/ColorFAQ.html) - Clarifies aspects of colour specification and image coding. @@ -138,7 +136,7 @@ Inspired by the __[awesome](https://github.com/sindresorhus/awesome)__ list. Ple - [Color Appearance Models](http://onlinelibrary.wiley.com/book/10.1002/9781118653128) - [Color Gamut Mapping](https://onlinelibrary.wiley.com/doi/book/10.1002/9780470758922) - [Color Science: Concepts and Methods, Quantitative Data and Formulae, 2nd Edition](https://www.wiley.com/en-us/Color+Science%3A+Concepts+and+Methods%2C+Quantitative+Data+and+Formulae%2C+2nd+Edition-p-9780471399186) -- [Colour: Sense & Measurement](https://www.filmlight.ltd.uk/resources/download.php) +- [Colour: Sense & Measurement](https://www.filmlight.ltd.uk/resources/download.php) - [Computational Colour Science using MATLAB](https://onlinelibrary.wiley.com/doi/book/10.1002/9780470710890) - [Vision Science - Photons to Phenomenology](https://mitpress.mit.edu/books/vision-science) @@ -147,7 +145,7 @@ Inspired by the __[awesome](https://github.com/sindresorhus/awesome)__ list. Ple ### Websites and Articles - [Academy ACES](http://www.oscars.org/science-technology/sci-tech-projects/aces) - Industry standard for managing colour throughout the life cycle of a motion picture or television production. -- [Basic Photographic Sensitometry Workbook](https://www.kodak.com/content/products-brochures/Film/Basic-Photographic-Sensitometry-Workbook.pdf) - An Eastman Kodak's workbook on photographic sensitometry. +- [Basic Photographic Sensitometry Workbook](https://www.kodak.com/content/products-brochures/Film/Basic-Photographic-Sensitometry-Workbook.pdf) - An Eastman Kodak's workbook on photographic sensitometry. - [Chromatic Aberration Simulator](https://smallpond.ca/jim/photomicrography/ca/index.html) - A web-based online axial and transverse chromatic aberration simulator. - [Cinematic Color](http://cinematiccolor.org/) - Motion picture colour management. - [Digital Camera Reviews and Sensor Performance Summary](http://www.clarkvision.com/articles/digital.sensor.performance.summary/) - Digital camera sensor electronics and concepts. diff --git a/mkdocs.yml b/mkdocs.yml index 22a6f78..d6e685c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,43 +1,43 @@ # Project Information -site_name: 'Awesome Colour' -site_url: 'http://awesome-colour.org' -site_description: 'A curated list of awesome colour science resources.' -site_author: 'Colour Developers' +site_name: "Awesome Colour" +site_url: "http://awesome-colour.org" +site_description: "A curated list of awesome colour science resources." +site_author: "Colour Developers" # Repository -repo_name: 'colour-science/awesome-colour' -repo_url: 'https://github.com/colour-science/awesome-colour' +repo_name: "colour-science/awesome-colour" +repo_url: "https://github.com/colour-science/awesome-colour" # Copyright copyright: 'Copyright 2018 Colour Developers' # Content nav: - - 'A curated list of awesome colour science resources.': 'index.md' - - 'Contributing': 'contributing.md' + - "A curated list of awesome colour science resources.": "index.md" + - "Contributing": "contributing.md" # Theme theme: - name: 'material' + name: "material" palette: - primary: 'grey' - accent: 'grey' + primary: "grey" + accent: "grey" # Social extra: social: - - icon: 'fontawesome/brands/github' - link: 'https://github.com/colour-science' - - icon: 'fontawesome/brands/github-alt' - link: 'https://gitter.im/colour-science/colour' - - icon: 'fontawesome/brands/facebook' - link: 'https://www.facebook.com/python.colour.science' - - icon: 'fontawesome/brands/twitter' - link: 'https://twitter.com/colour_science' - - icon: 'fontawesome/brands/linkedin' - link: 'https://www.linkedin.com/in/thomasmansencal/' + - icon: "fontawesome/brands/github" + link: "https://github.com/colour-science" + - icon: "fontawesome/brands/github-alt" + link: "https://gitter.im/colour-science/colour" + - icon: "fontawesome/brands/facebook" + link: "https://www.facebook.com/python.colour.science" + - icon: "fontawesome/brands/twitter" + link: "https://twitter.com/colour_science" + - icon: "fontawesome/brands/linkedin" + link: "https://www.linkedin.com/in/thomasmansencal/" # Analytics google_analytics: - - 'UA-119871277-1' - - 'auto' + - "UA-119871277-1" + - "auto" diff --git a/pyproject.toml b/pyproject.toml index c410292..1423b85 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,8 +3,8 @@ name = "awesome-colour" version = "1.0.0" description = "Curated list of awesome colour science resources" license = "CC0" -authors = [ "Colour Developers " ] -maintainers = [ "Colour Developers " ] +authors = ["Colour Developers "] +maintainers = ["Colour Developers "] repository = "https://github.com/colour-science/awesome-colour" homepage = "http://awesome-colour.org/" keywords = [ @@ -28,91 +28,85 @@ keywords = [ ] [tool.poetry.dependencies] -python = ">= 3.9, < 3.12" +python = ">= 3.9, < 3.13" mkdocs = "*" "mkdocs-material" = "*" -black = { version = "*", optional = true } # Development dependency. -flynt = { version = "*", optional = true } # Development dependency. -invoke = { version = "*", optional = true } # Development dependency. -pre-commit = { version = "*", optional = true } # Development dependency. -ruff = { version = "*", optional = true } # Development dependency. - -[tool.poetry.dev-dependencies] -black = "*" -flynt = "*" +[tool.poetry.group.dev.dependencies] invoke = "*" -pre-commit = "*" -ruff = "*" - -[tool.poetry.extras] -development = [ - "black", - "flynt", - "invoke", - "pre-commit", - "ruff" -] +pre-commit = ">= 3.5" -[tool.black] -line-length = 79 -exclude = ''' -/( - \.git - | \.mypy_cache - | build - | dist -)/ -''' +[tool.codespell] +ignore-words-list = 'buil' [tool.flynt] -line_length=999 +line_length = 999 + +[tool.isort] +ensure_newline_before_comments = true +force_grid_wrap = 0 +include_trailing_comma = true +line_length = 88 +multi_line_output = 3 +split_on_trailing_comma = true +use_parentheses = true + +[tool.pyright] +reportMissingImports = false +reportMissingModuleSource = false +reportUnboundVariable = false +reportUnnecessaryCast = true +reportUnnecessaryTypeIgnorComment = true +reportUnsupportedDunderAll = false +reportUnusedExpression = false + +[tool.pytest.ini_options] +addopts = "-n auto --dist=loadscope --durations=5" [tool.ruff] target-version = "py39" line-length = 88 select = [ - "A", # flake8-builtins - "ARG", # flake8-unused-arguments - # "ANN", # flake8-annotations - "B", # flake8-bugbear - # "BLE", # flake8-blind-except - "C4", # flake8-comprehensions - # "C90", # mccabe - # "COM", # flake8-commas - "DTZ", # flake8-datetimez - "D", # pydocstyle - "E", # pydocstyle - # "ERA", # eradicate - # "EM", # flake8-errmsg - "EXE", # flake8-executable - "F", # flake8 - # "FBT", # flake8-boolean-trap - "G", # flake8-logging-format - "I", # isort - "ICN", # flake8-import-conventions - "INP", # flake8-no-pep420 - "ISC", # flake8-implicit-str-concat - "N", # pep8-naming - # "PD", # pandas-vet - "PIE", # flake8-pie - "PGH", # pygrep-hooks - "PL", # pylint - # "PT", # flake8-pytest-style - # "PTH", # flake8-use-pathlib [Enable] - "Q", # flake8-quotes - "RET", # flake8-return - "RUF", # Ruff - "S", # flake8-bandit - "SIM", # flake8-simplify - "T10", # flake8-debugger - "T20", # flake8-print - # "TCH", # flake8-type-checking - "TID", # flake8-tidy-imports - "TRY", # tryceratops - "UP", # pyupgrade - "W", # pydocstyle - "YTT" # flake8-2020 + "A", # flake8-builtins + "ARG", # flake8-unused-arguments + # "ANN", # flake8-annotations + "B", # flake8-bugbear + # "BLE", # flake8-blind-except + "C4", # flake8-comprehensions + # "C90", # mccabe + # "COM", # flake8-commas + "DTZ", # flake8-datetimez + "D", # pydocstyle + "E", # pydocstyle + # "ERA", # eradicate + # "EM", # flake8-errmsg + "EXE", # flake8-executable + "F", # flake8 + # "FBT", # flake8-boolean-trap + "G", # flake8-logging-format + "I", # isort + "ICN", # flake8-import-conventions + "INP", # flake8-no-pep420 + "ISC", # flake8-implicit-str-concat + "N", # pep8-naming + # "PD", # pandas-vet + "PIE", # flake8-pie + "PGH", # pygrep-hooks + "PL", # pylint + # "PT", # flake8-pytest-style + # "PTH", # flake8-use-pathlib [Enable] "Q", # flake8-quotes + "RET", # flake8-return + "RUF", # Ruff + "S", # flake8-bandit + "SIM", # flake8-simplify + "T10", # flake8-debugger + "T20", # flake8-print + # "TCH", # flake8-type-checking + "TID", # flake8-tidy-imports + "TRY", # tryceratops + "UP", # pyupgrade + "W", # pydocstyle + "YTT", # flake8-2020 ] ignore = [ "B008", @@ -131,9 +125,13 @@ ignore = [ "N813", "N815", "N816", + "PGH003", "PIE804", "PLE0605", + "PLR0911", + "PLR0912", "PLR0913", + "PLR0915", "PLR2004", "RET504", "RET505", @@ -143,7 +141,6 @@ ignore = [ "TRY003", "TRY300", ] -typing-modules = ["colour.hints"] fixable = ["B", "C", "E", "F", "PIE", "RUF", "SIM", "UP", "W"] [tool.ruff.pydocstyle] @@ -152,6 +149,9 @@ convention = "numpy" [tool.ruff.per-file-ignores] "tasks.py" = ["INP"] +[tool.ruff.format] +docstring-code-format = true + [build-system] -requires = [ "poetry>=0.12" ] +requires = ["poetry>=0.12"] build-backend = "poetry.masonry.api" diff --git a/readme.md b/readme.md index 2d78a77..3489926 100644 --- a/readme.md +++ b/readme.md @@ -1,16 +1,14 @@ # Awesome Colour [![Awesome](https://awesome.re/badge.svg)](https://awesome.re) -__A curated list of awesome colour science resources.__ - -Inspired by the __[awesome](https://github.com/sindresorhus/awesome)__ list. Please read the __[contribution guidelines](contributing.md)__ before contributing. +**A curated list of awesome colour science resources.** +Inspired by the **[awesome](https://github.com/sindresorhus/awesome)** list. Please read the **[contribution guidelines](contributing.md)** before contributing. ## Contents - - [Awesome Colour](#awesome-colour-) - [Contents](#contents) - [Applications](#applications) @@ -40,7 +38,6 @@ Inspired by the __[awesome](https://github.com/sindresorhus/awesome)__ list. Ple - ## Applications - [CIE Color Calculator](http://www.brucelindbloom.com/ColorCalculator.html) - Online conversion between most of the CIE color models. @@ -139,7 +136,7 @@ Inspired by the __[awesome](https://github.com/sindresorhus/awesome)__ list. Ple - [Color Appearance Models](http://onlinelibrary.wiley.com/book/10.1002/9781118653128) - [Color Gamut Mapping](https://onlinelibrary.wiley.com/doi/book/10.1002/9780470758922) - [Color Science: Concepts and Methods, Quantitative Data and Formulae, 2nd Edition](https://www.wiley.com/en-us/Color+Science%3A+Concepts+and+Methods%2C+Quantitative+Data+and+Formulae%2C+2nd+Edition-p-9780471399186) -- [Colour: Sense & Measurement](https://www.filmlight.ltd.uk/resources/download.php) +- [Colour: Sense & Measurement](https://www.filmlight.ltd.uk/resources/download.php) - [Computational Colour Science using MATLAB](https://onlinelibrary.wiley.com/doi/book/10.1002/9780470710890) - [Vision Science - Photons to Phenomenology](https://mitpress.mit.edu/books/vision-science) @@ -148,7 +145,7 @@ Inspired by the __[awesome](https://github.com/sindresorhus/awesome)__ list. Ple ### Websites and Articles - [Academy ACES](http://www.oscars.org/science-technology/sci-tech-projects/aces) - Industry standard for managing colour throughout the life cycle of a motion picture or television production. -- [Basic Photographic Sensitometry Workbook](https://www.kodak.com/content/products-brochures/Film/Basic-Photographic-Sensitometry-Workbook.pdf) - An Eastman Kodak's workbook on photographic sensitometry. +- [Basic Photographic Sensitometry Workbook](https://www.kodak.com/content/products-brochures/Film/Basic-Photographic-Sensitometry-Workbook.pdf) - An Eastman Kodak's workbook on photographic sensitometry. - [Chromatic Aberration Simulator](https://smallpond.ca/jim/photomicrography/ca/index.html) - A web-based online axial and transverse chromatic aberration simulator. - [Cinematic Color](http://cinematiccolor.org/) - Motion picture colour management. - [Digital Camera Reviews and Sensor Performance Summary](http://www.clarkvision.com/articles/digital.sensor.performance.summary/) - Digital camera sensor electronics and concepts. diff --git a/tasks.py b/tasks.py index 7fffd7c..917d46b 100644 --- a/tasks.py +++ b/tasks.py @@ -65,8 +65,6 @@ def release(ctx): output = ctx.run("git status") if "nothing to commit, working tree clean" not in output.stdout: - raise RuntimeError( - "Working tree is not clean, please commit your changes!" - ) + raise RuntimeError("Working tree is not clean, please commit your changes!") ctx.run("mkdocs gh-deploy")