Skip to content

__init__: rm sys.path.insert() and force internal imports#653

Merged
yunjunz merged 3 commits intoinsarlab:mainfrom
yunjunz:conda
Sep 1, 2021
Merged

__init__: rm sys.path.insert() and force internal imports#653
yunjunz merged 3 commits intoinsarlab:mainfrom
yunjunz:conda

Conversation

@yunjunz
Copy link
Member

@yunjunz yunjunz commented Sep 1, 2021

Description of proposed changes

This PR address the 1st and 2nd issues in #652.

  • mintpy/__inti__.py:
    • remove try/except for print and MINTPY_HOME as it's not really used anywhere, and their corresponding module imports.
    • remove sys.path.insert() calls. These were replicates from the isce-2 style (isceobj, iscesys, etc.), but they are not really applicable to and used in mintpy, nor had we encouraged in any other files besides this one.

NOTE: however, this might still potentially impact downstream workflows, thus, should be noted in the release notes/changelog.

  • test_smallbaselineApp.py:
    • use the relative path to locate config file, instead of using mintpy module
    • remove the occurrence of MINTPY_HOME

Reminders

  • Pass Codacy code review (green)
  • Pass Circle CI / local test (green)
  • Make sure that your code follows our style. Use the other functions/files as a basis.

@yunjunz yunjunz requested a review from jhkennedy September 1, 2021 00:36
+ mintpy/__inti__.py: remove try/except for print and MINTPY_HOME as it's not used anywhere

+ test_smallbaselineApp.py:
   - use relative path to locate config file, instead of using mintpy module
   - remove the occrrence of MINTPY_HOME
   - remove print view.py cmd as it's now included inside view.py if --noverbose is turned ON
Copy link
Collaborator

@jhkennedy jhkennedy left a comment

Choose a reason for hiding this comment

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

Looks great! Just one real change I'd suggest (TEMPLATE_FILES) and another structure suggestion (namespace) you can feel free to take or leave.

+ mintpy/__inti__.py: remove `sys.path.insert()` calls. This was a replicate of the isce-2 syle (isceobj, iscesys, etc.), but it is not really applicable and used in mintpy.

+ test_sbApp: use `pathlib.Path().resolve()` instead of `os.path.dirname()`
@yunjunz yunjunz changed the title adjust for conda-forge - part 1 __init__: rm sys.path.insert() and force all internal imports Sep 1, 2021
@yunjunz yunjunz changed the title __init__: rm sys.path.insert() and force all internal imports __init__: rm sys.path.insert() and force internal imports Sep 1, 2021
Copy link
Collaborator

@jhkennedy jhkennedy left a comment

Choose a reason for hiding this comment

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

Looks great!

@yunjunz yunjunz merged commit b5e6e5b into insarlab:main Sep 1, 2021
@yunjunz yunjunz deleted the conda branch September 1, 2021 06:40
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.

2 participants