JuliaApproximation / DomainSets.jl

A Julia package for describing domains as continuous sets of elements
MIT License
72 stars 12 forks source link

Revisit open and closed domains #56

Closed daanhb closed 4 years ago

daanhb commented 4 years ago

In the package IntervalSets, isopen and isclosed will soon be renamed to isopenset and isclosedset (see https://github.com/JuliaMath/IntervalSets.jl/issues/59). We will have to follow suit.

One issue I noticed is that the current definition of the boundary of an interval is unexpected. It does not include endpoints if the interval is open:

julia> boundary(ClosedInterval(0.,1.))
a union of 2 domains:
    1.  : Point{Float64}(0.0)
    2.  : Point{Float64}(1.0)

julia> boundary(OpenInterval(0.,1.))
the empty space with eltype Float64

If an interval is seen as a subset of the real line, then its boundary includes both endpoints, regardless of whether the interval is open or not. I.e., I would expect:

boundary(d::AbstractInterval) = Point(leftendpoint(d)) ∪ Point(rightendpoint(d))

Then, one could define the closure of an open interval as the corresponding closed interval, and the interior of the closed interval as the open one - the boundary would be the difference between the two.

Is there a reason for the current implementation? Now seems like a good time to change it.

daanhb commented 4 years ago

I have tentatively applied that change in #55. It seems to break ApproxFun, which was to be expected. The rename to isopenset and isclosedset is yet to happen.

daanhb commented 4 years ago

@JuliaRegistrator register()

JuliaRegistrator commented 4 years ago

Registration pull request created: JuliaRegistries/General/13423

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.0 -m "<description of version>" f1a2bbb3c041ade4d82e4777fbaf0f2c42dd56e7
git push origin v0.3.0