Skip to content

Commit

Permalink
Merge pull request #143 from StoicLoofah/mark_170
Browse files Browse the repository at this point in the history
mark release version 1.7.0
  • Loading branch information
StoicLoofah authored May 18, 2021
2 parents c2a5407 + b4ae14d commit dffaf57
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 20 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
CHANGELOG
============

1.7.0 - May 17, 2021
--------------------
* Add DOI to the README #128
* Add various missing attributes for co-op replays #129
* Add support for python 3.8, 3.9 #132 #136
* Fix owner on an event with no unit #133
* Add support for ResourceTradeEvent #135
* Fix depot URL template #139

1.6.0 - July 30, 2020
---------------------
* Add support for protocol 80949 (StarCraft 5.0) #122
Expand Down
2 changes: 1 addition & 1 deletion sc2reader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"""
from __future__ import absolute_import, print_function, unicode_literals, division

__version__ = "1.6.0"
__version__ = "1.7.0"

import os
import sys
Expand Down
20 changes: 10 additions & 10 deletions sc2reader/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,42 +151,42 @@ def title(self):

@property
def type(self):
""" The internal type id of the current unit type of this unit. None if no type is assigned"""
"""The internal type id of the current unit type of this unit. None if no type is assigned"""
return self._type_class.id if self._type_class else None

@property
def race(self):
""" The race of this unit. One of Terran, Protoss, Zerg, Neutral, or None"""
"""The race of this unit. One of Terran, Protoss, Zerg, Neutral, or None"""
return self._type_class.race if self._type_class else None

@property
def minerals(self):
""" The mineral cost of the unit. None if no type is assigned"""
"""The mineral cost of the unit. None if no type is assigned"""
return self._type_class.minerals if self._type_class else None

@property
def vespene(self):
""" The vespene cost of the unit. None if no type is assigned"""
"""The vespene cost of the unit. None if no type is assigned"""
return self._type_class.vespene if self._type_class else None

@property
def supply(self):
""" The supply used by this unit. Negative for supply providers. None if no type is assigned """
"""The supply used by this unit. Negative for supply providers. None if no type is assigned"""
return self._type_class.supply if self._type_class else None

@property
def is_worker(self):
""" Boolean flagging units as worker units. SCV, MULE, Drone, Probe """
"""Boolean flagging units as worker units. SCV, MULE, Drone, Probe"""
return self._type_class.is_worker if self._type_class else False

@property
def is_building(self):
""" Boolean flagging units as buildings. """
"""Boolean flagging units as buildings."""
return self._type_class.is_building if self._type_class else False

@property
def is_army(self):
""" Boolean flagging units as army units. """
"""Boolean flagging units as army units."""
return self._type_class.is_army if self._type_class else False

def __str__(self):
Expand Down Expand Up @@ -221,7 +221,7 @@ def __repr__(self):


class UnitType(object):
""" Represents an in game unit type """
"""Represents an in game unit type"""

def __init__(
self,
Expand Down Expand Up @@ -272,7 +272,7 @@ def __init__(


class Ability(object):
""" Represents an in-game ability """
"""Represents an in-game ability"""

def __init__(
self, id, name=None, title=None, is_build=False, build_time=0, build_unit=None
Expand Down
2 changes: 1 addition & 1 deletion sc2reader/events/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __str__(self):


class PlayerSetupEvent(TrackerEvent):
""" Sent during game setup to help us organize players better """
"""Sent during game setup to help us organize players better"""

def __init__(self, frames, data, build):
super(PlayerSetupEvent, self).__init__(frames)
Expand Down
6 changes: 3 additions & 3 deletions sc2reader/factories/plugins/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def deselect(self, mode, data):
return True

elif mode == "Mask":
""" Deselect objects according to deselect mask """
"""Deselect objects according to deselect mask"""
mask = data
if len(mask) < size:
# pad to the right
Expand All @@ -105,15 +105,15 @@ def deselect(self, mode, data):
return len(mask) <= size

elif mode == "OneIndices":
""" Deselect objects according to indexes """
"""Deselect objects according to indexes"""
clean_data = list(filter(lambda i: i < size, data))
self.objects = [
self.objects[i] for i in range(len(self.objects)) if i not in clean_data
]
return len(clean_data) == len(data)

elif mode == "ZeroIndices":
""" Deselect objects according to indexes """
"""Deselect objects according to indexes"""
clean_data = list(filter(lambda i: i < size, data))
self.objects = [self.objects[i] for i in clean_data]
return len(clean_data) == len(data)
Expand Down
2 changes: 1 addition & 1 deletion sc2reader/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def __init__(self, x, y, xy_list=None):
self.values = y

def as_points(self):
""" Get the graph as a list of (x, y) tuples """
"""Get the graph as a list of (x, y) tuples"""
return list(zip(self.times, self.values))

def __str__(self):
Expand Down
2 changes: 1 addition & 1 deletion sc2reader/scripts/sc2printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


def printReplay(filepath, arguments):
""" Prints summary information about SC2 replay file """
"""Prints summary information about SC2 replay file"""
try:
replay = sc2reader.load_replay(filepath, debug=True)

Expand Down
2 changes: 1 addition & 1 deletion sc2reader/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, bytes):

@property
def url(self):
""" Returns url of the depot file. """
"""Returns url of the depot file."""
return self.url_template.format(self.server, self.hash, self.type)

def __hash__(self):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
setuptools.setup(
license="MIT",
name="sc2reader",
version="1.6.0",
version="1.7.0",
keywords=["starcraft 2", "sc2", "replay", "parser"],
description="Utility for parsing Starcraft II replay files",
long_description=open("README.rst").read() + "\n\n" + open("CHANGELOG.rst").read(),
Expand Down
2 changes: 1 addition & 1 deletion test_replays/test_replays.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def test_cn_replays(self):
self.assertEqual(replay.expansion, "WoL")

def test_unit_types(self):
""" sc2reader#136 regression test """
"""sc2reader#136 regression test"""
replay = sc2reader.load_replay("test_replays/2.0.8.25604/issue136.SC2Replay")
hellion_times = [
u.started_at for u in replay.players[0].units if u.name == "Hellion"
Expand Down

0 comments on commit dffaf57

Please sign in to comment.