Mplsoccer

Latest version: v1.4.0

Safety actively analyzes 682361 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 8

1.4.0

----------------------

Added
* :icecream: added Sonars for plotting the angles of football events. \
The ``bin_statistic_sonar`` method has been added for binning the data \
by pitch grid cells and the event angles. The ``sonar`` and ``sonar_grid`` \
methods have been added for plotting the Sonars.
* :heart_eyes: added football markers for shirts and football boots by the \
wonderful Kalle Yrjänä.

Changes
* :x: Changed the default pitch standardizer to a 'custom' pitch (from 'uefa'). \
This makes metricasports coordinate conversions more accurate, e.g. for flow diagrams.
* :x: Changed the ``label_heatmap`` method to return a list of matplotlib.text.Text \
instead of matplotlib.text.Annotation objects.
* :x: Removed the ``calculate_angle_and_distance`` method's ``standardized`` argument. \
Instead, the data is automatically standardized if the aspect ratio is unequal.
* :x: Internally the binned_stastics now use the ``BinnedStatisticResult`` \
dataclass rather than the ``_BinnedStatisticResult`` named tuple.
* :x: Changed the polar ``inset_axes`` zero location to 'N' for vertical pitches.

1.3.0

----------------------
Added
* :new: The ``pitch_type`` argument now accepts custom dimensions in addition to strings ('statsbomb'). \
For example: \
from mplsoccer.dimensions import center_scale_dims \
from mplsoccer import Pitch \
dim = center_scale_dims(pitch_width=68, pitch_length=105, width=2, length=2) \
pitch = Pitch(pitch_type=dim, label=True, axis=True) \
fig, ax = pitch.draw() \
See the ``mplsoccer.dimensions`` module for examples of how to define the dimensions.
The custom dimensions must be a subclass of ``mplsoccer.dimensions.BaseDims``.

Fixed
* Fixed the padding validation for vertical pitches.
* Fixed the padding scaling for vertical pitches with unequal aspect ratios.

1.2.4

----------------------

Added
* Added the ``flip_side`` method to ``Pitch`` to flip coordinates to the other side of the pitch.

Fixed
* Fixed the ``424`` formation so the front line is a line of four \
rather than two strikers and two attacking wingers.

1.2.3

----------------------

Added
* Added the ``exclude_nan`` argument to ``Pitch.label_heatmap`` to exclude nan from text labels.
* Added a ``spot_type`` argument to the ``Pitch`` class to enable plotting penalty and center \
spots as squares as well as circles.

Fixed
* Fixed broken FontManager links.

1.2.2

----------------------

Fixed
* Fixed an import error for matplotlib.docstring, which has been depreciated as an external module.
* Fixed a pandas depreciation warning for the StatsBomb module.

1.2.0

----------------------

Added
* :heart_eyes: Added the ``formation`` method, which plots formations as text, images, inset axes, \
scatter plots or pitches.
* :new: Added the ability to return a dataframe for all the formations and player positions with the \
``Pitch.formations_dataframe`` attribute and the ``Pitch.get_positions()`` method.
* :new: Added the ``inset_axes`` and ``inset_image`` methods/functions for plotting \
inset axes and images.
* :new: Added the ``Pitch.text`` wrapper for Axes.text, which automatically flips \
the x and y coordinates.
* :new: Added the ``xoffset`` and ``yoffset``arguments to the label_heatmap method \
for plotting a heatmap's labels off-center.

Breaking Changes
* :x: Fixed the Matplotlib dependency to version 3.6 or higher.
* :x: The StatsBomb ``tactics_formation`` is changed from a numeric dtype to a string dtype, \
e.g. 442 changed to '442'

Changes
* :ok: Added the new pitch attributes ``positional_alpha`` and ``shade_alpha`` for \
controlling the transparency of the positional lines and shaded block in the middle of the pitch. \
Previously, the alpha was controlled by the ``line_alpha`` attribute.

Fixes
* Fixed some deprecation warnings for Matplotlib (get_cmap) and Seaborn (kdeplot).

Page 1 of 8

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.