Commit 9d5c2891 authored by Michaël Roynard's avatar Michaël Roynard
Browse files

Remarks following code review:

Factorize profile
Cleanup DockerFile
remove installation of gtest in DockerFile
parent a89c8b15
......@@ -4,11 +4,34 @@ stages:
- bench
- deploy
image: carlinet/buildimage
variables:
DOCKER_IMAGE: "${CI_REGISTRY}/olena/pylene/build-toolset"
BUILD_DOCKER: 'false'
PACKAGE_NAME: "pylene" # Conan package name
PACKAGE_TAG: "testing" # Conan tag
PACKAGE_VERSION: "head" # Version to build
CONAN_USER: "lrde"
before_script:
- mkdir build && cd build
- conan install .. -pr buildfarm --build=missing
#########
# Build #
#########
.job-build-docker-base: &build-docker-base
stage: build
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build -t ${DOCKER_IMAGE} -f utils/docker/Dockerfile --no-cache .
- docker push ${DOCKER_IMAGE}
build-docker-manual:
<<: *build-docker-base
when: manual
build-docker-automatic:
<<: *build-docker-base
only:
variables:
- $BUILD_DOCKER =~ /true/i
########
......@@ -16,8 +39,11 @@ before_script:
########
.job-build-linux-base: &distcheck-linux-base
image: ${DOCKER_IMAGE}
stage: test
script:
- mkdir build && cd build
- conan install .. -pr $BUILD_PROFILE --build missing
- cmake .. -DCMAKE_BUILD_TYPE=$PYLENE_CONFIGURATION
- cmake --build apps --config $PYLENE_CONFIGURATION
- cmake --build tests --config $PYLENE_CONFIGURATION
......@@ -29,34 +55,69 @@ before_script:
junit: [build/tests/UT*.xml, build/bench/tests/UT*.xml]
expire_in: 15 days
distcheck-linux-gcc-release:
distcheck-linux-gcc7-release:
<<: *distcheck-linux-base
variables:
PYLENE_CONFIGURATION: "Release"
CXX: "g++"
CC: "gcc"
BUILD_PROFILE: "gcc7"
CXX: "g++-7"
CC: "gcc-7"
distcheck-linux-gcc7-debug:
<<: *distcheck-linux-base
variables:
PYLENE_CONFIGURATION: "Debug"
BUILD_PROFILE: "gcc7"
CXX: "g++-7"
CC: "gcc-7"
distcheck-linux-clang-release:
distcheck-linux-gcc8-release:
<<: *distcheck-linux-base
variables:
PYLENE_CONFIGURATION: "Release"
CXX: "clang++"
CC: "clang"
BUILD_PROFILE: "gcc8"
CXX: "g++-8"
CC: "gcc-8"
distcheck-linux-gcc-debug:
distcheck-linux-gcc8-debug:
<<: *distcheck-linux-base
variables:
PYLENE_CONFIGURATION: "Debug"
CXX: "g++"
CC: "gcc"
BUILD_PROFILE: "gcc8"
CXX: "g++-8"
CC: "gcc-8"
distcheck-linux-clang-debug:
distcheck-linux-clang6-release:
<<: *distcheck-linux-base
variables:
PYLENE_CONFIGURATION: "Release"
BUILD_PROFILE: "clang6"
CXX: "clang++-6.0"
CC: "clang-6.0"
distcheck-linux-clang6-debug:
<<: *distcheck-linux-base
variables:
PYLENE_CONFIGURATION: "Debug"
CXX: "clang++"
CC: "clang"
BUILD_PROFILE: "clang6"
CXX: "clang++-6.0"
CC: "clang-6.0"
distcheck-linux-clang7-release:
<<: *distcheck-linux-base
variables:
PYLENE_CONFIGURATION: "Release"
BUILD_PROFILE: "clang7"
CXX: "clang++-7"
CC: "clang-7"
distcheck-linux-clang7-debug:
<<: *distcheck-linux-base
variables:
PYLENE_CONFIGURATION: "Debug"
BUILD_PROFILE: "clang7"
CXX: "clang++-7"
CC: "clang-7"
#########
......@@ -64,8 +125,11 @@ distcheck-linux-clang-debug:
#########
.job-bench-linux-base: &distbench-linux-base
image: ${DOCKER_IMAGE}
stage: bench
script:
- mkdir build && cd build
- conan install .. -pr $BUILD_PROFILE --build missing
- cmake .. -DCMAKE_BUILD_TYPE=$PYLENE_CONFIGURATION
- cmake --build . --target fetch-external-data
- cmake --build .
......@@ -81,27 +145,49 @@ distcheck-linux-clang-debug:
- build/bench/*.json
expire_in: 15 days
distbench-linux-gcc-release:
distbench-linux-gcc7-release:
<<: *distbench-linux-base
variables:
PYLENE_CONFIGURATION: "Release"
BUILD_PROFILE: "gcc7"
CXX: "g++-7"
CC: "gcc-7"
distbench-linux-clang6-release:
<<: *distbench-linux-base
variables:
PYLENE_CONFIGURATION: "Release"
CXX: "g++"
CC: "gcc"
BUILD_PROFILE: "clang6"
CXX: "clang++-6.0"
CC: "clang-6.0"
distbench-linux-clang-release:
distbench-linux-gcc8-release:
<<: *distbench-linux-base
variables:
PYLENE_CONFIGURATION: "Release"
CXX: "clang++"
CC: "clang"
BUILD_PROFILE: "gcc8"
CXX: "g++-8"
CC: "gcc-8"
distbench-linux-clang7-release:
<<: *distbench-linux-base
variables:
PYLENE_CONFIGURATION: "Release"
BUILD_PROFILE: "clang6"
CXX: "clang++-7"
CC: "clang-7"
#################
# Documentation #
#################
.documentation-base: &documentation-base
image: ${DOCKER_IMAGE}
stage: test
script:
- mkdir build && cd build
- conan install .. -pr pylene_default --build missing
- cmake .. -DCMAKE_BUILD_TYPE=Release
- cmake --build .
--config Release
......@@ -124,26 +210,19 @@ documentation:
# Deploy #
##########
variables:
PACKAGE_NAME: "pylene" # Conan package name
PACKAGE_TAG: "testing" # Conan tag
PACKAGE_VERSION: "head" # Version to build
CONAN_USER: "lrde"
pages:
<<: *documentation-base
only:
- dev
package:
image: ${DOCKER_IMAGE}
stage: deploy
dependencies: []
script:
- conan remote add lrde-public https://artifactory.lrde.epita.fr/artifactory/api/conan/lrde-public
- mkdir build && cd build
- conan install .. -pr pylene_default --build missing
- conan user carlinet -r lrde-public -p $CONAN_LRDE_API_KEY
- conan create .. --build missing $PACKAGE_NAME/$PACKAGE_VERSION@$CONAN_USER/$PACKAGE_TAG
- conan upload -r lrde-public --all $PACKAGE_NAME/$PACKAGE_VERSION@$CONAN_USER/$PACKAGE_TAG
only: [ "dev", "development/ranges" ]
add_subdirectory(source/snipsets)
add_subdirectory(source/snippets)
add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/doxyxml/index.xml
COMMAND doxygen Doxyfile
......
......@@ -11,16 +11,18 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os
import sys
import os
# 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.
sys.path.insert(0, os.path.abspath('.'))
sys.path.append( os.path.abspath("..") )
sys.path.append(os.path.abspath(".."))
import pylene_lexer
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
......@@ -29,7 +31,7 @@ import pylene_lexer
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.coverage', 'sphinx.ext.mathjax', 'sphinx.ext.ifconfig', 'breathe', "ext.conceptdoc",
'matplotlib.sphinxext.plot_directive']
'matplotlib.sphinxext.plot_directive', "sphinxcontrib.plantuml"]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
......@@ -176,21 +178,21 @@ htmlhelp_basename = 'Pylenedoc'
# -- Options for LaTeX output --------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
# Additional stuff for the LaTeX preamble.
# 'preamble': '',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'Pylene.tex', u'Pylene Documentation',
u'EC', 'manual'),
('index', 'Pylene.tex', u'Pylene Documentation',
u'EC', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
......@@ -233,9 +235,9 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'Pylene', u'Pylene Documentation',
u'EC', 'Pylene', 'One line description of project.',
'Miscellaneous'),
('index', 'Pylene', u'Pylene Documentation',
u'EC', 'Pylene', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
......@@ -248,7 +250,7 @@ texinfo_documents = [
#texinfo_show_urls = 'footnote'
# BREATHE
breathe_projects = { "Pylene": os.path.realpath("../doxyxml/") }
breathe_projects = {"Pylene": os.path.realpath("../doxyxml/")}
breathe_default_project = "Pylene"
......@@ -258,7 +260,7 @@ breathe_path = os.path.realpath("../doxyxml/")
# Matplotlib
plot_include_source = False
plot_html_show_formats = False
plot_formats = [ ("png", 150) ]
plot_formats = [("png", 150)]
# Substitution
rst_prolog = """
......
......@@ -215,11 +215,11 @@ Structuring Element Properties
| Expression | Return Type | Sementics |
+==============+================+===========================================================+
| ``se.inc()`` | *impl-defined* | A SE equivalent to :math:`\Delta\mathcal{B}^+(p) = |
| | | \mathcal{B}(p) ∖ (\mathcal{B}(p) ∩ |
| | | \mathcal{B}(p) ∖ (\mathcal{B}(p) ∩ |
| | | \mathcal{B}(\mathrm{prev}))` |
+--------------+----------------+-----------------------------------------------------------+
| ``se.dec()`` | *impl-defined* | A SE `s` equivalent to :math:`\Delta\mathcal{B}^-(p) = |
| | | \mathcal{B}(\mathrm{prev}) ∖ (\mathcal{B}(p) ∩ |
| | | \mathcal{B}(\mathrm{prev}) ∖ (\mathcal{B}(p) ∩ |
| | | \mathcal{B}(\mathrm{prev}))` |
+--------------+----------------+-----------------------------------------------------------+
......
......@@ -60,7 +60,7 @@ Hit or miss transform to detect horizontal 1px-thick line, with pattern::
x x x
.. literalinclude:: /snipsets/staff_lines.cpp
.. literalinclude:: /snippets/staff_lines.cpp
:start-after: #M1_START
:end-before: #M1_END
:language: cpp
......@@ -79,7 +79,7 @@ Hit or miss transform to detect horizontal 2px-thick line, with pattern::
o o o
x x x
.. literalinclude:: /snipsets/staff_lines.cpp
.. literalinclude:: /snippets/staff_lines.cpp
:language: cpp
:start-after: #M2_START
:end-before: #M2_END
......@@ -94,7 +94,7 @@ Hit or miss transform to detect horizontal 2px-thick line, with pattern::
Logical or between the two previous images:
.. literalinclude:: /snipsets/staff_lines.cpp
.. literalinclude:: /snippets/staff_lines.cpp
:lines: 50
:language: cpp
......
......@@ -54,7 +54,7 @@ The markers have been obtained with the :cpp:func:`hit_or_miss`.
* Reconstruction of the objects touching staff lines; with the foundamental SE
(4-connection). All objects that do not touch the staff lines are removed.
.. literalinclude:: /snipsets/staff_lines.cpp
.. literalinclude:: /snippets/staff_lines.cpp
:lines: 56
:language: cpp
......@@ -67,7 +67,7 @@ The markers have been obtained with the :cpp:func:`hit_or_miss`.
* Reconstruction of the lines only; with an horizontal SE `x-o-x`.
.. literalinclude:: /snipsets/staff_lines.cpp
.. literalinclude:: /snippets/staff_lines.cpp
:lines: 59
:language: cpp
......
......@@ -48,7 +48,7 @@ Example 1: Cell segmentation
3. Watershed segmentation
4. Input labelization w.r.t in segmentation labels
.. literalinclude:: /snipsets/blobs_watershed.cpp
.. literalinclude:: /snippets/blobs_watershed.cpp
:start-after: BEGIN
:end-before: END
......
......@@ -311,7 +311,7 @@ A complete example
Filtering the square roadsigns.
.. image:: /snipsets/images/roadsigns.png
.. image:: /snippets/images/roadsigns.png
Method description
^^^^^^^^^^^^^^^^^^
......@@ -370,7 +370,7 @@ The method will proceed as follows:
It gives the following result:
.. image:: /snipsets/images/roadsigns-square.png
.. image:: /snippets/images/roadsigns-square.png
Which is not bad but not perfect. Roadsigns have a high contrast
......@@ -392,13 +392,13 @@ levels with average gray level of the shape::
Result:
.. image:: /snipsets/images/roadsigns-square-2.png
.. image:: /snippets/images/roadsigns-square-2.png
Full code
^^^^^^^^^
.. literalinclude:: /snipsets/component_tree_1.cpp
.. literalinclude:: /snippets/component_tree_1.cpp
......
......@@ -158,7 +158,7 @@ An image can be birectional (see :concept:`Bidirectional Image`) and
allows to be traversed in the reverse order. In that case, the
*ranges* are bidirectional as well. Below is an example of image traversal.
.. literalinclude:: /snipsets/first_start_1.cpp
.. literalinclude:: /snippets/first_start_1.cpp
It produces the following output.
......
......@@ -24,7 +24,6 @@ namespace mln::archetypes
// (Output)IndexableAndAccessibleImage
namespace details
{
template <class I>
......@@ -33,7 +32,7 @@ namespace mln::archetypes
using I::I;
using concrete_type = AsImage<typename I::concrete_type>;
concrete_type concretize() const;
concrete_type concretize() const;
template <typename V>
......@@ -47,8 +46,8 @@ namespace mln::archetypes
struct ConcreteImage
{
using new_pixel_type = archetypes::Pixel;
using value_type = pixel_value_t<archetypes::Pixel>;
using reference = pixel_reference_t<archetypes::Pixel>;
using value_type = pixel_value_t<mln::archetypes::Pixel>;
using reference = pixel_reference_t<mln::archetypes::Pixel>;
using point_type = ::ranges::range_value_t<Domain>;
using domain_type = Domain;
using category_type = forward_image_tag;
......@@ -69,7 +68,7 @@ namespace mln::archetypes
ConcreteImage& operator=(const ConcreteImage&) = default;
ConcreteImage& operator=(ConcreteImage&&) = default;
domain_type domain() const;
domain_type domain() const;
struct pixel_range
......@@ -107,7 +106,7 @@ namespace mln::archetypes
struct OutputImage : Image
{
using new_pixel_type = archetypes::OutputPixel;
using reference = pixel_reference_t<archetypes::OutputPixel>;
using reference = pixel_reference_t<mln::archetypes::OutputPixel>;
struct pixel_range
{
......@@ -157,33 +156,32 @@ namespace mln::archetypes
struct OutputAccessibleImage : OutputImage
{
using accessible = std::true_type;
using accessible = std::true_type;
using concrete_type = OutputAccessibleImage;
template <class V>
using ch_value_type = OutputAccessibleImage;
reference operator()(point_type);
reference at(point_type);
new_pixel_type new_pixel(point_type);
new_pixel_type new_pixel_at(point_type);
reference operator()(point_type);
reference at(point_type);
new_pixel_type new_pixel(point_type);
new_pixel_type new_pixel_at(point_type);
};
struct AccessibleImage : Image
{
using accessible = std::true_type;
using accessible = std::true_type;
using concrete_type = OutputAccessibleImage;
template <class V>
using ch_value_type = OutputAccessibleImage;
reference operator()(point_type);
reference at(point_type);
new_pixel_type new_pixel(point_type);
new_pixel_type new_pixel_at(point_type);
reference operator()(point_type);
reference at(point_type);
new_pixel_type new_pixel(point_type);
new_pixel_type new_pixel_at(point_type);
};
......@@ -198,14 +196,13 @@ namespace mln::archetypes
using ch_value_type = OutputIndexableAndAccessibleImage;
reference operator[](index_type);
point_type point_at_index(index_type) const;
index_type index_of_point(point_type) const;
index_type delta_index(point_type) const;
reference operator[](index_type);
point_type point_at_index(index_type) const;
index_type index_of_point(point_type) const;
index_type delta_index(point_type) const;
};
struct IndexableAndAccessibleImage : AccessibleImage
{
using index_type = int;
......@@ -216,15 +213,13 @@ namespace mln::archetypes
template <class V>
using ch_value_type = OutputIndexableAndAccessibleImage;
reference operator[](index_type);
point_type point_at_index(index_type) const;
index_type index_of_point(point_type) const;
index_type delta_index(point_type) const;
reference operator[](index_type);
point_type point_at_index(index_type) const;
index_type index_of_point(point_type) const;
index_type delta_index(point_type) const;
};
struct BidirectionalImage : Image
{
using category_type = bidirectional_image_tag;
......@@ -233,7 +228,7 @@ namespace mln::archetypes
{
const new_pixel_type* begin();
const new_pixel_type* end();
pixel_range reversed();
pixel_range reversed();
};
pixel_range new_pixels();
......@@ -242,7 +237,7 @@ namespace mln::archetypes
{
const value_type* begin();
const value_type* end();
value_range reversed();
value_range reversed();
};
value_range new_values();
......@@ -252,7 +247,7 @@ namespace mln::archetypes
struct OutputBidirectionalImage : BidirectionalImage
{
using new_pixel_type = archetypes::OutputPixel;
using reference = pixel_reference_t<archetypes::OutputPixel>;
using reference = pixel_reference_t<mln::archetypes::OutputPixel>;
struct value_range
{
......@@ -267,7 +262,7 @@ namespace mln::archetypes
{
const new_pixel_type* begin();
const new_pixel_type* end();
pixel_range reversed();
pixel_range reversed();
};
pixel_range new_pixels();
......@@ -277,8 +272,8 @@ namespace mln::archetypes
struct RawImage : IndexableAndAccessibleImage
{
using category_type = raw_image_tag;
using pixel_range = BidirectionalImage::pixel_range;
using value_range = BidirectionalImage::value_range;
using pixel_range = BidirectionalImage::pixel_range;
using value_range = BidirectionalImage::value_range;
pixel_range new_pixels();
value_range new_values();
......@@ -292,14 +287,14 @@ namespace mln::archetypes
struct OutputRawImage : OutputIndexableAndAccessibleImage
{
using category_type = raw_image_tag;
using pixel_range = OutputBidirectionalImage::pixel_range;
using value_range = OutputBidirectionalImage::value_range;
using pixel_range = OutputBidirectionalImage::pixel_range;
using value_range = OutputBidirectionalImage::value_range;