fairnessforensics / wiggum

simpson's paradox inspired fairness forensics
https://fairnessforensics.github.io/wiggum/
MIT License
5 stars 3 forks source link

Saving file directory is hard-coded by the relative path in the code #106

Open Shine226 opened 5 years ago

Shine226 commented 5 years ago

We need to find a better way for the saving path. JS doesn't provide a way to browser a folder dialog.

brownsarahm commented 5 years ago

Current research:

Possible temporary soln

put only config_example under version control and the config file will have the location on that local system where the person wants things saved for now we can require the person to manually edit that file and in the futur we can figure out how to do it automatically

brownsarahm commented 4 years ago

when this is solved docs/source/wiggum_app.rst needs to also be updated to reflect this changed

brownsarahm commented 4 years ago

If we get this one solved, we can submit Wiggum to pipy, but if this is not solved, we can't because Wiggum can only currently work if run from the same directory as the data, which is complicated.

We might be able to come up with another workaround set of instructions for how to launch the app so that it can work without being launched in the code directory, but one of these needs to happen before submitting it to pipy makes sense.

brownsarahm commented 4 years ago

these can help for data we provide, but not for use-provided data

https://setuptools.readthedocs.io/en/latest/setuptools.html#including-data-files

https://docs.python.org/2/distutils/setupscript.html

brownsarahm commented 4 years ago

This issue captures multiple related problems:

Shine226 commented 4 years ago

Tried flask.send_file https://community.plotly.com/t/allowing-users-to-download-csv-on-click/5550, but the function doesn't send file to anyplace.

Shine226 commented 4 years ago

I added code under 'save' action: send_file('/Users/chenguangxu/Documents/GitHub/detect_simpsons_paradox_dev/data/genderpaygap/df.csv' , as_attachment=True)

Since os.path.join(directory,data_csv) doesn't give me a correct path, I used a hard-coded file path instead.