castelao / seabird

Python parser for Sea-Bird CTD outputs, usually .cnv files.
BSD 3-Clause "New" or "Revised" License
49 stars 30 forks source link

fCNV JSONDecoder error #72

Open fpahernandez opened 1 year ago

fpahernandez commented 1 year ago

Using fCNV to read a .cnv profile:

import sys import numpy as np import seabird from seabird.cnv import fCNV Fic = DirHydro + DirABR + "Est11__SouthBahia.cnv" profile = fCNV(Fic)

Error description:

Traceback (most recent call last):

File "/var/folders/s5/l4k15wz11tj840w0qyj2ksph0000gn/T/ipykernel_9928/2120108936.py", line 1, in profile = fCNV(Fic)

File "/Users/fhernandez/opt/anaconda3/envs/dev39/lib/python3.10/site-packages/seabird/cnv.py", line 574, in init super(fCNV, self).init(text, defaults)

File "/Users/fhernandez/opt/anaconda3/envs/dev39/lib/python3.10/site-packages/seabird/cnv.py", line 58, in init self.rule, self.parsed = load_rule(self.raw_text)

File "/Users/fhernandez/opt/anaconda3/envs/dev39/lib/python3.10/site-packages/seabird/utils.py", line 77, in load_rule rule = json.loads(text.decode('utf-8'), encoding="utf-8")

File "/Users/fhernandez/opt/anaconda3/envs/dev39/lib/python3.10/json/init.py", line 359, in loads return cls(**kw).decode(s)

TypeError: JSONDecoder.init() got an unexpected keyword argument 'encoding'

USING: MAcOS 12.6.1 Anaconda Navigator 2.3.2 cotede 0.23.7 seabird 0.11.5 python 3.10.6

castelao commented 1 year ago

Thanks for reporting that. You'll need to update to seabird-0.12 or later. You can do that with PIP or wait a few minutes for conda-forge to update itself.

Cheers,

On Mon, Jun 19, 2023 at 4:48 AM fpahernandez @.***> wrote:

Using fCNV to read a .cnv profile:

import sys import numpy as np import seabird from seabird.cnv import fCNV Fic = DirHydro + DirABR + "Est11__SouthBahia.cnv" profile = fCNV(Fic)

Error description:

Traceback (most recent call last):

File "/var/folders/s5/l4k15wz11tj840w0qyj2ksph0000gn/T/ipykernel_9928/2120108936.py", line 1, in profile = fCNV(Fic)

File "/Users/fhernandez/opt/anaconda3/envs/dev39/lib/python3.10/site-packages/seabird/cnv.py", line 574, in init super(fCNV, self).init(text, defaults)

File "/Users/fhernandez/opt/anaconda3/envs/dev39/lib/python3.10/site-packages/seabird/cnv.py", line 58, in init self.rule, self.parsed = load_rule(self.raw_text)

File "/Users/fhernandez/opt/anaconda3/envs/dev39/lib/python3.10/site-packages/seabird/utils.py", line 77, in load_rule rule = json.loads(text.decode('utf-8'), encoding="utf-8")

File "/Users/fhernandez/opt/anaconda3/envs/dev39/lib/python3.10/json/ init.py", line 359, in loads return cls(**kw).decode(s)

TypeError: JSONDecoder.init() got an unexpected keyword argument 'encoding'

USING: MAcOS 12.6.1 Anaconda Navigator 2.3.2 cotede 0.23.7 seabird 0.11.5 python 3.10.6

— Reply to this email directly, view it on GitHub https://github.com/castelao/seabird/issues/72, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOQXZKOSW3ODI6Y4KDXXITXMAVBDANCNFSM6AAAAAAZLYEKTE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

fpahernandez commented 1 year ago

Thanks a lot. I updated usind "conda update seabird" on my environnement. It works. By the way, my .cnv files do not contain lon/lat (they are recorded only onto the log doc from the sea campaign). Is there a way to update the cnv file with lon/lat data? Thanks again for your effort for the community.