Skip to content

Commit

Permalink
feat: Refactor icat generator to use python-icat
Browse files Browse the repository at this point in the history
  • Loading branch information
Reillyhewitson committed Feb 13, 2023
1 parent f14bccb commit ae6ae0b
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions util/icat_db_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ def get_end_date(i):
)


def validate():
pass


def apply_common_parameter_attributes(entity, i, client):
if entity.type.valueType == "NUMERIC":
entity.numericValue = faker.random_int(
Expand Down Expand Up @@ -469,9 +465,6 @@ class KeywordGenerator(Generator):
keywords = []

def generate(self):
# timer = datetime.datetime.now()
# with multiprocessing.get_context("spawn").Pool() as pool:
# pool.map(KeywordGenerator.generate_keyword, range(1, self.amount))
for i in range(1, self.amount):
KeywordGenerator.generate_keyword(i)
self.client.createMany(self.keywords)
Expand All @@ -483,7 +476,6 @@ def generate_keyword(cls, i):
keyword.investigation = cls.client.get(
"Investigation", faker.random_int(1, InvestigationGenerator.amount - 1),
)
keyword.validate = validate
cls.keywords.append(keyword)


Expand Down Expand Up @@ -742,13 +734,6 @@ def generate(self):
for i in range(1, self.amount):
DatafileParameterGenerator.generate_datafile_parameter(i)

# timer = datetime.datetime.now()
# with multiprocessing.get_context("spawn").Pool() as pool:
# pool.map(
# DatafileParameterGenerator.generate_datafile_parameter,
# range(1, self.amount),
# )

@classmethod
def generate_datafile_parameter(cls, i):
datafile_param = cls.client.new("datafileParameter")
Expand Down

0 comments on commit ae6ae0b

Please sign in to comment.