Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure no duplicates are created when --allow-duplicates flag is not set #65

Merged
merged 1 commit into from
May 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/core/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def __init__(self, **args):
# initialize state
self.nonce = 0
self.all_genomes = []
self.all_combinations = []

def __tomlify(self) -> str:
"""
Expand Down Expand Up @@ -102,9 +103,10 @@ def __build_genome_metadata(self, token_id: int = 0):
else:
return self.__build_genome_metadata(token_id)

if genome_traits in self.all_genomes and not self.allow_duplicates:
if genome_traits in self.all_combinations and not self.allow_duplicates:
return self.__build_genome_metadata(token_id)
else:
self.all_combinations.append(genome_traits)
self.all_genomes.append(
{
"token_id": token_id,
Expand Down
Loading