Comments (5)
I agree with a name-change to somethingSet, if this package does end up implementing Base.Set
, as in:
https://docs.julialang.org/en/stable/stdlib/collections/#Base.Set
and
https://github.com/JuliaLang/julia/blob/9d11f62bcb124327831206089967f93020e84200/base/set.jl
However, I think something like EuclideanSet
might be a better name, since all of the types in this package represent subsets of a Euclidean space. An infinite set could be something much more general, like the set of all words from the Roman alphabet, or the set of all binary trees.
from domainsets.jl.
Hmm, I suppose would imply having everything <: AbstractSet
.
This actually goes against my other leaning, is that anything that supports in
is a valid domain: that is, no need to use Point(1.0)
since 1.0
itself supports in
:
julia> 1.0 in 1.0
true
So maybe leave it as Domains
and define the "domain interface" as implementation of in
?
from domainsets.jl.
See related discussion in SciML/PDERoadmap#4 (comment)
@jlperla @ChrisRackauckas any updates on how you you decided to design "domain"s?
from domainsets.jl.
Not yet. I need to discuss some things with the Modia.jl people.
from domainsets.jl.
Some thoughts on a domain interface:
DomainError
gives precedence for whatDomain
means in Juliadomain
should be toFunction
whataxes
is toAbstractArray
andkeys
is toAbstractDict
More details:
(Hypothetical) Axes interface for AbstractArray
At the moment, axes(::AbstractArray)
is required to return an AbstractUnitRange
, but one could imagine this restriction being relaxed to support fractional indices (e.g., finite-differences), or even continuous indices (e.g., continuum limits). In this case, the "axes interfaces" would probably only require the following:
A[k...]
does not throw aBoundsError
if and only ifk in zip(axes(A)...)
Keys interface for AbstractDict
In this hypothetical world where arrays support even more general indices, the difference between an array and a dictionary becomes subtle, in fact, one could propose that AbstractDict{I,T} <: AbstractVector{T}
. But in any case, the current behaviour satisfies the following:
A[k]
does not throw aKeyError
if and only ifk in keys(A)
Proposed domains interface for Function
Now we get to Function
s, and the proposal is that domain
plays the same role as axes
and keys
. Here's a subtlety: we want to work with functions but domain is only well-defined for methods. For example, the domain of log
has different behaviour depending on the argument type:
- for
log(x::Float64)
it is(0.0,Inf)
, - for
log(x::Int)
it is1:∞
- for
log(x::Complex{Float64})
it isComplexPlane()
So I'd propose the following:
f(x...)
does not throw aDomainError
if and only ifx in domain(f, typeof(x))
What about Fun
?
Unlike functions like log
, Fun
s currently have a default ambient type. For example Fun(exp, 1..2)
lives naturally in Float64
. This might be true for other functions, so we could have the default implementation domain(f) = domain(f, ambienttype(f))
where functions with ambient types override ambienttype
.
I don't think the classical special functions exp
, log
, have a natural ambient type (who's to say domain(exp)
should be RealLine{Float64}()
and not ComplexPlane{Float64}()
or even SquareMatrices{Float64}()
), so they would just throw an error.
from domainsets.jl.
Related Issues (20)
- More Spaces HOT 18
- Center for HyperRectangle? HOT 4
- Should boundary(::Rectangle) use simpler types? HOT 2
- Failure on julia master `Method overwriting is not permitted during Module precompile.` HOT 1
- Precompiling ParameterEstimation fails HOT 2
- Hashes of domains should be consistent with equality HOT 3
- Getting the domain/support of objects, and domain type hierarchy HOT 61
- Support constructors along with `convert` HOT 3
- arithmetic operations with broadcasting
- package extensions and interoperability with different domain types HOT 1
- Roadmap for future development of DomainSets HOT 3
- A confusing bug HOT 9
- VcatDomain(ℝ, ℕ) causes MethodError HOT 2
- Removing points from interval HOT 3
- Depend on EltypeExtensions.jl? HOT 6
- Triangles? HOT 1
- Add Makie extension? HOT 3
- Fix codecov
- `RealNumbers` vs `RealLine` HOT 3
- Allow Makie v0.21 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from domainsets.jl.