Ejemplo n.º 1
0
    def load_data(self, input_file: str) -> None:
        # load data
        data = SaveAndLoad.load_data(input_file)
        self.frames = data["frames"]
        self.simulation_params = data["parameters"]

        log.info("Processor: Got %d frames" % len(self.frames))
    def load_data(self, simulation_data_file: str,
                  processing_dir: str) -> None:
        # decide which data is necessary
        data_to_fetch = set()
        for drawable in self.to_draw:
            required_data = drawable_to_data[drawable]
            for data in required_data:
                data_to_fetch.add(data)
        if self.options["quiver_color_by_group"] or self.options[
                "quiver_draw_by_group"]:
            data_to_fetch.add("groups")

        # load data
        self.processed_data = {}
        if "_simulation" in data_to_fetch:
            self.processed_data["_simulation"] = SaveAndLoad.load_data(
                simulation_data_file)
            data_to_fetch.remove("_simulation")
        for property_name in data_to_fetch:
            self.processed_data[property_name] = SaveAndLoad.load_data_dirname(
                processing_dir, "%s.json" % property_name)
        self.simulation_parameters = SaveAndLoad.load_data_dirname(
            processing_dir, "processing_parameters.json")