ocean-transport / floater

For working with lagrangian float data
http://floater.readthedocs.io
15 stars 17 forks source link

errors with floater_convert #31

Closed rabernat closed 7 years ago

rabernat commented 7 years ago

cc: @geosciz, @nathanieltarshish

I just tried running floater_convert with the new options on yeti with my Pacific sector data.

$ floater_convert --output_format netcdf --ref_time 1993-01-01 --step_time 86400 float_trajectories

I got this error:

Traceback (most recent call last):
  File "/u/6/r/ra2697/.conda/envs/xmitgcm_env/bin/floater_convert", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/hmt/sirius1/prv0/u/6/r/ra2697/floater/scripts/floater_convert", line 76, in <module>
    output_prefix=args.output_prefix)
  File "/hmt/sirius1/prv0/u/6/r/ra2697/floater/floater/utils.py", line 264, in floats_to_netcdf
    step_num = int(dfcs.time.values[0])//step_time
TypeError: unsupported operand type(s) for //: 'int' and 'str'

What is going on?

rabernat commented 7 years ago

FYI, this run is located in /vega/physo/users/ra2697/global_lagrangian/run_fix_floater

geosciz commented 7 years ago

@rabernat It seems that floater_convert read the input 86400 as str rather than int. An immediate fix is to remove --step_time argument since the values you set is the default value. I will submit a PR to force the input to int.

nathanieltarshish commented 7 years ago

I think that step_time may be getting parsed wrong as string rather than int. As a temp fix, 86400 is the default value, so I think it would work if you drop --step_time 86400.

nathanieltarshish commented 7 years ago

Sorry, I did not see your comment @geosciz before I posted mine.

rabernat commented 7 years ago

This scenario should have been covered by the tests. So you should fix the error and add more tests that cover all the possible command line options. In a new PR.

Sent from my iPhone

On Apr 13, 2017, at 4:13 PM, nathanieltarshish notifications@github.com wrote:

I think that step_time may be getting parsed wrong as string rather than int. As a temp fix, 86400 is the default value, so I think it would work if you drop --step_time 86400.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

rabernat commented 7 years ago

closed by #33