Changeset 1027


Ignore:
Timestamp:
26/05/06 12:31:12 (13 years ago)
Author:
domlowe
Message:

fixed API imports across all modules

Location:
TI02-CSML/trunk/parser
Files:
1 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • TI02-CSML/trunk/parser/API/ops_AbstractFeature.py

    r1025 r1027  
    44    print 'testmethod for abstract feature' 
    55    return 'testmethod abstract feature' 
     6 
     7def getAllowedSubsettings(self): 
     8    return ['none'] 
  • TI02-CSML/trunk/parser/API/ops_AbstractFileExtract.py

    r1026 r1027  
    44    print 'testmethod for AbstractFileExtract feature' 
    55    return 'testmethod AbstractFileExtract' 
     6 
  • TI02-CSML/trunk/parser/API/ops_GridSeriesFeature.py

    r1025 r1027  
    11''' ops_GridSeriesFeature  contains operations for GridSeriesFeatures''' 
     2from API import * 
    23 
    34def testmethod(self): 
    45    print 'testmethod for gridseries feature' 
    56    return 'testmethod - gridseries' 
     7 
     8def getAllowedSubsettings(self): 
     9    return ['subsetToGridSeries'] 
     10 
     11def getDomainReference(self): 
     12    #Inspects a time position list for the domain reference. 
     13    #TODO, does not handle a file extract in place of a list. 
     14    if isinstance(self.domain.domainReference,Parser.TimePositionList): 
     15        time = {} 
     16        time['t'] = self.domain.domainReference.timePositions 
     17        domainref  = time 
     18    return domainref 
     19     
     20#     def __getDomainComplement(self): 
     21#         #This will return a list containing one or more ordinates: 
     22#         #currently in form [Name, values] 
     23#         domaincomp ={} 
     24#         dc = self.domain.domainComplement 
     25#         #dc should be a grid! 
     26#         if isinstance(dc, Grid): 
     27#             for ordinate in dc.ordinates: 
     28#                 fe=CSMLAbstractFileExtract(ordinate.axisValues) 
     29#                 domaincomp[ordinate.definesAxis]=fe.getAxisData() 
     30#                 fe.close() 
     31#         return domaincomp 
     32             
     33# #     def getDomain(self): 
     34# #         #returns both the domain reference axes and domain compliment axes in a single domain dictionary 
     35# #         #axes are in no particular order 
     36# #         domain = {} 
     37# #         dr=self.__getDomainReference() 
     38# #         dc=self.__getDomainComplement() 
     39# #         for key in dc.keys(): 
     40# #             domain[key]=dc[key] 
     41# #         for key in dr.keys(): 
     42# #             domain[key]=dr[key] 
     43# #         return domain 
  • TI02-CSML/trunk/parser/API/parser_api.py

    r1025 r1027  
    22 
    33#import parser from parent directory 
    4 import os, sys 
    5 currentPath=os.getcwd() 
    6 parserPath=os.sep.join(currentPath.split(os.sep)[:-1]) 
    7 sys.path.append(parserPath) #append the parser path to sys.path  
    8 try: 
    9     from Parser import * 
    10     import parser_extra 
    11 except: 
    12     print 'Could not import CSML Parser. Make sure the Parser code is in parent directory.' 
    13     sys.exit() 
    14  
    15 import ops_Dataset 
    16 import ops_AbstractFeature 
    17 import ops_PointFeature 
    18 import ops_ProfileFeature 
    19  
     4# import os, sys 
     5# currentPath=os.getcwd() 
     6# parserPath=os.sep.join(currentPath.split(os.sep)[:-1]) 
     7# sys.path.append(parserPath) #append the parser path to sys.path  
     8# try: 
     9#     from Parser import * 
     10#     import parser_extra 
     11# except: 
     12#     print 'Could not import CSML Parser. Make sure the Parser code is in parent directory.' 
     13#     sys.exit() 
     14#  
     15# import ops_Dataset 
     16# import ops_AbstractFeature 
     17# import ops_PointFeature 
     18# import ops_PointSeriesFeature 
     19# import ops_ProfileFeature 
     20# import ops_ProfileSeriesFeature 
     21# import ops_GridFeature 
     22# import ops_GridSeriesFeature 
     23# import ops_TrajectoryFeature 
    2024 
    2125#Assign methods  .. hmmm perhaps a loop needed here!! 
     
    2529Dataset.getFeatureList=ops_Dataset.getFeatureList 
    2630Dataset.getFeature=ops_Dataset.getFeature 
     31Dataset.getFileExtract=ops_Dataset.getFileExtract 
    2732 
    2833 
    2934#AbstractFeature methods: 
    3035AbstractFeature.testmethod=ops_AbstractFeature.testmethod 
     36AbstractFeature.getAllowedSubsettings=ops_AbstractFeature.getAllowedSubsettings 
    3137 
    3238#PointFeature methods: 
    3339PointFeature.testmethod=ops_PointFeature.testmethod 
     40#PointFeature.getAllowedSubsettings=ops_PointFeature.getAllowedSubsettings 
    3441 
    3542#PointSeriesFeature methods: 
    3643PointSeriesFeature.testmethod=ops_PointSeriesFeature.testmethod 
     44#PointSeriesFeature.getAllowedSubsettings=ops_PointSeriesFeature.getAllowedSubsettings 
    3745 
    3846#ProfileFeature methods: 
    3947ProfileFeature.testmethod=ops_ProfileFeature.testmethod 
     48#ProfileFeature.getAllowedSubsettings=ops_ProfileFeature.getAllowedSubsettings 
    4049 
    4150#ProfileSeriesFeature methods: 
    4251ProfileSeriesFeature.testmethod=ops_ProfileSeriesFeature.testmethod 
     52#ProfileSeriesFeature.getAllowedSubsettings=ops_ProfileSeriesFeature.getAllowedSubsettings 
    4353 
    44 #Grid methods: 
    45 Grid.testmethod=ops_GridFeature.testmethod 
     54#GridFeature methods: 
     55GridFeature.testmethod=ops_GridFeature.testmethod 
     56#GridFeature.getAllowedSubsettings=ops_GridFeature.getAllowedSubsettings 
    4657 
    47 #GridSeries methods: 
    48 GridSeries.testmethod=ops_GridSeriesFeature.testmethod 
     58#GridSeriesFeature methods: 
     59GridSeriesFeature.testmethod=ops_GridSeriesFeature.testmethod 
     60GridSeriesFeature.getAllowedSubsettings=ops_GridSeriesFeature.getAllowedSubsettings 
     61GridSeriesFeature.getDomainReference=ops_GridSeriesFeature.getDomainReference 
    4962 
    50 #Trajectory methods: 
    51 Trajectory.testmethod=ops_TrajectoryFeature.testmethod 
     63#TrajectoryFeature methods: 
     64TrajectoryFeature.testmethod=ops_TrajectoryFeature.testmethod 
Note: See TracChangeset for help on using the changeset viewer.