BAM-PFA / pymm

A set of scripts for audiovisual digital preservation tasks
BSD 2-Clause "Simplified" License
5 stars 2 forks source link

idea: object-oriented ingest #7

Closed mcampos-quinn closed 5 years ago

mcampos-quinn commented 6 years ago

to do: explore ingest process as an object class with various attributes:

this would simplify some of the flow of data through the process. and i think it would also make things like database reporting much simpler.

class Ingest(argDict):
    # input args as dict per the current processingVars dict?
    # or maybe
    def __init__(self,**kwargs):
        self.ingestObject = os.path.basename(inputPath)
       self.operator = operator
       ... etc ...
    def makeDerivs(self,inputObject):
        # do stuff
    def reportDB(self, self.inputObject):
        magicCnx = dbAccess.DB(user)
        do_query(magicCnx, superSQL)

fewd for thought.

kieranjol commented 6 years ago

Yeah, very interesting...

On Sat, 21 Apr 2018, 00:27 Michael Campos-Quinn, notifications@github.com wrote:

to do: explore ingest process as an object class with various attributes:

  • object being ingested
  • status
  • other crap now in processingVars dictionary

this would simplify some of the flow of data through the process. and i think it would also make things like database reporting much simpler.

class Ingest(argDict):

input args as dict per the current processingVars dict?

# or maybe
def __init__(self,**kwargs):
    self.ingestObject = os.path.basename(inputPath)
   self.operator = operator
   ... etc ...
def makeDerivs(self,inputObject):
    # do stuff
def reportDB(self, self.inputObject):
    magicCnx = dbAccess.DB(user)
    do_query(magicCnx, superSQL)

fewd for thought.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/BAM-PFA/pymm/issues/7, or mute the thread https://github.com/notifications/unsubscribe-auth/ABEyvgiCTktEHGS_jfpkY9gKgqQJSihuks5tqm7FgaJpZM4TeNap .

kieranjol commented 5 years ago

I was thinking about this again today, I think it's the way to go..

mcampos-quinn commented 5 years ago

Yes, I think it would have been better had I started with that approach. There are some elements of the ingest process that are fairly fragile that would have been better served with an object oriented approach (transcoding of derivatives, error handling, etc.).

I'm thinking of it as a next iteration, but there are a lot of steps between here and there for my work load.

mcampos-quinn commented 5 years ago

Closing as mostly done on ingest-refactor-compact