euroargodev / argopy

A python library for Argo data beginners and experts
https://argopy.readthedocs.io
European Union Public License 1.2
184 stars 41 forks source link

User ID bug #310

Closed Marie59 closed 10 months ago

Marie59 commented 10 months ago

Hello, I would like to create a Galaxy (https://usegalaxy.eu/) tool using argopy in order to retrieve argo data and get them on Galaxy. I started the work here https://github.com/galaxyecology/tools-ecology/pull/81.

However when launching the galaxy test to get the tool up and running I'm having an error. Indeed, the tool is launched in a container and in the argopy code there's a line trying to get the user id which makes the tool stop. Here is the line https://github.com/euroargodev/argopy/blob/master/argopy/data_fetchers/erddap_data.py#L686

this_ds.attrs["Fetched_by"] = getpass.getuser()

I was thinking maybe it would be possible to use a try except here to avoid the error. To analyze the error reported from Galaxy, I looked at the code. If being able to identify the origin of the data request is important, you can add a named parameter to the function post_process() to pass the value to be assigned to this_ds.attrs["Fetched_by"]. If a value is specified for this parameter, then the code does not attempt to retrieve the user from the OS session. In this case, it will be necessary to propagate this parameter to the calling functions.

Do you think there is something that can be done here ?

gmaze commented 10 months ago

Hi @Marie59 We can surely simply modify this for a simple try/except, and fallback on an "anonymous" fetched_by attribute. Would you need a new release for this or is the master branch ok ?

Marie59 commented 10 months ago

Hi @gmaze Thanks a lot for your answer and help ! I would need a new release in order to get the conda package up to date also (I am installing argopy with conda for the tool). Thank you !

gmaze commented 10 months ago

Tests are running Before issuing a new release, can you make sure this will fix your issue downstream ? you can install argopy from the specific branch using pip

Marie59 commented 10 months ago

Hi @gmaze I just tested the changes and everything is working !!! Thank you ! If you could do a new release for the conda package it would be great !

gmaze commented 10 months ago

Awesome, I'll issue a new release this afternoon then ! Could you please post here where to find this new argopy usage ? (not familiar with https://usegalaxy.eu/ stuff)

Marie59 commented 10 months ago

Great thanks ! Yes of course, I will give you the link to the tool once it's published here ! (for now it's only a PR)

Marie59 commented 10 months ago

Hi @gmaze ! Sorry to bother you again, I saw that you merged the branch but did not do the release, I just wanted to make sure that you did not forget :)

gmaze commented 10 months ago

I'm on it, upstream tests are failing for some reasons I need to fix before the release

Marie59 commented 10 months ago

Ah ok no problem ! Good luck !

gmaze commented 10 months ago

v0.1.15 is released on pypi and fix this bug

Marie59 commented 9 months ago

Hi @gmaze and happy new year! I forgot to send you the ling of the Argopy tool on the Galaxy Platform. So, there it is https://earth-system.usegalaxy.eu/root?tool_id=toolshed.g2.bx.psu.edu/repos/ecology/argo_getdata/argo_getdata/0.1.15+galaxy0 it's working pretty well ! Thanks a lot !!

gmaze commented 9 months ago

awesome !