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

Add setter for colors property #58

Merged
merged 10 commits into from
Sep 19, 2023
Merged

Conversation

chrisjonesBSU
Copy link
Member

This PR adds a way to manually set colors besides using a dictionary with particle_type:color pairings. For example, to set different colors for the first half and second half of particles by count:

Here is a quick example. It's from the welding tutorial in hoomd_organics:

sim_viewer = FresnelGSD(gsd_file="tensile.gsd", view_axis=(0, 1, 0), frame=-1, height=16)
weld_colors = np.zeros_like(sim_viewer.positions)
weld_colors[:weld_colors.shape[0]//2 + 1] = np.array([0.5, 0.25, 0.5])
weld_colors[weld_colors.shape[0]//2 + 1:] = np.array([0.5, 0.1, 0.1])
sim_viewer.colors = weld_colors

@codecov
Copy link

codecov bot commented Sep 19, 2023

Codecov Report

Merging #58 (27c6fb3) into master (d13ab94) will decrease coverage by 0.14%.
The diff coverage is 80.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #58      +/-   ##
==========================================
- Coverage   96.08%   95.95%   -0.14%     
==========================================
  Files           8        8              
  Lines         638      642       +4     
==========================================
+ Hits          613      616       +3     
- Misses         25       26       +1     
Files Changed Coverage Δ
cmeutils/visualize.py 96.89% <80.00%> (-0.47%) ⬇️

@chrisjonesBSU chrisjonesBSU merged commit 6b83bc5 into cmelab:master Sep 19, 2023
2 of 4 checks passed
@chrisjonesBSU chrisjonesBSU deleted the fresnel branch September 19, 2023 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant