Mplsoccer

Latest version: v1.2.4

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

Scan your dependencies

Page 4 of 8

1.0.4

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

Added
* Added ``convexhull`` method to the Pitch classes. This creates a polygon with the smallest \
shape that contains the points.

1.0.3

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

Added
* Added ``**kwargs`` to ``Bumpy.plot()`` method. \
All the keyword arguments are passed for setting ticklabels and labels.
* It is now possible to adjust the text in Pizza comparison charts if \
the the text overlaps through ``get_compare_value_texts``. \
Four new methods have been added to ``PyPizza`` to enable this:
* ``get_param_texts()`` : To fetch list of ``axes.text`` for params.
* ``get_value_texts()`` : To fetch list of ``axes.text`` for values.
* ``get_compare_value_texts()`` : To fetch list of ``axes.text`` for comparison-values.
* ``get_theta()`` : To fetch list containing theta values (``float``) (x-coordinate for each text).
* added line_alpha to control the transparency of the pitch lines.
* added a cyberpunk example with glowing pitch lines.

Changes
* increased the ``goal_alpha`` default to 1. ``goal_alpha`` can now be used with all goal_types.

Fixes
* fixed the Pitch.grid method ``axis`` argument default to True to match the docstrings.

1.0.2

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

This release is a major refactor of mplsoccer and a merger with
[soccerplots](https://github.com/Slothfulwave612/soccerplots) for plotting Radars.

---

Breaking Changes
* :x: ``orientation`` argument is removed. \
To plot on a vertical pitch use the new ``VerticalPitch`` class.
* :x: ``layout`` argument is removed. Use the Matplotlib style ``nrows`` and ``ncols`` instead. \
For example, Pitch(layout=(4, 5)) becomes pitch = Pitch() and pitch.draw(nrows=4, ncols=5).
* :x: ``view`` argument is removed. Use half=True to display half-a-pitch. \
For example, Pitch(view='half') becomes Pitch(half=True).
* :x: ``pitch_type=stats`` pitch_type option removed.
* :x: removed ``jointplot`` method and replaced with the more flexible ``jointgrid`` method.

---

Changes
* :white_check_mark: ``hexbin`` now clips to the sides of the soccer pitch for a more \
attractive visualization.
* :heavy_exclamation_mark: ``wyscout`` goal width increased to 12 units (from 10 units) \
to align with ggsoccer. This matters as the new ``Standardizer`` \
class uses the goalpost dimensions.
* :heavy_exclamation_mark: fixed the``bin_statistic_positional`` and ``heatmap_positional`` \
so the heatmaps are created consistently at the heatmap edges \
i.e. grid cells are created from the bottom to the top of the pitch, where the top edge \
always belongs to the cell above.

---

Added
* :heart_eyes: Merged mplsoccer with [soccerplots](https://github.com/Slothfulwave612/soccerplots) \
for wonderful radar charts and bumpy charts.
* :strawberry: Added Nightingale Rose Charts (also known as pizza charts).
* :strawberry: Added a ``jointgrid`` method to draw optional marginal axes on the four-sides \
of a soccer pitch. This replaces the old ``jointplot``, which did not allow non-square pitches.
* :strawberry: Added the ``grid`` method to create a grid of pitches with more control \
than plt.subplots.
* :strawberry: Added ``FontManager`` from [ridge_map](https://github.com/colcarroll/ridge_map) \
by [Colin Carroll](https://twitter.com/colindcarroll) for downloading and using google fonts.
* :strawberry: Added ``Standardizer`` for changing from one provider data format to another. \
For example, StatsBomb to Tracab.
* :icecream: Added new pitch_types: ``skillcorner``, ``secondspectrum``, and a ``custom`` \
pitch type where the length and width can vary.
* :icecream: Added ``goal_alpha`` for controlling the transparency of ``goal_type='box'`` goals.
* :icecream: Added ``goal_type='circle'`` to plot the goalposts as circles.
* :new: Added ``degrees=True`` option so calculate_angle_and_degrees can output the angle \
in degrees clockwise.
* :new: Added ``create_transparent_cmap`` to create colormaps that vary from high transparency \
to low transparency.
* :new: Added ``normalize`` option to ``bin_statistic`` and ``bin_statistic_positional`` \
so the results are divided by the total.
* Added ``str_format`` option to ``label_heatmap`` to enable formatting of heatmap labels, \
e.g. % or rounding.
* Added ``exclude_zeros`` option (default False) to ``label_heatmap`` to enable you to \
exclude drawing any labels equal to zero.

---

Fixes
* :ok: Changed ``Seaborn`` x and y from arguments to keyword arguments. \
This fixes a FutureWarning from Seaborn that the only valid positional argument will be data.
* :ok: Changed imports so that you do not need to reference the module. \
For example, you can now use: from mplsoccer import Pitch.
* :ok: Added repr methods for string representations of classes.
* :ok: Stopped the storage of the Matplotlib figure and axes in the pitch class attributes.
* :ok: Fixed a FutureWarning from Pandas that the lookup method will be deprecated.

---

Docs
* :page_with_curl: Added examples for custom colormaps
* :page_with_curl: Tweaked the StatsBomb data example to only update files if the \
JSON file has changed.
* :page_with_curl: Added more beautiful scatter examples and chart titles.
* :page_with_curl: Added examples for ``grid`` and ``jointgrid``.

---

Refactoring
The pitch class has been split into multiple modules and classes to simplify the code.
This helps reduce the number of conditional if/else switches.
* pitch.py contains the new classes for plotting/ drawing pitches. The ``Pitch`` class is for a \
horizontally orientated soccer pitch, and the new ``VerticalPitch`` is for the \
vertical orientation. A change from the old API of Pitch(orientation='vertical').
* The ``Pitch`` and ``VerticalPitch`` classes inherit their \
plotting methods from ``BasePitchPlot``. While ``BasePitchPlot`` inherits attributes and methods \
for drawing a soccer pitch from ``BasePitch``.
* The soccer pitch dimensions are in a separate module (dimensions.py) for reuse within \
a new ``Standardizer`` class.
* The code for heatmaps, arrows, lines, scatter_rotation, and scatter_football are now \
in separate modules (heatmap.py, quiver.py, linecollection.py, and scatterutils.py).

---

0.0.23

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

Hot fix
Fixed the statsbomb module to allow a requests response to be used in read_event, read_match, read_competition and read_lineup. This should allow the statsbomb module to be used with the StatsBomb API via the requests library.

0.0.22

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

Hot fix
Fixed statsbomb read_event to read the z location, as StatsBomb recently changed their data so it also records the shot impact height 'z' location.

0.0.21

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

Changed
1) changed the name of the 'statsperform' pitch_type to 'uefa'
2) changed the background zorder from 0.8 -> 0.6 so it defaults to below the new Juego de posición pitch markings
3) changed the center circle size for the opta, wyscout, statsbomb, and stats pitches to align with the edge of the six-yard box

Fixed
1) amended the fbref plotting example to work for all five of the leagues.
2) arrows can now take *args to allow colors to be set using C via a cmap.
3) fixed a bug for the metricasports pitch so the center circle and arcs plot when the pitch_width and pitch_length are the same size
4) fixed a bug for the Voronoi plot where the wyscout, opta, and metricasports data wasn't scaled appropriately to a full-sized pitch
5) fixed bin_statistic so the binning of data is always consistent from the bottom to the top of the pitch. Previously pitches with an inverted axis were binned top to bottom. This does not currently apply to bin_statistic_positional.

Added
1) added a method calculate_angles_and_distance to calculate the angle and distance from start and end locations.
2) added an example for plotting a pass network contributed by DymondFormation.
3) added parameters to shade the middle section of the pitch and draw Juego de posición pitch markings.
4) added a method flow to plot a pass flow map and a new example using this method

Page 4 of 8

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.