Skip to content

Commit 30097fb

Browse files
authored
Merge pull request #779 from CitrineInformatics/PLA-10156/make-batchsize-package-constant
convert batch_size into a package constant
2 parents 8bac6b2 + eab5854 commit 30097fb

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/citrine/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.37.0'
1+
__version__ = '1.37.1'

src/citrine/resources/gemd_resource.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
from citrine._session import Session
1717
from citrine._utils.functions import scrub_none, replace_objects_with_links
1818

19+
BATCH_SIZE = 50
20+
1921

2022
class GEMDResourceCollection(DataConceptsCollection[DataConcepts]):
2123
"""A collection of any kind of GEMD objects/templates."""
@@ -121,7 +123,6 @@ def register_all(self,
121123
set_uuids(models, scope=scope)
122124

123125
resources = list()
124-
batch_size = 50
125126
result_index = dict()
126127
if dry_run:
127128
batcher = Batcher.by_dependency()
@@ -130,9 +131,9 @@ def register_all(self,
130131

131132
if status_bar:
132133
desc = "Verifying GEMDs" if dry_run else "Registering GEMDs"
133-
iterator = tqdm(batcher.batch(models, batch_size), leave=False, desc=desc)
134+
iterator = tqdm(batcher.batch(models, BATCH_SIZE), leave=False, desc=desc)
134135
else:
135-
iterator = batcher.batch(models, batch_size)
136+
iterator = batcher.batch(models, BATCH_SIZE)
136137

137138
for batch in iterator:
138139
objects = [replace_objects_with_links(scrub_none(model.dump())) for model in batch]

0 commit comments

Comments
 (0)