Skip to content

Commit b04deed

Browse files
committed
version 2.0.1
1 parent 62c05e3 commit b04deed

26 files changed

+240
-79
lines changed

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# python coverage configuration file
22
[run]
33
omit =
4-
test/test_*.py
4+
test/**
55
draftsman/env.py
66
draftsman/environment/*
77
branch = True

changelog.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
# Changelog
22

33
## 2.0.1
4-
* Updated `factorio-data` to version `2.0.33` (latest)
4+
* Updated `factorio-data` to version `2.0.41` (latest)
55
* Added `planets.get_surface_properties()` which grabs a dict of surface properties with valid defaults
66
* Added `Entity.surface_conditions`, which maps directly to the Factorio API `surface_conditions`
77
* Added `Entity.is_placeable_on()`, which returns false if an entity's `surface_conditions` prohibit their construction on a planet
88
* Added `utils.passes_surface_conditions()`, which acts as the abstract backend which runs `Entity.is_placable_on()` and `recipes.is_usable_on()`
9+
* Added testing for `Asteroid Collector`
910
* Finished implementing features for `LogisticsContainer`s
1011
* `quality` is now an accessible and modifiable attribute of `Entity`s
1112
* Made `Container.inventory_size` proportional to the entity's `quality`
13+
* *(note that all quality modifiers are not yet available)*
1214
* Merge RosieBaish's pull request:
1315
* Add logic to allow mods with different special characters
1416
* Merge Gavinp's pull requests:
@@ -17,6 +19,7 @@
1719
* `draftsman` now prints usage/help on empty args.
1820
* Fixed #142 (Logistics containers not importing properly)
1921
* Fixed #121 (Support for Bob's Inserters)
22+
* Fixed #151 (Severe Performance degradation when using `add_circuit_connection`)
2023

2124
## 2.0.0
2225
* Updated `factorio-data` to version `2.0.28` (latest)

draftsman/_factorio_version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# _factorio_version.py
22

3-
__factorio_version__ = "2.0.34.0"
4-
__factorio_version_info__ = (2, 0, 34, 0)
3+
__factorio_version__ = "2.0.42.0"
4+
__factorio_version_info__ = (2, 0, 42, 0)

draftsman/classes/collection.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -795,19 +795,25 @@ def add_circuit_connection(
795795
# if not isinstance(location_2, tuple):
796796
# location_2 = (location_2, "input")
797797

798-
if not isinstance(entity_1, EntityLike):
798+
if isinstance(entity_1, EntityLike):
799+
if entity_1 not in self.entities:
800+
raise InvalidAssociationError(
801+
"entity_1 ({}) not contained within this collection".format(
802+
entity_1
803+
)
804+
)
805+
else:
799806
entity_1 = self.entities[entity_1]
800-
if not isinstance(entity_2, EntityLike):
801-
entity_2 = self.entities[entity_2]
802807

803-
if entity_1 not in self.entities:
804-
raise InvalidAssociationError(
805-
"entity_1 ({}) not contained within this collection".format(entity_1)
806-
)
807-
if entity_2 not in self.entities:
808-
raise InvalidAssociationError(
809-
"entity_2 ({}) not contained within this collection".format(entity_2)
810-
)
808+
if isinstance(entity_2, EntityLike):
809+
if entity_2 not in self.entities:
810+
raise InvalidAssociationError(
811+
"entity_2 ({}) not contained within this collection".format(
812+
entity_2
813+
)
814+
)
815+
else:
816+
entity_2 = self.entities[entity_2]
811817

812818
if color not in {"red", "green"}:
813819
raise InvalidWireTypeError(color)

draftsman/classes/mixins/request_filters.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,7 @@ def request_filters(self, value: Optional[Format.RequestFilters]) -> None:
162162
# else:
163163
# self._root.request_filters = value
164164
result = attempt_and_reissue(
165-
self,
166-
type(self).Format,
167-
self._root,
168-
"request_filters",
169-
value
165+
self, type(self).Format, self._root, "request_filters", value
170166
)
171167
self._root.request_filters = result
172168

draftsman/data/entities.pkl

40.8 KB
Binary file not shown.

draftsman/data/fluids.pkl

0 Bytes
Binary file not shown.

draftsman/data/instruments.pkl

0 Bytes
Binary file not shown.

draftsman/data/items.pkl

4.12 KB
Binary file not shown.

draftsman/data/mods.pkl

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)