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

remove openmp from the dependency list #825

Merged
merged 2 commits into from
Aug 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ dependencies:
- pyaps3>=0.3
- pykml>=0.2
- pyproj
- pyresample
- pysolid
- scikit-image
- scipy
# for ARIA, FRInGE, HyP3, GMTSAR
# for ISCE, ARIA, FRInGE, HyP3, GMTSAR
- gdal>=3
# for pyresample
- pyresample
- openmp
2 changes: 1 addition & 1 deletion mintpy/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def get_view_parser(subparsers=None):
def get_parser():
"""Instantiate the command line argument parser."""
parser = argparse.ArgumentParser(prog=PROG, description=__doc__)
parser.add_argument("--version", action="version", version=f"%(prog)s {__version__}")
parser.add_argument("-v","--version", action="version", version=f"{__version__}")

# Sub-command management
sp = parser.add_subparsers(title="sub-commands", dest='func', required=True, metavar='')
Expand Down
2 changes: 1 addition & 1 deletion mintpy/asc_desc2horz_vert.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def cmd_line_parse(iargs=None):
if any(ref_diff > inps.max_ref_yx_diff for ref_diff in [ref_y_diff, ref_x_diff]):
msg = 'REF_LAT/LON difference between input files > {} pixels!\n'.format(inps.max_ref_yx_diff)
for fname, ref_lat, ref_lon in zip(inps.file, [ref_lat1, ref_lat2], [ref_lon1, ref_lon2]):
msg += 'file1: {}\n'.format(fname)
msg += 'file: {}\n'.format(fname)
msg += '\tREF_LAT/LON: [{:.8f}, {:.8f}]\n'.format(ref_lat, ref_lon)
raise ValueError(msg)

Expand Down
5 changes: 4 additions & 1 deletion mintpy/geocode.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,11 @@ def read_template2inps(template_file, inps):
def check_num_processor(nprocs):
"""Check number of processors
Note by Yunjun, 2019-05-02:
1. conda install pyresample will install pykdtree and openmp, but it seems not working
1. conda install pyresample will install pykdtree and openmp, but it seems not working:
geocode.py is getting slower with more processors
Test on a TS HDF5 file in size of (241, 2267, 2390)
Memory: up to 10GB
Run time: 2.5 mins for nproc=1, 3 mins for nproc=4
2. macports seems to have minor speedup when more processors
Thus, default number of processors is set to 1; although the capability of using multiple
processors is written here.
Expand Down
4 changes: 3 additions & 1 deletion mintpy/reference_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,9 @@ def read_reference_input(inps):
# Do not use ref_y/x in masked out area
if inps.maskFile and os.path.isfile(inps.maskFile):
print('mask: '+inps.maskFile)
mask = readfile.read(inps.maskFile, datasetName='mask')[0]
ds_names = readfile.get_dataset_list(inps.maskFile)
ds_name = [x for x in ds_names if x in ['mask', 'waterMask']][0]
mask = readfile.read(inps.maskFile, datasetName=ds_name)[0]
if mask[inps.ref_y, inps.ref_x] == 0:
inps.ref_y, inps.ref_x = None, None
msg = 'input reference point is in masked OUT area defined by {}!'.format(inps.maskFile)
Expand Down
8 changes: 7 additions & 1 deletion mintpy/smallbaselineApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
smallbaselineApp.py -H #print default template options
smallbaselineApp.py -g #generate default template if it does not exist
smallbaselineApp.py -g <custom_template> #generate/update default template based on custom template
smallbaselineApp.py --plot #plot results without run
smallbaselineApp.py --plot #plot results w/o run [to populate the 'pic' folder after failed runs]

# Run with --start/stop/dostep options
smallbaselineApp.py GalapagosSenDT128.template --dostep velocity #run at step 'velocity' only
Expand Down Expand Up @@ -617,6 +617,12 @@ def generate_temporal_coherence_mask(self):
msg += "Try the following:\n"
msg += "1) Check the reference pixel and make sure it's not in areas with unwrapping errors\n"
msg += "2) Check the network and make sure it's fully connected without subsets"
print(f'ERROR: {msg}')

# populate the pic folder to facilate the trouble shooting
self.plot_result(print_aux=False)

# terminate the program
raise RuntimeError(msg)
return

Expand Down
13 changes: 8 additions & 5 deletions mintpy/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,31 @@
release_version = release_history[0].version
release_date = release_history[0].date

def get_version_info(version='v{}'.format(release_version), date=release_date):
def get_version_info():
"""Grab version and date of the latest commit from a git repository"""
# go to the repository directory
dir_orig = os.getcwd()
os.chdir(os.path.dirname(os.path.dirname(__file__)))

# grab git info into string
try:
# grab from git cmd
cmd = "git describe --tags"
version = subprocess.check_output(cmd.split(), stderr=subprocess.DEVNULL)
version = version.decode('utf-8').strip()
version = version.decode('utf-8').strip()[1:]

#if there are new commits after the latest release
# if there are new commits after the latest release
if '-' in version:
version, num_commit = version.split('-')[:2]
version += '-{}'.format(num_commit)

cmd = "git log -1 --date=short --format=%cd"
date = subprocess.check_output(cmd.split(), stderr=subprocess.DEVNULL)
date = date.decode('utf-8').strip()

except:
pass
# use the latest release version/date
version = release_version
date = release_date

# go back to the original directory
os.chdir(dir_orig)
Expand Down
6 changes: 2 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ numpy
pyaps3>=0.3
pykml>=0.2
pyproj
pyresample
pysolid
scikit-image
scipy
# for ARIA, FRInGE, HyP3, GMTSAR
# for ISCE, ARIA, FRInGE, HyP3, GMTSAR
# gdal>=3
# for pyresample
pyresample
openmp
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,10 @@
"pyaps3>=0.3",
"pykml>=0.2",
"pyproj",
"pyresample", # pip installed version does not work
"setuptools",
"scikit-image",
"scipy",
"pyresample",
# "openmp",
],
extras_require={
"cli": ["argcomplete"],
Expand Down