예제 #1
0
파일: node.py 프로젝트: AhmedBekhit/nilmtk
 def get_metadata(self):
     if self.results:
         metadata = deepcopy(self.upstream.get_metadata())
         results_dict = self.results.to_dict()
         recursively_update_dict(metadata, results_dict)
     else:
         # Don't bother to deepcopy upstream's metadata if 
         # we aren't going to modify it.
         metadata = self.upstream.get_metadata()
     return metadata
예제 #2
0
 def get_metadata(self):
     if self.results:
         metadata = deepcopy(self.upstream.get_metadata())
         results_dict = self.results.to_dict()
         recursively_update_dict(metadata, results_dict)
     else:
         # Don't bother to deepcopy upstream's metadata if
         # we aren't going to modify it.
         metadata = self.upstream.get_metadata()
     return metadata
예제 #3
0
파일: node.py 프로젝트: AhmedBekhit/nilmtk
    def dry_run_metadata(self):
        """Does a 'dry run' so we can validate the full pipeline before
        loading any data.

        Returns
        -------
        dict : dry run metadata
        """
        state = deepcopy(self.__class__.postconditions)
        recursively_update_dict(state, self.upstream.dry_run_metadata())
        return state
예제 #4
0
    def dry_run_metadata(self):
        """Does a 'dry run' so we can validate the full pipeline before
        loading any data.

        Returns
        -------
        dict : dry run metadata
        """
        state = deepcopy(self.__class__.postconditions)
        recursively_update_dict(state, self.upstream.dry_run_metadata())
        return state
예제 #5
0
    def dry_run_metadata(self):
        """Does a 'dry run' so we can validate the full pipeline before
        loading any data. Not to be called from outside the node system.
        Only used by the check_requirements function.
        For normal nodes it incorporates the postconditions. For the 
        source node, which is a elecmeter, it really inserts its metadata.

        Returns
        -------
        dict : dry run metadata
        """
        state = deepcopy(self.__class__.postconditions)
        recursively_update_dict(state, self.upstream.dry_run_metadata())
        return state
예제 #6
0
 def get_metadata(self):
     '''
     Recursively gets the metadata. Is the full function
     while dry_run only checks the postconditions.
     '''
     if self.results:
         metadata = deepcopy(self.upstream.get_metadata())
         results_dict = self.results.to_dict()
         recursively_update_dict(metadata, results_dict)
     else:
         # Don't bother to deepcopy upstream's metadata if
         # we aren't going to modify it.
         metadata = self.upstream.get_metadata()
     return metadata