Skip to content

Commit

Permalink
generator parameter order updates plus DS generator update
Browse files Browse the repository at this point in the history
  • Loading branch information
lizlouise1335 committed Jul 24, 2023
1 parent 928b769 commit d85efa2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions synthetic_data/dataset_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def generate_dataset_by_class(
rng: Generator,
columns_to_generate: List[dict] = None,
dataset_length: int = 100000,
path: Optional[str] = None,
path: str = None,
) -> pd.DataFrame:
"""
Randomizes a dataset with a mixture of different data classes.
Expand Down Expand Up @@ -84,6 +84,6 @@ def generate_dataset_by_class(
raise ValueError(f"generator: {col_generator} is not a valid generator.")

col_generator_function = gen_funcs.get(col_generator)
dataset.append(col_generator_function(**col_, num_rows=dataset_length, rng=rng))
dataset.append(col_generator_function(rng=rng, num_rows=dataset_length))
column_names.append(col_generator)
return convert_data_to_df(dataset, path, column_names=column_names)
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
def random_categorical(
rng: Generator,
categories: Optional[List[str]] = None,
num_rows: int = 1,
probabilities: Optional[List[float]] = None,
num_rows: int = 1,
) -> np.array:
"""
Randomly generates an array of categorical values chosen out of categories.
Expand Down
6 changes: 3 additions & 3 deletions synthetic_data/distinct_generators/text_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
def random_string(
rng: Generator,
chars: Optional[List[str]] = None,
num_rows: int = 1,
str_len_min: int = 1,
str_len_max: int = 256,
num_rows: int = 1,
) -> np.array:
"""
Randomly generates an array of strings with length between the min and max values.
Expand Down Expand Up @@ -50,9 +50,9 @@ def random_string(
def random_text(
rng: Generator,
chars: Optional[str] = None,
num_rows: int = 1,
str_len_min: int = 256,
str_len_max: int = 1000,
num_rows: int = 1,
) -> np.array:
"""
Randomly generates an array of text with length between the min and max values.
Expand All @@ -75,4 +75,4 @@ def random_text(
f"str_len_min must be > 255. " f"Value provided: {str_len_min}."
)

return random_string(rng, chars, num_rows, str_len_min, str_len_max)
return random_string(rng, chars, str_len_min, str_len_max, num_rows)

0 comments on commit d85efa2

Please sign in to comment.