Unverified Commit c35028fa authored by jlaura's avatar jlaura Committed by GitHub
Browse files

Fixes #4 (#13)

* removes custom json parsing

* Logical test and fixture renaming

* fixes #4 pluginlist iterator

* Removes version warning for << operator

* Adds license file

* Fixes linking on OSX

* Logical test and fixture renaming

* fixes #4 pluginlist iterator

* Removes version warning for << operator

* Adds license file

* Fixes linking on OSX

* Updates env and recipe
parent 6c0b1b22
Loading
Loading
Loading
Loading

LICENSE.txt

0 → 100644
+24 −0
Original line number Diff line number Diff line
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/>
+0 −1
Original line number Diff line number Diff line
name: csmswig
channels:
  - conda-forge
  - usgs-astrogeology
dependencies:
  - cmake >= 3.10
  - csm
+4 −4
Original line number Diff line number Diff line
%module(package="csmapi") plugin
%{
    #include "Plugin.h"

    typedef csm::Plugin Plugin;
%}

%include <std_string.i>
%include <std_list.i>
%include Model.h


%apply SWIGTYPE *DYNAMIC { csm::Model * };

%include Plugin.h
typedef csm::Plugin Plugin;
// Returns a list of pointer to pointers (which is necessary because the 
// plugin is an abstract base class...)
%template(PluginList) std::list<const csm::Plugin*>;

%{
    namespace swig {
    template <> struct traits<csm::Plugin>
@@ -27,7 +28,6 @@
    }
%}


// A general purpose function for dynamic casting of a Model *
%{
static swig_type_info *
+9 −1
Original line number Diff line number Diff line
@@ -22,8 +22,16 @@ include_directories(${CSM_INCLUDE_DIR})
swig_add_library(csmapi
                 LANGUAGE python 
                 SOURCES ../csmapi.i)

set_target_properties(_csmapi PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SWIG_OUTDIR})

if (APPLE)
     set_target_properties(_csmapi PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
     # On OSX, do not link python - this causes segfaults
     swig_link_libraries(csmapi ${CSM_LIBRARY})
else()
     swig_link_libraries(csmapi ${CSM_LIBRARY} ${PYTHON_LIBRARY})
endif()

# Build out a standard directory structure
# file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tests)
+2 −4
Original line number Diff line number Diff line
@@ -17,8 +17,7 @@ def isd():

@pytest.fixture
def plugin():
    plugin = csmapi.Plugin.findPlugin('PluginFixture')
    return plugin 
    return csmapi.Plugin.findPlugin('PluginFixture') 

@pytest.fixture
def model(isd, plugin):
@@ -59,4 +58,3 @@ def test_bad_ground_to_image(model):
    with pytest.warns(Warning) as w:
        img = model.groundToImage(gnd_coord, 0)
        assert len(w) == 1
 No newline at end of file
    
 No newline at end of file
Loading