ASFOpenSARlab / opensarlab-lib

A Python library to support ASF OpenSARlab's Jupyter Notebook repository https://github.com/ASFOpenSARlab/opensarlab-notebooks
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

ASFN select functions #2

Closed ryan-p-rock closed 1 year ago

ryan-p-rock commented 1 year ago

select_issue

The select_parameter and select_mult_parameters functions don't seem to be responding to user inputs. Each time, no matter the choice it defaults to the first option.

There is a similar issue with the select function for the file/folder location. No file tree is loading.

ruikawahara commented 1 year ago

Thank you for letting us know about this issue.

I went ahead and tested the select_parameter option based on one of the notebooks that use this feature, and the below gif displays my result:

select_parameter_test

I was able to get a different result (i.e. working properly), but you may have a different issue from my test result.

If possible, could you post the output of the following variables?

Input argument, which is active_projects.keys() in this case, needs to be a list of strings, so it should look something like this:

['Beal-Asc-InSAR', 'beal-desc-insar']

Another possibility is that you are using display(project_select) right after the project_select = ... line. Try removing display() and just use the project_select.

Please let us know if you have any further issues with the above suggestions.

In a meantime, I will look into the issue regarding the select function for the file/folder location.

ryan-p-rock commented 1 year ago

Interesting. Here is the output of the active project keys. image

ryan-p-rock commented 1 year ago

here is the other output you requested (I think...). Removing the display() call seems to result in no options being shown. image

ruikawahara commented 1 year ago

One possibility why this is happening is because the variable active_projects is a dictionary and the value of active_projects.keys() returns a dict_keys datatype instead of a list. You can verify this with the below example:

# make a new list for testing purposes
active_projects_list = ['Beal-Asc-InSAR', 'beal-desc-insar']

# store a value of active_projects.keys()
dictionary_key = active_projects.keys()

# printout the data type:
print(type(active_projects_list)) # will yield <class 'list'>
print(type(dictionary_key )) # will yield <class 'dict_keys'>

If you wish to convert the dict_keys into a list, you can do something like this:

dictionary_key = list(active_projects.keys())

I would also like to note that even with dictionary_key, I was able to run the select_parameter properly, but it could be due to a different environment setup.

Please let us know if you have any further issues.

Thank you.

ryan-p-rock commented 1 year ago

I am using the pre-built "insar_analysis" env that was created using the notebook 'Create_OSL_Conda_Environments'. Should I be using a different env?

ryan-p-rock commented 1 year ago

It doesn't look like changing to a list makes a difference. I also printed the project_select object in case that is helpful. image

ruikawahara commented 1 year ago

Hello Ryan,

Would you be able to send us an output of your insar_analysis environments?

To do this, make a new cell, and type in the following command:

!conda list

which runs a bash script that outputs all the environment that is installed in the kernel.

For reference, *this is what mine looks like.

*_NB: It will download the log output of my insar_analysis env._

You can use a diff checker, such as this one, to check the discrepancies between our environments.

ryan-p-rock commented 1 year ago

thanks! here is a link to the differences. Didn't notice any missing pkgs but some version differences for sure. My openssl version is much older than yours. https://www.diffchecker.com/u5f81JHf

ruikawahara commented 1 year ago

Thank you for providing us with the results. In that case, please try to update the outdated packages first. There are two ways to do this:

  1. Update via terminal: Open the terminal and run the following command:
    mamba update -c conda-forge openssl
  2. Update via JupyterLab: Make new cell, and run this command:
    # this requires "!" symbol
    !mamba update -c conda-forge openssl

Once done, confirm the version with conda list command (and also make sure that you are on insar_analysis kernel).

If you suspect that other packages are causing this issue, try updating these packages by replacing the openssl part of the update command:

Please let us know if you still have any issues.

ryan-p-rock commented 1 year ago

updating those pkgs is not solving the issue either.

would you be able to send me a .yml of your insar_analysis env?

ryan-p-rock commented 1 year ago

I feel like I may be getting closer... I noticed in the comparison of our package lists that I have a pkg called 'comm' that you do not have in your env. Whenever I try to interact with any of the radio buttons generated by the asfn.select_parameter() function, I get these warnings in the log at the bottom of the notebook. 'No such comm: xxxxx' Related?

comm_error

ryan-p-rock commented 1 year ago

follow up: I tired to remove the comm package from the insar_analysis env but that failed

ruikawahara commented 1 year ago

This is the up-to-date insar_analysis.yml that we are using.

If everything in the .yaml looks correct, try *rebuilding the insar_analysis kernel using Create_OSL_Conda_Environments.ipynb notebook.

This should be located in /home/jovyan/conda_environments.

*_NB: Make sure that you also have install_insar_analysis_pkgs.sh script on the same directory._

ryan-p-rock commented 1 year ago

thank you, recreating the environment appears to have solved the problem.