Skip to content

Commit

Permalink
Merge pull request #155 from george0st/change
Browse files Browse the repository at this point in the history
Decrease amount of transaction and events
  • Loading branch information
george0st authored Apr 18, 2024
2 parents 6398032 + c0a15b5 commit 67a258b
Show file tree
Hide file tree
Showing 32 changed files with 595 additions and 557 deletions.
Binary file modified 02-data/01-size-100/01-basic-party.csv.gz
Binary file not shown.
Binary file modified 02-data/01-size-100/01-basic-party.parquet
Binary file not shown.
Binary file modified 02-data/01-size-100/02-basic-contact.csv.gz
Binary file not shown.
Binary file modified 02-data/01-size-100/02-basic-contact.parquet
Binary file not shown.
Binary file modified 02-data/01-size-100/03-basic-relation.csv.gz
Binary file not shown.
Binary file modified 02-data/01-size-100/03-basic-relation.parquet
Binary file not shown.
Binary file modified 02-data/01-size-100/04-basic-account.csv.gz
Binary file not shown.
Binary file modified 02-data/01-size-100/04-basic-account.parquet
Binary file not shown.
Binary file modified 02-data/01-size-100/05-basic-transaction.csv.gz
Binary file not shown.
Binary file modified 02-data/01-size-100/05-basic-transaction.parquet
Binary file not shown.
Binary file modified 02-data/01-size-100/06-basic-event.csv.gz
Binary file not shown.
Binary file modified 02-data/01-size-100/06-basic-event.parquet
Binary file not shown.
Binary file modified 02-data/01-size-100/07-basic-communication.csv.gz
Binary file not shown.
Binary file modified 02-data/01-size-100/07-basic-communication.parquet
Binary file not shown.
Binary file modified 02-data/02-size-1K/01-basic-party.csv.gz
Binary file not shown.
Binary file modified 02-data/02-size-1K/01-basic-party.parquet
Binary file not shown.
Binary file modified 02-data/02-size-1K/02-basic-contact.csv.gz
Binary file not shown.
Binary file modified 02-data/02-size-1K/02-basic-contact.parquet
Binary file not shown.
Binary file modified 02-data/02-size-1K/03-basic-relation.csv.gz
Binary file not shown.
Binary file modified 02-data/02-size-1K/03-basic-relation.parquet
Binary file not shown.
Binary file modified 02-data/02-size-1K/04-basic-account.csv.gz
Binary file not shown.
Binary file modified 02-data/02-size-1K/04-basic-account.parquet
Binary file not shown.
Binary file modified 02-data/02-size-1K/05-basic-transaction.csv.gz
Binary file not shown.
Binary file modified 02-data/02-size-1K/05-basic-transaction.parquet
Binary file not shown.
Binary file modified 02-data/02-size-1K/06-basic-event.csv.gz
Binary file not shown.
Binary file modified 02-data/02-size-1K/06-basic-event.parquet
Binary file not shown.
Binary file modified 02-data/02-size-1K/07-basic-communication.csv.gz
Binary file not shown.
Binary file modified 02-data/02-size-1K/07-basic-communication.parquet
Binary file not shown.
566 changes: 295 additions & 271 deletions 03-test/01-size-100.json

Large diffs are not rendered by default.

570 changes: 289 additions & 281 deletions 03-test/02-size-1k.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions generator/basic_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,18 @@ def generate(self, count):
# for customer: more active
# for non customer: small amount of activities
if party_customer:
day = self.rnd_choose(range(10),[0.01, 0.19, 0.1, 0.2, 0.1, 0.05, 0.05, 0.1, 0.1, 0.1])
day = self.rnd_choose(range(10),[0, 0, 0, 0.1, 0.3, 0.15, 0.15, 0.1, 0.1, 0.1])
else:
day = self.rnd_choose(range(10), [0, 0, 0, 0, 0.05, 0.05, 0.1, 0.2, 0.3, 0.3])
event_date = event_date + datetime.timedelta(days=float(day))
if event_date > self.now:
break

# define bundle
# for customer: size 2-15x events (bigger amount of activities)
# for non-customer: size 2-10x events (small amount of activites)
# for customer: size 2-10x events (bigger amount of activities)
# for non-customer: size 2-5x events (small amount of activites)
session_id = str(uuid.uuid4())
session_events=self.rnd_choose(range(2, 15)) if party_customer else self.rnd_choose(range(2, 10))
session_events=self.rnd_choose(range(2, 10)) if party_customer else self.rnd_choose(range(2, 5))
session_datetime = datetime.datetime(event_date.year,
event_date.month,
event_date.day,
Expand Down
8 changes: 7 additions & 1 deletion generator/basic_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
class BasicTransaction(BaseData):

NAME= "05-basic-transaction"
MAX_EVENT_HISTORY_MONTHS = 3*12 # 3 years as default, in case of value '0' or '-1', it is without limit

def __init__(self, path, gmodel):
super().__init__(path, gmodel, BasicTransaction.NAME)
Expand Down Expand Up @@ -41,10 +42,15 @@ def generate(self, count):

dif_date=round((date_to-date_from).days/30)

# apply limit for max history
if self.MAX_EVENT_HISTORY_MONTHS > 0:
if dif_date > self.MAX_EVENT_HISTORY_MONTHS:
dif_date = self.MAX_EVENT_HISTORY_MONTHS

for mounth in range(dif_date):
a=mounth*30
b=int(self.rnd_int(1,30))
new_date=date_from+datetime.timedelta(days=a+b)
new_date=date_to-datetime.timedelta(days=a+b)

model=self.model_item()

Expand Down

0 comments on commit 67a258b

Please sign in to comment.