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

Submodule restructure #78

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
8 changes: 4 additions & 4 deletions open_rarity/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .collection import Collection
from .token import Token
from .token_identifier import EVMContractTokenIdentifier
from .token_metadata import StringAttribute, TokenMetadata
from .token_rarity import TokenRarity
from .token_standard import TokenStandard
from .token.identifier import EVMContractTokenIdentifier
theelderbeever marked this conversation as resolved.
Show resolved Hide resolved
from .token.metadata import StringAttribute, TokenMetadata
theelderbeever marked this conversation as resolved.
Show resolved Hide resolved
from .token.rarity import TokenRarity
from .token.standard import TokenStandard
1 change: 1 addition & 0 deletions open_rarity/models/collection/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .collection import Collection, CollectionAttribute
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
from dataclasses import dataclass
from functools import cached_property

from open_rarity.models.token import Token
from open_rarity.models.token_metadata import (
from open_rarity.models.token import (
AttributeName,
AttributeValue,
StringAttribute,
Token,
)
from open_rarity.models.token_standard import TokenStandard
from open_rarity.models.token.standard import TokenStandard
from open_rarity.models.utils.attribute_utils import normalize_attribute_string


Expand Down
8 changes: 8 additions & 0 deletions open_rarity/models/token/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from .metadata import (
AttributeName,
AttributeValue,
DateAttribute,
NumericAttribute,
StringAttribute,
)
from .token import Token
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dataclasses import dataclass

from open_rarity.models.token import Token
from open_rarity.models.token_ranking_features import TokenRankingFeatures
from .ranking_features import TokenRankingFeatures
from .token import Token


@dataclass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from dataclasses import dataclass
from typing import Any

from open_rarity.models.token_identifier import (
from .identifier import (
EVMContractTokenIdentifier,
SolanaMintAddressTokenIdentifier,
TokenIdentifier,
get_identifier_class_from_dict,
)
from open_rarity.models.token_metadata import AttributeName, TokenMetadata
from open_rarity.models.token_standard import TokenStandard
from .metadata import AttributeName, TokenMetadata
from .standard import TokenStandard


@dataclass
Expand Down
4 changes: 2 additions & 2 deletions open_rarity/rarity_ranker.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import math

from open_rarity.models.collection import Collection
from open_rarity.models.token_rarity import TokenRarity
from open_rarity.models.token.rarity import TokenRarity
from open_rarity.scoring.feature_extractor import TokenFeatureExtractor
from open_rarity.scoring.scorer import Scorer
from open_rarity.scoring.token_feature_extractor import TokenFeatureExtractor


class RarityRanker:
Expand Down
6 changes: 3 additions & 3 deletions open_rarity/resolver/opensea_api_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

from open_rarity.models.collection import Collection
from open_rarity.models.token import Token
from open_rarity.models.token_identifier import EVMContractTokenIdentifier
from open_rarity.models.token_metadata import (
from open_rarity.models.token.identifier import EVMContractTokenIdentifier
from open_rarity.models.token.metadata import (
DateAttribute,
NumericAttribute,
StringAttribute,
TokenMetadata,
)
from open_rarity.models.token_standard import TokenStandard
from open_rarity.models.token.standard import TokenStandard
from open_rarity.resolver.models.collection_with_metadata import CollectionWithMetadata

logger = logging.getLogger("open_rarity_logger")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import requests

from open_rarity.models.token_identifier import EVMContractTokenIdentifier
from open_rarity.models.token.identifier import EVMContractTokenIdentifier
from open_rarity.resolver.models.collection_with_metadata import CollectionWithMetadata
from open_rarity.resolver.models.token_with_rarity_data import (
EXTERNAL_RANK_PROVIDERS,
Expand Down
6 changes: 3 additions & 3 deletions open_rarity/resolver/testset_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

from open_rarity.models.collection import Collection
from open_rarity.models.token import Token
from open_rarity.models.token_identifier import EVMContractTokenIdentifier
from open_rarity.models.token_rarity import TokenRarity
from open_rarity.models.token.identifier import EVMContractTokenIdentifier
from open_rarity.models.token.rarity import TokenRarity
from open_rarity.rarity_ranker import RarityRanker
from open_rarity.resolver.models.collection_with_metadata import CollectionWithMetadata
from open_rarity.resolver.models.token_with_rarity_data import (
Expand All @@ -28,6 +28,7 @@
EXTERNAL_RANK_PROVIDERS,
ExternalRarityProvider,
)
from open_rarity.scoring.feature_extractor import TokenFeatureExtractor
from open_rarity.scoring.handlers.arithmetic_mean_scoring_handler import (
ArithmeticMeanScoringHandler,
)
Expand All @@ -41,7 +42,6 @@
InformationContentScoringHandler,
)
from open_rarity.scoring.handlers.sum_scoring_handler import SumScoringHandler
from open_rarity.scoring.token_feature_extractor import TokenFeatureExtractor

harmonic_handler = HarmonicMeanScoringHandler()
arithmetic_handler = ArithmeticMeanScoringHandler()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from open_rarity.models import Token
from open_rarity.models.collection import Collection
from open_rarity.models.token_ranking_features import TokenRankingFeatures
from open_rarity.models.token.ranking_features import TokenRankingFeatures


class TokenFeatureExtractor:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from open_rarity.models.collection import Collection, CollectionAttribute
from open_rarity.models.token import Token
from open_rarity.models.token_metadata import AttributeName
from open_rarity.models.token.metadata import AttributeName
from open_rarity.scoring.utils import get_token_attributes_scores_and_weights

logger = logging.getLogger("open_rarity_logger")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from open_rarity.models.collection import Collection, CollectionAttribute
from open_rarity.models.token import Token
from open_rarity.models.token_metadata import AttributeName
from open_rarity.models.token.metadata import AttributeName
from open_rarity.scoring.utils import get_token_attributes_scores_and_weights

logger = logging.getLogger("open_rarity_logger")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from open_rarity.models.collection import Collection, CollectionAttribute
from open_rarity.models.token import Token
from open_rarity.models.token_metadata import AttributeName
from open_rarity.models.token.metadata import AttributeName
from open_rarity.scoring.utils import get_token_attributes_scores_and_weights

logger = logging.getLogger("open_rarity_logger")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from open_rarity.models.collection import Collection, CollectionAttribute
from open_rarity.models.token import Token
from open_rarity.models.token_metadata import AttributeName
from open_rarity.models.token.metadata import AttributeName
from open_rarity.scoring.utils import get_token_attributes_scores_and_weights

logger = logging.getLogger("open_rarity_logger")
Expand Down
2 changes: 1 addition & 1 deletion open_rarity/scoring/handlers/sum_scoring_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from open_rarity.models.collection import Collection, CollectionAttribute
from open_rarity.models.token import Token
from open_rarity.models.token_metadata import AttributeName
from open_rarity.models.token.metadata import AttributeName
from open_rarity.scoring.utils import get_token_attributes_scores_and_weights

logger = logging.getLogger("open_rarity_logger")
Expand Down
2 changes: 1 addition & 1 deletion open_rarity/scoring/scorer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from open_rarity.models.collection import Collection
from open_rarity.models.token import Token
from open_rarity.models.token_standard import TokenStandard
from open_rarity.models.token.standard import TokenStandard
from open_rarity.scoring.handlers.information_content_scoring_handler import (
InformationContentScoringHandler,
)
Expand Down
2 changes: 1 addition & 1 deletion open_rarity/scoring/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from open_rarity.models.collection import Collection, CollectionAttribute
from open_rarity.models.token import Token
from open_rarity.models.token_metadata import AttributeName
from open_rarity.models.token.metadata import AttributeName


def get_token_attributes_scores_and_weights(
Expand Down
2 changes: 1 addition & 1 deletion scripts/score_real_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import json

from open_rarity import RarityRanker
from open_rarity.models.token_rarity import TokenRarity
from open_rarity.models.token.rarity import TokenRarity
from open_rarity.resolver.opensea_api_helpers import get_collection_from_opensea

parser = argparse.ArgumentParser()
Expand Down
6 changes: 3 additions & 3 deletions tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

from open_rarity.models.collection import Collection
from open_rarity.models.token import Token
from open_rarity.models.token_identifier import (
from open_rarity.models.token.identifier import (
EVMContractTokenIdentifier,
SolanaMintAddressTokenIdentifier,
)
from open_rarity.models.token_metadata import (
from open_rarity.models.token.metadata import (
AttributeName,
NumericAttribute,
StringAttribute,
TokenMetadata,
)
from open_rarity.models.token_standard import TokenStandard
from open_rarity.models.token.standard import TokenStandard


def create_evm_token(
Expand Down
4 changes: 2 additions & 2 deletions tests/models/test_collection.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from open_rarity.models.collection import Collection, CollectionAttribute
from open_rarity.models.token import Token
from open_rarity.models.token_metadata import StringAttribute, TokenMetadata
from open_rarity.models.token_standard import TokenStandard
from open_rarity.models.token.metadata import StringAttribute, TokenMetadata
from open_rarity.models.token.standard import TokenStandard
from tests.helpers import (
create_evm_token,
create_numeric_evm_token,
Expand Down
6 changes: 3 additions & 3 deletions tests/models/test_token.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from open_rarity.models.token import Token
from open_rarity.models.token_identifier import (
from open_rarity.models.token.identifier import (
EVMContractTokenIdentifier,
SolanaMintAddressTokenIdentifier,
)
from open_rarity.models.token_metadata import (
from open_rarity.models.token.metadata import (
NumericAttribute,
StringAttribute,
TokenMetadata,
)
from open_rarity.models.token_standard import TokenStandard
from open_rarity.models.token.standard import TokenStandard
from tests.helpers import create_evm_token


Expand Down
2 changes: 1 addition & 1 deletion tests/models/test_token_identifier.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from open_rarity.models.token_identifier import (
from open_rarity.models.token.identifier import (
EVMContractTokenIdentifier,
SolanaMintAddressTokenIdentifier,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/models/test_token_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from open_rarity.models.token_metadata import (
from open_rarity.models.token.metadata import (
DateAttribute,
NumericAttribute,
StringAttribute,
Expand Down
2 changes: 1 addition & 1 deletion tests/scoring/test_token_feature_extractor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from open_rarity.scoring.token_feature_extractor import TokenFeatureExtractor
from open_rarity.scoring.feature_extractor import TokenFeatureExtractor
from tests.helpers import generate_collection_with_token_traits


Expand Down
8 changes: 4 additions & 4 deletions tests/test_rarity_ranker.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from open_rarity.models.collection import Collection
from open_rarity.models.token import Token
from open_rarity.models.token_identifier import (
from open_rarity.models.token.identifier import (
EVMContractTokenIdentifier,
SolanaMintAddressTokenIdentifier,
)
from open_rarity.models.token_metadata import TokenMetadata
from open_rarity.models.token_ranking_features import TokenRankingFeatures
from open_rarity.models.token_rarity import TokenRarity
from open_rarity.models.token.metadata import TokenMetadata
from open_rarity.models.token.ranking_features import TokenRankingFeatures
from open_rarity.models.token.rarity import TokenRarity
from open_rarity.rarity_ranker import RarityRanker
from tests.helpers import generate_collection_with_token_traits

Expand Down