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

Dev refactor #401

Merged
merged 37 commits into from
May 13, 2024
Merged

Dev refactor #401

merged 37 commits into from
May 13, 2024

Conversation

alexfore
Copy link
Collaborator

@alexfore alexfore commented May 1, 2024

Partial refactor of ARIA-tools

  • More domain specific knowledge needed to finish refactoring
  • add util submodule
  • fix executable permissions
  • Rename methods in util.shp
  • Add default args to util.shp.open / save methods
  • Clean up logging and add --log-level command line args
  • improve clarity of main computational loop
  • Remove lat/lon from export_products_worker interface
  • Add ability to run export_products in parallel with GNU parallel
  • Add multiproc_method argument to export_products with three options:
    • gnu_parallel: will use subjobs, executed in parallel, to process export_products_worker
    • threads: will use multiple threads, faster startup/tear down but has the python GIL issue
    • single: will run single-threaded

@pep8speaks
Copy link

pep8speaks commented May 1, 2024

Hello @alexfore! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 665:80: E501 line too long (89 > 79 characters)

Line 185:17: E131 continuation line unaligned for hanging indent
Line 197:80: E501 line too long (149 > 79 characters)
Line 198:36: E127 continuation line over-indented for visual indent
Line 198:80: E501 line too long (168 > 79 characters)
Line 199:35: E131 continuation line unaligned for hanging indent
Line 200:35: E131 continuation line unaligned for hanging indent
Line 201:35: E131 continuation line unaligned for hanging indent
Line 202:35: E131 continuation line unaligned for hanging indent
Line 203:35: E131 continuation line unaligned for hanging indent
Line 204:35: E131 continuation line unaligned for hanging indent
Line 205:35: E131 continuation line unaligned for hanging indent
Line 206:35: E131 continuation line unaligned for hanging indent
Line 207:35: E131 continuation line unaligned for hanging indent
Line 212:80: E501 line too long (90 > 79 characters)
Line 213:80: E501 line too long (119 > 79 characters)
Line 214:32: E128 continuation line under-indented for visual indent
Line 214:80: E501 line too long (91 > 79 characters)
Line 215:31: E126 continuation line over-indented for hanging indent
Line 225:80: E501 line too long (117 > 79 characters)
Line 226:31: E126 continuation line over-indented for hanging indent
Line 226:80: E501 line too long (126 > 79 characters)
Line 232:80: E501 line too long (97 > 79 characters)
Line 233:80: E501 line too long (110 > 79 characters)
Line 234:32: E128 continuation line under-indented for visual indent
Line 234:80: E501 line too long (91 > 79 characters)
Line 235:31: E126 continuation line over-indented for hanging indent
Line 246:80: E501 line too long (110 > 79 characters)
Line 247:32: E128 continuation line under-indented for visual indent
Line 247:80: E501 line too long (91 > 79 characters)
Line 248:31: E126 continuation line over-indented for hanging indent
Line 260:80: E501 line too long (91 > 79 characters)
Line 261:80: E501 line too long (115 > 79 characters)
Line 262:32: E128 continuation line under-indented for visual indent
Line 264:80: E501 line too long (91 > 79 characters)
Line 265:31: E126 continuation line over-indented for hanging indent

Comment last updated at 2024-05-13 10:44:07 UTC

@alexfore alexfore force-pushed the dev_refactor branch 2 times, most recently from 3b8331a to 5d7b87f Compare May 7, 2024 17:52
alexfore and others added 26 commits May 13, 2024 03:18
* More domain specific knowledge needed to finish refactoring
* add util submodule
* fix executable permissions
* Rename methods in util.shp
* Add default args to util.shp.open / save methods
* Clean up logging and add --log-level command line args
* improve clarity of main computational loop
* Remove lat/lon from export_products_worker interface
* Add ability to run export_products in parallel with GNU parallel
* Add multiproc_method argument to export_products with three options:
  * gnu_parallel: will use subjobs, executed in parallel, to process export_products_worker
  * threads: will use multiple threads, faster startup/tear down but has the python GIL issue
  * single: will run single-threaded
For a given IFG, avoid mixing v3 and v2 products such that only v3 products are passed for a given IFG where available.
Before, the program checked for gaps between products for a given IFG before filtering out v2 in the presence of v3 products
When running this command:
`ariaDownload.py --bbox "34.6 34.8 -118.1 -117.9" --track 71 --output Url --start 20211214 --end 20220102`

Vestigial 'inps' variable lead to a crash:
```
/u/trappist-r0/ssangha/conda_installation/miniforge/miniforge/envs/dev_ARIA-tools/bin/ariaDownload.py:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  __import__('pkg_resources').require('ARIAtools==1.1.6')
Traceback (most recent call last):
  File "/u/trappist-r0/ssangha/conda_installation/miniforge/miniforge/envs/dev_ARIA-tools/bin/ariaDownload.py", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/u/trappist-r0/ssangha/conda_installation/miniforge/miniforge/dev_ARIA-tools/ARIA-tools/tools/bin/ariaDownload.py", line 332, in <module>
    main()
  File "/u/trappist-r0/ssangha/conda_installation/miniforge/miniforge/dev_ARIA-tools/ARIA-tools/tools/bin/ariaDownload.py", line 329, in main
    Downloader(args)()
  File "/u/trappist-r0/ssangha/conda_installation/miniforge/miniforge/dev_ARIA-tools/ARIA-tools/tools/bin/ariaDownload.py", line 250, in __call__
    dst = fmt_dst(inps)
                  ^^^^
NameError: name 'inps' is not defined. Did you mean: 'input'?
```
* tests ariaDownload, ariaExtract, and ariaTssetup
* golden input and output data are stored at s3://aria-tools/tests/regression/
* Add NISAR support

* ariaExtract updates

* Make updates to ariaTSsetup

* pep8 changes

* Issue pep8 changes to long lines

* Push pep8 changes

* Adjust long line

* Adjust product.py imports

* minor style changes

* Update masking function (#400)

* Update masking function to leverage the OPERA project tile-mate tool

*  Access to reliable, actively supported high-resolution water masks

* Native UTM projections of the NISAR GUNW supported

---------

Co-authored-by: Simran S Sangha <[email protected]>
Co-authored-by: fore <[email protected]>

* Indent if statements to reflect pep8 convention

* Indent continuation lines following pep8 suggestion

* Split long if statement conditional into multiple lines

* Fix minor bug in distinguishing NISAR from S1 GUNWs

---------

Co-authored-by: Simran S Sangha <[email protected]>
Co-authored-by: fore <[email protected]>
* Found when debugging github issue 396
@alexfore
Copy link
Collaborator Author

I'm not going to address the style issues in ariaPlot at this time -- they are mostly related to the nested list comps which I lack the energy to decompose.

@alexfore alexfore merged commit e66ea18 into dev May 13, 2024
@alexfore alexfore deleted the dev_refactor branch May 14, 2024 16:00
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.

4 participants