-
Notifications
You must be signed in to change notification settings - Fork 176
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
added findfeaturesSegment script #5091
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
d78d6a8
added findfeaturesSegment script
Kelvinrr 44fc0cc
now parrallelized
Kelvinrr b099e00
updated logging code
Kelvinrr f6d7559
added help string
Kelvinrr 200a70e
added help string
Kelvinrr 15dad84
added envs and fixed progress bar output
Kelvinrr 8f6b0c7
staging things
Kelvinrr 5ea43df
added python stuff, fixed segment issues, addressed coments
Kelvinrr fd280c5
addressing comments
Kelvinrr 6022344
added more doc strings
Kelvinrr ec6d444
made pybindings on by default
Kelvinrr 967e53d
addressing comments
Kelvinrr a0a043c
fixed some things, local testing
Kelvinrr 8d6b379
merge conflict
Kelvinrr c0e7046
updated install steps
Kelvinrr f3d9b9b
added basic tests
Kelvinrr 64d1407
reverting ale pin
Kelvinrr 5522fa6
changed license
Kelvinrr 2d70b7c
turn on pybindings in jenkins
Kelvinrr 1424dad
renamed script
Kelvinrr c87ea4a
shadow rename?
Kelvinrr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
cmake_minimum_required(VERSION 3.14) | ||
|
||
# Setup for SWIG | ||
set(CMAKE_SWIG_FLAGS) | ||
find_package(SWIG REQUIRED) | ||
include(UseSWIG) | ||
list(APPEND CMAKE_SWIG_FLAGS "-py3;-DPY3") | ||
|
||
message(STATUS "SWIG flags: " ${CMAKE_SWIG_FLAGS} ) | ||
|
||
# Setup for Python linking | ||
find_package(Python3 REQUIRED COMPONENTS Interpreter Development) | ||
|
||
# Setup for wrapper library | ||
set(ASTROSET_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/astroset") | ||
set(ASTROSET_SOURCES astroset.i | ||
UserInterface.i | ||
) | ||
|
||
set(ASTROSET_APPS apps/) | ||
|
||
set_source_files_properties(${ASTROSET_SOURCES} PROPERTIES CPLUSPLUS ON) | ||
swig_add_library(astroset | ||
LANGUAGE python | ||
SOURCES ${ASTROSET_SOURCES} | ||
OUTPUT_DIR ${ASTROSET_OUTPUT_DIR}) | ||
swig_link_libraries(astroset isis Python3::Module) | ||
set_target_properties(astroset PROPERTIES SWIG_USE_TARGET_INCLUDE_DIRECTORIES TRUE) | ||
set_target_properties(astroset PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${ASTROSET_OUTPUT_DIR}) | ||
|
||
# Create the files to install the Python wrapper | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in | ||
${CMAKE_CURRENT_BINARY_DIR}/setup.py) | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/__init__.py | ||
${ASTROSET_OUTPUT_DIR}/__init__.py | ||
COPYONLY) | ||
|
||
file(COPY ${ASTROSET_APPS} | ||
DESTINATION | ||
${ASTROSET_OUTPUT_DIR}/apps/) | ||
|
||
set(ASTROSET_APP_XML_FILES "apps/findFeaturesSegment/findFeaturesSegment.xml") | ||
file(COPY ${ASTROSET_APP_XML_FILES} DESTINATION ${CMAKE_BINARY_DIR}/bin/xml/ ) | ||
install(FILES ${ASTROSET_APP_XML_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/xml/) | ||
|
||
# Setup to run setup tools on install | ||
install(CODE "execute_process(COMMAND $ENV{CONDA_PREFIX}/bin/pip install ${CMAKE_CURRENT_BINARY_DIR}/ --prefix=${CMAKE_INSTALL_PREFIX} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})") | ||
|
||
acpaquette marked this conversation as resolved.
Show resolved
Hide resolved
|
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,42 @@ | ||
%module(package="astroset") UserInterface | ||
|
||
|
||
%{ | ||
#include "Gui.h" | ||
#include "Pvl.h" | ||
acpaquette marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#include "UserInterface.h" | ||
%} | ||
|
||
%include <QVector> | ||
%include <QString> | ||
|
||
// Rename the constructors to Python-friendly names | ||
%rename(UserInterfaceFromArgsv) UserInterface(const QString &xmlfile, int &argc, char *argv[]); | ||
%rename(UserInterfaceFromList) UserInterface(const QString &xmlfile, QVector<QString> &args); | ||
|
||
%rename(GetFileName) IsisAml::GetFileName(QString const &) const; | ||
%rename(GetFileNameWithExt) IsisAml::GetFileName(QString const &, QString) const; | ||
%rename(GetFileNames) IsisAml::GetFileName(QString const &, std::vector<QString> &) const; | ||
|
||
%rename(GetAsString) IsisAml::GetAsString(QString const &) const; | ||
%rename(GetAsStrings) IsisAml::GetAsString(QString const &, std::vector<QString> &) const; | ||
|
||
%rename(GetString) IsisAml::GetString(QString const &) const; | ||
%rename(GetStrings) IsisAml::GetString(QString const &, std::vector<QString> &) const; | ||
|
||
%rename(GetCubeNameWithExt) IsisAml::GetCubeName(QString const &,QString) const; | ||
%rename(GetCubeName) IsisAml::GetCubeName(QString const &) const; | ||
|
||
%rename(GetInteger) IsisAml::GetInteger(const QString &) const; | ||
%rename(GetIntegers) IsisAml::GetInteger(const QString &, std::vector<int> &) const; | ||
|
||
%rename(GetDouble) IsisAml::GetDouble(const QString &) const; | ||
%rename(GetDoubles) IsisAml::GetDouble(const QString &, std::vector<int> &) const; | ||
|
||
%rename(GetBoolean) IsisAml::GetBoolean(const QString &) const; | ||
%rename(GetBooleans) IsisAml::GetBoolean(const QString &, std::vector<bool> &) const; | ||
|
||
%include "Pvl.h" | ||
%include "IsisAml.h" | ||
%include "UserInterface.h" | ||
|
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,22 @@ | ||
from .astroset import * | ||
|
||
from pathlib import Path | ||
import os | ||
|
||
try: | ||
ISISROOT = Path(os.environ["ISISROOT"]) | ||
except KeyError: | ||
raise EnvironmentError("Please set ISISROOT before importing anything") | ||
|
||
def init_application(args): | ||
appname = os.path.basename(args[0]) | ||
args = args[1:] | ||
|
||
xmlpath = Path(appname).with_suffix(".xml") | ||
if not xmlpath.exists() or not xmlpath.is_file(): | ||
xmlpath = ISISROOT / "bin" / "xml" / xmlpath | ||
print(xmlpath) | ||
if not xmlpath.exists(): | ||
raise FileExistsError(f"{appname} does not have an XML file") | ||
|
||
return UserInterfaceFromList(str(xmlpath), args) |
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 @@ | ||
from . import findFeaturesSegment |
Empty file.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added the tests to jenkins