issues with PyJData bjdata 0.3.0

58 views
Skip to first unread message

G Buist

unread,
Mar 14, 2022, 6:36:34 AM3/14/22
to mcx-users

Dear Qianqian,

Recently I installed bjdata 0.3.0 for python. After I did this .bnii files that I could open with the 0.2.8 bjdata version started to give errors when I try to load them.

The errors include: 
DecoderException: ('Container bytes array too short (at byte 62954118)', 62954118)

DecoderException: ('Negative count/length unexpected (at byte 899)', 899)

Uninstalling version 0.3.0 and installing version 0.2.8 solves the problem.
Therefore it seems that are issues with version 0.3.0.

Best Regards,
Gijs Buist


Qianqian Fang

unread,
Mar 14, 2022, 9:48:57 AM3/14/22
to mcx-...@googlegroups.com

hi Gijs,

recently, I implemented a breaking-change in the BJData spec and changed the default numeric byte-order from Big-Endian to Little-Endian, see

https://github.com/NeuroJSON/bjdata/commit/19f4b5c852a2deb3f450cc32f68258545fada788

as a result of this spec change, both bjdata (0.3) and jsonlab (2.9.8) have been updated to correctly parse the new bjdata spec (Draft-2) data files.

for now, please use bjdata 0.2.8 to continue reading the .bnii files created by mcx v2020-nightly, I will need to update the C library in mcx and output bjd draft-2 compliant files. will ship those in the next release.

Qianqian

--
You received this message because you are subscribed to the Google Groups "mcx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mcx-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mcx-users/e5aed7de-5ad0-4f3c-8fa6-8c472cec372en%40googlegroups.com.

G Buist

unread,
Mar 16, 2022, 4:56:46 AM3/16/22
to mcx-users
Hi Qianqian,

Thanks for the clear explanation. Will the change in the bjdata spec be implemented in nightly builds from now on or will it be implemented after the next stable release?

Regards,
Gijs

Op maandag 14 maart 2022 om 14:48:57 UTC+1 schreef q.fang:

Qianqian Fang

unread,
Mar 16, 2022, 8:37:49 AM3/16/22
to mcx-...@googlegroups.com

hi Gijs, it will be first implemented in the nightly build, and included in the next release

I forgot to mention, you can still load older bjdata files using bjdata 0.3, by simply adding a parameter "islittle=false" in either jdata.load() or bjdata.load() call.

https://github.com/fangq/pybj/commit/74b0ab14ebdca05fed99cf396b950d606aa0960e#diff-176bccd8e845d7750dd46e0763f7490e34e3b911fe319cae67daaabe82eb30c6R393

Qianqian Fang

unread,
Mar 22, 2022, 4:41:27 PM3/22/22
to mcx-...@googlegroups.com
hi Gijs,

just want to let you know that this issue has been fixed on github



please redownload the nightly build to test the updated bnii output.

Qianqian

Buist, G.

unread,
Mar 29, 2022, 3:32:06 AM3/29/22
to mcx-...@googlegroups.com

Hi Qianqian,

 

Thanks for the updates. I still have one question.

 

Using ‘’islittle=False’’ works to load the old files. But for new files created with the nightly build I downloaded today (2022 03 29) ‘’islittle=False’’ is also necessary to load properly.

Should this not be the case for the new files?

 

Gijs

--
You received this message because you are subscribed to a topic in the Google Groups "mcx-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mcx-users/c9mPMjd0RQw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mcx-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mcx-users/4b1f399b-735b-c118-e192-91f84ce95640%40neu.edu.

Buist, G. (Gijs)

unread,
Apr 4, 2022, 6:52:03 AM4/4/22
to mcx-...@googlegroups.com

Hi Qianqian,

 

I found an error in my code and after fixing it I have no problems with the bjdata and “islittle=False” option.

Sorry for the confusion.

 

Gijs

Qianqian Fang

unread,
Apr 6, 2022, 4:15:22 PM4/6/22
to mcx-...@googlegroups.com
On 4/4/22 06:52, 'Buist, G. (Gijs)' via mcx-users wrote:

Hi Qianqian,

 

I found an error in my code and after fixing it I have no problems with the bjdata and “islittle=False” option.

Sorry for the confusion.


glad to hear the issue is resolved.


Reply all
Reply to author
Forward
0 new messages