Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example to parse file for analyzer by user #1583

Open
shchen-idmod opened this issue Jul 6, 2021 · 0 comments
Open

example to parse file for analyzer by user #1583

shchen-idmod opened this issue Jul 6, 2021 · 0 comments
Assignees

Comments

@shchen-idmod
Copy link
Collaborator

shchen-idmod commented Jul 6, 2021

Sometime, user may need or want to parse file to analyzer by themselves
you can set parse=False like this example:(unzip first, then run_analysis_locally.py)
Analysis_local.zip.txt
example parse csv in map:

    def map(self, data, simulation):
        # retrieve sim data
        s = str(data[self.filenames[0]], 'utf-8')
        from io import StringIO
        csv_data = pd.read_csv(StringIO(s), header=None)
        df_all = self.retrieve_total_cases(csv_data, simulation, self.start_time, self.end_time)
        return df_all

example to call analyzermanager with parse=False:

    am = AnalyzeManager(platform, ids=[(exp_id, ItemType.EXPERIMENT)],
                        analyzers=[
                            TotalCasesAnalyzer(site=site, compute_likelihood=True, start_time=2007, end_time=2015,
                                               weight=1, parse=False)])
    am.analyze()
@shchen-idmod shchen-idmod changed the title example to parse file for analyzer from user self example to parse file for analyzer by user Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants