Commit 4848df5e authored by M. Huang's avatar M. Huang
Browse files

wip: pass all tests before make py

parent 04f3515f
......@@ -46,8 +46,8 @@ class Classes_meta(type):
'fdi.dataset.dateparameter': ['DateParameter'],
'fdi.dataset.stringparameter': ['StringParameter'],
'fdi.dataset.arraydataset': ['ArrayDataset', 'Column'],
'fdi.dataset.dataset': ['GenericDataset',
'TableDataset', 'CompositeDataset'],
'fdi.dataset.dataset': ['GenericDataset', 'CompositeDataset'],
'fdi.dataset.tabledataset': ['TableDataset', 'IndexedTableDataset'],
'fdi.dataset.readonlydict': ['ReadOnlyDict'],
'fdi.pal.context': ['AbstractContext', 'Context',
'AbstractMapContext', 'MapContext',
......
This diff is collapsed.
name: ArrayDataset_DataModel
description: ArrayDataset class data model mandatory configuration
name: TableDataset_DataModel
description: TableDataset class data model mandatory configuration
parents:
-
schema: '1.6'
......@@ -12,22 +12,7 @@ metadata:
type:
data_type: string
description: Type identification. Name of class.
default: ArrayDataset
valid: ''
unit:
data_type: string
description: Unit of every element.
default: null
valid: ''
shape:
data_type: tuple
description: Number of elements in each dimension. Quick changers to the right.
default: ()
valid: ''
typecode:
data_type: string
description: Python internal storage code.
default: UNKNOWN
default: TableDataset
valid: ''
version:
data_type: string
......
......@@ -3,19 +3,36 @@
from .indexed import Indexed
from .ndprint import ndprint
from .odict import ODict
import itertools
from ..utils.common import mstr, bstr, lls, exprstrs
from .dataset import Dataset
from .indexed import Indexed
try:
from .arraydataset_datamodel import Model
except ImportError:
Model = {'metadata': {}}
import sys
from collections.abc import Sequence
from collections import OrderedDict
import itertools
if sys.version_info[0] + 0.1 * sys.version_info[1] >= 3.3:
PY33 = True
from collections.abc import Container, Sequence, Mapping
seqlist = Sequence
maplist = Mapping
else:
assert 0, 'python 3'
PY33 = False
from .collectionsMockUp import ContainerMockUp as Container
from .collectionsMockUp import SequenceMockUp as Sequence
from .collectionsMockUp import MappingMockUp as Mapping
seqlist = (tuple, list, Sequence, str)
# ,types.XRangeType, types.BufferType)
maplist = (dict, Mapping)
import logging
# create logger
logger = logging.getLogger(__name__)
......@@ -74,7 +91,7 @@ class TableModel(object):
self.getColumn(columnIndex).data[rowIndex] = value
-MdpInfo = Model['metadata']
MdpInfo = Model['metadata']
class TableDataset(Dataset, TableModel):
......@@ -111,6 +128,7 @@ class TableDataset(Dataset, TableModel):
self._list = []
super(TableDataset, self).__init__(
**kwds) # initialize data, meta, unit
self.setData(data)
def getData(self):
""" Optimized for _data being an ``ODict`` implemented with ``UserDict``.
......
......@@ -3,7 +3,8 @@ from .product import Product
from .numericparameter import NumericParameter
from .stringparameter import StringParameter
from .datatypes import Vector
from .dataset import CompositeDataset, TableDataset
from .dataset import CompositeDataset
from .tabledataset import TableDataset
from .arraydataset import ArrayDataset, Column
from ..pal.context import Context, MapContext
from .finetime import FineTime
......
......@@ -4,7 +4,8 @@ from ..utils.common import trbk, trbk2, getUidGid, lls
from ..utils.run_proc import run_proc
from ..dataset.deserialize import deserialize
from ..dataset.serializable import serialize
from ..dataset.dataset import GenericDataset, TableDataset
from ..dataset.dataset import GenericDataset
from ..dataset.tabledataset import TableDataset
from ..dataset.product import Product
from ..dataset.finetime import FineTime1
from ..dataset.baseproduct import History
......
......@@ -20,7 +20,6 @@ If the above fail and a method whose name starts with 'is' then the method is ca
p0 = paths[0]
found_meth = None
print(p0)
is_str = issubclass(p0.__class__, str)
if is_str and hasattr(nested, p0):
......
......@@ -19,7 +19,7 @@ from fdi.dataset.stringparameter import StringParameter
from fdi.dataset.dateparameter import DateParameter
from fdi.dataset.finetime import FineTime, FineTime1
from fdi.dataset.arraydataset import ArrayDataset, Column
from fdi.dataset.dataset import TableDataset
from fdi.dataset.tabledataset import TableDataset
from fdi.dataset.classes import Classes
from fdi.pal.context import Context, MapContext
from fdi.pal.productref import ProductRef
......
# -*- coding: utf-8 -*-
from fdi.dataset.odict import ODict
from fdi.dataset.dataset import TableDataset, IndexedTableDataset
from fdi.dataset.tabledataset import TableDataset, IndexedTableDataset
from fdi.dataset.indexed import Indexed
import random
from operator import itemgetter
......
......@@ -34,7 +34,7 @@ from fdi.dataset.attributable import Attributable
from fdi.dataset.abstractcomposite import AbstractComposite
from fdi.dataset.datawrapper import DataWrapper, DataWrapperMapper
from fdi.dataset.arraydataset import ArrayDataset, Column
from fdi.dataset.dataset import TableDataset
from fdi.dataset.tabledataset import TableDataset
from fdi.dataset.dataset import GenericDataset, CompositeDataset
from fdi.dataset.indexed import Indexed
from fdi.dataset.ndprint import ndprint
......
# -*- coding: utf-8 -*-
from fdi.dataset.eq import deepcmp
from fdi.dataset.metadata import Parameter, MetaData, make_jsonable
from fdi.dataset.numericparameter import NumericParameter
from fdi.dataset.stringparameter import StringParameter
from fdi.dataset.dataset import TableDataset, CompositeDataset
from fdi.dataset.arraydataset import Column, ArrayDataset
from fdi.dataset.metadata import make_jsonable
from fdi.dataset.datatypes import Vector, Quaternion
from fdi.dataset.deserialize import Class_Look_Up
from fdi.dataset.product import Product
from fdi.dataset.testproducts import get_sample_product
from fdi.pal.urn import Urn
from fdi.utils.checkjson import checkjson
from fdi.utils.loadfiles import loadcsv
from fdi.utils import moduleloader
from fdi.utils.common import fullname, l2t
from fdi.utils.common import fullname
from fdi.utils.options import opt
from fdi.utils.fetch import fetch
import datetime
import importlib
import traceback
import copy
import sys
......
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