Commit 3db20b1c authored by Mitar's avatar Mitar
Browse files

Fixing typing.

parent 4554e6e3
Pipeline #147079469 passed with stage
in 4 minutes
......@@ -29,7 +29,7 @@ class AbsSumPrimitive(transformer.TransformerPrimitiveBase[Inputs, Outputs, Hype
A primitive that sums the absolute value of the elements in a container and returns a list with a single value: the sum.
"""
metadata = metadata_base.PrimitiveMetadata({
metadata: typing.ClassVar[metadata_base.PrimitiveMetadata] = metadata_base.PrimitiveMetadata({
'id': '24de67db-aa08-4b66-85b2-b7be97154cf6',
'version': __version__,
'name': "Absolute Sum Test Primitive",
......
import os.path
import typing
import numpy as np # type: ignore
......@@ -28,7 +29,7 @@ class ContainerHyperparamPrimitive(transformer.TransformerPrimitiveBase[Inputs,
A primitive which uses a hyperparam of type container_argument.
"""
metadata = metadata_base.PrimitiveMetadata({
metadata: typing.ClassVar[metadata_base.PrimitiveMetadata] = metadata_base.PrimitiveMetadata({
'id': '442b600e-1144-11e9-ab14-d663bd873d93',
'version': __version__,
'name': "Container Hyperparam Tester",
......
import os.path
import typing
from d3m import container, utils
from d3m.metadata import hyperparams, base as metadata_base
from d3m.primitive_interfaces import base, transformer
......@@ -25,7 +27,7 @@ class DataHyperparamPrimitive(transformer.TransformerPrimitiveBase[Inputs, Outpu
A primitive that requires a data argument hyperparam.
"""
metadata = metadata_base.PrimitiveMetadata({
metadata: typing.ClassVar[metadata_base.PrimitiveMetadata] = metadata_base.PrimitiveMetadata({
'id': '98582315-33f9-4fe9-91a4-5d768a123aa8',
'version': __version__,
'name': "Data Hyperparam Test Primitive",
......
import os.path
import typing
from d3m import container, exceptions, utils
from d3m.metadata import hyperparams, base as metadata_base
......@@ -48,7 +49,7 @@ class FailPrimitive(transformer.TransformerPrimitiveBase[Inputs, Outputs, Hyperp
and unpickle it, it does not seen itself as fitted anymore.
"""
metadata = metadata_base.PrimitiveMetadata({
metadata: typing.ClassVar[metadata_base.PrimitiveMetadata] = metadata_base.PrimitiveMetadata({
'id': 'd6dfbefa-0fb8-11e9-ab14-d663bd873d93',
'version': __version__,
'name': "Failure Tester",
......
......@@ -22,7 +22,7 @@ class FakeScorePrimitive(transformer.TransformerPrimitiveBase[Inputs, Outputs, H
A primitive that takes a DataFrame and returns hard-coded fake accuracy scores.
"""
metadata = metadata_base.PrimitiveMetadata(
metadata: typing.ClassVar[metadata_base.PrimitiveMetadata] = metadata_base.PrimitiveMetadata(
{
'id': '1c4d5cbd-163c-424d-8be5-0f267641ae34',
'version': __version__,
......
import os
import typing
import numpy # type: ignore
import frozendict # type: ignore
......@@ -26,7 +27,7 @@ class DummyImageReaderPrimitive(primitives.FileReaderPrimitiveBase):
_file_structural_type = container.ndarray
_file_semantic_types = ('http://schema.org/ImageObject',)
metadata = metadata_base.PrimitiveMetadata(
metadata: typing.ClassVar[metadata_base.PrimitiveMetadata] = metadata_base.PrimitiveMetadata(
{
'id': '4f6e56b6-4ece-444b-9354-5a2b4e575a13',
'version': __version__,
......
......@@ -35,7 +35,7 @@ class IncrementPrimitive(transformer.TransformerPrimitiveBase[Inputs, Outputs, H
"""
# This should contain only metadata which cannot be automatically determined from the code.
metadata = metadata_base.PrimitiveMetadata({
metadata: typing.ClassVar[metadata_base.PrimitiveMetadata] = metadata_base.PrimitiveMetadata({
# Simply an UUID generated once and fixed forever. Generated using "uuid.uuid4()".
'id': '5c9d5acf-7754-420f-a49f-90f4d9d0d694',
'version': __version__,
......
import os.path
import typing
from d3m import container, utils
from d3m.metadata import base as metadata_base, hyperparams, params
......@@ -32,7 +33,7 @@ class MonomialPrimitive(supervised_learning.SupervisedLearnerPrimitiveBase[Input
"""
# This should contain only metadata which cannot be automatically determined from the code.
metadata = metadata_base.PrimitiveMetadata({
metadata: typing.ClassVar[metadata_base.PrimitiveMetadata] = metadata_base.PrimitiveMetadata({
# Simply an UUID generated once and fixed forever. Generated using "uuid.uuid4()".
'id': '4a0336ae-63b9-4a42-860e-86c5b64afbdd',
'version': __version__,
......
......@@ -29,7 +29,7 @@ class MultiDataHyperparamPrimitive(transformer.TransformerPrimitiveBase[Inputs,
A primitive that requires a data argument hyperparam.
"""
metadata = metadata_base.PrimitiveMetadata({
metadata: typing.ClassVar[metadata_base.PrimitiveMetadata] = metadata_base.PrimitiveMetadata({
'id': 'ad8b8a35-9023-4f24-a628-a8f41eb2e3b0',
'version': __version__,
'name': "Multi Data Hyperparam Test Primitive",
......
import os.path
import typing
from d3m import container, utils
from d3m.metadata import base as metadata_base, hyperparams, params
......@@ -27,7 +28,7 @@ class NullTransformerPrimitive(transformer.TransformerPrimitiveBase[Inputs, Outp
It does not really care if inputs is list.
"""
metadata = metadata_base.PrimitiveMetadata({
metadata: typing.ClassVar[metadata_base.PrimitiveMetadata] = metadata_base.PrimitiveMetadata({
'id': 'e0f83c35-fe3d-4fa6-92cf-f7421408eab5',
'version': __version__,
'name': "Produce the same as the input",
......@@ -71,7 +72,7 @@ class NullUnsupervisedLearnerPrimitive(unsupervised_learning.UnsupervisedLearner
It does not really care if inputs is list.
"""
metadata = metadata_base.PrimitiveMetadata({
metadata: typing.ClassVar[metadata_base.PrimitiveMetadata] = metadata_base.PrimitiveMetadata({
'id': '5310d7c4-89a0-4dab-8419-3285e650105a',
'version': __version__,
'name': "Produce the same as the input",
......@@ -150,7 +151,7 @@ class NullDataFrameUnsupervisedLearnerPrimitive(unsupervised_learning.Unsupervis
It does not really care if inputs is a Dataframe.
"""
metadata = metadata_base.PrimitiveMetadata({
metadata: typing.ClassVar[metadata_base.PrimitiveMetadata] = metadata_base.PrimitiveMetadata({
'id': '0c063f7b-98d8-4d3c-91df-6a56623b9cc3',
'version': __version__,
'name': "Produce the same as the input",
......
......@@ -7,6 +7,7 @@ import shutil
import signal
import subprocess
import time
import typing
import prctl # type: ignore
import psycopg2 # type: ignore
......@@ -33,7 +34,7 @@ class PostgreSQLPrimitive(transformer.TransformerPrimitiveBase[Inputs, Outputs,
A primitive which which uses PostgreSQL to compute a value.
"""
metadata = metadata_base.PrimitiveMetadata({
metadata: typing.ClassVar[metadata_base.PrimitiveMetadata] = metadata_base.PrimitiveMetadata({
'id': 'f23ea340-ce22-4b15-b2f3-e63885f192b3',
'version': __version__,
'name': "PostgreSQL operator",
......
import os.path
import typing
import pandas as pd # type: ignore
......@@ -29,7 +30,7 @@ class PrimitiveHyperparamPrimitive(transformer.TransformerPrimitiveBase[Inputs,
A primitive that requires a data argument hyperparam.
"""
metadata = metadata_base.PrimitiveMetadata({
metadata: typing.ClassVar[metadata_base.PrimitiveMetadata] = metadata_base.PrimitiveMetadata({
'id': 'bd67f49a-bf10-4251-9774-019add57370b',
'version': __version__,
'name': "Primitive Hyperparam Test Primitive",
......
......@@ -47,7 +47,7 @@ class PrimitiveSumPrimitive(transformer.TransformerPrimitiveBase[Inputs, Outputs
"""
# This should contain only metadata which cannot be automatically determined from the code.
metadata = metadata_base.PrimitiveMetadata({
metadata: typing.ClassVar[metadata_base.PrimitiveMetadata] = metadata_base.PrimitiveMetadata({
# Simply an UUID generated once and fixed forever. Generated using "uuid.uuid4()".
'id': '6b061902-5e40-4a7a-9a21-b995dce1b2aa',
'version': __version__,
......
......@@ -38,7 +38,7 @@ class RandomPrimitive(generator.GeneratorPrimitiveBase[Outputs, None, Hyperparam
"""
# This should contain only metadata which cannot be automatically determined from the code.
metadata = metadata_base.PrimitiveMetadata({
metadata: typing.ClassVar[metadata_base.PrimitiveMetadata] = metadata_base.PrimitiveMetadata({
# Simply an UUID generated once and fixed forever. Generated using "uuid.uuid4()".
'id': 'df3153a1-4411-47e2-bbc0-9d5e9925ad79',
'version': __version__,
......
......@@ -32,7 +32,7 @@ class RandomClassifierPrimitive(SupervisedLearnerPrimitiveBase[Inputs, Outputs,
It uses the first column of ``outputs`` as a target column.
"""
metadata = metadata_base.PrimitiveMetadata({
metadata: typing.ClassVar[metadata_base.PrimitiveMetadata] = metadata_base.PrimitiveMetadata({
'id': 'b8d0d982-fc53-4a3f-8a8c-a284fdd45bfd',
'version': __version__,
'name': "Random Classifier",
......
......@@ -43,7 +43,7 @@ class SumPrimitive(transformer.TransformerPrimitiveBase[Inputs, Outputs, Hyperpa
"""
# This should contain only metadata which cannot be automatically determined from the code.
metadata = metadata_base.PrimitiveMetadata({
metadata: typing.ClassVar[metadata_base.PrimitiveMetadata] = metadata_base.PrimitiveMetadata({
# Simply an UUID generated once and fixed forever. Generated using "uuid.uuid4()".
'id': '9c00d42d-382d-4177-a0e7-082da88a29c8',
'version': __version__,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment