SylviaCHS / BME547_Final_Project

MIT License
0 stars 1 forks source link

Fix plot_his() problem of outputing array. #48

Closed tiffanylin43 closed 5 years ago

tiffanylin43 commented 5 years ago

@kkl18 Hi, Kim! I've edited the plot_his() function. You should be able use .tolist() to turn both his and bins into list that can be saved.

KimberlyLennox commented 5 years ago

@tiffanylin43 Hi Tiffany. Unfortunately, this still isn't fixed. Even after using .tolist() my code is trying to save this as an array. Please try saving the data into a json file on a Mongo database. I'll keep trying to fix this but I'm at a loss at this point.

tiffanylin43 commented 5 years ago

@kkl18 Hi, Kim! Sylvia said that she've fixed this last night. Did you test the codes in her new branch? I think it's called "fix_get_image" with her netid. Let me know if this works.

KimberlyLennox commented 5 years ago

@tiffanylin43 @SylviaCHS I merged the fix_get_his branch into mine and checked the code myself to make sure that it merged correctly. Using .tolist() still does not work, nor does list(). In the end, I had to export every single bin and histogram separately as its own list and it still isn't working, but now the histograms are saving, just not the bins.

Has anyone else been able to successfully implement the server code complete with saving the histogram to the database?

tiffanylin43 commented 5 years ago

@kkl18 Hi, Kim! I checked the pull request, it seems that you didn't merge Sylvia's latest codes which should have solved the problem. Her branch is "Hc239/client fix get image". Could you please check if those codes work?

SylviaCHS commented 5 years ago

@kkl18 Hi Kim, I solved the problem by changing Tiffany's image processing code. The latest version is on the branch hc239/client_fix_get_image. You can merge the branch and see if it's working now.

Thanks, Sylvia

From: kkl18 notifications@github.com Reply-To: SylviaCHS/BME547_Final_Project reply@reply.github.com Date: Saturday, April 27, 2019 at 7:35 PM To: SylviaCHS/BME547_Final_Project BME547_Final_Project@noreply.github.com Cc: Huisi Cai huisi.cai@duke.edu, Mention mention@noreply.github.com Subject: Re: [SylviaCHS/BME547_Final_Project] Fix plot_his() problem of outputing array. (#48)

@tiffanylin43https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_tiffanylin43&d=DwMFaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=3x6D5e-HAURq1_2ftMxSmQ&m=S5v6coN4tk1Wcj0ybzTxsVgWbzJe2r_MlcW0tIKo1Bs&s=PIuCZxENppzhiCGNnx-OtmNqQ4ZrUr1ze9PXQIMFWuY&e= @SylviaCHShttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_SylviaCHS&d=DwMFaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=3x6D5e-HAURq1_2ftMxSmQ&m=S5v6coN4tk1Wcj0ybzTxsVgWbzJe2r_MlcW0tIKo1Bs&s=69V_oFz5NHK95mgaMCKE0pGR8CQPkEDHQgicUrVvaUI&e= I merged the fix_get_his branch into mine and checked the code myself to make sure that it merged correctly. Using .tolist() still does not work, nor does list(). In the end, I had to export every single bin and histogram separately as its own list and it still isn't working, but now the histograms are saving, just not the bins.

Has anyone else been able to successfully implement the server code complete with saving the histogram to the database?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_SylviaCHS_BME547-5FFinal-5FProject_issues_48-23issuecomment-2D487327647&d=DwMFaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=3x6D5e-HAURq1_2ftMxSmQ&m=S5v6coN4tk1Wcj0ybzTxsVgWbzJe2r_MlcW0tIKo1Bs&s=D_LDm6SQwZMeYTPPKdHBSSU9NoVwepu9B1RjgwV8igU&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ALDKS3JNIJ55P6SDFCP35XDPSTPNDANCNFSM4HI3DIFA&d=DwMFaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=3x6D5e-HAURq1_2ftMxSmQ&m=S5v6coN4tk1Wcj0ybzTxsVgWbzJe2r_MlcW0tIKo1Bs&s=WgIdr0S_HxT46Fwrv01JAHj8GZJVlX-jOlELrq-KYQM&e=.

KimberlyLennox commented 5 years ago

@SylviaCHS

Did this work in your version of the client code? I ran everything as-is and it's still broken

To clarify: I've merged fix_get_image into my own branch and then run the client code. It's identical to what's on GitHub. The same errors are coming back.

SylviaCHS commented 5 years ago

@kkl18 Yes, it is working. I print the type of hist and bins, they are 'list' now. I am not calling the them to plot histograms in GUI, but they shouldn't give an error. image

What error are you getting? Have you change mongo.py? I am testing using my own database now.

KimberlyLennox commented 5 years ago

@SylviaCHS Hi Sylvia,

I had to make one more change to the image processing code to get the histogram data to save, but I still don't know if it will plot correctly.

The problem is that the function is making a list of numpy arrays and that seems to throw off the .tolist() function.

The only thing that I can think of is that it's an OS or a virtual environment issue.

I saw the change in the database code. The original database has sped up considerably, but it will probably help if we aren't all querying it at the same time.