Parcourir la source

Documentation updates

Jérôme BUISINE il y a 3 ans
Parent
commit
cccc31223e

+ 8 - 11
.github/workflows/docs.yml

@@ -1,22 +1,19 @@
-name: Packages Docs
-on:
+name: Generate docs
+on: 
   push:
     branches:
       - master
       - develop
 
 jobs:
-  build-test-deploy:
+  docs:
     runs-on: ubuntu-latest
     steps:
-      - name: Checkout
-        uses: actions/checkout@v2
-      - run: python3 -m pip install -r requirements.txt
-      - run: python3 -m pip install sphinx_rtd_theme
-      - run: whereis sphinx-build
-      - run: export PATH=/usr/local/bin/sphinx-build:$PATH
-      - run: cd docs && make html
-      - name: Deploy
+    - uses: actions/checkout@v1
+    - uses: ammaraskar/sphinx-action@master
+      with:
+        docs-folder: "docs/"
+    - name: Deploy
         uses: crazy-max/ghaction-github-pages@v1
         with:
           target_branch: gh-pages

+ 56 - 7
docs/source/_static/css/custom.css

@@ -1,15 +1,64 @@
-.wy-nav-content {
-    max-width: 100% !important;
+.main-menu {
+    display: none !important;
 }
 
-.wy-side-nav-search {
-    background-color: #009900 !important;
+.header-logo {
+    background-image: url("../logo_macop.png") !important;
 }
 
-.wy-side-nav-search input[type="text"] {
-    border-color: #FFFFFF !important;
+.pytorch-left-menu-search input[type="text"] {
+    border-color: #009900 !important;
 }
 
-.wy-menu-vertical header, .wy-menu-vertical p.caption {
+.pytorch-left-menu li.toctree-l1.current > a, .pytorch-right-menu li.toctree-l1.current > a {
+    color: #009900 !important;
+}
+
+ul.pytorch-breadcrumbs a {
+    color: #009900 !important;
+}
+
+.pytorch-left-menu-search .version {
+    color: white !important;
+    text-align: center !important;
+}
+
+a .btn {
+    color: #009900 !important;
+}
+
+footer a {
+    color: #009900 !important;   
+}
+
+colgroup :first-child {
+    width: 60% !important;
+}
+
+.rst-content a:link, .rst-content a:visited, .rst-content a:hover {
+    color: #009900 !important;
+}
+
+.pre {
+    color: #009900 !important;
+}
+
+.article.pytorch-article .function dt, article.pytorch-article .attribute dt, article.pytorch-article .class .attribute dt, article.pytorch-article .class dt {
+    background-color: #bfbfbf !important;
+}
+
+.article.pytorch-article .class em.property {
+    color: #404040 !important;
+}
+
+.article.pytorch-article .function dt em, article.pytorch-article .attribute dt em, article.pytorch-article .class .attribute dt em, article.pytorch-article .class dt em, article.pytorch-article .function dt .sig-paren, article.pytorch-article .attribute dt .sig-paren, article.pytorch-article .class dt .sig-paren {
+    color: #404040 !important;
+}
+
+.article.pytorch-article .function dt:hover .viewcode-link, article.pytorch-article .attribute dt:hover .viewcode-link, article.pytorch-article .class dt:hover .viewcode-link {
+    color: #009900 !important;
+}
+
+.article.pytorch-article .function dt > code, article.pytorch-article .attribute dt > code, article.pytorch-article .class .attribute dt > code, article.pytorch-article .class dt > code {
     color: #009900 !important;
 }

BIN
docs/source/_static/documentation/project_knapsack_problem.png


BIN
docs/source/_static/documentation/project_knapsack_solution.png


+ 19 - 0
docs/source/_static/images/arrow-down-orange-prev.svg

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="13px" height="13px" viewBox="0 0 13 13" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 51.2 (57519) - http://www.bohemiancoding.com/sketch -->
+    <title>Group 5</title>
+    <desc>Created with Sketch.</desc>
+    <defs></defs>
+    <g id="desktop" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="Sphinx_Elements" transform="translate(-119.000000, -5164.000000)" fill="#EE4C2C">
+            <g id="Main-Copy-6" transform="translate(98.000000, 4927.000000)">
+                <g id="Group-6" transform="translate(2.000000, 220.000000)">
+                    <g id="Group-5" transform="translate(25.500000, 23.500000) rotate(90.000000) translate(-25.500000, -23.500000) translate(19.000000, 17.000000)">
+                        <polygon id="Fill-1" points="4.87283333 1.2818 8.83956667 5.24766667 8.83956667 2.6832 6.1555 0"></polygon>
+                        <polygon id="Fill-2" points="8.83913333 5.2481 0 5.2481 0 7.06116667 8.83913333 7.06116667 4.8724 11.0279 6.15506667 12.3105667 12.311 6.15463333 11.4036 5.2481"></polygon>
+                    </g>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>

+ 94 - 0
docs/source/_static/images/arrow-down-orange.svg

@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="13px"
+   height="13px"
+   viewBox="0 0 13 13"
+   version="1.1"
+   id="svg15"
+   sodipodi:docname="arrow-down-orange-green.svg"
+   inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)">
+  <metadata
+     id="metadata19">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title>Group 5</dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="3840"
+     inkscape:window-height="2094"
+     id="namedview17"
+     showgrid="false"
+     inkscape:zoom="80.153846"
+     inkscape:cx="6.6497121"
+     inkscape:cy="6.5"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg15" />
+  <!-- Generator: Sketch 51.2 (57519) - http://www.bohemiancoding.com/sketch -->
+  <title
+     id="title2">Group 5</title>
+  <desc
+     id="desc4">Created with Sketch.</desc>
+  <defs
+     id="defs6" />
+  <g
+     id="desktop"
+     stroke="none"
+     stroke-width="1"
+     fill="none"
+     fill-rule="evenodd">
+    <g
+       id="Sphinx_Elements"
+       transform="translate(-119.000000, -5164.000000)"
+       fill="#EE4C2C">
+      <g
+         id="Main-Copy-6"
+         transform="translate(98.000000, 4927.000000)">
+        <g
+           id="Group-6"
+           transform="translate(2.000000, 220.000000)">
+          <g
+             id="Group-5"
+             transform="translate(25.500000, 23.500000) rotate(90.000000) translate(-25.500000, -23.500000) translate(19.000000, 17.000000)">
+            <polygon
+               id="Fill-1"
+               points="4.87283333 1.2818 8.83956667 5.24766667 8.83956667 2.6832 6.1555 0" />
+            <polygon
+               id="Fill-2"
+               points="8.83913333 5.2481 0 5.2481 0 7.06116667 8.83913333 7.06116667 4.8724 11.0279 6.15506667 12.3105667 12.311 6.15463333 11.4036 5.2481" />
+          </g>
+        </g>
+      </g>
+    </g>
+  </g>
+  <path
+     style="fill:#009900;stroke-width:0.012476"
+     d="M 3.7708188,9.2290722 0.69862003,6.1568544 1.3349302,5.520636 1.9712404,4.8844176 3.95491,6.8680578 5.9385797,8.851698 V 4.425849 0 H 6.8430902 7.7476008 V 5.6984806 11.396961 L 7.2953092,11.849125 6.8430175,12.30129 Z"
+     id="path844" />
+  <path
+     style="fill:#009900;stroke-width:0.012476"
+     d="m 9.7437617,6.8555665 1.9774173,-1.977447 0.636273,0.6362728 0.636273,0.636273 -1.341131,1.3411741 -1.34113,1.341174 H 9.0389041 7.7663443 Z"
+     id="path846" />
+</svg>

+ 19 - 0
docs/source/_static/images/arrow-right-with-tail-prev.svg

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="13px" height="13px" viewBox="0 0 13 13" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 51.2 (57519) - http://www.bohemiancoding.com/sketch -->
+    <title>Page 1</title>
+    <desc>Created with Sketch.</desc>
+    <defs></defs>
+    <g id="desktop" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="01_Home" transform="translate(-1202.000000, -1930.000000)" fill="#EE4C2C">
+            <g id="community" transform="translate(-18.000000, 1075.000000)">
+                <g id="newsletter" transform="translate(740.000000, 843.000000)">
+                    <g id="Page-1" transform="translate(480.000000, 12.000000)">
+                        <polygon id="Fill-1" points="4.87266 1.28206 8.83939333 5.24792667 8.83939333 2.68346 6.15532667 0.00026"></polygon>
+                        <polygon id="Fill-2" points="8.83896 5.24836 -0.000173333333 5.24836 -0.000173333333 7.06142667 8.83896 7.06142667 4.87222667 11.02816 6.15489333 12.3108267 12.3108267 6.15489333 11.4034267 5.24836"></polygon>
+                    </g>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>

+ 94 - 0
docs/source/_static/images/arrow-right-with-tail.svg

@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="13px"
+   height="13px"
+   viewBox="0 0 13 13"
+   version="1.1"
+   id="svg15"
+   sodipodi:docname="arrow-right-with-tail-green.svg"
+   inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)">
+  <metadata
+     id="metadata19">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title>Page 1</dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="3840"
+     inkscape:window-height="2094"
+     id="namedview17"
+     showgrid="false"
+     inkscape:zoom="80.153846"
+     inkscape:cx="6.6497121"
+     inkscape:cy="6.5"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg15" />
+  <!-- Generator: Sketch 51.2 (57519) - http://www.bohemiancoding.com/sketch -->
+  <title
+     id="title2">Page 1</title>
+  <desc
+     id="desc4">Created with Sketch.</desc>
+  <defs
+     id="defs6" />
+  <g
+     id="desktop"
+     stroke="none"
+     stroke-width="1"
+     fill="none"
+     fill-rule="evenodd">
+    <g
+       id="01_Home"
+       transform="translate(-1202.000000, -1930.000000)"
+       fill="#EE4C2C">
+      <g
+         id="community"
+         transform="translate(-18.000000, 1075.000000)">
+        <g
+           id="newsletter"
+           transform="translate(740.000000, 843.000000)">
+          <g
+             id="Page-1"
+             transform="translate(480.000000, 12.000000)">
+            <polygon
+               id="Fill-1"
+               points="4.87266 1.28206 8.83939333 5.24792667 8.83939333 2.68346 6.15532667 0.00026" />
+            <polygon
+               id="Fill-2"
+               points="8.83896 5.24836 -0.000173333333 5.24836 -0.000173333333 7.06142667 8.83896 7.06142667 4.87222667 11.02816 6.15489333 12.3108267 12.3108267 6.15489333 11.4034267 5.24836" />
+          </g>
+        </g>
+      </g>
+    </g>
+  </g>
+  <path
+     style="fill:#009900;stroke-width:0.012476"
+     d="M 5.520636,11.66507 4.8844176,11.02876 6.8680578,9.04509 8.851698,7.0614203 H 4.425849 0 V 6.1569098 5.2523992 H 5.6984806 11.396961 L 11.849125,5.7046909 12.30129,6.1569825 9.2290722,9.2291812 6.1568544,12.30138 Z"
+     id="path844" />
+  <path
+     style="fill:#009900;stroke-width:0.012476"
+     d="M 6.8514682,3.2521409 4.876161,1.2768034 5.5165354,0.64507925 6.1569098,0.01335516 7.4950211,1.3510342 l 1.3381114,1.3376789 -0.00318,1.2693827 -0.00318,1.2693826 z"
+     id="path846" />
+</svg>

+ 18 - 0
docs/source/_static/images/chevron-down-grey.svg

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0.4 0.2 12.4 7.2" enable-background="new 0.4 0.2 12.4 7.2" xml:space="preserve">
+<desc>Created with Sketch.</desc>
+<g id="desktop">
+	<g id="Cloud-Button-Sequence" transform="translate(-1311.000000, -3818.000000)">
+		<g id="GetStarted-Copy-3" transform="translate(98.000000, 3249.000000)">
+			<g id="Via-CLoud" transform="translate(855.000000, 212.000000)">
+				<g id="Button" transform="translate(0.000000, 328.000000)">
+					<polyline id="Page-1" fill="none" stroke="#C7C7C7" stroke-width="2" points="370.1,29.9 364.6,35.1 359.1,29.9 					"/>
+				</g>
+			</g>
+		</g>
+	</g>
+</g>
+</svg>

Fichier diff supprimé car celui-ci est trop grand
+ 71 - 0
docs/source/_static/images/chevron-right-orange.svg


+ 17 - 0
docs/source/_static/images/chevron-right-prev.svg

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0.3 0.3 8.2 14.4" enable-background="new 0.3 0.3 8.2 14.4" xml:space="preserve">
+<title>Page 1</title>
+<desc>Created with Sketch.</desc>
+<g id="desktop">
+	<g id="_x30_1_x5F_Home" transform="translate(-864.000000, -1683.000000)">
+		<g id="community" transform="translate(-18.000000, 1391.000000)">
+			<g id="cta" transform="translate(741.000000, 277.000000)">
+				<polyline id="Page-1" fill="none" stroke="#EE4C2C" stroke-width="2" points="142,16 148.1,22.5 142,29 				"/>
+			</g>
+		</g>
+	</g>
+</g>
+</svg>

+ 17 - 0
docs/source/_static/images/chevron-right-white.svg

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+     viewBox="0.3 0.3 8.2 14.4" enable-background="new 0.3 0.3 8.2 14.4" xml:space="preserve">
+<title>Page 1</title>
+<desc>Created with Sketch.</desc>
+<g id="desktop">
+    <g id="_x30_1_x5F_Home" transform="translate(-864.000000, -1683.000000)">
+        <g id="community" transform="translate(-18.000000, 1391.000000)">
+            <g id="cta" transform="translate(741.000000, 277.000000)">
+                <polyline id="Page-1" fill="none" stroke="#FFFFFF" stroke-width="2" points="142,16 148.1,22.5 142,29                 "/>
+            </g>
+        </g>
+    </g>
+</g>
+</svg>

BIN
docs/source/_static/images/home-footer-background.jpg


+ 21 - 0
docs/source/_static/images/icon-close.svg

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="20px" height="21px" viewBox="0 0 20 21" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 51.2 (57519) - http://www.bohemiancoding.com/sketch -->
+    <title>Page 1</title>
+    <desc>Created with Sketch.</desc>
+    <defs></defs>
+    <g id="desktop" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="Behaviors" transform="translate(-421.000000, -1035.000000)" fill="#BBBBBA">
+            <g id="mobile" transform="translate(-3.000000, -4.000000)">
+                <g id="expanded-menu" transform="translate(92.000000, 949.000000)">
+                    <g id="Group-2" transform="translate(26.000000, 85.000000)">
+                        <g id="Page-1" transform="translate(316.000000, 15.503381) rotate(-21.000000) translate(-316.000000, -15.503381) translate(304.000000, 3.503381)">
+                            <polygon id="Fill-1" points="7.8940033 -8.03165789e-06 5.75107666 0.955277357 10.3761069 11.3312155 8.03165788e-06 15.9562457 0.955213104 18.0992527 11.3313119 13.4743028 15.9562618 23.850241 18.0993491 22.8950359 7.89416393 -8.03165789e-06"></polygon>
+                            <polygon id="Fill-2" points="17.7071311 8.06344719 18.6623362 10.2066148 23.8503053 7.89405952 22.8951002 5.75097225"></polygon>
+                        </g>
+                    </g>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>

+ 42 - 0
docs/source/_static/images/icon-menu-dots-dark.svg

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="25px" height="6px" viewBox="0 0 25 6" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 51.2 (57519) - http://www.bohemiancoding.com/sketch -->
+    <title>Page 1</title>
+    <desc>Created with Sketch.</desc>
+    <defs>
+        <polygon id="path-1" points="0 0.4815 4.81659091 0.4815 4.81659091 5.249925 0 5.249925"></polygon>
+        <polygon id="path-3" points="0.683560606 0.4815 5.50022727 0.4815 5.50022727 5.249925 0.683560606 5.249925"></polygon>
+        <polygon id="path-5" points="0.61030303 0.4815 5.42621212 0.4815 5.42621212 5.249925 0.61030303 5.249925"></polygon>
+    </defs>
+    <g id="desktop" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="Behaviors" transform="translate(-856.000000, -249.000000)">
+            <g id="mobile" transform="translate(-3.000000, -4.000000)">
+                <g id="condensed-menu-scroll" transform="translate(530.000000, 158.000000)">
+                    <g id="Page-1" transform="translate(329.000000, 95.000000)">
+                        <g id="Group-3">
+                            <mask id="mask-2" fill="white">
+                                <use xlink:href="#path-1"></use>
+                            </mask>
+                            <g id="Clip-2"></g>
+                            <path d="M-7.57575758e-05,2.865675 C-7.57575758e-05,1.548675 1.07871212,0.481425 2.40825758,0.481425 C3.73856061,0.481425 4.81659091,1.548675 4.81659091,2.865675 C4.81659091,4.182675 3.73856061,5.249925 2.40825758,5.249925 C1.07871212,5.249925 -7.57575758e-05,4.182675 -7.57575758e-05,2.865675" id="Fill-1" fill-opacity="0.5" fill="#8C8C8C" mask="url(#mask-2)"></path>
+                        </g>
+                        <g id="Group-6" transform="translate(9.000000, 0.000000)">
+                            <mask id="mask-4" fill="white">
+                                <use xlink:href="#path-3"></use>
+                            </mask>
+                            <g id="Clip-5"></g>
+                            <path d="M0.683560606,2.865675 C0.683560606,1.548675 1.76234848,0.481425 3.09265152,0.481425 C4.42295455,0.481425 5.50022727,1.548675 5.50022727,2.865675 C5.50022727,4.182675 4.42295455,5.249925 3.09265152,5.249925 C1.76234848,5.249925 0.683560606,4.182675 0.683560606,2.865675" id="Fill-4" fill-opacity="0.5" fill="#8C8C8C" mask="url(#mask-4)"></path>
+                        </g>
+                        <g id="Group-9" transform="translate(19.000000, 0.000000)">
+                            <mask id="mask-6" fill="white">
+                                <use xlink:href="#path-5"></use>
+                            </mask>
+                            <g id="Clip-8"></g>
+                            <path d="M0.61030303,2.865675 C0.61030303,1.548675 1.68833333,0.481425 3.01863636,0.481425 C4.34893939,0.481425 5.42621212,1.548675 5.42621212,2.865675 C5.42621212,4.182675 4.34893939,5.249925 3.01863636,5.249925 C1.68833333,5.249925 0.61030303,4.182675 0.61030303,2.865675" id="Fill-7" fill-opacity="0.5" fill="#8C8C8C" mask="url(#mask-6)"></path>
+                        </g>
+                    </g>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>

+ 10 - 0
docs/source/_static/images/pytorch-x-prev.svg

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0 0 200 200" style="enable-background:new 0 0 200 200;" xml:space="preserve">
+<style type="text/css">
+	.st0{fill:#EE4C2A;}
+</style>
+<rect x="-27.55" y="90.14" transform="matrix(0.7071 0.7071 -0.7071 0.7071 100 -41.4214)" class="st0" width="255.1" height="19.72"/>
+<rect x="-27.55" y="90.14" transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 241.4214 100)" class="st0" width="255.1" height="19.72"/>
+</svg>

+ 66 - 0
docs/source/_static/images/pytorch-x.svg

@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   version="1.1"
+   id="Layer_1"
+   x="0px"
+   y="0px"
+   viewBox="0 0 200 200"
+   style="enable-background:new 0 0 200 200;"
+   xml:space="preserve"
+   sodipodi:docname="pytorch-x-green.svg"
+   inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"><metadata
+   id="metadata13"><rdf:RDF><cc:Work
+       rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+         rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+   id="defs11" /><sodipodi:namedview
+   pagecolor="#ffffff"
+   bordercolor="#666666"
+   borderopacity="1"
+   objecttolerance="10"
+   gridtolerance="10"
+   guidetolerance="10"
+   inkscape:pageopacity="0"
+   inkscape:pageshadow="2"
+   inkscape:window-width="3840"
+   inkscape:window-height="2094"
+   id="namedview9"
+   showgrid="false"
+   inkscape:zoom="5.21"
+   inkscape:cx="102.30326"
+   inkscape:cy="100"
+   inkscape:window-x="0"
+   inkscape:window-y="0"
+   inkscape:window-maximized="1"
+   inkscape:current-layer="Layer_1" />
+<style
+   type="text/css"
+   id="style2">
+	.st0{fill:#EE4C2A;}
+</style>
+<rect
+   x="-27.55"
+   y="90.14"
+   transform="matrix(0.7071 0.7071 -0.7071 0.7071 100 -41.4214)"
+   class="st0"
+   width="255.1"
+   height="19.72"
+   id="rect4" />
+<rect
+   x="-27.55"
+   y="90.14"
+   transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 241.4214 100)"
+   class="st0"
+   width="255.1"
+   height="19.72"
+   id="rect6" />
+<path
+   style="fill:#009900;stroke-width:0.191939"
+   d="M 9.8847818,190.11511 2.9761032,183.20443 44.578207,141.60232 86.180313,100.00022 44.578263,58.397841 2.9762137,16.79546 9.884837,9.8848367 16.79346,2.9742136 58.396729,44.577152 100,86.18009 141.60327,44.577152 183.20654,2.9742136 l 6.90862,6.9106231 6.90862,6.9106233 -41.60204,41.602381 -41.60205,41.602379 41.6021,41.6021 41.60211,41.60211 -6.90868,6.91068 -6.90868,6.91067 L 141.60327,155.42285 100,113.81991 58.396729,155.42285 16.79346,197.02578 Z"
+   id="path838" /></svg>

Fichier diff supprimé car celui-ci est trop grand
+ 19 - 0
docs/source/_static/images/search-icon-prev.svg


Fichier diff supprimé car celui-ci est trop grand
+ 92 - 0
docs/source/_static/images/search-icon.svg


+ 13 - 0
docs/source/_static/images/view-page-source-icon-prev.svg

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg width="20px" height="20px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0 0 300 225.9" style="enable-background:new 0 0 300 225.9;" xml:space="preserve">
+<style type="text/css">
+	.st0{fill:#EE4C2C;}
+</style>
+<g>
+	<path class="st0" d="M0,0v225.9h300V0H0z M282.4,208.3H17.6V17.6h264.7V208.3z"/>
+	<polygon class="st0" points="64.4,166.1 76.8,178.5 142.4,112.9 76.8,47.3 64.4,59.8 64.4,59.8 117.5,112.9 	"/>
+	<rect x="158.8" y="156.4" class="st0" width="88.2" height="17.6"/>
+</g>
+</svg>

+ 87 - 0
docs/source/_static/images/view-page-source-icon.svg

@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="20px"
+   height="20px"
+   version="1.1"
+   id="Layer_1"
+   x="0px"
+   y="0px"
+   viewBox="0 0 300 225.9"
+   style="enable-background:new 0 0 300 225.9;"
+   xml:space="preserve"
+   sodipodi:docname="view-page-source-icon-green.svg"
+   inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"><metadata
+   id="metadata17"><rdf:RDF><cc:Work
+       rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+         rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+   id="defs15" /><sodipodi:namedview
+   pagecolor="#ffffff"
+   bordercolor="#666666"
+   borderopacity="1"
+   objecttolerance="10"
+   gridtolerance="10"
+   guidetolerance="10"
+   inkscape:pageopacity="0"
+   inkscape:pageshadow="2"
+   inkscape:window-width="3840"
+   inkscape:window-height="2094"
+   id="namedview13"
+   showgrid="false"
+   inkscape:zoom="52.1"
+   inkscape:cx="10.230326"
+   inkscape:cy="10"
+   inkscape:window-x="0"
+   inkscape:window-y="0"
+   inkscape:window-maximized="1"
+   inkscape:current-layer="Layer_1" />
+<style
+   type="text/css"
+   id="style2">
+	.st0{fill:#EE4C2C;}
+</style>
+<g
+   id="g10">
+	<path
+   class="st0"
+   d="M 0,0 V 225.9 H 300 V 0 Z M 282.4,208.3 H 17.6 V 17.6 h 264.7 v 190.7 z"
+   id="path4" />
+	<polygon
+   class="st0"
+   points="142.4,112.9 76.8,47.3 64.4,59.8 64.4,59.8 117.5,112.9 64.4,166.1 76.8,178.5 "
+   id="polygon6" />
+	<rect
+   x="158.8"
+   y="156.39999"
+   class="st0"
+   width="88.199997"
+   height="17.6"
+   id="rect8" />
+</g>
+<path
+   style="fill:#7fff2a;stroke-width:0.0191939"
+   d="M 0,10 V 2.4760077 H 10 20 V 10 17.523992 H 10 0 Z m 18.829175,0 V 3.6276392 H 10 1.1708253 V 10 16.372361 H 10 18.829175 Z"
+   id="path842"
+   transform="matrix(15,0,0,15,0,-37.05)" /><path
+   style="fill:#7fff2a;stroke-width:0.0191939"
+   d="m 10.59501,13.483685 v -0.585412 h 2.927063 2.927063 v 0.585412 0.585413 H 13.522073 10.59501 Z"
+   id="path844"
+   transform="matrix(15,0,0,15,0,-37.05)" /><path
+   style="fill:#009900;stroke-width:0.0191939;fill-opacity:1"
+   d="M 4.7072408,13.949196 4.2994064,13.541362 6.0700098,11.770681 7.8406132,10 6.0699543,8.2292635 4.2992954,6.458527 4.7121062,6.0460512 5.124917,5.6335753 7.303352,7.8120102 9.4817869,9.9904451 7.2984311,12.173738 5.1150753,14.357031 Z"
+   id="path846"
+   transform="matrix(15,0,0,15,0,-37.05)" /><path
+   style="fill:#009900;fill-opacity:1;stroke-width:0.0191939"
+   d="m 10.59501,13.483685 v -0.585412 h 2.927063 2.927063 v 0.585412 0.585413 H 13.522073 10.59501 Z"
+   id="path848"
+   transform="matrix(15,0,0,15,0,-37.05)" /><path
+   style="fill:#009900;fill-opacity:1;stroke-width:0.0191939"
+   d="M 0,10 V 2.4760077 H 10 20 V 10 17.523992 H 10 0 Z m 18.829175,0 V 3.6276392 H 10 1.1708253 V 10 16.372361 H 10 18.829175 Z"
+   id="path850"
+   transform="matrix(15,0,0,15,0,-37.05)" /></svg>

+ 1 - 1
docs/source/api.rst

@@ -60,7 +60,7 @@ macop.policies
    macop.policies.classicals
    macop.policies.reinforcement
 
-macop.solution
+macop.solutions
 -------------------
 
 .. autosummary::

+ 7 - 3
docs/source/conf.py

@@ -18,7 +18,7 @@ sys.path.insert(0, os.path.abspath('../../../macop'))
 
 # -- Project information -----------------------------------------------------
 
-project = 'macop'
+project = 'Macop'
 copyright = '2020, Jérôme BUISINE'
 author = 'Jérôme BUISINE'
 
@@ -90,7 +90,7 @@ language = None
 exclude_patterns = []
 
 # The name of the Pygments (syntax highlighting) style to use.
-pygments_style = None
+pygments_style = 'default'
 
 
 # -- Options for HTML output -------------------------------------------------
@@ -98,7 +98,11 @@ pygments_style = None
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
 #
-html_theme = 'sphinx_rtd_theme'
+#html_theme = 'sphinx_rtd_theme'
+#html_theme = 'divio_docs_theme'
+
+html_theme = 'asteroid_sphinx_theme' # use the theme in subdir 'theme'
+# html_theme_path = ['.'] # make sphinx search for themes in current dir
 
 # Theme options are theme-specific and customize the look and feel of a theme
 # further.  For a list of options available for each theme, see the

+ 16 - 14
docs/source/documentations/problem.rst

@@ -1,7 +1,7 @@
 2. Problem instance
 ===================
 
-In this tutorial, we introduce the way of using `macop` and running your algorithm quickly using a well the known `knapsack` problem.
+In this tutorial, we introduce the way of using **Macop** and running your algorithm quickly using the well known `knapsack` problem.
 
 2.1 Problem definition
 ~~~~~~~~~~~~~~~~~~~~~~
@@ -12,36 +12,38 @@ The **knapsack problem** is a problem in combinatorial optimization: Given a set
 The image below provides an illustration of the problem:
 
 .. image:: ../_static/documentation/knapsack_problem.png
-   :width:  300 px
+   :width: 300 px
    :align: center
 
 
 In this problem, we try to optimise the value associated with the objects we wish to put in our backpack while respecting the capacity of the bag (weight constraint).
 
-It is a combinatorial and therefore discrete problem. `Macop` decomposes its package into two parts, which is related to discrete optimisation on the one hand, and continuous optimisation on the other hand. This will be detailed later.
+.. warning::
+    It is a combinatorial and therefore discrete problem. **Macop** decomposes its package into two parts, which is related to discrete optimisation on the one hand, and continuous optimisation on the other hand. This will be detailed later.
 
 
 2.2 Problem implementation
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-Hence, we define our problem in Python:
+During the whole tutorial, the example used is based on the previous illustration with:
+
+.. image:: ../_static/documentation/project_knapsack_problem.png
+   :width: 600 px
+   :align: center
+
+
+Hence, we now define our problem in Python:
 
 - values of each objects 
 - weight associated to each of these objects
 
-.. code:: python
+.. code-block:: python
     
-    """
-    imports part
-    """
-    import random
-
     """
     Problem definition
     """
-    random.seed(42)
 
-    elements_score = [ random.randint(1, 20) for _ in range(30) ] # value of each object
-    elements_weight = [ random.randint(5, 25) for _ in range(30) ] # weight of each object
+    elements_score = [ 4, 2, 10, 1, 2 ] # value of each object
+    elements_weight = [ 12, 1, 4, 1, 2 ] # weight of each object
 
-Once we have defined the instance of our problem, we will need to define the representation of a solution to that problem.
+Once we have defined the instance of our problem, we will need to define the representation of a solution to that problem.

+ 129 - 1
docs/source/documentations/solutions.rst

@@ -1,10 +1,138 @@
 3. Solutions
 =============
 
-A solution is a means of representing a solution to a specific problem in the form of data. In this example, we will always use the knapsack problem as a basis.
+Representing a solution to a specific problem is very important in an optimisation process. In this example, we will always use the **knapsack problem** as a basis.
+
+In a first step, the management of the solutions by the macop package will be presented. Then a specific implementation for the current problem will be detailed.
 
 3.1. Generic Solution
 ~~~~~~~~~~~~~~~~~~~~~~~~~
 
+Inside ``macop.solutions.base`` module of `Macop`, the ``Solution`` class is available. It's an abstract solution class structure which:
+
+- stores the solution data representation into its ``data`` attribute
+- get ``size`` (shape) of specific data representation
+- stores the ``score`` of the solution once a solution is evaluated
+
+Some specific methods are available:
+
+.. code-block:: python
+
+    class Solution():
+
+        def __init__(self, data, size):
+            """
+            Abstract solution class constructor
+            """
+            ...
+
+        def isValid(self, validator):
+            """
+            Use of custom function which checks if a solution is valid or not
+            """
+            ...
+
+        def evaluate(self, evaluator):
+            """
+            Evaluate solution using specific `evaluator`
+            """
+            ...
+
+        def fitness(self):
+            """
+            Returns fitness score
+            """
+            ...
+
+        @staticmethod
+        def random(size, validator=None):
+            """
+            Initialize solution using random data with validator or not
+            """
+            ...
+
+        def clone(self):
+            """
+            Clone the current solution and its data, but without keeping evaluated `_score`
+            """
+            ...
+
+
+From these basic methods, it is possible to manage a representation of a solution to our problem. 
+
+Allowing to initialize it randomly or not (using constructor or ``random`` method), to evaluate it (``evaluate`` method) and to check some constraints of validation of the solution (``isValid`` method).
+
+.. note::
+    Only one of these methods needs specification if we create our own type of solution. This is the ``random`` method, which depends on the need of the problem.
+
+We will now see how to define a type of solution specific to our problem.
+
 3.2. Solution representation for knapsack
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+We will now use the abstract ``Solution`` type available in the ``macop.solutions.base`` module in order to define our own solution.
+First of all, let's look at the representation of our knapsack problem. **How to represent the solution?**
+
+3.2.1. Knapsack solution
+************************
+
+A valid solution can be shown below where the sum of the object weights is 15 and the sum of the selected objects values is 8 (its fitness):
+
+.. image:: ../_static/documentation/project_knapsack_solution.png
+   :width:  800 px
+   :align: center
+
+Its representation can be translate as a **binary array** with value:
+
+.. code-block::
+
+    [1, 1, 0, 0, 1]
+
+where selected objects have **1** as value otherwise **0**.
+
+3.2.2. Binary Solution
+**********************
+
+We will now define our own type of solution by inheriting from ``macop.solutions.base.Solution``, which we will call ``BinarySolution``.
+
+First we will define our new class as inheriting functionality from ``Solution`` (such as child class). 
+We will also have to implement the ``random`` method to create a new random solution.
+
+.. code-block:: python
+
+    """
+    modules imports
+    """
+    from macop.solutions.base import Solution
+    import numpy as np
+
+    class BinarySolution(Solution):
+        
+        @staticmethod
+        def random(size, validator=None):
+
+            # create binary array of specific size using numpy random module
+            data = np.random.randint(2, size=size)
+            # initialize new solution using constructor
+            solution = BinarySolution(data, size)
+
+            # check if validator is set
+            if not validator:
+                return solution
+
+            # try to generate solution until solution validity (if validator is provided)
+            while not validator(solution):
+                data = np.random.randint(2, size=size)
+                solution = BinarySolution(data, size)
+
+            return solution
+
+Using this new Solution representation, we can now generate solution randomly:
+
+.. code-block:: python
+
+    solution = BinarySolution.random(5)
+
+
+3.3. Validate a solution
+~~~~~~~~~~~~~~~~~~~~~~~~~

+ 2 - 2
macop/solutions/base.py

@@ -27,7 +27,7 @@ class Solution():
 
     def isValid(self, validator):
         """
-        Use of custom method which validates if solution is valid or not
+        Use of custom function which checks if a solution is valid or not
 
         Args:
             validator: {function} -- specific function which validates or not a solution
@@ -62,7 +62,7 @@ class Solution():
     @staticmethod
     def random(size, validator=None):
         """
-        Initialize solution using random data with validator
+        Initialize solution using random data with validator or not
 
         Args:
             size: {int} -- expected solution size to generate