You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some headache inducing behaviour I encountered today.
If you give plotypus a list of photometry file names from stdin, and one of those doesn't actually exist, it will give a cryptic error message like the following:
Traceback (most recent call last):
File "/home/dwysocki/.local/bin/plotypus", line 9, in <module>
load_entry_point('plotypus==0.2.6-dev', 'console_scripts', 'plotypus')()
File "/home/dwysocki/plotypus/src/plotypus/plotypus.py", line 283, in main
processes=args.star_processes, **picklable_args)
File "/home/dwysocki/plotypus/src/plotypus/utils.py", line 84, in pmap
for arg in args]
File "/home/dwysocki/plotypus/src/plotypus/utils.py", line 83, in <listcomp>
results = [p.apply_async(func, (arg,), kwargs, callback)
File "/home/dwysocki/plotypus/src/plotypus/plotypus.py", line 251, in <lambda>
else path.join(args.input, filename),
File "/home/dwysocki/.local/lib/python3.3/posixpath.py", line 83, in join
path += b
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'
I encountered this while trying to run plotypus on the OGLE-III LMC cepheids, by taking the names from the cepF.dat file they provided, and adding the appropriate directory and file extension information. Turns out, some of the names in that file do not actually have photometry for whatever reason, causing it to crash with the above error.
I see pros and cons to skipping non-existant filenames. On one hand, it makes problems like this trivial, and a verbose error message could be produced. On the other hand, it does make things more error prone. Either way, we should provide a better error message.
For now I'll just have to use some sort of UNIX wizardry to get around this problem.
The text was updated successfully, but these errors were encountered:
For what it's worth, here is the UNIX wizardry that got me around the problem.
ls -d -1 phot/I/*|# list all file names in phot/I/ directory, including their relative paths
comm -1 -2 cepF-names.dat - # suppress all file names not present in *both* the directory and the names file
It was simple enough, so perhaps an improved error message is all we need.
Some headache inducing behaviour I encountered today.
If you give plotypus a list of photometry file names from
stdin
, and one of those doesn't actually exist, it will give a cryptic error message like the following:I encountered this while trying to run plotypus on the OGLE-III LMC cepheids, by taking the names from the
cepF.dat
file they provided, and adding the appropriate directory and file extension information. Turns out, some of the names in that file do not actually have photometry for whatever reason, causing it to crash with the above error.I see pros and cons to skipping non-existant filenames. On one hand, it makes problems like this trivial, and a verbose error message could be produced. On the other hand, it does make things more error prone. Either way, we should provide a better error message.
For now I'll just have to use some sort of UNIX wizardry to get around this problem.
The text was updated successfully, but these errors were encountered: