Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mkprof command clobbers item file with empty one when --skeleton flag not used #125

Closed
ned2 opened this issue Sep 1, 2017 · 9 comments
Closed

Comments

@ned2
Copy link

ned2 commented Sep 1, 2017

When not supplying the --skeleton flag, the mkprof will clobber the newly created item file containing the input items with an empty item file when it creates empty files for all tables.

I see the problem in main.mkprof, will try and submit a PR.

@goodmami
Copy link
Member

goodmami commented Sep 1, 2017

Oops, I thought I'd tested that. Is this on the develop branch?

@ned2
Copy link
Author

ned2 commented Sep 1, 2017

That was in version 0.6.2 from PyPy.

I just forked and was about to add the appropriate check to skip over the item file but ran into another problem on the ;latest develop branch:

Traceback (most recent call last):
  File "/home/nejl/.pyenv/versions/3.6.2/bin/delphin", line 11, in <module>
    load_entry_point('PyDelphin==0.6.3a0', 'console_scripts', 'delphin')()
  File "/home/nejl/.pyenv/versions/3.6.2/lib/python3.6/site-packages/delphin/main.py", line 169, in main
    command(args)
  File "/home/nejl/.pyenv/versions/3.6.2/lib/python3.6/site-packages/delphin/main.py", line 314, in mkprof
    for table in p.relations:
AttributeError: 'NoneType' object has no attribute 'relations'

Looks like p never gets assigned a profile, but that bit of code assumes it has. Might have to leave it with you at this point :)

@goodmami
Copy link
Member

goodmami commented Sep 1, 2017 via email

@ned2
Copy link
Author

ned2 commented Sep 1, 2017

Can't reproduce the same problem because of the new exception. To reproduce that from the develop branch, this command line from the wiki does it for me:

$ echo -e "A dog barks.\n*Dog barks a." \
  | delphin mkprof \
      --relations ~/logon/lingo/lkb/src/tsdb/skeletons/english/Relations \
      newprof

@goodmami
Copy link
Member

goodmami commented Sep 1, 2017

Oh sorry, I'm on my phone and didn't catch that your second attempt was on develop. Thanks for that; I'll take a look.

@ned2
Copy link
Author

ned2 commented Sep 1, 2017

No worries :) As it happens I only actually need a skeleton but forgot to supply the flag, so it's not blocking any work for me right now.

goodmami added a commit that referenced this issue Sep 1, 2017
@goodmami
Copy link
Member

goodmami commented Sep 1, 2017

Can you pull and try again on develop? It seems to keep the item files for me.

This is maybe the shortest possible diff... just one character fixed the stacktrace :)

@ned2
Copy link
Author

ned2 commented Sep 1, 2017

Success! No exception, and no clobbered item file. two issues fixed for the price of one character :)

@goodmami
Copy link
Member

goodmami commented Sep 1, 2017

Great, thanks for confirming. I'll close the issue.

@goodmami goodmami closed this as completed Sep 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants