806 lines
3.4 MiB
Plaintext
806 lines
3.4 MiB
Plaintext
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 1,
|
||
|
"metadata": {
|
||
|
"execution": {
|
||
|
"iopub.execute_input": "2020-10-04T07:26:57.870820Z",
|
||
|
"iopub.status.busy": "2020-10-04T07:26:57.869670Z",
|
||
|
"iopub.status.idle": "2020-10-04T07:26:58.499789Z",
|
||
|
"shell.execute_reply": "2020-10-04T07:26:58.500257Z"
|
||
|
},
|
||
|
"extensions": {
|
||
|
"jupyter_dashboards": {
|
||
|
"version": 1,
|
||
|
"views": {
|
||
|
"grid_default": {},
|
||
|
"report_default": {
|
||
|
"hidden": true
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
"papermill": {
|
||
|
"duration": 0.66457,
|
||
|
"end_time": "2020-10-04T07:26:58.500489",
|
||
|
"exception": false,
|
||
|
"start_time": "2020-10-04T07:26:57.835919",
|
||
|
"status": "completed"
|
||
|
},
|
||
|
"slideshow": {
|
||
|
"slide_type": "skip"
|
||
|
},
|
||
|
"tags": []
|
||
|
},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/html": [
|
||
|
" <script type=\"text/javascript\">\n",
|
||
|
" window.PlotlyConfig = {MathJaxConfig: 'local'};\n",
|
||
|
" if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}\n",
|
||
|
" if (typeof require !== 'undefined') {\n",
|
||
|
" require.undef(\"plotly\");\n",
|
||
|
" define('plotly', function(require, exports, module) {\n",
|
||
|
" /**\n",
|
||
|
"* plotly.js v1.56.0\n",
|
||
|
"* Copyright 2012-2020, Plotly, Inc.\n",
|
||
|
"* All rights reserved.\n",
|
||
|
"* Licensed under the MIT license\n",
|
||
|
"*/\n",
|
||
|
"!function(t){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=t();else if(\"function\"==typeof define&&define.amd)define([],t);else{(\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:this).Plotly=t()}}((function(){return function t(e,r,n){function a(o,s){if(!r[o]){if(!e[o]){var l=\"function\"==typeof require&&require;if(!s&&l)return l(o,!0);if(i)return i(o,!0);var c=new Error(\"Cannot find module '\"+o+\"'\");throw c.code=\"MODULE_NOT_FOUND\",c}var u=r[o]={exports:{}};e[o][0].call(u.exports,(function(t){return a(e[o][1][t]||t)}),u,u.exports,t,e,r,n)}return r[o].exports}for(var i=\"function\"==typeof require&&require,o=0;o<n.length;o++)a(n[o]);return a}({1:[function(t,e,r){\"use strict\";var n=t(\"../src/lib\"),a={\"X,X div\":\"direction:ltr;font-family:'Open Sans', verdana, arial, sans-serif;margin:0;padding:0;\",\"X input,X button\":\"font-family:'Open Sans', verdana, arial, sans-serif;\",\"X input:focus,X button:focus\":\"outline:none;\",\"X a\":\"text-decoration:none;\",\"X a:hover\":\"text-decoration:none;\",\"X .crisp\":\"shape-rendering:crispEdges;\",\"X .user-select-none\":\"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;\",\"X svg\":\"overflow:hidden;\",\"X svg a\":\"fill:#447adb;\",\"X svg a:hover\":\"fill:#3c6dc5;\",\"X .main-svg\":\"position:absolute;top:0;left:0;pointer-events:none;\",\"X .main-svg .draglayer\":\"pointer-events:all;\",\"X .cursor-default\":\"cursor:default;\",\"X .cursor-pointer\":\"cursor:pointer;\",\"X .cursor-crosshair\":\"cursor:crosshair;\",\"X .cursor-move\":\"cursor:move;\",\"X .cursor-col-resize\":\"cursor:col-resize;\",\"X .cursor-row-resize\":\"cursor:row-resize;\",\"X .cursor-ns-resize\":\"cursor:ns-resize;\",\"X .cursor-ew-resize\":\"cursor:ew-resize;\",\"X .cursor-sw-resize\":\"cursor:sw-resize;\",\"X .cursor-s-resize\":\"cursor:s-resize;\",\"X .cursor-se-resize\":\"cursor:se-resize;\",\"X .cursor-w-resize\":\"cursor:w-resize;\",\"X .cursor-e-resize\":\"cursor:e-resize;\",\"X .cursor-nw-resize\":\"cursor:nw-resize;\",\"X .cursor-n-resize\":\"cursor:n-resize;\",\"X .cursor-ne-resize\":\"cursor:ne-resize;\",\"X .cursor-grab\":\"cursor:-webkit-grab;cursor:grab;\",\"X .modebar\":\"position:absolute;top:2px;right:2px;\",\"X .ease-bg\":\"-webkit-transition:background-color 0.3s ease 0s;-moz-transition:background-color 0.3s ease 0s;-ms-transition:background-color 0.3s ease 0s;-o-transition:background-color 0.3s ease 0s;transition:background-color 0.3s ease 0s;\",\"X .modebar--hover>:not(.watermark)\":\"opacity:0;-webkit-transition:opacity 0.3s ease 0s;-moz-transition:opacity 0.3s ease 0s;-ms-transition:opacity 0.3s ease 0s;-o-transition:opacity 0.3s ease 0s;transition:opacity 0.3s ease 0s;\",\"X:hover .modebar--hover .modebar-group\":\"opacity:1;\",\"X .modebar-group\":\"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;\",\"X .modebar-btn\":\"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;\",\"X .modebar-btn svg\":\"position:relative;top:2px;\",\"X .modebar.vertical\":\"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;\",\"X .modebar.vertical svg\":\"top:-1px;\",\"X .modebar.vertical .modebar-group\":\"display:block;float:none;padding-left:0px;padding-bottom:8px;\",\"X .modebar.vertical .modebar-group .modebar-btn\":\"display:block;text-align:center;\",\"X [data-title]:before,X [data-title]:after\":\"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;\",\"X [data-title]:hover:before,X [data-title]:hover:after\":\"display:block;opacity:1;\",\"X [data-title]:before\":\"content:'';position:absolute;background:transparent;border:6px solid transpa
|
||
|
"/*!\n",
|
||
|
" * The buffer module from node.js, for the browser.\n",
|
||
|
" *\n",
|
||
|
" * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>\n",
|
||
|
" * @license MIT\n",
|
||
|
" */function a(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,a=0,i=Math.min(r,n);a<i;++a)if(t[a]!==e[a]){r=t[a],n=e[a];break}return r<n?-1:n<r?1:0}function i(t){return r.Buffer&&\"function\"==typeof r.Buffer.isBuffer?r.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var o=t(\"util/\"),s=Object.prototype.hasOwnProperty,l=Array.prototype.slice,c=\"foo\"===function(){}.name;function u(t){return Object.prototype.toString.call(t)}function h(t){return!i(t)&&(\"function\"==typeof r.ArrayBuffer&&(\"function\"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}var f=e.exports=y,p=/\\s*function\\s+([^\\(\\s]*)\\s*/;function d(t){if(o.isFunction(t)){if(c)return t.name;var e=t.toString().match(p);return e&&e[1]}}function g(t,e){return\"string\"==typeof t?t.length<e?t:t.slice(0,e):t}function m(t){if(c||!o.isFunction(t))return o.inspect(t);var e=d(t);return\"[Function\"+(e?\": \"+e:\"\")+\"]\"}function v(t,e,r,n,a){throw new f.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:a})}function y(t,e){t||v(t,!0,e,\"==\",f.ok)}function x(t,e,r,n){if(t===e)return!0;if(i(t)&&i(e))return 0===a(t,e);if(o.isDate(t)&&o.isDate(e))return t.getTime()===e.getTime();if(o.isRegExp(t)&&o.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&\"object\"==typeof t||null!==e&&\"object\"==typeof e){if(h(t)&&h(e)&&u(t)===u(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===a(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(i(t)!==i(e))return!1;var s=(n=n||{actual:[],expected:[]}).actual.indexOf(t);return-1!==s&&s===n.expected.indexOf(e)||(n.actual.push(t),n.expected.push(e),function(t,e,r,n){if(null==t||null==e)return!1;if(o.isPrimitive(t)||o.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var a=b(t),i=b(e);if(a&&!i||!a&&i)return!1;if(a)return t=l.call(t),e=l.call(e),x(t,e,r);var s,c,u=T(t),h=T(e);if(u.length!==h.length)return!1;for(u.sort(),h.sort(),c=u.length-1;c>=0;c--)if(u[c]!==h[c])return!1;for(c=u.length-1;c>=0;c--)if(s=u[c],!x(t[s],e[s],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function b(t){return\"[object Arguments]\"==Object.prototype.toString.call(t)}function _(t,e){if(!t||!e)return!1;if(\"[object RegExp]\"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function w(t,e,r,n){var a;if(\"function\"!=typeof e)throw new TypeError('\"block\" argument must be a function');\"string\"==typeof r&&(n=r,r=null),a=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?\" (\"+r.name+\").\":\".\")+(n?\" \"+n:\".\"),t&&!a&&v(a,r,\"Missing expected exception\"+n);var i=\"string\"==typeof n,s=!t&&a&&!r;if((!t&&o.isError(a)&&i&&_(a,r)||s)&&v(a,r,\"Got unwanted exception\"+n),t&&a&&r&&!_(a,r)||!t&&a)throw a}f.AssertionError=function(t){this.name=\"AssertionError\",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return g(m(t.actual),128)+\" \"+t.operator+\" \"+g(m(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,a=d(e),i=n.indexOf(\"\\n\"+a);if(i>=0){var o=n.indexOf(\"\\n\",i+1);n=n.substring(o+1)}this.stack=n}}},o.inherits(f.AssertionError,Error),f.fail=v,f.ok=y,f.equal=function(t,e,r){t!=e&&v(t,e,r,\"==\",f.equal)},f.notEqual=function(t,e,r){t==e&&v(t,e,r,\"!=\",f.notEqual)},f.deepEqual=function(t,e,r){x(t,e,!1)||v(t,e,r,\"deepEqual\",f.deepEqual)},f.deepStrictEqual=function(t,e,r){x(t,e,!0)||v(t,e,r,\"deepStrictEqual\",f.deepStrictEqual)},f.notDeepEqual=function(t,e,r){x(t,e,!1)&&v(t,e,r,\"notDeepEqual\",f.notDeepEqual)},f.notDeepStrictEqual=function t(e,r,n){x(e,r,!0)&&v(e,r,n,\"notDeepStrictEqual\",t)},f.strictEqual=function(t,e
|
||
|
"/*!\n",
|
||
|
" * The buffer module from node.js, for the browser.\n",
|
||
|
" *\n",
|
||
|
" * @author Feross Aboukhadijeh <https://feross.org>\n",
|
||
|
" * @license MIT\n",
|
||
|
" */\n",
|
||
|
"\"use strict\";var n=t(\"base64-js\"),a=t(\"ieee754\");r.Buffer=e,r.SlowBuffer=function(t){+t!=t&&(t=0);return e.alloc(+t)},r.INSPECT_MAX_BYTES=50;function i(t){if(t>2147483647)throw new RangeError('The value \"'+t+'\" is invalid for option \"size\"');var r=new Uint8Array(t);return r.__proto__=e.prototype,r}function e(t,e,r){if(\"number\"==typeof t){if(\"string\"==typeof e)throw new TypeError('The \"string\" argument must be of type string. Received type number');return l(t)}return o(t,e,r)}function o(t,r,n){if(\"string\"==typeof t)return function(t,r){\"string\"==typeof r&&\"\"!==r||(r=\"utf8\");if(!e.isEncoding(r))throw new TypeError(\"Unknown encoding: \"+r);var n=0|h(t,r),a=i(n),o=a.write(t,r);o!==n&&(a=a.slice(0,o));return a}(t,r);if(ArrayBuffer.isView(t))return c(t);if(null==t)throw TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof t);if(B(t,ArrayBuffer)||t&&B(t.buffer,ArrayBuffer))return function(t,r,n){if(r<0||t.byteLength<r)throw new RangeError('\"offset\" is outside of buffer bounds');if(t.byteLength<r+(n||0))throw new RangeError('\"length\" is outside of buffer bounds');var a;a=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);return a.__proto__=e.prototype,a}(t,r,n);if(\"number\"==typeof t)throw new TypeError('The \"value\" argument must not be of type number. Received type number');var a=t.valueOf&&t.valueOf();if(null!=a&&a!==t)return e.from(a,r,n);var o=function(t){if(e.isBuffer(t)){var r=0|u(t.length),n=i(r);return 0===n.length||t.copy(n,0,0,r),n}if(void 0!==t.length)return\"number\"!=typeof t.length||N(t.length)?i(0):c(t);if(\"Buffer\"===t.type&&Array.isArray(t.data))return c(t.data)}(t);if(o)return o;if(\"undefined\"!=typeof Symbol&&null!=Symbol.toPrimitive&&\"function\"==typeof t[Symbol.toPrimitive])return e.from(t[Symbol.toPrimitive](\"string\"),r,n);throw new TypeError(\"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type \"+typeof t)}function s(t){if(\"number\"!=typeof t)throw new TypeError('\"size\" argument must be of type number');if(t<0)throw new RangeError('The value \"'+t+'\" is invalid for option \"size\"')}function l(t){return s(t),i(t<0?0:0|u(t))}function c(t){for(var e=t.length<0?0:0|u(t.length),r=i(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function u(t){if(t>=2147483647)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+2147483647..toString(16)+\" bytes\");return 0|t}function h(t,r){if(e.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||B(t,ArrayBuffer))return t.byteLength;if(\"string\"!=typeof t)throw new TypeError('The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,a=arguments.length>2&&!0===arguments[2];if(!a&&0===n)return 0;for(var i=!1;;)switch(r){case\"ascii\":case\"latin1\":case\"binary\":return n;case\"utf8\":case\"utf-8\":return D(t).length;case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return 2*n;case\"hex\":return n>>>1;case\"base64\":return R(t).length;default:if(i)return a?-1:D(t).length;r=(\"\"+r).toLowerCase(),i=!0}}function f(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return\"\";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return\"\";if((r>>>=0)<=(e>>>=0))return\"\";for(t||(t=\"utf8\");;)switch(t){case\"hex\":return A(this,e,r);case\"utf8\":case\"utf-8\":return T(this,e,r);case\"ascii\":return k(this,e,r);case\"latin1\":case\"binary\":return M(this,e,r);case\"base64\":return w(this,e,r);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return S(this,e,r);default:if(n)throw new TypeError(\"Unknown encoding: \"+t);t=(t+\"\").toLowerCase(),n=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function d(t,r,n,a,i){if(0===t.length)return-1;if(\"string\"==typeof n?(a=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),N(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}i
|
||
|
"/*!\n",
|
||
|
" * @overview es6-promise - a tiny implementation of Promises/A+.\n",
|
||
|
" * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n",
|
||
|
" * @license Licensed under MIT license\n",
|
||
|
" * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n",
|
||
|
" * @version v4.2.8+1e68dce6\n",
|
||
|
" */\n",
|
||
|
"!function(t,n){\"object\"==typeof r&&\"undefined\"!=typeof e?e.exports=n():t.ES6Promise=n()}(this,(function(){\"use strict\";function e(t){return\"function\"==typeof t}var r=Array.isArray?Array.isArray:function(t){return\"[object Array]\"===Object.prototype.toString.call(t)},i=0,o=void 0,s=void 0,l=function(t,e){g[i]=t,g[i+1]=e,2===(i+=2)&&(s?s(m):_())};var c=\"undefined\"!=typeof window?window:void 0,u=c||{},h=u.MutationObserver||u.WebKitMutationObserver,f=\"undefined\"==typeof self&&\"undefined\"!=typeof n&&\"[object process]\"==={}.toString.call(n),p=\"undefined\"!=typeof Uint8ClampedArray&&\"undefined\"!=typeof importScripts&&\"undefined\"!=typeof MessageChannel;function d(){var t=setTimeout;return function(){return t(m,1)}}var g=new Array(1e3);function m(){for(var t=0;t<i;t+=2){(0,g[t])(g[t+1]),g[t]=void 0,g[t+1]=void 0}i=0}var v,y,x,b,_=void 0;function w(t,e){var r=this,n=new this.constructor(M);void 0===n[k]&&D(n);var a=r._state;if(a){var i=arguments[a-1];l((function(){return z(a,n,i,r._result)}))}else P(r,n,t,e);return n}function T(t){if(t&&\"object\"==typeof t&&t.constructor===this)return t;var e=new this(M);return S(e,t),e}f?_=function(){return n.nextTick(m)}:h?(y=0,x=new h(m),b=document.createTextNode(\"\"),x.observe(b,{characterData:!0}),_=function(){b.data=y=++y%2}):p?((v=new MessageChannel).port1.onmessage=m,_=function(){return v.port2.postMessage(0)}):_=void 0===c&&\"function\"==typeof t?function(){try{var t=Function(\"return this\")().require(\"vertx\");return\"undefined\"!=typeof(o=t.runOnLoop||t.runOnContext)?function(){o(m)}:d()}catch(t){return d()}}():d();var k=Math.random().toString(36).substring(2);function M(){}function A(t,r,n){r.constructor===t.constructor&&n===w&&r.constructor.resolve===T?function(t,e){1===e._state?C(t,e._result):2===e._state?L(t,e._result):P(e,void 0,(function(e){return S(t,e)}),(function(e){return L(t,e)}))}(t,r):void 0===n?C(t,r):e(n)?function(t,e,r){l((function(t){var n=!1,a=function(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}(r,e,(function(r){n||(n=!0,e!==r?S(t,r):C(t,r))}),(function(e){n||(n=!0,L(t,e))}),t._label);!n&&a&&(n=!0,L(t,a))}),t)}(t,r,n):C(t,r)}function S(t,e){if(t===e)L(t,new TypeError(\"You cannot resolve a promise with itself\"));else if(a=typeof(n=e),null===n||\"object\"!==a&&\"function\"!==a)C(t,e);else{var r=void 0;try{r=e.then}catch(e){return void L(t,e)}A(t,e,r)}var n,a}function E(t){t._onerror&&t._onerror(t._result),I(t)}function C(t,e){void 0===t._state&&(t._result=e,t._state=1,0!==t._subscribers.length&&l(I,t))}function L(t,e){void 0===t._state&&(t._state=2,t._result=e,l(E,t))}function P(t,e,r,n){var a=t._subscribers,i=a.length;t._onerror=null,a[i]=e,a[i+1]=r,a[i+2]=n,0===i&&t._state&&l(I,t)}function I(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,a=void 0,i=t._result,o=0;o<e.length;o+=3)n=e[o],a=e[o+r],n?z(r,n,a,i):a(i);t._subscribers.length=0}}function z(t,r,n,a){var i=e(n),o=void 0,s=void 0,l=!0;if(i){try{o=n(a)}catch(t){l=!1,s=t}if(r===o)return void L(r,new TypeError(\"A promises callback cannot return that same promise.\"))}else o=a;void 0!==r._state||(i&&l?S(r,o):!1===l?L(r,s):1===t?C(r,o):2===t&&L(r,o))}var O=0;function D(t){t[k]=O++,t._state=void 0,t._result=void 0,t._subscribers=[]}var R=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(M),this.promise[k]||D(this.promise),r(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?C(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&C(this.promise,this._result))):L(this.promise,new Error(\"Array Methods must be provided an Array\"))}return t.prototype._enumerate=function(t){for(var e=0;void 0===this._state&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===T){var a=void 0,i=void 0,o=!1;try{a=t.then}catch(t){o=!0,i=t}if(a===w&&void 0!==t._state)this._settledAt(t._state,e,t._result);else if(\"function\"!=typeof a)this._remaining--,this._result[e]=t;else if(r===F){var s=new r
|
||
|
"/*!\n",
|
||
|
" * Determine if an object is a Buffer\n",
|
||
|
" *\n",
|
||
|
" * @author Feross Aboukhadijeh <https://feross.org>\n",
|
||
|
" * @license MIT\n",
|
||
|
" */\n",
|
||
|
"e.exports=function(t){return null!=t&&(n(t)||function(t){return\"function\"==typeof t.readFloatLE&&\"function\"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},{}],440:[function(t,e,r){\"use strict\";e.exports=\"undefined\"!=typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\\//.test(navigator.appVersion))},{}],441:[function(t,e,r){\"use strict\";e.exports=i,e.exports.isMobile=i,e.exports.default=i;var n=/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series[46]0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,a=/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series[46]0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i;function i(t){t||(t={});var e=t.ua;if(e||\"undefined\"==typeof navigator||(e=navigator.userAgent),e&&e.headers&&\"string\"==typeof e.headers[\"user-agent\"]&&(e=e.headers[\"user-agent\"]),\"string\"!=typeof e)return!1;var r=t.tablet?a.test(e):n.test(e);return!r&&t.tablet&&t.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==e.indexOf(\"Macintosh\")&&-1!==e.indexOf(\"Safari\")&&(r=!0),r}},{}],442:[function(t,e,r){\"use strict\";e.exports=function(t){var e=typeof t;return null!==t&&(\"object\"===e||\"function\"===e)}},{}],443:[function(t,e,r){\"use strict\";var n=Object.prototype.toString;e.exports=function(t){var e;return\"[object Object]\"===n.call(t)&&(null===(e=Object.getPrototypeOf(t))||e===Object.getPrototypeOf({}))}},{}],444:[function(t,e,r){\"use strict\";e.exports=function(t){for(var e,r=t.length,n=0;n<r;n++)if(((e=t.charCodeAt(n))<9||e>13)&&32!==e&&133!==e&&160!==e&&5760!==e&&6158!==e&&(e<8192||e>8205)&&8232!==e&&8233!==e&&8239!==e&&8287!==e&&8288!==e&&12288!==e&&65279!==e)return!1;return!0}},{}],445:[function(t,e,r){\"use strict\";e.exports=function(t){return\"string\"==typeof t&&(t=t.trim(),!!(/^[mzlhvcsqta]\\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\\dz]$/i.test(t)&&t.length>4))}},{}],446:[function(t,e,r){e.exports=function(t,e,r){return t*(1-r)+e*r}},{}],447:[function(t,e,r){!function(t,n){\"object\"==typeof r&&\"undefined\"!=typeof e?e.exports=n():(t=t||self).mapboxgl=n()}(this,(function(){\"use strict\";var t,e,r;function n(n,a){if(t)if(e){var i=\"var sharedChunk = {}; (\"+t+\")(sharedChunk); (\"+e+\")(sharedChunk);\",o={};t(o),(r=a(o)).workerUrl=window.URL.createObjectURL(new Blob([i],{type:\"text/javascript\"}))}else e=a;else t=a}return n(0,(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=n;function n(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n}n.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},n.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},n.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},n.prototype.solveCurveX=function(t,e){var r,n,a,i,o;for(void 0===e&&(e=1e-6),a=t,o=0;o<8;o++){if(i=this.sampleCurveX(a)-t,Math.abs(i)<e)return a;var s=this.sampleCurveDerivativeX(a);if(Math.abs(s)<1e-6)break;a-=i/s}if((a=t)<(r=0))return r;if(a>(n=1))return n;for(;r<n;){if(i=this.sampleCurveX(a),Math.abs(i-t)<e)return a;t>i?r=a:n=a,a=.5*(n-r)+r}return a},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var a=i;function i(t,e){this.x=t,this.y=e}function o(t,e,n,a){var i=new r(t,e,n,a);return function(t){return i.solve(t)}}i.prototype={clone:function(){return new i(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoi
|
||
|
"/*\n",
|
||
|
"object-assign\n",
|
||
|
"(c) Sindre Sorhus\n",
|
||
|
"@license MIT\n",
|
||
|
"*/\n",
|
||
|
"\"use strict\";var n=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(t){if(null==t)throw new TypeError(\"Object.assign cannot be called with null or undefined\");return Object(t)}e.exports=function(){try{if(!Object.assign)return!1;var t=new String(\"abc\");if(t[5]=\"de\",\"5\"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e[\"_\"+String.fromCharCode(r)]=r;if(\"0123456789\"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(\"\"))return!1;var n={};return\"abcdefghijklmnopqrst\".split(\"\").forEach((function(t){n[t]=t})),\"abcdefghijklmnopqrst\"===Object.keys(Object.assign({},n)).join(\"\")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,s,l=o(t),c=1;c<arguments.length;c++){for(var u in r=Object(arguments[c]))a.call(r,u)&&(l[u]=r[u]);if(n){s=n(r);for(var h=0;h<s.length;h++)i.call(r,s[h])&&(l[s[h]]=r[s[h]])}}return l}},{}],474:[function(t,e,r){\"use strict\";e.exports=function(t,e,r,n,a,i,o,s,l,c){var u=e+i+c;if(h>0){var h=Math.sqrt(u+1);t[0]=.5*(o-l)/h,t[1]=.5*(s-n)/h,t[2]=.5*(r-i)/h,t[3]=.5*h}else{var f=Math.max(e,i,c);h=Math.sqrt(2*f-u+1);e>=f?(t[0]=.5*h,t[1]=.5*(a+r)/h,t[2]=.5*(s+n)/h,t[3]=.5*(o-l)/h):i>=f?(t[0]=.5*(r+a)/h,t[1]=.5*h,t[2]=.5*(l+o)/h,t[3]=.5*(s-n)/h):(t[0]=.5*(n+s)/h,t[1]=.5*(o+l)/h,t[2]=.5*h,t[3]=.5*(r-a)/h)}return t}},{}],475:[function(t,e,r){\"use strict\";e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),u(r=[].slice.call(r,0,4),r);var a=new h(r,e,Math.log(n));a.setDistanceLimits(t.zoomMin,t.zoomMax),(\"eye\"in t||\"up\"in t)&&a.lookAt(0,t.eye,t.center,t.up);return a};var n=t(\"filtered-vector\"),a=t(\"gl-mat4/lookAt\"),i=t(\"gl-mat4/fromQuat\"),o=t(\"gl-mat4/invert\"),s=t(\"./lib/quatFromFrame\");function l(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function c(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function u(t,e){var r=e[0],n=e[1],a=e[2],i=e[3],o=c(r,n,a,i);o>1e-6?(t[0]=r/o,t[1]=n/o,t[2]=a/o,t[3]=i/o):(t[0]=t[1]=t[2]=0,t[3]=1)}function h(t,e,r){this.radius=n([r]),this.center=n(e),this.rotation=n(t),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var f=h.prototype;f.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},f.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;u(e,e);var r=this.computedMatrix;i(r,e);var n=this.computedCenter,a=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);a[0]=n[0]+s*r[2],a[1]=n[1]+s*r[6],a[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var c=0,h=0;h<3;++h)c+=r[l+4*h]*a[h];r[12+l]=-c}},f.getMatrix=function(t,e){this.recalcMatrix(t);var r=this.computedMatrix;if(e){for(var n=0;n<16;++n)e[n]=r[n];return e}return r},f.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},f.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},f.pan=function(t,e,r,n){e=e||0,r=r||0,n=n||0,this.recalcMatrix(t);var a=this.computedMatrix,i=a[1],o=a[5],s=a[9],c=l(i,o,s);i/=c,o/=c,s/=c;var u=a[0],h=a[4],f=a[8],p=u*i+h*o+f*s,d=l(u-=i*p,h-=o*p,f-=s*p);u/=d,h/=d,f/=d;var g=a[2],m=a[6],v=a[10],y=g*i+m*o+v*s,x=g*u+m*h+v*f,b=l(g-=y*i+x*u,m-=y*o+x*h,v-=y*s+x*f);g/=b,m/=b,v/=b;var _=u*e+i*r,w=h*e+o*r,T=f*e+s*r;this.center.move(t,_,w,T);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+n),this.radius.set(t,Math.log(k))},f.rotate=function(t,e,r,n){this.recalcMatrix(t),e=e||0,r=r||0;var a=this.computedMatrix,i=a[0],o=a[4],s=a[8],u=a[1],h=a[5],f=a[9],p=a[2],d=a[6],g=a[10],m=e*i+r*u,v=e*o+r*h,y=e*s+r*f,x=-(d*y-g*v),b=-(g*m-p*y),_=-(p*v-d*m),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),T=c(x,b,_,w);T>1e-6?(x/=T,b/=
|
||
|
"/*!\n",
|
||
|
" * pad-left <https://github.com/jonschlinkert/pad-left>\n",
|
||
|
" *\n",
|
||
|
" * Copyright (c) 2014-2015, Jon Schlinkert.\n",
|
||
|
" * Licensed under the MIT license.\n",
|
||
|
" */\n",
|
||
|
"\"use strict\";var n=t(\"repeat-string\");e.exports=function(t,e,r){return n(r=\"undefined\"!=typeof r?r+\"\":\" \",e)+t}},{\"repeat-string\":513}],477:[function(t,e,r){\"use strict\";function n(t,e){if(\"string\"!=typeof t)return[t];var r=[t];\"string\"==typeof e||Array.isArray(e)?e={brackets:e}:e||(e={});var n=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:[\"{}\",\"[]\",\"()\"],a=e.escape||\"___\",i=!!e.flat;n.forEach((function(t){var e=new RegExp([\"\\\\\",t[0],\"[^\\\\\",t[0],\"\\\\\",t[1],\"]*\\\\\",t[1]].join(\"\")),n=[];function i(e,i,o){var s=r.push(e.slice(t[0].length,-t[1].length))-1;return n.push(s),a+s+a}r.forEach((function(t,n){for(var a,o=0;t!=a;)if(a=t,t=t.replace(e,i),o++>1e4)throw Error(\"References have circular dependency. Please, check them.\");r[n]=t})),n=n.reverse(),r=r.map((function(e){return n.forEach((function(r){e=e.replace(new RegExp(\"(\\\\\"+a+r+\"\\\\\"+a+\")\",\"g\"),t[0]+\"$1\"+t[1])})),e}))}));var o=new RegExp(\"\\\\\"+a+\"([0-9]+)\\\\\"+a);return i?r:function t(e,r,n){for(var a,i=[],s=0;a=o.exec(e);){if(s++>1e4)throw Error(\"Circular references in parenthesis\");i.push(e.slice(0,a.index)),i.push(t(r[a[1]],r)),e=e.slice(a.index+a[0].length)}return i.push(e),i}(r[0],r)}function a(t,e){if(e&&e.flat){var r,n=e&&e.escape||\"___\",a=t[0];if(!a)return\"\";for(var i=new RegExp(\"\\\\\"+n+\"([0-9]+)\\\\\"+n),o=0;a!=r;){if(o++>1e4)throw Error(\"Circular references in \"+t);r=a,a=a.replace(i,s)}return a}return t.reduce((function t(e,r){return Array.isArray(r)&&(r=r.reduce(t,\"\")),e+r}),\"\");function s(e,r){if(null==t[r])throw Error(\"Reference \"+r+\"is undefined\");return t[r]}}function i(t,e){return Array.isArray(t)?a(t,e):n(t,e)}i.parse=n,i.stringify=a,e.exports=i},{}],478:[function(t,e,r){\"use strict\";var n=t(\"pick-by-alias\");e.exports=function(t){var e;arguments.length>1&&(t=arguments);\"string\"==typeof t?t=t.split(/\\s/).map(parseFloat):\"number\"==typeof t&&(t=[t]);t.length&&\"number\"==typeof t[0]?e=1===t.length?{width:t[0],height:t[0],x:0,y:0}:2===t.length?{width:t[0],height:t[1],x:0,y:0}:{x:t[0],y:t[1],width:t[2]-t[0]||0,height:t[3]-t[1]||0}:t&&(t=n(t,{left:\"x l left Left\",top:\"y t top Top\",width:\"w width W Width\",height:\"h height W Width\",bottom:\"b bottom Bottom\",right:\"r right Right\"}),e={x:t.left||0,y:t.top||0},null==t.width?t.right?e.width=t.right-e.x:e.width=0:e.width=t.width,null==t.height?t.bottom?e.height=t.bottom-e.y:e.height=0:e.height=t.height);return e}},{\"pick-by-alias\":485}],479:[function(t,e,r){e.exports=function(t){var e=[];return t.replace(a,(function(t,r,a){var o=r.toLowerCase();for(a=function(t){var e=t.match(i);return e?e.map(Number):[]}(a),\"m\"==o&&a.length>2&&(e.push([r].concat(a.splice(0,2))),o=\"l\",r=\"m\"==r?\"l\":\"L\");;){if(a.length==n[o])return a.unshift(r),e.push(a);if(a.length<n[o])throw new Error(\"malformed path data\");e.push([r].concat(a.splice(0,n[o])))}})),e};var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},a=/([astvzqmhlc])([^astvzqmhlc]*)/gi;var i=/-?[0-9]*\\.?[0-9]+(?:e[-+]?\\d+)?/gi},{}],480:[function(t,e,r){e.exports=function(t,e){e||(e=[0,\"\"]),t=String(t);var r=parseFloat(t,10);return e[0]=r,e[1]=t.match(/[\\d.\\-\\+]*\\s*(.*)/)[1]||\"\",e}},{}],481:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var a=t[n];\".\"===a?t.splice(n,1):\"..\"===a?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift(\"..\");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n<t.length;n++)e(t[n],n,t)&&r.push(t[n]);return r}r.resolve=function(){for(var r=\"\",a=!1,i=arguments.length-1;i>=-1&&!a;i--){var o=i>=0?arguments[i]:t.cwd();if(\"string\"!=typeof o)throw new TypeError(\"Arguments to path.resolve must be strings\");o&&(r=o+\"/\"+r,a=\"/\"===o.charAt(0))}return(a?\"/\":\"\")+(r=e(n(r.split(\"/\"),(function(t){return!!t})),!a).join(\"/\"))||\".\"},r.normalize=function(t){var i=r.isAbsolute(t),o=\"/\"===a(t,-1);return(t=e(n(t.split(\"/\"),(function(t){return!!t})),!i).join(\"/\"))||i||(t=\".\"),t&&o&&(t+=\"/\"),(i?\"/\":\"\")+t},r.isAbsolute=function(
|
||
|
"/*\n",
|
||
|
" * @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc\n",
|
||
|
" * @license MIT\n",
|
||
|
" * @preserve Project Home: https://github.com/voidqk/polybooljs\n",
|
||
|
" */\n",
|
||
|
"var n,a=t(\"./lib/build-log\"),i=t(\"./lib/epsilon\"),o=t(\"./lib/intersecter\"),s=t(\"./lib/segment-chainer\"),l=t(\"./lib/segment-selector\"),c=t(\"./lib/geojson\"),u=!1,h=i();function f(t,e,r){var a=n.segments(t),i=n.segments(e),o=r(n.combine(a,i));return n.polygon(o)}n={buildLog:function(t){return!0===t?u=a():!1===t&&(u=!1),!1!==u&&u.list},epsilon:function(t){return h.epsilon(t)},segments:function(t){var e=o(!0,h,u);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:o(!1,h,u).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:l.union(t.combined,u),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:l.intersect(t.combined,u),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:l.difference(t.combined,u),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:l.differenceRev(t.combined,u),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:l.xor(t.combined,u),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:s(t.segments,h,u),inverted:t.inverted}},polygonFromGeoJSON:function(t){return c.toPolygon(n,t)},polygonToGeoJSON:function(t){return c.fromPolygon(n,h,t)},union:function(t,e){return f(t,e,n.selectUnion)},intersect:function(t,e){return f(t,e,n.selectIntersect)},difference:function(t,e){return f(t,e,n.selectDifference)},differenceRev:function(t,e){return f(t,e,n.selectDifferenceRev)},xor:function(t,e){return f(t,e,n.selectXor)}},\"object\"==typeof window&&(window.PolyBool=n),e.exports=n},{\"./lib/build-log\":492,\"./lib/epsilon\":493,\"./lib/geojson\":494,\"./lib/intersecter\":495,\"./lib/segment-chainer\":497,\"./lib/segment-selector\":498}],492:[function(t,e,r){e.exports=function(){var t,e=0,r=!1;function n(e,r){return t.list.push({type:e,data:r?JSON.parse(JSON.stringify(r)):void 0}),t}return t={list:[],segmentId:function(){return e++},checkIntersection:function(t,e){return n(\"check\",{seg1:t,seg2:e})},segmentChop:function(t,e){return n(\"div_seg\",{seg:t,pt:e}),n(\"chop\",{seg:t,pt:e})},statusRemove:function(t){return n(\"pop_seg\",{seg:t})},segmentUpdate:function(t){return n(\"seg_update\",{seg:t})},segmentNew:function(t,e){return n(\"new_seg\",{seg:t,primary:e})},segmentRemove:function(t){return n(\"rem_seg\",{seg:t})},tempStatus:function(t,e,r){return n(\"temp_status\",{seg:t,above:e,below:r})},rewind:function(t){return n(\"rewind\",{seg:t})},status:function(t,e,r){return n(\"status\",{seg:t,above:e,below:r})},vert:function(e){return e===r?t:(r=e,n(\"vert\",{x:e}))},log:function(t){return\"string\"!=typeof t&&(t=JSON.stringify(t,!1,\" \")),n(\"log\",{txt:t})},reset:function(){return n(\"reset\")},selected:function(t){return n(\"selected\",{segs:t})},chainStart:function(t){return n(\"chain_start\",{seg:t})},chainRemoveHead:function(t,e){return n(\"chain_rem_head\",{index:t,pt:e})},chainRemoveTail:function(t,e){return n(\"chain_rem_tail\",{index:t,pt:e})},chainNew:function(t,e){return n(\"chain_new\",{pt1:t,pt2:e})},chainMatch:function(t){return n(\"chain_match\",{index:t})},chainClose:function(t){return n(\"chain_close\",{index:t})},chainAddHead:function(t,e){return n(\"chain_add_head\",{index:t,pt:e})},chainAddTail:function(t,e){return n(\"chain_add_tail\",{index:t,pt:e})},chainConnect:function(t,e){return n(\"chain_con\",{index1:t,index2:e})},chainReverse:function(t){return n(\"chain_rev\",{index:t})},chainJoin:function(t,e){return n(\"chain_join\",{index1:t,index2:e})},done:function(){return n(\"done\")}}}},{}],493:[function(t,e,r){e.exports=function(t){\"number\"!=typeof t&&(t=1e-10);var e={epsilon:function(e){return\"number\"==typeof e&&(t=e),t},pointAboveOrOnLine:function(e,r,n){var a=r[0],i=r[1],o=n[0],s=n[1],l=e[0];return(o-a)*(e[1]-i)-(s-i)*(l-a)>=-t},pointBetween:function(e,r,n){var a=e[1]-r[1],i=n[0]-r[0],o=e[0]-r[0],s=n[1]-r[1],l=o*i+a*s;return!(l<t)&&!(l-(i*i+s*s)>-t)},pointsSameX:function(e,r){r
|
||
|
"/*!\n",
|
||
|
" * repeat-string <https://github.com/jonschlinkert/repeat-string>\n",
|
||
|
" *\n",
|
||
|
" * Copyright (c) 2014-2015, Jon Schlinkert.\n",
|
||
|
" * Licensed under the MIT License.\n",
|
||
|
" */\n",
|
||
|
"\"use strict\";var n,a=\"\";e.exports=function(t,e){if(\"string\"!=typeof t)throw new TypeError(\"expected a string\");if(1===e)return t;if(2===e)return t+t;var r=t.length*e;if(n!==t||\"undefined\"==typeof n)n=t,a=\"\";else if(a.length>=r)return a.substr(0,r);for(;r>a.length&&e>1;)1&e&&(a+=t),e>>=1,t+=t;return a=(a+=t).substr(0,r)}},{}],514:[function(t,e,r){(function(t){e.exports=t.performance&&t.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}}).call(this,\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{})},{}],515:[function(t,e,r){\"use strict\";e.exports=function(t){for(var e=t.length,r=t[t.length-1],n=e,a=e-2;a>=0;--a){var i=r,o=t[a];(l=o-((r=i+o)-i))&&(t[--n]=r,r=l)}var s=0;for(a=n;a<e;++a){var l;i=t[a];(l=(o=r)-((r=i+o)-i))&&(t[s++]=l)}return t[s++]=r,t.length=s,t}},{}],516:[function(t,e,r){\"use strict\";var n=t(\"two-product\"),a=t(\"robust-sum\"),i=t(\"robust-scale\"),o=t(\"robust-compress\");function s(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var a=r[n-1]=new Array(t.length-1),i=0,o=0;i<t.length;++i)i!==e&&(a[o++]=t[n][i]);return r}function l(t){for(var e=new Array(t),r=0;r<t;++r){e[r]=new Array(t);for(var n=0;n<t;++n)e[r][n]=[\"m[\",r,\"][\",n,\"]\"].join(\"\")}return e}function c(t){if(2===t.length)return[\"sum(prod(\",t[0][0],\",\",t[1][1],\"),prod(-\",t[0][1],\",\",t[1][0],\"))\"].join(\"\");for(var e=[],r=0;r<t.length;++r)e.push([\"scale(\",c(s(t,r)),\",\",(n=r,1&n?\"-\":\"\"),t[0][r],\")\"].join(\"\"));return function t(e){if(1===e.length)return e[0];if(2===e.length)return[\"sum(\",e[0],\",\",e[1],\")\"].join(\"\");var r=e.length>>1;return[\"sum(\",t(e.slice(0,r)),\",\",t(e.slice(r)),\")\"].join(\"\")}(e);var n}function u(t){return new Function(\"sum\",\"scale\",\"prod\",\"compress\",[\"function robustDeterminant\",t,\"(m){return compress(\",c(l(t)),\")};return robustDeterminant\",t].join(\"\"))(a,i,n,o)}var h=[function(){return[0]},function(t){return[t[0][0]]}];!function(){for(;h.length<6;)h.push(u(h.length));for(var t=[],r=[\"function robustDeterminant(m){switch(m.length){\"],n=0;n<6;++n)t.push(\"det\"+n),r.push(\"case \",n,\":return det\",n,\"(m);\");r.push(\"}var det=CACHE[m.length];if(!det)det=CACHE[m.length]=gen(m.length);return det(m);}return robustDeterminant\"),t.push(\"CACHE\",\"gen\",r.join(\"\"));var a=Function.apply(void 0,t);for(e.exports=a.apply(void 0,h.concat([h,u])),n=0;n<h.length;++n)e.exports[n]=h[n]}()},{\"robust-compress\":515,\"robust-scale\":522,\"robust-sum\":525,\"two-product\":554}],517:[function(t,e,r){\"use strict\";var n=t(\"two-product\"),a=t(\"robust-sum\");e.exports=function(t,e){for(var r=n(t[0],e[0]),i=1;i<t.length;++i)r=a(r,n(t[i],e[i]));return r}},{\"robust-sum\":525,\"two-product\":554}],518:[function(t,e,r){\"use strict\";var n=t(\"two-product\"),a=t(\"robust-sum\"),i=t(\"robust-subtract\"),o=t(\"robust-scale\");function s(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var a=r[n-1]=new Array(t.length-1),i=0,o=0;i<t.length;++i)i!==e&&(a[o++]=t[n][i]);return r}function l(t){if(1===t.length)return t[0];if(2===t.length)return[\"sum(\",t[0],\",\",t[1],\")\"].join(\"\");var e=t.length>>1;return[\"sum(\",l(t.slice(0,e)),\",\",l(t.slice(e)),\")\"].join(\"\")}function c(t,e){if(\"m\"===t.charAt(0)){if(\"w\"===e.charAt(0)){var r=t.split(\"[\");return[\"w\",e.substr(1),\"m\",r[0].substr(1)].join(\"\")}return[\"prod(\",t,\",\",e,\")\"].join(\"\")}return c(e,t)}function u(t){if(2===t.length)return[[\"diff(\",c(t[0][0],t[1][1]),\",\",c(t[1][0],t[0][1]),\")\"].join(\"\")];for(var e=[],r=0;r<t.length;++r)e.push([\"scale(\",l(u(s(t,r))),\",\",(n=r,!0&n?\"-\":\"\"),t[0][r],\")\"].join(\"\"));return e;var n}function h(t,e){for(var r=[],n=0;n<e-2;++n)r.push([\"prod(m\",t,\"[\",n,\"],m\",t,\"[\",n,\"])\"].join(\"\"));return l(r)}function f(t){for(var e=[],r=[],c=function(t){for(var e=new Array(t),r=0;r<t;++r){e[r]=new Array(t);for(var n=0;n<t;++n)e[r][n]=[\"m\",n,\"[\",t-r-2,\"]\"].join(\"\")}return e}(t),f=0;f<t;++f)c[0][f]=\"1\",c[t-1][f]=\"w\"+f;fo
|
||
|
" });\n",
|
||
|
" require(['plotly'], function(Plotly) {\n",
|
||
|
" window._Plotly = Plotly;\n",
|
||
|
" });\n",
|
||
|
" }\n",
|
||
|
" </script>\n",
|
||
|
" "
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"from IPython.display import Markdown as md\n",
|
||
|
"from IPython.display import display, HTML\n",
|
||
|
"import pandas as pd\n",
|
||
|
"import numpy as np\n",
|
||
|
"import ipywidgets as widgets\n",
|
||
|
"from pathlib import Path\n",
|
||
|
"from datetime import datetime\n",
|
||
|
"from recopytex import flat_df_students, pp_q_scores\n",
|
||
|
"from datetime import datetime\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"import chart_studio.plotly as py\n",
|
||
|
"import plotly.graph_objects as go\n",
|
||
|
"import plotly.figure_factory as ff\n",
|
||
|
"\n",
|
||
|
"from plotly.offline import iplot, init_notebook_mode\n",
|
||
|
"init_notebook_mode()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 2,
|
||
|
"metadata": {
|
||
|
"execution": {
|
||
|
"iopub.execute_input": "2020-10-04T07:26:58.701039Z",
|
||
|
"iopub.status.busy": "2020-10-04T07:26:58.700150Z",
|
||
|
"iopub.status.idle": "2020-10-04T07:26:58.703382Z",
|
||
|
"shell.execute_reply": "2020-10-04T07:26:58.702696Z"
|
||
|
},
|
||
|
"extensions": {
|
||
|
"jupyter_dashboards": {
|
||
|
"version": 1,
|
||
|
"views": {
|
||
|
"grid_default": {},
|
||
|
"report_default": {
|
||
|
"hidden": true
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
"papermill": {
|
||
|
"duration": 0.105904,
|
||
|
"end_time": "2020-10-04T07:26:58.703518",
|
||
|
"exception": false,
|
||
|
"start_time": "2020-10-04T07:26:58.597614",
|
||
|
"status": "completed"
|
||
|
},
|
||
|
"slideshow": {
|
||
|
"slide_type": "skip"
|
||
|
},
|
||
|
"tags": [
|
||
|
"parameters"
|
||
|
]
|
||
|
},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"tribe = \"ES\"\n",
|
||
|
"assessment = \"ds2\"\n",
|
||
|
"date = \"14/10/19\"\n",
|
||
|
"csv_file = Path(f\"../{tribe}/191014_{assessment}.csv\")"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 3,
|
||
|
"metadata": {
|
||
|
"execution": {
|
||
|
"iopub.execute_input": "2020-10-04T07:26:58.908180Z",
|
||
|
"iopub.status.busy": "2020-10-04T07:26:58.907084Z",
|
||
|
"iopub.status.idle": "2020-10-04T07:26:58.911239Z",
|
||
|
"shell.execute_reply": "2020-10-04T07:26:58.910123Z"
|
||
|
},
|
||
|
"papermill": {
|
||
|
"duration": 0.110363,
|
||
|
"end_time": "2020-10-04T07:26:58.911455",
|
||
|
"exception": false,
|
||
|
"start_time": "2020-10-04T07:26:58.801092",
|
||
|
"status": "completed"
|
||
|
},
|
||
|
"tags": [
|
||
|
"injected-parameters"
|
||
|
]
|
||
|
},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"# Parameters\n",
|
||
|
"tribe = \"TST1\"\n",
|
||
|
"assessment = \"Ds3\"\n",
|
||
|
"date = \"13/11/20\"\n",
|
||
|
"csv_file = \"/home/lafrite/Cours/2020-2021/Notes/TST1/201113_DS3.csv\"\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 4,
|
||
|
"metadata": {
|
||
|
"execution": {
|
||
|
"iopub.execute_input": "2020-10-04T07:26:59.130362Z",
|
||
|
"iopub.status.busy": "2020-10-04T07:26:59.129790Z",
|
||
|
"iopub.status.idle": "2020-10-04T07:26:59.131451Z",
|
||
|
"shell.execute_reply": "2020-10-04T07:26:59.130977Z"
|
||
|
},
|
||
|
"papermill": {
|
||
|
"duration": 0.109746,
|
||
|
"end_time": "2020-10-04T07:26:59.131570",
|
||
|
"exception": false,
|
||
|
"start_time": "2020-10-04T07:26:59.021824",
|
||
|
"status": "completed"
|
||
|
},
|
||
|
"tags": []
|
||
|
},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"/home/lafrite/Cours/2020-2021/Notes/TST1/201113_DS3\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"date = datetime.strptime(date, \"%d/%m/%y\")\n",
|
||
|
"output_path = Path(csv_file[:-4])\n",
|
||
|
"print(output_path)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 5,
|
||
|
"metadata": {
|
||
|
"execution": {
|
||
|
"iopub.execute_input": "2020-10-04T07:26:59.353722Z",
|
||
|
"iopub.status.busy": "2020-10-04T07:26:59.353175Z",
|
||
|
"iopub.status.idle": "2020-10-04T07:26:59.356913Z",
|
||
|
"shell.execute_reply": "2020-10-04T07:26:59.356386Z"
|
||
|
},
|
||
|
"extensions": {
|
||
|
"jupyter_dashboards": {
|
||
|
"version": 1,
|
||
|
"views": {
|
||
|
"grid_default": {},
|
||
|
"report_default": {
|
||
|
"hidden": false
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
"papermill": {
|
||
|
"duration": 0.122626,
|
||
|
"end_time": "2020-10-04T07:26:59.357021",
|
||
|
"exception": false,
|
||
|
"start_time": "2020-10-04T07:26:59.234395",
|
||
|
"status": "completed"
|
||
|
},
|
||
|
"slideshow": {
|
||
|
"slide_type": "slide"
|
||
|
},
|
||
|
"tags": []
|
||
|
},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"text/markdown": [
|
||
|
"# Ds3 (20/11/13) pour TST1"
|
||
|
],
|
||
|
"text/plain": [
|
||
|
"<IPython.core.display.Markdown object>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"if date is None:\n",
|
||
|
" display(md(f\"# {assessment} pour {tribe}\"))\n",
|
||
|
"else:\n",
|
||
|
" display(md(f\"# {assessment} ({date:%y/%m/%d}) pour {tribe}\"))"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 45,
|
||
|
"metadata": {
|
||
|
"execution": {
|
||
|
"iopub.execute_input": "2020-10-04T07:26:59.584153Z",
|
||
|
"iopub.status.busy": "2020-10-04T07:26:59.583420Z",
|
||
|
"iopub.status.idle": "2020-10-04T07:26:59.842267Z",
|
||
|
"shell.execute_reply": "2020-10-04T07:26:59.840480Z"
|
||
|
},
|
||
|
"extensions": {
|
||
|
"jupyter_dashboards": {
|
||
|
"version": 1,
|
||
|
"views": {
|
||
|
"grid_default": {},
|
||
|
"report_default": {
|
||
|
"hidden": true
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
"papermill": {
|
||
|
"duration": 0.385376,
|
||
|
"end_time": "2020-10-04T07:26:59.842589",
|
||
|
"exception": true,
|
||
|
"start_time": "2020-10-04T07:26:59.457213",
|
||
|
"status": "failed"
|
||
|
},
|
||
|
"slideshow": {
|
||
|
"slide_type": "skip"
|
||
|
},
|
||
|
"tags": []
|
||
|
},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"stack_scores = pd.read_csv(csv_file, encoding=\"UTF8\")\n",
|
||
|
"comments = stack_scores.iloc[0]\n",
|
||
|
"stack_scores.drop([0], inplace=True)\n",
|
||
|
"scores = flat_df_students(stack_scores).dropna(subset=[\"Score\"])\n",
|
||
|
"scores = pp_q_scores(scores)\n",
|
||
|
"#scores.head()\n",
|
||
|
"#comments.drop()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 8,
|
||
|
"metadata": {
|
||
|
"extensions": {
|
||
|
"jupyter_dashboards": {
|
||
|
"version": 1,
|
||
|
"views": {
|
||
|
"grid_default": {},
|
||
|
"report_default": {
|
||
|
"hidden": true
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
"papermill": {
|
||
|
"duration": null,
|
||
|
"end_time": null,
|
||
|
"exception": null,
|
||
|
"start_time": null,
|
||
|
"status": "pending"
|
||
|
},
|
||
|
"slideshow": {
|
||
|
"slide_type": "skip"
|
||
|
},
|
||
|
"tags": []
|
||
|
},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"exercises_scores = scores.groupby([\"Exercice\", \"Eleve\"]).agg({\"Note\": \"sum\", \"Bareme\": \"sum\"})"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 9,
|
||
|
"metadata": {
|
||
|
"papermill": {
|
||
|
"duration": null,
|
||
|
"end_time": null,
|
||
|
"exception": null,
|
||
|
"start_time": null,
|
||
|
"status": "pending"
|
||
|
},
|
||
|
"tags": []
|
||
|
},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"assessment_scores = scores.groupby([\"Eleve\"]).agg({\"Note\": \"sum\", \"Bareme\": \"sum\"})"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {
|
||
|
"papermill": {
|
||
|
"duration": null,
|
||
|
"end_time": null,
|
||
|
"exception": null,
|
||
|
"start_time": null,
|
||
|
"status": "pending"
|
||
|
},
|
||
|
"tags": []
|
||
|
},
|
||
|
"source": [
|
||
|
"### Bilans personnalisés"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 20,
|
||
|
"metadata": {
|
||
|
"papermill": {
|
||
|
"duration": null,
|
||
|
"end_time": null,
|
||
|
"exception": null,
|
||
|
"start_time": null,
|
||
|
"status": "pending"
|
||
|
},
|
||
|
"scrolled": true,
|
||
|
"tags": []
|
||
|
},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"import pytex\n",
|
||
|
"#scores.head()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 21,
|
||
|
"metadata": {
|
||
|
"papermill": {
|
||
|
"duration": null,
|
||
|
"end_time": null,
|
||
|
"exception": null,
|
||
|
"start_time": null,
|
||
|
"status": "pending"
|
||
|
},
|
||
|
"tags": []
|
||
|
},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"datas = {\n",
|
||
|
" \"assessment\": {\n",
|
||
|
" \"name\": assessment,\n",
|
||
|
" \"date\": date\n",
|
||
|
" },\n",
|
||
|
" #\"exercises\": scores[\"Exercice\"].unique(),\n",
|
||
|
" #\"questions\": scores[[\"Exercice\", 'Question', 'Competence', 'Domaine', 'Commentaire', 'Bareme', 'Est_nivele']],\n",
|
||
|
" \"eleves\": {}\n",
|
||
|
"}\n",
|
||
|
"for e in scores[\"Eleve\"].unique():\n",
|
||
|
" edatas = {\n",
|
||
|
" \"assessment\": assessment_scores.loc[e],\n",
|
||
|
" \"exercices\": exercises_scores.xs(e, level=\"Eleve\"),\n",
|
||
|
" \"exscores\": {}\n",
|
||
|
" }\n",
|
||
|
" for i, ex in edatas[\"exercices\"].iterrows():\n",
|
||
|
" edatas[\"exscores\"][i] = scores.loc[(scores.Exercice==i) & (scores.Eleve==e)]\n",
|
||
|
" datas[\"eleves\"][e] = edatas"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 22,
|
||
|
"metadata": {
|
||
|
"papermill": {
|
||
|
"duration": null,
|
||
|
"end_time": null,
|
||
|
"exception": null,
|
||
|
"start_time": null,
|
||
|
"status": "pending"
|
||
|
},
|
||
|
"tags": []
|
||
|
},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"score_template = r\"\"\"\n",
|
||
|
"\\documentclass[a5paper,10pt]{article}\n",
|
||
|
"\\usepackage{fullpage}\n",
|
||
|
"\\usepackage{booktabs}\n",
|
||
|
"\\usepackage{longtable}\n",
|
||
|
"\n",
|
||
|
"\\usepackage{geometry}\n",
|
||
|
"\\geometry{left=10mm,right=10mm, top=10mm}\n",
|
||
|
"\n",
|
||
|
"\\renewcommand{\\arraystretch}{1}\n",
|
||
|
"\\setlength{\\columnseprule}{0pt}\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
"\\begin{document}\n",
|
||
|
"\n",
|
||
|
"\n",
|
||
|
" \\section*{\\Var{assessment.name} \\hfill \\Var{e} \\hfill \\Var{sc.assessment.Note}/\\Var{sc.assessment.Bareme}}\n",
|
||
|
" %- for i,ex in sc.exercices.iterrows() \n",
|
||
|
" \\subsection*{Exercice \\Var{i}: \\Var{ex.Note} / \\Var{ex.Bareme}}\n",
|
||
|
" \\Var{sc.exscores[i].to_latex(index=False, columns=[\"Question\", \"Domaine\", \"Commentaire\", \"Note\", \"Bareme\"])}\n",
|
||
|
" %#\\Var{sc.exscores}\n",
|
||
|
" %- endfor\n",
|
||
|
"\n",
|
||
|
"\\end{document}\n",
|
||
|
"\"\"\""
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 23,
|
||
|
"metadata": {
|
||
|
"papermill": {
|
||
|
"duration": null,
|
||
|
"end_time": null,
|
||
|
"exception": null,
|
||
|
"start_time": null,
|
||
|
"status": "pending"
|
||
|
},
|
||
|
"tags": []
|
||
|
},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"Wrote 201113_Ds3_AIOUAZ Ahmed.tex\n",
|
||
|
"Wrote 201113_Ds3_BAHBAH Zakaria.tex\n",
|
||
|
"Wrote 201113_Ds3_BENHATTAL Chakir.tex\n",
|
||
|
"Wrote 201113_Ds3_CLAIN Avinash.tex\n",
|
||
|
"Wrote 201113_Ds3_COLASSI Alexis.tex\n",
|
||
|
"Wrote 201113_Ds3_COUBAT Alexis.tex\n",
|
||
|
"Wrote 201113_Ds3_COULLON Anis.tex\n",
|
||
|
"Wrote 201113_Ds3_DINGER Sölen.tex\n",
|
||
|
"Wrote 201113_Ds3_EYRAUD Cynthia.tex\n",
|
||
|
"Wrote 201113_Ds3_FERREIRA Léo.tex\n",
|
||
|
"Wrote 201113_Ds3_FILALI Zakaria.tex\n",
|
||
|
"Wrote 201113_Ds3_FOIGNY Romain.tex\n",
|
||
|
"Wrote 201113_Ds3_HIPOLITO DA SILVA Andréa.tex\n",
|
||
|
"Wrote 201113_Ds3_HUMBERT Rayan.tex\n",
|
||
|
"Wrote 201113_Ds3_MASSON Grace.tex\n",
|
||
|
"Wrote 201113_Ds3_MOKHTARI Nissrine.tex\n",
|
||
|
"Wrote 201113_Ds3_MOUFAQ Amine.tex\n",
|
||
|
"Wrote 201113_Ds3_ONAL Yakub.tex\n",
|
||
|
"Wrote 201113_Ds3_SORIANO Laura.tex\n",
|
||
|
"Wrote 201113_Ds3_VECCHIO Léa.tex\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"tpl = pytex.texenv.from_string(score_template)\n",
|
||
|
"\n",
|
||
|
"for e,sc in datas['eleves'].items():\n",
|
||
|
" reportfilename = f\"{date:%y%m%d}_{assessment}_{e}.tex\"\n",
|
||
|
" with open(output_path / reportfilename, \"w\") as f:\n",
|
||
|
" f.write(tpl.render(sc=sc, **datas))\n",
|
||
|
" print(f\"Wrote {reportfilename}\")\n",
|
||
|
" pytex.pdflatex(reportfilename)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {
|
||
|
"papermill": {
|
||
|
"duration": null,
|
||
|
"end_time": null,
|
||
|
"exception": null,
|
||
|
"start_time": null,
|
||
|
"status": "pending"
|
||
|
},
|
||
|
"tags": []
|
||
|
},
|
||
|
"source": [
|
||
|
"## Envoie des bilans par mail"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 47,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"Bian du devoir Ds3\n",
|
||
|
"Bonsoir,\n",
|
||
|
"En pièce jointe, vous trouverez un document détaillant la note du devoir.\n",
|
||
|
"B.Bertrand\n",
|
||
|
"\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"mailfrom = \"benjamin.bertrand@ac-lyon.fr\"\n",
|
||
|
"subject = f\"Bian du devoir {assessment}\"\n",
|
||
|
"message = \"\"\"Bonsoir,\n",
|
||
|
"En pièce jointe, vous trouverez un document détaillant la note du devoir.\n",
|
||
|
"B.Bertrand\n",
|
||
|
"\"\"\"\n",
|
||
|
"print(subject)\n",
|
||
|
"print(message)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 25,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"import smtplib\n",
|
||
|
"import os\n",
|
||
|
"import sys\n",
|
||
|
"from email.message import EmailMessage\n",
|
||
|
"import mimetypes\n",
|
||
|
"import time\n",
|
||
|
"import random"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 26,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"def build_msg(subj, to_addr, from_addr, body, att):\n",
|
||
|
" msg = EmailMessage()\n",
|
||
|
" msg[\"Subject\"] = subj\n",
|
||
|
" msg[\"To\"] = to_addr\n",
|
||
|
" #msg[\"To\"] = \"lafrite26@gmail.com\"\n",
|
||
|
" msg[\"From\"] = from_addr\n",
|
||
|
" msg.set_content(body)\n",
|
||
|
"\n",
|
||
|
" if att != []:\n",
|
||
|
" ctype, encoding = mimetypes.guess_type(att)\n",
|
||
|
" if ctype is None or encoding is not None:\n",
|
||
|
" ctype = 'application/octet-stream'\n",
|
||
|
" maintype, subtype = ctype.split('/', 1)\n",
|
||
|
" with open(att, \"rb\") as f:\n",
|
||
|
" msg.add_attachment(f.read(),\n",
|
||
|
" maintype=maintype,\n",
|
||
|
" subtype=subtype,\n",
|
||
|
" filename=att.name)\n",
|
||
|
" return msg\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"send = 0\n",
|
||
|
"fake = 1"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 42,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"if send:\n",
|
||
|
" if fake:\n",
|
||
|
" server = smtplib.SMTP(\"localhost\", 8025)\n",
|
||
|
" server.ehlo()\n",
|
||
|
" else:\n",
|
||
|
" server = smtplib.SMTP(\"smtps.ac-lyon.fr\", 587)\n",
|
||
|
" server.ehlo()\n",
|
||
|
" server.starttls()\n",
|
||
|
" server.ehlo()\n",
|
||
|
" server.login(\"bbertrand\", os.popen(\"pass Prof/Lyon/bbertrand\").read()[:-1]) "
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 40,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"try:\n",
|
||
|
" eleves_data = pd.read_csv(f\"../../{tribe}.csv\")\n",
|
||
|
"except FileNotFoundError:\n",
|
||
|
" try:\n",
|
||
|
" eleves_data = pd.read_csv(f\"../{tribe}.csv\")\n",
|
||
|
" except FileNotFoundError:\n",
|
||
|
" eleves_data = pd.read_csv(f\"{tribe}.csv\")\n",
|
||
|
"eleves_data.fillna(\"\", inplace=True)\n",
|
||
|
"#eleves_data"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 39,
|
||
|
"metadata": {
|
||
|
"papermill": {
|
||
|
"duration": null,
|
||
|
"end_time": null,
|
||
|
"exception": null,
|
||
|
"start_time": null,
|
||
|
"status": "pending"
|
||
|
},
|
||
|
"tags": []
|
||
|
},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"name": "stdout",
|
||
|
"output_type": "stream",
|
||
|
"text": [
|
||
|
"Pas de rapport pour BALLOFFET Kenza\n",
|
||
|
"Pas de mail pour FOIGNY Romain\n",
|
||
|
"Pas de mail pour HUMBERT Rayan\n"
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"for e in eleves_data.iterrows():\n",
|
||
|
" reportfilename = Path(f\"{date:%y%m%d}_{assessment}_{e[1]['Nom']}.pdf\")\n",
|
||
|
" try:\n",
|
||
|
" assert reportfilename.exists()\n",
|
||
|
" except:\n",
|
||
|
" print(f\"Pas de rapport pour {e[1]['Nom']}\")\n",
|
||
|
" else:\n",
|
||
|
" if e[1][\"mail\"] != \"\":\n",
|
||
|
" if send:\n",
|
||
|
" msg = build_msg(subject, e[1][\"mail\"], mailfrom, message, reportfilename)\n",
|
||
|
" server.send_message(msg)\n",
|
||
|
" print(f\"\\tBilan envoyé à {e[1]['Nom']}\")\n",
|
||
|
" else:\n",
|
||
|
" print(f\"Pas de mail pour {e[1]['Nom']}\")\n",
|
||
|
" "
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
}
|
||
|
],
|
||
|
"metadata": {
|
||
|
"celltoolbar": "Diaporama",
|
||
|
"extensions": {
|
||
|
"jupyter_dashboards": {
|
||
|
"activeView": "grid_default",
|
||
|
"version": 1,
|
||
|
"views": {
|
||
|
"grid_default": {
|
||
|
"cellMargin": 10,
|
||
|
"defaultCellHeight": 20,
|
||
|
"maxColumns": 12,
|
||
|
"name": "grid",
|
||
|
"type": "grid"
|
||
|
},
|
||
|
"report_default": {
|
||
|
"name": "report",
|
||
|
"type": "report"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
"kernelspec": {
|
||
|
"display_name": "Python 3",
|
||
|
"language": "python",
|
||
|
"name": "python3"
|
||
|
},
|
||
|
"language_info": {
|
||
|
"codemirror_mode": {
|
||
|
"name": "ipython",
|
||
|
"version": 3
|
||
|
},
|
||
|
"file_extension": ".py",
|
||
|
"mimetype": "text/x-python",
|
||
|
"name": "python",
|
||
|
"nbconvert_exporter": "python",
|
||
|
"pygments_lexer": "ipython3",
|
||
|
"version": "3.9.7"
|
||
|
},
|
||
|
"papermill": {
|
||
|
"duration": 4.26524,
|
||
|
"end_time": "2020-10-04T07:27:01.280572",
|
||
|
"environment_variables": {},
|
||
|
"exception": true,
|
||
|
"input_path": "templates/tpl_evaluation.ipynb",
|
||
|
"output_path": "TST1/200930_DS1/Ds1.ipynb",
|
||
|
"parameters": {
|
||
|
"assessment": "Ds1",
|
||
|
"csv_file": "/home/lafrite/Cours/2020-2021/Notes/TST1/200930_DS1.csv",
|
||
|
"date": "30/09/20",
|
||
|
"tribe": "TST1"
|
||
|
},
|
||
|
"start_time": "2020-10-04T07:26:57.015332",
|
||
|
"version": "1.2.1"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 2
|
||
|
}
|