diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9b49721..08c2fff 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -44,7 +44,7 @@ jobs: - name: Generate coverage report run: julia --project=. -e 'using Pkg; Pkg.add("Coverage"); using Coverage; LCOV.writefile("coverage-lcov.info", process_folder())' - name: Upload coverage to Codecov - if: ${{ matrix.version }} == '1' + if: matrix.version == '1' uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index ce2cb9c..a1eed0c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,6 @@ Manifest.toml .vscode .DS_Store docs/node_modules/ -*.cov \ No newline at end of file +*.cov +.pytest_cache/ +__pycache__/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 30a68e9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: julia -julia: - - nightly - - 1.1 - -codecov: false -coveralls: false - -jobs: - include: - - stage: "Documentation" - julia: 1.1 - os: linux - script: - - julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); - Pkg.instantiate()' - - julia --project=docs/ docs/make.jl - after_success: skip \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..4de9391 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,74 @@ +# Contributing to ComplexRegions.jl + +Thanks for your interest in contributing! Bug reports, feature requests, +documentation improvements, and pull requests are all welcome. + +## Reporting issues + +Please open an issue on the [issue tracker](https://github.com/complexvariables/ComplexRegions.jl/issues). +A good report includes: + +- the version of ComplexRegions.jl and Julia you are using (`] status` and `versioninfo()`), +- a short, self-contained example that reproduces the problem, and +- what you expected to happen versus what actually happened. + +## Development setup + +1. Fork and clone the repository. +2. From the repository root, activate the project and instantiate its dependencies: + + ```julia + julia --project=. -e 'using Pkg; Pkg.instantiate()' + ``` + +3. Make your changes on a feature branch (not `master`). + +## Running the tests + +The test suite runs against both `Float64` and `BigFloat`, and includes +[Aqua](https://github.com/JuliaTesting/Aqua.jl) quality checks and +[JET](https://github.com/aviatesk/JET.jl) static analysis. + +```bash +julia --project=. -e 'using Pkg; Pkg.test()' +``` + +or from the Julia REPL package mode: + +```julia +] test +``` + +Please make sure the full suite passes before opening a pull request, and add +tests covering any new behavior or bug fix. + +## Coding conventions + +- Follow the style of the surrounding code. +- Types are capitalized (e.g. `Segment`, `Circle`); methods that merely produce + values of existing types are lowercase (e.g. `n_gon`). +- Use `tolerance(T)` for floating-point comparisons rather than hardcoded values, + so that code works correctly across real types including `BigFloat`. +- See [`CLAUDE.md`](CLAUDE.md) for a tour of the type hierarchy, design + conventions, and notes on extending the package with new curve or region types. + +## Pull requests + +- Keep each pull request focused on a single change. +- Include a clear description of what the change does and why. +- Update documentation and docstrings when behavior changes. +- The CI workflow runs the test suite and reports coverage; please check that it + passes. + +## AI-assisted contributions + +Contributions developed with the help of large language models are welcome, but +you must understand and review the code you submit; please do not open pull +requests containing unreviewed generated code. If a contribution includes +substantial AI-generated content, note that in the pull request. This mirrors +the [Julia General registry guidance](https://github.com/JuliaRegistries/General). + +## License + +By contributing, you agree that your contributions will be licensed under the +[MIT License](LICENSE) that covers this project. diff --git a/README.md b/README.md index 4f6eef4..d6cbd51 100644 --- a/README.md +++ b/README.md @@ -5,32 +5,35 @@ [![][docs-stable-img]][docs-stable-url] [![codecov](https://codecov.io/github/complexvariables/ComplexRegions.jl/graph/badge.svg?token=4RNN2G3NWY)](https://codecov.io/github/complexvariables/ComplexRegions.jl) -[![DOI](https://zenodo.org/badge/210664766.svg)](https://zenodo.org/badge/latestdoi/210664766) [![DOI](https://joss.theoj.org/papers/10.21105/joss.01811/status.svg)](https://doi.org/10.21105/joss.01811) This package provides types and methods that are useful for working with curves and regions in the complex plane. Most functionality is provided through Julia types. Per Julia conventions, these are all capitalized. You use these capitalized names to create values of the type; e.g., [Segment](@ref) and [Circle](@ref). -Other methods may create values of these types, but since they are not distinct types themselves, they are not capitalized. For example, the [`rectangle`](@ref) method creates a [Polygon](@ref). +Other methods may create values of these types, but since they are not distinct types themselves, they are not capitalized. For example, the [`n_gon`](@ref) method creates a [Polygon](@ref). The methods in this package should work not only with the built-in `Complex` type, but also with the `Polar` and `Spherical` types from the [ComplexValues](https://complexvariables.github.io/ComplexValues.jl/stable/) package, which it re-exports. Please see the [documentation](https://complexvariables.github.io/ComplexRegions.jl/stable/) for more details. +Please open an [issue][issues-url] if you encounter any problems. + ## Installation The package can be installed with Julia's package manager: -```julia +```julia-repl julia> import Pkg julia> Pkg.add("ComplexRegions") ``` -or just use ```] add ComplexRegions``` at the usual command prompt. -## Project Status +Or, just type ```] add ComplexRegions``` at the usual command prompt. + +## AI disclosure + +Claude has been used since version 0.3.6 to assist with finding bugs, identifying and fixing performance issues such as type stability, updating package maintenance tools, and consultations on making refactors and improvements. All AI work has been incremental and human-supervised. The original handwritten tests have never been removed. -Please open an [issue][issues-url] if you encounter any problems. [docs-latest-img]: https://img.shields.io/badge/docs-latest-blue.svg [docs-latest-url]: https://complexvariables.github.io/ComplexRegions.jl/latest @@ -38,7 +41,4 @@ Please open an [issue][issues-url] if you encounter any problems. [docs-stable-img]: https://img.shields.io/badge/docs-stable-blue.svg [docs-stable-url]: https://complexvariables.github.io/ComplexRegions.jl/stable -[travis-img]: https://travis-ci.com/complexvariables/ComplexRegions.jl.svg?branch=master -[travis-url]: https://travis-ci.com/complexvariables/ComplexRegions.jl - [issues-url]: https://github.com/complexvariables/ComplexRegions.jl/issues diff --git a/todo.txt b/todo.txt deleted file mode 100644 index 547bc28..0000000 --- a/todo.txt +++ /dev/null @@ -1,15 +0,0 @@ -# Type issues to be fixed - -5. RegionIntersection stores mismatched real types -regions.jl:49-55: the struct declares both fields as AbstractRegion{T}, but the constructor promotes the type parameter without converting the stored values: - - -struct RegionIntersection{T} <: AbstractRegion{T} - one::AbstractRegion{T} - two::AbstractRegion{T} - function RegionIntersection(one::AbstractRegion{R}, two::AbstractRegion{S}) where {R,S} - # one, two = promote(one, two) ← commented out - new{promote_type(R,S)}(one, two) - end -end -If R=Float64 and S=BigFloat, the struct is RegionIntersection{BigFloat} but one::AbstractRegion{Float64}, which violates the declared field type. The commented-out promote line is the intended fix that was never completed. RegionUnion has the same issue.