Skip to content

Commit

Permalink
Store generated examples in the build directory
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Dec 19, 2015
1 parent 2b9c6e7 commit d364602
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 217 deletions.
4 changes: 3 additions & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ ENDMACRO()

GENERATE_DOXYGEN_HTML(Doxyfile_en.in pages html insert_examples.py)
GENERATE_DOXYGEN_HTML(Doxyfile_cn.in pages_cn html_cn insert_examples_cn.py)
add_custom_target(doc DEPENDS documented_examples ${DOC_DEPENDENCIES})

add_subdirectory(sphinx)
add_custom_target(doc DEPENDS examples documented_example shogun_sphinx_doc ${DOC_DEPENDENCIES})
144 changes: 0 additions & 144 deletions doc/sphinx/sgexample.py

This file was deleted.

3 changes: 3 additions & 0 deletions doc/sphinx/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
import sys
import os

sys.path.append(os.path.abspath('extensions'))
sys.path.append(os.path.abspath('.'))

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ Since Pythagoras, we know that :math:`a^2 + b^2 = c^2`. Use that for KNN.
Example
-------

Lets setup environment:

.. sgexample:: knn.sg:begin

Imagine you have some training and test data.

.. sgexample:: knn.sg:load_data
Expand All @@ -27,4 +23,3 @@ Once you have chosen a distance, create an instance of the CKNN classifier, pass
Now we run the KNN algorithm and apply it to test data

.. sgexample:: knn.sg:train_and_apply
.. sgexample:: knn.sg:end
25 changes: 0 additions & 25 deletions doc/sphinx/source/examples/classifier/knn/knn.sg

This file was deleted.

2 changes: 2 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ IF (CmdLineStatic AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/undocumented/cmdline_st
ENDIF()

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/examples_v2)

add_custom_target(examples DEPENDS shogun_meta_examples)
8 changes: 7 additions & 1 deletion examples/examples_v2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ IF(NOT PLY_FOUND)
ENDIF()

# Run example generation script
execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/generator/generate.py -i ${CMAKE_CURRENT_SOURCE_DIR}/meta -o ${CMAKE_CURRENT_SOURCE_DIR} -t ${CMAKE_CURRENT_SOURCE_DIR}/generator/targets)
add_custom_target(shogun_meta_examples
COMMAND ${PYTHON_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/generator/generate.py
-i ${CMAKE_CURRENT_SOURCE_DIR}/meta
-o ${CMAKE_CURRENT_BINARY_DIR}
-t ${CMAKE_CURRENT_SOURCE_DIR}/generator/targets
COMMENT "Generating examples from meta-language")

# If testing is enabled we run the examples
IF(ENABLE_TESTING)
Expand Down
25 changes: 0 additions & 25 deletions examples/examples_v2/meta/classification/knn.sg

This file was deleted.

16 changes: 0 additions & 16 deletions examples/examples_v2/meta/classification/liblinear.sg

This file was deleted.

0 comments on commit d364602

Please sign in to comment.