Comments (14)
That is interesting. Shouldn't be too hard to implement, feel free to have a go.
Just remember that most of the core tools are defined in primitives.jl, you shouldn't have to do much yourself.
from dimensionaldata.jl.
I'm wondering if this is compatible with current behaviour of *
on arrays. Will there be any circumstances where *
will currently work (ie not error because of size mismatch etc) but this change will produce a different result?
If so we may need to add a method for this.
from dimensionaldata.jl.
I have concluded that using the symbol *
is not a good idea, as it will naturally try to compare itself with the behavior of pure arrays, which I don't think makes much sense. I will use the symbol \otimes
instead.
from dimensionaldata.jl.
Would it be possible to generalise this a little more? We could write this so you can us +,-,/,|,& etc as well using the same methods. Something like:
somemethod(f, A, B)
Where f
can be *
, or anything else that accepts two args. But I'm not sure what to call the method...
from dimensionaldata.jl.
dimensionwise
?
from dimensionaldata.jl.
That gets the meaning across really well. dimwise
would be shorter but maybe less clear, I'm not sure.
from dimensionaldata.jl.
Hi, I was going to start working on that today, but I saw that there is #48 and #49 , which are not directly relevant, but still good to know and should be taken into account to write the most clear source code.
So I'll wait for them to be done and then I'll start doing this next week. In the meantime I'll start a Documentation PR that builds more proper docs based on Documenter.
from dimensionaldata.jl.
nice, I've solved this. Implemented it and tested it in my code and it works. Will PR it once #48 and #50 are merged, because I don't want to be constantly doing rebasing stuff.
from dimensionaldata.jl.
@Datseris, when you say A * B
, is that python syntax or have you translated? I like the idea of being able to use xarray
's A * B
(I'd call this "broadcasting"), but I'm not as much a fan of their A @ B
.
from dimensionaldata.jl.
A*B is Python syntax, but as I said elsewhere it does radically different thing that what *
does here now, after Raf merged the *
PR. Once you are done with #48 we will get it here as well, but not with *
, with dimewise
instead.
from dimensionaldata.jl.
Ah, I had thought you were thinking of matrix multiplication. I think xarray
's A * B
would make more sense as A .* B
in Julia. So, something like @dimwise A .* B
for automatic alignment, since it's difficult to pass .*
as an argument to a function.
from dimensionaldata.jl.
Ah, I had thought you were thinking of matrix multiplication. I think xarray's A * B would make more sense as A .* B in Julia. So, something like @dimwise A .* B for automatic alignment, since it's difficult to pass .* as an argument to a function.
I like just passing *
and avoiding the macro. Did you have a go at this @Datseris?
from dimensionaldata.jl.
Yeah I have this solved in my own code. I have implemented the dimwise
function as originally described, it works for any binary f
: dimwise(f, A, B)
, where f = *, -, +, ...
from dimensionaldata.jl.
dimwise
was implemented in #151
from dimensionaldata.jl.
Related Issues (20)
- broadcasted_dims on groupby HOT 1
- NetCDF is 1000x slower when indexing compared to Zarr HOT 15
- mapslices on in memory vector fails
- Can't show a DimSlices object HOT 4
- Docs build issues HOT 3
- Dimension metadata HOT 3
- Failing on nightly because uses private methods from Base HOT 1
- StackOverflow when constructing table from DimArray with single dimension HOT 2
- stable docs link is broken HOT 3
- support Julia 1.9
- error showing DimArray HOT 6
- DimensionMismatch with `cat` HOT 10
- Improvements to docstrings HOT 12
- Cannot get my own `Categorical` order to work HOT 2
- docs/stable toggle in readme returns 404 HOT 2
- broadcast_dims.(*, ..., ...) no method matching order(::Vector{Vector{Int64}}) HOT 3
- Typo in function name HOT 3
- Accessing the dimension combinations HOT 9
- add title to DimArray HOT 3
- Where and isnan issues HOT 1
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 dimensionaldata.jl.