This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.patches as pch | |
import matplotlib.image as img | |
def create_normalized_pitch(size=(12.5, 8.0), pcolor='none', ecolor='black'): | |
""" | |
Create figure that has football pitch lines drawn on it. Figure coordinates are normalized to a 100x100 grid. | |
If aspect ratio of figure is not equal to 1.5625 (12.5 in / 8.0 in), the figure width is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as n | |
import pylab as p | |
from matplotlib.patches import Rectangle | |
from matplotlib.collections import PatchCollection | |
from pitch import create_normalized_pitch | |
def _add_centered_square(xy, area): | |
size = n.sqrt(area) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import multiprocessing | |
class Consumer(multiprocessing.Process): | |
"""Consumer processes. Subclassed from Process in multiprocessing.""" | |
def __init__(self, task_queue, result_queue): | |
multiprocessing.Process.__init__(self) | |
self.task_queue = task_queue | |
self.result_queue = result_queue |
OlderNewer