Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate step 2 #44

Merged
merged 17 commits into from
Dec 15, 2023
Merged

Integrate step 2 #44

merged 17 commits into from
Dec 15, 2023

Conversation

kmilo9999
Copy link
Collaborator

  • Modified m_spectrum_ph3.py and ICEsat2_SI_tools/generalized_FT.py to integrate the pipeline's step 2 to the current folder structure and packaging configuration

cpaniaguam
cpaniaguam previously approved these changes Dec 11, 2023
Copy link
Member

@cpaniaguam cpaniaguam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good! We can do some cleanups later.

Copy link
Member

@hollandjg hollandjg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be an install problem here!

.github/workflows/test-B01_SL_load_single_file.yml Outdated Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't seem to be able to install this using the description in the README any more – I'm getting the following error:

  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      /var/folders/n5/6b48sz2j3yldl4mnglvsr6mh0000gq/T/H5closem9scgpzm.c:1:10: fatal error: 'H5public.h' file not found
      #include "H5public.h"
               ^~~~~~~~~~~~
      1 error generated.
      cpuinfo failed, assuming no CPU features: 'flags'
      * Using Python 3.9.18 (main, Oct  4 2023, 15:25:11)
      * Found cython 3.0.6
      * USE_PKGCONFIG: True
      .. ERROR:: Could not find a local HDF5 installation.
         You may need to explicitly state where your local HDF5 headers and
         library can be found by setting the ``HDF5_DIR`` environment
         variable or by using the ``--hdf5`` command-line option.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Is there something special I need to do to make this work? On main it still builds fine. It looks like a problem with tables.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kmilo9999 check when tables is being used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hollandjg This error is because it's not finding HDF5 in your macos. I created a workflow that checks the installation in that system and they seem to work. Have you set the HDF5_DIR environmental variable?

@cpaniaguam @hollandjg This is the stack trace of the throw error when the pytables dependency is missed.

Traceback (most recent call last):
  File "/mnt/c/Projects/Github/icesat2-tracks/src/icesat2_tracks/analysis_db/B02_make_spectra_gFT.py", line 439, in <module>
    MT.save_pandas_table(Pars_optm, save_name+'_params', save_path )
  File "/mnt/c/Projects/Github/icesat2-tracks/src/icesat2_tracks/local_modules/m_tools_ph3.py", line 282, in save_pandas_table
    with HDFStore(save_path+'/'+ID+'.h5') as store:
  File "/mnt/c/Projects/Github/icesat2-tracks/venv39/lib/python3.9/site-packages/pandas/io/pytables.py", line 566, in __init__
    tables = import_optional_dependency("tables")
  File "/mnt/c/Projects/Github/icesat2-tracks/venv39/lib/python3.9/site-packages/pandas/compat/_optional.py", line 135, in import_optional_dependency
    raise ImportError(msg)
ImportError: Missing optional dependency 'pytables'.  Use pip or conda to install pytables.

Basically, when the analysis results are being save to a pandas table, pandas calls the function :
import_optional_dependency("tables")
and that producess the error

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This solves it, but I think it needs to be in the README. I've put in a suggestion in #49 which can be merged into this branch.

src/icesat2_tracks/analysis_db/B02_make_spectra_gFT.py Outdated Show resolved Hide resolved
Copy link
Member

@cpaniaguam cpaniaguam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested a couple more cleanups before approving and merging.

Also added some comments for future development items.

src/icesat2_tracks/analysis_db/B02_make_spectra_gFT.py Outdated Show resolved Hide resolved
src/icesat2_tracks/analysis_db/B02_make_spectra_gFT.py Outdated Show resolved Hide resolved
"sliderule==4.1.0",
"ipyleaflet",
"lmfit",
"tables"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might be able to remove this dep if the I/O is optimized in step 2.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be nice.

@@ -50,7 +58,7 @@ def linear_gap_fill(F, key_lead, key_int):
return y_g


# %%

track_name, batch_key, test_flag = io.init_from_input(sys.argv) # loads standard experiment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might change after the cli is implemented.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely!

@cpaniaguam cpaniaguam self-requested a review December 14, 2023 17:32
Co-authored-by: Carlos Paniagua <cpaniaguam@gmail.com>
Copy link
Member

@cpaniaguam cpaniaguam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pointed out a few more lines that can also be deleted.

Copy link
Member

@cpaniaguam cpaniaguam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am requesting one more deletion of commented code. Other than that I think this is ready to merge!

Comment on lines 39 to 41
# h.heap()
#import s3fs
#from memory_profiler import profile
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not delete these too?

#track_name, batch_key, test_flag = '20190601094826_09790312_004_01', 'SH_batch01', False
#track_name, batch_key, test_flag = '20190207111114_06260210_004_01', 'SH_batch02', False
#track_name, batch_key, test_flag = '20190208152826_06440210_004_01', 'SH_batch01', False
#track_name, batch_key, test_flag = '20190213133330_07190212_004_01', 'SH_batch02', False
#track_name, batch_key, test_flag = '20190205231558_06030212_004_01', 'SH_batch02', False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might have missed suggesting removing other commented code, but lines 61-76, 78, 106 could be deleted.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed all the commented code

Copy link
Member

@cpaniaguam cpaniaguam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean as a whistle!

Copy link
Member

@hollandjg hollandjg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it! Just one suggested change in #49

@kmilo9999 kmilo9999 merged commit a497b80 into main Dec 15, 2023
1 check passed
@kmilo9999 kmilo9999 deleted the feat-step2-intg branch December 15, 2023 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants