multik icon indicating copy to clipboard operation
multik copied to clipboard

Can we access .npy files in kotlin multiplatform?

Open droidwithme opened this issue 9 months ago • 2 comments

Hello Developers @devcrocod @polka125 @luca992 @therealansh @dimonchik0036 thanks for the amazing library. I am developing a kotlin multiplatform, targeting Android & iOS. and Im trying to access .npy files in the shared module. Is it possible or any workaround to access .npy or .pkl files in the shared module?

for Jvm target I am able to access but my primary targets are iOS and Android.

droidwithme avatar Mar 27 '25 05:03 droidwithme

Unfortunately, there’s no workaround

  • for Android, you can use the JVM implementation of reading .npy files.
  • for iOS, you’ll need to implement it manually. The JVM library used for .npy files is available at: https://github.com/JetBrains-Research/npy. You can check out the implementation here: https://github.com/JetBrains-Research/npy/blob/7eb23f2ae21e105f3cb0f95d0607bfac886925b4/src/main/kotlin/org/jetbrains/bio/npy/Npy.kt#L27

devcrocod avatar Mar 27 '25 08:03 devcrocod

Jetbrains really needs to stop making jvm only stuff, especially as simple as that https://github.com/JetBrains-Research/npy

They make kotlinx-io and then just ignore it lol 💀

On the bright side if you have time for a weekend project it would be easy to fork and migrate it @droidwithme

luca992 avatar Mar 27 '25 08:03 luca992