Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use diff1d with reverse #120

Closed
dmg46664 opened this issue Oct 16, 2024 · 3 comments
Closed

Cannot use diff1d with reverse #120

dmg46664 opened this issue Oct 16, 2024 · 3 comments

Comments

@dmg46664
Copy link

The following

(->
   (dtype/make-reader :float32 10 (rand 10))
   (dfun/- 5)
   (dfun/signum)
   (dgrad/diff1d)
   (dtype/reverse)
   )

yields

Caused by java.lang.ClassCastException
   class tech.v3.datatype_api$reverse$fn$reify__55509 cannot be cast to class
   clojure.lang.IFn$LD (tech.v3.datatype_api$reverse$fn$reify__55509 is in
   unnamed module of loader clojure.lang.DynamicClassLoader @10a83d20;
   clojure.lang.IFn$LD is in unnamed module of loader 'app')

          datatype_api.clj:  175  tech.v3.datatype-api/make-reader-fn/reify
           Reductions.java:   95  ham_fisted.Reductions/serialReduction
             IMutList.java:  347  ham_fisted.IMutList/fillArray
             IMutList.java:  356  ham_fisted.IMutList/toArray
             IMutList.java:  624  ham_fisted.IMutList$13/invoke
       LazyChunkedSeq.java:   38  ham_fisted.LazyChunkedSeq/unlockedUnwrap
       LazyChunkedSeq.java:   54  ham_fisted.LazyChunkedSeq/lockedUnwrap
       LazyChunkedSeq.java:   62  ham_fisted.LazyChunkedSeq/first
                   RT.java:  692  clojure.lang.RT/first
                  core.clj:   55  clojure.core/first
            core_print.clj:   64  clojure.core/print-sequential
            core_print.clj:  295  clojure.core/fn
            core_print.clj:  294  clojure.core/fn
              MultiFn.java:  234  clojure.lang.MultiFn/invoke

Similar to the following except it's not IPersistentCollection but clojure.lang.IFn$LD
https://clojurians.zulipchat.com/#narrow/stream/151924-data-science/topic/Simple.20Tablecloth.20beginnings/near/246087035
although I just thought that not working with reverse feels more fundamental than not working with conj.

If this is intended it might be worth documenting somewhere :-)

@dmg46664
Copy link
Author

PS. I'm using the latest version included with noj, so my bad if this has been resolved.

@cnuernber
Copy link
Owner

Nope - this was a totally valid issue - fixing soon

@dmg46664
Copy link
Author

@cnuernber Great, thanks for the library 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants