-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update FileName test and merge dev into testing (#598)
* Update CMakeLists.txt with version 3.6.0 (patch 1) * Update cmake/CMakeLists.txt library version * Updated the Installation instructions based on user feedback. Also fixed a problem with the isis3VarInit.py script. * Updates made in accordance with requests made on this PR by other developers. * Fix tgo cassis unit test correctly * Fix tgo cassis unit test correctly (#544) * Fixed two bug with AutoReg. One occurs with one dimensional pattern cubes and the other causes the revious registration sample/line to be returned on sub-pixel registration failure. * Fix tgo cassis camera truth again (#554) * Update docsys Makefile to support wwwdoc (#559) The documentation is installed under `docs`, not `doc`, so this file has been updated. `setisis isis3.6.0` and running `make wwwdoc` in `$ISISROOT/../isis/src/docsys` will properly sync the documentation to our web server. * Update isis3VarInit.py Unnecessary 'touch'ing, the '>' redirect will create the file if it doesn't exist. Also, the first redirect should be the single '>'. Otherwise, multiple runs of this program will continue appending to these files. They still work, its just a lot of setting and unsetting for no good reason. * Fixed isis3Startup scripts * Removed unneeded LineEquation include * Make this program more pythonic (#589) * Updated documentation, user interaction, and made the file and directory handling more 'pythonic'. * Correcting for PR comments. * Fixed broken links in the Installation instructions due to the hyperlinks to our GitHub wiki changing. * Removed unused Parabola class * Removed old license, added new unlicense (#594) * Tweaked FileName test to use ISISROOT variable
- Loading branch information
1 parent
1c7d600
commit d0764eb
Showing
22 changed files
with
232 additions
and
352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
This is free and unencumbered software released into the public domain. | ||
|
||
Anyone is free to copy, modify, publish, use, compile, sell, or | ||
distribute this software, either in source code form or as a compiled | ||
binary, for any purpose, commercial or non-commercial, and by any | ||
means. | ||
|
||
In jurisdictions that recognize copyright laws, the author or authors | ||
of this software dedicate any and all copyright interest in the | ||
software to the public domain. We make this dedication for the benefit | ||
of the public at large and to the detriment of our heirs and | ||
successors. We intend this dedication to be an overt act of | ||
relinquishment in perpetuity of all present and future rights to this | ||
software under copyright law. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
For more information, please refer to <http://unlicense.org/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,97 @@ | ||
#!/usr/bin/env python | ||
"""This program builds shell scripts that define ISIS3 environment variables during conda environment activation and deactivation, and creates some directories.""" | ||
|
||
import argparse | ||
import os | ||
import sys | ||
#Author: Tyler Wilson | ||
#Date : 2018-10-05 | ||
#Description: This script sets ISISROOT/ISIS3DATA/ISIS3TESTDATA for the user and is executed | ||
#within the conda environment created for the ISIS3 installation. | ||
#The data directory and test directory are optional command line arguments. If the user chooses | ||
#not to set them, they will both be placed created on the same level as the $ISISROOT directory | ||
#within the conda environment. | ||
|
||
parser = argparse.ArgumentParser(description='Usage: ./isis3VarInit --data_dir <data dir path> --test_dir <test dir path') | ||
|
||
isisroot = '$CONDA_PREFIX' | ||
data_dir='$CONDA_PREFIX/data' | ||
testdata_dir='$CONDA_PREFIX/testData' | ||
|
||
parser.add_argument("--data-dir",default= data_dir,help="ISIS3 Mission Data Directory") | ||
parser.add_argument("--test-dir",default=testdata_dir,help="ISIS3 Mission Test Data Directory") | ||
|
||
########################################################################################################## | ||
# | ||
# This work is free and unencumbered software released into the public domain. | ||
# In jurisdictions that recognize copyright laws, the author or authors | ||
# of this software dedicate any and all copyright interest in the | ||
# software to the public domain. | ||
# | ||
# | ||
# Description: This program builds the shell scripts that define the | ||
# ISISROOT/ISIS3DATA/ISIS3TESTDATA environment variables for the user | ||
# when the ISIS3 conda environment is activated, and clean up when it is | ||
# deactivated. | ||
# | ||
# The data directory and test directory are optional command line arguments. | ||
# If the user chooses not to set them, they will both be created in the | ||
# $ISISROOT directory. | ||
# | ||
# History: | ||
# Author: Tyler Wilson, USGS | ||
# Date: 2018-10-05 | ||
# Description: Initial commit. | ||
# | ||
# Author: Tyler Wilson, USGS | ||
# Date: 2018-11-01 | ||
# Description: Removed a pair of lines which were causing output errors on Mac OS X and were not | ||
# required anyway. | ||
# | ||
# Author: Ross Beyer | ||
# Date: 2018-11-19 | ||
# Description: Streamlined the program, improved documentation, and made the directory and | ||
# file creation more `pythonic' rather than using system calls. | ||
# | ||
# | ||
########################################################################################################## | ||
|
||
# There are still a lot of Python 2 installations out there, and if people don't have | ||
# their conda environment set up properly, the error message they'll get will be hard | ||
# to decipher. This might help: | ||
assert( sys.version_info >= (3,2) ) # Must be using Python 3.2 or later, is conda set up? | ||
|
||
|
||
# This just wraps and reports on the directory creation: | ||
def mkdir( p ): | ||
if os.path.exists( p ): print( 'Tried to create '+p+', but it already exists.' ) | ||
else: | ||
os.makedirs( p ) | ||
print( 'Created '+p ) | ||
return | ||
|
||
|
||
# Set up and then parse the command line: | ||
parser = argparse.ArgumentParser( description=__doc__ ) | ||
|
||
parser.add_argument('-d','--data-dir', | ||
default=os.environ['CONDA_PREFIX']+'/data', | ||
help='ISIS3 Data Directory, default: %(default)s' ) | ||
parser.add_argument('-t','--test-dir', | ||
default=os.environ['CONDA_PREFIX']+'/testData', | ||
help='ISIS3 Test Data Directory, default: %(default)s') | ||
args=parser.parse_args() | ||
if (data_dir != args.data_dir): | ||
os.system("mkdir -p "+args.data_dir) | ||
data_dir = args.data_dir | ||
else: | ||
os.system("mkdir -p "+data_dir) | ||
|
||
if (testdata_dir != args.test_dir): | ||
os.system("mkdir -p "+args.test_dir) | ||
testdata_dir=args.test_dir | ||
else: | ||
os.system("mkdir -p "+testdata_dir) | ||
|
||
os.popen('mkdir -p '+isisroot+'/etc/conda/activate.d') | ||
os.popen('mkdir -p '+isisroot+'/etc/conda/deactivate.d') | ||
|
||
os.system("echo -n '' >"+isisroot+"/etc/conda/activate.d/env_vars.sh") | ||
os.popen("echo -n '' >"+isisroot+"/etc/conda/deactivate.d/env_vars.sh") | ||
os.popen('touch '+isisroot+'/etc/conda/activate.d/env_vars.sh') | ||
os.popen('touch '+isisroot+'/etc/conda/activate.d/env_vars.sh') | ||
|
||
os.popen("echo '#!/bin/sh' >> "+isisroot+ "/etc/conda/activate.d/env_vars.sh") | ||
os.popen("echo 'export ISISROOT="+isisroot+"' >>"+isisroot+"/etc/conda/activate.d/env_vars.sh") | ||
os.popen("echo 'export ISIS3DATA="+data_dir+"' >>"+isisroot+"/etc/conda/activate.d/env_vars.sh") | ||
os.popen("echo 'export ISIS3TESTDATA="+testdata_dir+"' >>"+isisroot+"/etc/conda/activate.d/env_vars.sh") | ||
|
||
os.popen("echo '#!/bin/sh' >> "+isisroot+ "/etc/conda/deactivate.d/env_vars.sh") | ||
os.popen("echo 'unset ISISROOT' >>"+isisroot+"/etc/conda/deactivate.d/env_vars.sh") | ||
os.popen("echo 'unset ISIS3DATA' >>"+isisroot+"/etc/conda/deactivate.d/env_vars.sh") | ||
os.popen("echo 'unset ISIS3TESTDATA' >>"+isisroot+"/etc/conda/deactivate.d/env_vars.sh") | ||
|
||
|
||
# Create the data directories: | ||
mkdir( args.data_dir ) | ||
mkdir( args.test_dir ) | ||
|
||
# Create the conda activation and deactivation directories: | ||
activate_dir = os.environ['CONDA_PREFIX']+'/etc/conda/activate.d' | ||
deactivate_dir = os.environ['CONDA_PREFIX']+'/etc/conda/deactivate.d' | ||
|
||
mkdir( activate_dir ) | ||
mkdir( deactivate_dir ) | ||
|
||
# Write the files that manage the ISIS3 environments: | ||
activate_vars = activate_dir+'/env_vars.sh' | ||
deactivate_vars = deactivate_dir+'/env_vars.sh' | ||
|
||
with open( activate_vars, mode='w' ) as a: | ||
a.write('#!/bin/sh\n') | ||
a.write('export ISISROOT='+ os.environ['CONDA_PREFIX']+'\n') | ||
a.write('export ISIS3DATA='+ args.data_dir +'\n') | ||
a.write('export ISIS3TESTDATA='+ args.test_dir +'\n') | ||
print( 'Wrote '+activate_vars ) | ||
|
||
with open( deactivate_vars, mode='w' ) as d: | ||
d.write('#!/bin/sh\n') | ||
d.write('unset ISISROOT\n') | ||
d.write('unset ISIS3DATA\n') | ||
d.write('unset ISIS3TESTDATA\n') | ||
print( 'Wrote '+deactivate_vars ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.