Skip to main content

hypecycle is the fundamental package needed for creating, visualizing, and annotating Gartner Hype Cycle with Python

Project description

Package Name: hypecycle

hypecycle is a fundamental package for creating Gartner Hype Cycle with Python. Purpose Statement:

  • to generate data that are Gartner Hype Cycle distributed

  • to visualize Gartner Hype Cycle curves

  • to add annotations to Gartner Hype Cycle curves

1.Source Code

1.1Dependencies

import numpy as np

import matplotlib.pyplot as plt

1.2Create

def create(*x,crest1=50,crest2=25,stp_crest1=0.8,stp_crest2=0.2,midPoint=15,var=10):

    '''
    to create a Story HypeCycle
        x: Input data
        crest1,crest2: Controlling the height of the first wave crest and the second wave crest respectively.
        stp_crest1,stp_crest2: Representing steepness.
        midPoint: The location of the mean value mainly controls the location of the first wave crest.
        var: Displaying moves or penalties for midpoint
        Recommended parameters:crest1=50,crest2=25,stp_crest1=0.8,stp_crest2=0.2,midPoint=15,var=10
        x = np.linspace(0, 50, 5000)
    '''
    x = x
    # If user doesn't submit submit x, it will create a default DataSet.
    if x==():
        x = np.linspace(0, 70, 5000)
    else:
        x=x[0]

    lf_11 = crest1/(1+ np.exp( 1 * stp_crest1 * (x-midPoint-var)))
    lf_12 = crest1/(1+ np.exp( 1 * stp_crest1 * (x-midPoint)))
    lf_13 = crest2/(1+ np.exp( 1 * stp_crest2 * (x-midPoint-var)))
    hype= lf_11- lf_12- lf_13
    return hype

1.3Visualize

def visualize(*x, color="red", linewidth=3, linestyle="-"):

    """
     to visualize the HypeCycle Data into a HypeCycle Curve
    """
    x = x
    # If user doesn't submit submit x, it will create a default DataSet.
    if x==():
        x = np.linspace(0, 70, 5000)
    else:
        x=x[0]

    plt.plot(x, create(x), linewidth = linewidth, c = color,linestyle = linestyle)

1.4Annotate

def annotate(*x, x_value = 20, text = "None",color = "red",fontproperties='FZShuTi', fontsize = 13, alpha = 0.8,rotation=3):

    """
     to annaotate the HypeCycle Curve
    """

    x = x
    # If user doesn't submit submit x, it will create a default DataSet.
    if x==():
        x = np.linspace(0, 70, 5000)
    else:
        x=x[0]

    plt.plot(x, create(x), linewidth=3)

    x_val = x_value
    t = text
    c = color
    fp= fontproperties
    fs = fontsize
    a = alpha

    plt.rcParams["figure.figsize"] = [12, 6]
    plt.scatter(x_val, create(x_val), color="blue")
    plt.text(x_val, create(x_val), t ,color=c,fontproperties= fp, fontsize=fs, alpha=a,rotation=rotation)

2.Installing

pip install hyperycle

3.Usage

from hypecycle import HypeCycle

4.Examples

4.1Importing hypecycle

from hypecycle import HypeCycle as hc

4.2Testing Data

import numpy as np
x = np.linspace(0, 50, 5000)
x
array([0.00000000e+00, 1.00020004e-02, 2.00040008e-02, ...,
       4.99799960e+01, 4.99899980e+01, 5.00000000e+01])

4.3API-Create

# Default
y = hc.create( )
y
array([-2.48323716e+01, -2.48319021e+01, -2.48314312e+01, ...,
       -3.10218943e-03, -3.09351479e-03, -3.08486440e-03])
# With parameters
y = hc.create(x)
y
array([-24.83237162, -24.83203636, -24.83170041, ...,  -0.16798742,
        -0.16765397,  -0.16732117])

4.4API-visualize

# Default diagram
hc.visualize()
https://raw.githubusercontent.com/LemenChao/HypeCycle/master/images/output_15_0.png
# Custom chart
x = np.linspace(0, 70, 5000)
hc.visualize(x,"blue",8)
https://raw.githubusercontent.com/LemenChao/HypeCycle/master/images/output_16_0.png

4.5API-anotate

hc.annotate(x,x_value = 0,text = "the trigger",rotation=20)
hc.annotate(x,x_value = 15,text = "the growth",color="blue")
hc.annotate(x,x_value = 20,text = "the peak",color="red")
hc.annotate(x,x_value = 27,text = "the trough",color="green")
hc.annotate(x,x_value = 35,text = "the slope",color="blue",rotation=20)
hc.annotate(x,x_value = 45,text = "the Pleateau",color="red",rotation=15)
https://raw.githubusercontent.com/LemenChao/HypeCycle/master/images/output_18_0.png

5.Authors

Creator :Chaolemen Borjigin, Sun Zhizhong, Zhang Chen

Contact: chaolemen@ruc.edu.cn

License:BSD 3

6.Citation

If hypecycle contributes to a project that leads to a scientific publication, please acknowledge this fact by citing the project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hypecycle-0.5.2.tar.gz (35.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

hypecycle-0.5.2-py3.7.egg (8.2 kB view details)

Uploaded Egg

hypecycle-0.5.2-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file hypecycle-0.5.2.tar.gz.

File metadata

  • Download URL: hypecycle-0.5.2.tar.gz
  • Upload date:
  • Size: 35.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/49.6.0.post20200917 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.8

File hashes

Hashes for hypecycle-0.5.2.tar.gz
Algorithm Hash digest
SHA256 977d5be65a62aaed50e53dbcbed65029572716b15eb779110d20e7fe199d414a
MD5 fff14e0d652e0edb3149b7aaaa37f89e
BLAKE2b-256 129732a702118452c4ae80199315d285ad915a6bd1df01f4cbe1917778645859

See more details on using hashes here.

File details

Details for the file hypecycle-0.5.2-py3.7.egg.

File metadata

  • Download URL: hypecycle-0.5.2-py3.7.egg
  • Upload date:
  • Size: 8.2 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/49.6.0.post20200917 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.8

File hashes

Hashes for hypecycle-0.5.2-py3.7.egg
Algorithm Hash digest
SHA256 add15f3068f8bfdd98f8e98a11c10098fe5a3b0fee975d87fdf6cd46c3cab0ea
MD5 fcb1ed80405b304794383682a3f9072b
BLAKE2b-256 188239de9b98a4dfa27b5b25abf890dfb71c0d5bf839ab934248221dfbaefa62

See more details on using hashes here.

File details

Details for the file hypecycle-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: hypecycle-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/49.6.0.post20200917 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.8

File hashes

Hashes for hypecycle-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 76798bddcbb5c11bda5fe1f6cdc0a8ae3df4579e5381aacd45908959dc9a6a9e
MD5 45af8e8796e622d0ea78d8c5fcb03e3e
BLAKE2b-256 7c29ffbc758a1fb71de902869adef66424ab5ab2315c23911df514366aefc9a2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page