uwsampa / accept

an approximate compiler
http://accept.rocks
MIT License
37 stars 14 forks source link

Make eval.py debuggable #25

Open sampsyo opened 10 years ago

sampsyo commented 10 years ago

At the moment, it's really hard to develop/debug your eval.py. There's no way to run it outside of the full experiment workflow.

To make this better, I think we should get rid of the load() function. More often than not, I tend to use the file-sequestration mechanism anyway; we can just let the programmer specify the file to sequester in the Makefile. Then the score() function will always be passed two filenames. No need to worry about file size.

This will let us build a command that quickly invokes score() on two arbitrary files, or on the stored precise file and a specified relaxed file, for debugging eval.py.

sampsyo commented 9 years ago

For now you can make eval.py invokable by adding something like this at the bottom of the file:

if __name__ == '__main__':
    import sys
    score(sys.argv[1], sys.argv[2])

Then invoke it with python eval.py file1 file2.