Skip to content

Instantly share code, notes, and snippets.

View MarwanDebbiche's full-sized avatar
🎧
Having fun, as always.

Marwan Debbiche MarwanDebbiche

🎧
Having fun, as always.
  • Paris, FR
View GitHub Profile
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py
name: CI/CD # pipeline's name that will appear in Github Actions
on: # events that trigger our pipeline: push on any branch and release creation
push:
release:
types: [created]
jobs: # jobs. We will have two jobs (test and publish) with multiple steps.
test:
# Our test job will run on ubuntu.
import math
import numpy as np # type: ignore
import pandas as pd # type: ignore
from tsgen.time_serie import TimeSerie
def affine(start, end, freq, start_y, end_y) -> TimeSerie:
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: local
hooks:
import pandas as pd
import numpy as np
import pytest
from tsgen import TimeSerie
@pytest.fixture
def ts_monthly_constant():
start = "2020"
from tsgen.time_serie import TimeSerie
import tsgen.generators as generators
__all__ = ["TimeSerie", "generators"]
import math
import numpy as np
import pandas as pd
from tsgen.time_serie import TimeSerie
def affine(start, end, freq, start_y, end_y):
import pandas as pd
import numpy as np
class TimeSerie:
def __init__(self, index, y):
if not isinstance(index, pd.DatetimeIndex):
raise TypeError("index should be a pandas.DatetimeIndex")
self.index = index
self.y = np.array(y)
[tool.poetry]
name = "tsgen"
version = "0.1.0"
description = "Time Series Generator"
authors = ["Marwan Debbiche <marwan.debbiche@example.com>"]
license = "MIT"
[tool.poetry.dependencies]
python = "^3.8"
pandas = "^1.1.3"
@MarwanDebbiche
MarwanDebbiche / flask-iris-classifier-api-second-part.py
Created August 8, 2019 16:37
Flask Iris Classifier API - Second Part
@app.route('/predict-species-proba', methods=['POST'])
def predict_species_proba():
flower = {}
for feature in iris_classifier_features:
flower[feature] = [request.form[feature]]
flower = pd.DataFrame(flower)
probas = iris_classifier.predict_proba(flower[iris_classifier_features])[0, :].tolist()