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

Code Example: SRI Immunization Model #1684

Closed
ghost opened this issue Jul 6, 2017 · 3 comments
Closed

Code Example: SRI Immunization Model #1684

ghost opened this issue Jul 6, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented Jul 6, 2017

When running the sri.model.animate(21) function, I get an index error. Any help is appreciated.

screenshot 2017-07-05 18 53 26

@jlstevens
Copy link
Contributor

@senayyitbarek Thanks for reporting this!

I've started a PR (referenced above) to make fixes. The main things I had to do was use:

            path_data = [list(el[()]) for el in paths]
            # Create network path and node Elements
            network_paths = hv.Path(path_data, key_dimensions=spatial_dims)
            network_nodes = hv.Points(np.hstack([points, state_array]),
                                      key_dimensions=spatial_dims,
                                      value_dimensions=['State'])
            
            # Create overlay and accumulate in network HoloMap
            network_hmap[i] = (network_paths * network_nodes * nlabel).relabel(group='Network', label='SRI')
            self.step()

        # Create Overlay of Curves
        curves = hv.NdOverlay({label: hv.Curve(zip(range(steps), sird[:, i]),
                                               kdims=['Time'], vdims=['Count'])

In the animate loop.

The main changes are: the data format supplied to Path was invalid and key_dimensions and value_dimensions in the NdOverlay had to be changed to kdims and vdims.

@philippjfr
Copy link
Member

This has been fixed a while ago and further discussion about topics notebooks should happen in: #1638

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants