Giter VIP home page Giter VIP logo

Comments (14)

rafaqz avatar rafaqz commented on May 26, 2024

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.

rafaqz avatar rafaqz commented on May 26, 2024

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.

Datseris avatar Datseris commented on May 26, 2024

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.

rafaqz avatar rafaqz commented on May 26, 2024

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.

Datseris avatar Datseris commented on May 26, 2024

dimensionwise ?

from dimensionaldata.jl.

rafaqz avatar rafaqz commented on May 26, 2024

That gets the meaning across really well. dimwise would be shorter but maybe less clear, I'm not sure.

from dimensionaldata.jl.

Datseris avatar Datseris commented on May 26, 2024

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.

Datseris avatar Datseris commented on May 26, 2024

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.

ivirshup avatar ivirshup commented on May 26, 2024

@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.

Datseris avatar Datseris commented on May 26, 2024

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.

ivirshup avatar ivirshup commented on May 26, 2024

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.

rafaqz avatar rafaqz commented on May 26, 2024

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.

Datseris avatar Datseris commented on May 26, 2024

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.

rafaqz avatar rafaqz commented on May 26, 2024

dimwise was implemented in #151

from dimensionaldata.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.