Giter VIP home page Giter VIP logo

cosmicds's Introduction

Project generated with PyScaffold

Cosmic Data Stories

Cosmic Data Stories are online interactive resources for teaching the public data science skills. They are built on research-grade visualization tools like glue and WorldWide Telescope.

This is the base repo for all python-based Data Stories, such as HubbleDS.

Requirements

  • Python-based Cosmic Data Stories now run on solara.

Installation

  • Optional but recommended, set up a new python environment.
  • Install pip if you don't already have it.
  • If you haven't already installed it,
    $ pip install solara
  • Pull down the cosmicds repo.
  • Inside the cosmicds folder in your terminal,
    $ pip install -e .

Legacy Code

As of 4/30/2024, the voila-based code has been moved to the legacy branch.

To run the legacy code:

  • Pull down both the legacy branch and set up a new python environment.
  • In the cosmicds directory with the legacy code:
    $ pip install -e .
  • You may need to pip install any missing dependencies.
  • If you have trouble installing voila, you may need to downgrade your version of node.js to a Long Term Support (LTS) version (14.x or 16.x).

Note

This project has been set up using PyScaffold 4.5. For details and usage information on PyScaffold see https://pyscaffold.org/.

cosmicds's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cosmicds's Issues

Add functionality to display mean/median/mode on a histogram

Screen Shot 2023-07-11 at 1 26 55 PM
  • Click on box to display mean/median/mode value as a vertical line
  • Label each value as:
    Mean: ___
  • Allow data story to specify how many decimal places to display on the labels for mean/media
  • Allow data story to specify how to bin the data for the mode. (If we pass it binned in a certain way, respect the bins.)

These are handled by putting label into bqplot legend:

  • Set up the label heights so if they are all on, they don't crash into each other
  • Detect if it's too close to right side of plot and display label on left in that case.

Speech issues

I merged #195 and cosmicds/hubbleds#130 to get ready for the file renaming tomorrow, but just so we can keep track, here are some lingering speech issues I noticed in my not-extensive testing (which @Carifio24 may already know about):

  • The rate setting does not behave how I expect it should. To me, 2x means twice as fast as 1x, but at 2x, the speech was incomprehensibly fast. I chose a random blurb and timed how long it took to speak. At 1x, the duration was 31.6 sec. At 2x, it was 8.9 sec.
  • In terms of reading a long blurb in its entirety, the reader did pretty well with the default voice. However, when I switched to a different voice, I ran into the issue where random chunks of the blurb were skipped over. The different voice I chose (Alex-en-US) read significantly more slowly than the default voice, so I wonder if that caused the problem.
  • Just a suggestion - in the same way that the Google voices are prepended with Google in the dropdown, I wonder if it would help the user if we add Apple in front of the apple voices, and similarly for the Microsoft & Edge voices?

Files that keep going missing on cosmicds install

This has been happening to others too, so I'm leaving this here, so folks can know what the quick fix is if they run into this error where these 7 files go missing:

2022-09-07 Files in cosmicds repo that keep going missing

Temporary fix to the issue

IMPORTANT: Make sure you don't have any unstaged changes you don't want to lose.

To bring these files back, do
git reset --hard HEAD

"Previous" "Next" buttons don't work consistently

Navigation by the top tabs (1-4) steps through the screens as expected. If you instead use the "Next"/"Previous" buttons at the bottom of the screen, sometimes the content/graphs don't appear.

I have not been able to identify a pattern for what circumstances cause this, but @Carifio24 has observed the same behavior.

Issues for student 3174 & 3175

  1. The histogram generated from the seed data seems to very off. this is the histogram that appeared when I tested the first student. However, this doesn’t make any sense because the seed data was at 18. In the second graph you can see the correct histogram for three students

pasted image 0
pasted image 0-1

  1. The professional data does not show up for me for either student. This is from the voila version of the app (I don't know how much of this stage is built yet and my other errors are in relation to this stage so let me know if I shouldn't be looking to closely at this stage yet)
    pasted image 0-2
    pasted image 0-3
    pasted image 0-4

Implement privacy-protected process for students to access hubbleds with classroom code

Scheme to try for Fall 2023:

  • Teacher gets classroom code and enters max # of students
  • Student goes through CIlogon to get onto app -> generate random string user id -> initializes to app -> db auto generates a new student ID that is associated with that random string user ID
  • Student enters class code into a box -> puts that student into classroom with that class ID.
  • Consider capping the # of students that can be part of that class based on teacher's entered max (so if other random people get a hold of the class code, they can't get into the class). (It might be better not to put a cap. What is the worst someone can do if they randomly want to do the activity, since we've capped measurements? A cap is more likely to just cause problems.)

Components we need to build:

  • Implement code to create a new student in our db from the CIlogon user name info.
  • Verify that if we go the Solara route, that whatever oauth system we set up there will be able to connect to our db in the same way.
  • Add box for student to enter classroom code on entry to app if they are not already in a class (so they don't have to re-enter it on Day 2).
  • Implement code that connects the classroom code entered to a class in the db.

Issues we need to solve in the longer term:

  • See what issues come up in the fall rollout
  • What to do if a student uses gmail to go through oAuth on Day 1, then forgets and uses school email on Day 2 -> our system would think they are a different person.
  • If we implement a classroom cap, in the case above, that would take up 2 classroom slots, so if someone else was absent on the 1st day, they would not be able to get on after the other person messed up which account they were using.

Theming not honored for some components

Pulling this from #278 into its own issue so we don't forget about it.

I'm having a problem with the theming where the v-sheet component in the slideshow carousel has a theme--dark class applied to it when I'm in light mode. That is the only component that has the incorrect theming applied, and I can't figure out if we have a rogue dark designation somewhere, or what is causing this. If anyone can help track this down, I'd be grateful!

Screenshot 2024-05-03 at 6 54 25 PM

Lots of print statements showing up below app. Will that cause an issue on the server?

When I run the app locally as one of the beta2_15 students, I get all these print statements in the notebook below the app. Do we think they will appear below the app on the server, and should we comment them out to be safe?

WARNING:Comm:No such comm: 9a602bd9e5544f878a3adc256d0ec78d
WARNING:Comm:No such comm: 9a602bd9e5544f878a3adc256d0ec78d
WARNING:Comm:No such comm: 0be5ab95be7d4a6cbc0ac3c6934d4c6b
WARNING:Comm:No such comm: 0be5ab95be7d4a6cbc0ac3c6934d4c6b
WARNING:Comm:No such comm: 426a82415a35443fae33f076991436cb
WARNING:Comm:No such comm: 426a82415a35443fae33f076991436cb
WARNING:Comm:No such comm: 57d2efc705004472b3d21a405264d12d
WARNING:Comm:No such comm: 57d2efc705004472b3d21a405264d12d
WARNING:Comm:No such comm: d37b206cb6014845ab5ae23eace606b3
WARNING:Comm:No such comm: d37b206cb6014845ab5ae23eace606b3
WARNING:Comm:No such comm: 924bfb84b90047bc90ccf352b100fdce
WARNING:Comm:No such comm: 924bfb84b90047bc90ccf352b100fdce
WARNING:Comm:No such comm: 86cf8f3a9aa04729ad89d9058096a51c
WARNING:Comm:No such comm: 86cf8f3a9aa04729ad89d9058096a51c
WARNING:Comm:No such comm: 3f0d532280be4954beb0b02be35a9177
WARNING:Comm:No such comm: 3f0d532280be4954beb0b02be35a9177
WARNING:Comm:No such comm: 0acf8edd668242bf9a869563700e1cc6
WARNING:Comm:No such comm: 0acf8edd668242bf9a869563700e1cc6
WARNING:Comm:No such comm: 2d550e5414314154be538fc8b05f7575
WARNING:Comm:No such comm: 2d550e5414314154be538fc8b05f7575
WARNING:Comm:No such comm: f167fc0d3e0749b794634ca9b935f7ed
WARNING:Comm:No such comm: f167fc0d3e0749b794634ca9b935f7ed
WARNING:Comm:No such comm: 9488f3ddc0eb45c69a231e9dccad46cf
WARNING:Comm:No such comm: 9488f3ddc0eb45c69a231e9dccad46cf
WARNING:Comm:No such comm: 0be5ab95be7d4a6cbc0ac3c6934d4c6b
WARNING:Comm:No such comm: 0be5ab95be7d4a6cbc0ac3c6934d4c6b
WARNING:Comm:No such comm: 426a82415a35443fae33f076991436cb
WARNING:Comm:No such comm: 426a82415a35443fae33f076991436cb
WARNING:Comm:No such comm: 57d2efc705004472b3d21a405264d12d
WARNING:Comm:No such comm: 57d2efc705004472b3d21a405264d12d
WARNING:Comm:No such comm: d37b206cb6014845ab5ae23eace606b3
WARNING:Comm:No such comm: d37b206cb6014845ab5ae23eace606b3
WARNING:Comm:No such comm: 924bfb84b90047bc90ccf352b100fdce
WARNING:Comm:No such comm: 924bfb84b90047bc90ccf352b100fdce
WARNING:Comm:No such comm: 86cf8f3a9aa04729ad89d9058096a51c
WARNING:Comm:No such comm: 86cf8f3a9aa04729ad89d9058096a51c
WARNING:Comm:No such comm: 3f0d532280be4954beb0b02be35a9177
WARNING:Comm:No such comm: 3f0d532280be4954beb0b02be35a9177
WARNING:Comm:No such comm: 0acf8edd668242bf9a869563700e1cc6
WARNING:Comm:No such comm: 0acf8edd668242bf9a869563700e1cc6
WARNING:Comm:No such comm: 2d550e5414314154be538fc8b05f7575
WARNING:Comm:No such comm: 2d550e5414314154be538fc8b05f7575
WARNING:Comm:No such comm: f167fc0d3e0749b794634ca9b935f7ed
WARNING:Comm:No such comm: f167fc0d3e0749b794634ca9b935f7ed
WARNING:Comm:No such comm: 9488f3ddc0eb45c69a231e9dccad46cf
WARNING:Comm:No such comm: 9488f3ddc0eb45c69a231e9dccad46cf
WARNING:Comm:No such comm: 0be5ab95be7d4a6cbc0ac3c6934d4c6b
WARNING:Comm:No such comm: 0be5ab95be7d4a6cbc0ac3c6934d4c6b
WARNING:Comm:No such comm: 426a82415a35443fae33f076991436cb
WARNING:Comm:No such comm: 426a82415a35443fae33f076991436cb
WARNING:Comm:No such comm: 57d2efc705004472b3d21a405264d12d
WARNING:Comm:No such comm: 57d2efc705004472b3d21a405264d12d
WARNING:Comm:No such comm: d37b206cb6014845ab5ae23eace606b3
WARNING:Comm:No such comm: d37b206cb6014845ab5ae23eace606b3
WARNING:Comm:No such comm: 924bfb84b90047bc90ccf352b100fdce
WARNING:Comm:No such comm: 924bfb84b90047bc90ccf352b100fdce
WARNING:Comm:No such comm: 86cf8f3a9aa04729ad89d9058096a51c
WARNING:Comm:No such comm: 86cf8f3a9aa04729ad89d9058096a51c
WARNING:Comm:No such comm: 3f0d532280be4954beb0b02be35a9177
WARNING:Comm:No such comm: 3f0d532280be4954beb0b02be35a9177
WARNING:Comm:No such comm: 0acf8edd668242bf9a869563700e1cc6
WARNING:Comm:No such comm: 0acf8edd668242bf9a869563700e1cc6
WARNING:Comm:No such comm: 2d550e5414314154be538fc8b05f7575
WARNING:Comm:No such comm: 2d550e5414314154be538fc8b05f7575
WARNING:Comm:No such comm: f167fc0d3e0749b794634ca9b935f7ed
WARNING:Comm:No such comm: f167fc0d3e0749b794634ca9b935f7ed
WARNING:Comm:No such comm: 9488f3ddc0eb45c69a231e9dccad46cf
WARNING:Comm:No such comm: 9488f3ddc0eb45c69a231e9dccad46cf
WARNING:Comm:No such comm: 0be5ab95be7d4a6cbc0ac3c6934d4c6b
WARNING:Comm:No such comm: 0be5ab95be7d4a6cbc0ac3c6934d4c6b
WARNING:Comm:No such comm: 426a82415a35443fae33f076991436cb
WARNING:Comm:No such comm: 426a82415a35443fae33f076991436cb
WARNING:Comm:No such comm: 57d2efc705004472b3d21a405264d12d
WARNING:Comm:No such comm: 57d2efc705004472b3d21a405264d12d
WARNING:Comm:No such comm: d37b206cb6014845ab5ae23eace606b3
WARNING:Comm:No such comm: d37b206cb6014845ab5ae23eace606b3
WARNING:Comm:No such comm: 924bfb84b90047bc90ccf352b100fdce
WARNING:Comm:No such comm: 924bfb84b90047bc90ccf352b100fdce
WARNING:Comm:No such comm: 86cf8f3a9aa04729ad89d9058096a51c
WARNING:Comm:No such comm: 86cf8f3a9aa04729ad89d9058096a51c
WARNING:Comm:No such comm: 3f0d532280be4954beb0b02be35a9177
WARNING:Comm:No such comm: 3f0d532280be4954beb0b02be35a9177
WARNING:Comm:No such comm: 0acf8edd668242bf9a869563700e1cc6
WARNING:Comm:No such comm: 0acf8edd668242bf9a869563700e1cc6
WARNING:Comm:No such comm: 2d550e5414314154be538fc8b05f7575
WARNING:Comm:No such comm: 2d550e5414314154be538fc8b05f7575
WARNING:Comm:No such comm: f167fc0d3e0749b794634ca9b935f7ed
WARNING:Comm:No such comm: f167fc0d3e0749b794634ca9b935f7ed
WARNING:Comm:No such comm: 9488f3ddc0eb45c69a231e9dccad46cf
WARNING:Comm:No such comm: 9488f3ddc0eb45c69a231e9dccad46cf
WARNING:Comm:No such comm: 0be5ab95be7d4a6cbc0ac3c6934d4c6b
WARNING:Comm:No such comm: 0be5ab95be7d4a6cbc0ac3c6934d4c6b
WARNING:Comm:No such comm: 426a82415a35443fae33f076991436cb
WARNING:Comm:No such comm: 426a82415a35443fae33f076991436cb
WARNING:Comm:No such comm: 57d2efc705004472b3d21a405264d12d
WARNING:Comm:No such comm: 57d2efc705004472b3d21a405264d12d
WARNING:Comm:No such comm: d37b206cb6014845ab5ae23eace606b3
WARNING:Comm:No such comm: d37b206cb6014845ab5ae23eace606b3
WARNING:Comm:No such comm: 924bfb84b90047bc90ccf352b100fdce
WARNING:Comm:No such comm: 924bfb84b90047bc90ccf352b100fdce
WARNING:Comm:No such comm: 86cf8f3a9aa04729ad89d9058096a51c
WARNING:Comm:No such comm: 86cf8f3a9aa04729ad89d9058096a51c
WARNING:Comm:No such comm: 3f0d532280be4954beb0b02be35a9177
WARNING:Comm:No such comm: 3f0d532280be4954beb0b02be35a9177
WARNING:Comm:No such comm: 0acf8edd668242bf9a869563700e1cc6
WARNING:Comm:No such comm: 0acf8edd668242bf9a869563700e1cc6
WARNING:Comm:No such comm: 2d550e5414314154be538fc8b05f7575
WARNING:Comm:No such comm: 2d550e5414314154be538fc8b05f7575
WARNING:Comm:No such comm: f167fc0d3e0749b794634ca9b935f7ed
WARNING:Comm:No such comm: f167fc0d3e0749b794634ca9b935f7ed
WARNING:Comm:No such comm: 9488f3ddc0eb45c69a231e9dccad46cf

Update mc_radiogroup tries and scoring

New plan:

  • Neutral responses should also increment ntries.
  • Track wrong_tries and use that to calculate scores.

(See google doc that I sent on Slack for more details)

Spectrum Tool functionality in python

We decided it would be simpler to re-create the Spectrum Tool functionality in python rather than trying to fit the .js (#19) code into the ipyvuetify framework of the app. (Also, the .js code is more complex than we need it to be.)

At minimum:

  • Viewer should display a line plot of Flux vs. Wavelength. (See #27 for sample data file)
  • A moveable vertical line will serve as a wavelength measuring tool that can be clicked to read off the wavelength of a given emission/absorption line (like H-alpha)

If possible:

  • Recreate functionality to display the spectrum color image above the graph to show the corresponding wavelength colors with high/low brightness that corresponds to the flux at that wavelength. (@heywooddogwood had a suggestion for how to implement this that I didn't fully understand because I am not familiar with the different schemes for specifying colors in hex RGB, etc. Harry, feel free to add your suggestion here as a comment.)

Alyssa suggested we look at Plotly Dash as a way to easily create the plot + wavelength readout functionality, but I am open to other suggestions.

Lingering issues with percentage and stats selector functionality

We are merging in #243 for now, but I'm noting here some issues that still remain with its functionality.

  • When you have a stat displayed and then click on a percentage range, the stat marker remains in the top viewer, but disappears in the 2nd viewer.
Screen Shot 2023-07-15 at 11 54 58 AM
  • The percentage selector is not handling small class size correctly. I would expect the inner 50% of data for 6 students to include 3 or 4 values. This is displaying 5 values.
Screen Shot 2023-07-15 at 11 28 59 AM

Add NASA partner logo & acknowledgement (probably in footer)

This is a link to the NASA partner logo (which must be used as is - we are not supposed to crop it.):
https://static1.squarespace.com/static/5d9624740c5b607d9c914161/t/5eb5a499f3cd061ead12c082/1588962457899/NASA_Partner_color_300_no_outline.png

Acknowledgement/Disclaimer text:
The material contained on this website is based upon work supported by NASA under award No. 80NSSC21M0002. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Aeronautics and Space Administration.

"Generate Best Fit" requires 2 clicks to activate

In the HubbleDS app, on screen 2 ("Estimate Age of Universe"), you have to click "Generate Best Fit" twice to make the line appear.

This only happens the first time you run the app/jupyter notebook. After that, the line will appear after only 1 click, even after restarting the kernel and rerunning the cell.

If you bypass screen 2 and jump ahead to screen 3 ("Explore Class Data"), the "Fit Lines" button on that page works on one click. If you then back up to screen 2, you only have to click the generate best fit button once.

Fall 2023 deployment plan

Decide if Fall 2023 teachers will use Solara-wrapped version of Hubble (which requires):

  • glupyter hooks to Solara
  • pyWWT hooks to Solara
  • Mount entire hubbleds app as an ipywidget

or 2i2c Hub:

  • Cryptomining insecurity - can we get around requirement to have teacher upload lists of student emails?
  • Can we white-list email domains on a school by school basis?
  • Figure out why 2i2c hub is not consistently interfacing with our db

Update percent/stats label layout

Add an extra space above the viewer to place the label text. The issue with that plan is how to transition gracefully between not having labels displayed vs. having labels displayed.

Experiment with possible solutions to see how they feel. Off the bat, Option 1 seems like the best bet:

  1. Set it up with an animated transition when the label goes on, so when the viewer changes size it's not an abrupt shift.
  2. Set it up with the title bar below the graph (which might look weird under the x axis label text).
  3. Set it up with the extra space available, so when the labels are turned on, the viewer size doesn't jump up and down. Disadvantage is it would look awkward to have a large blank space between the title bar and viewer when there is no label.
Screen Shot 2023-08-04 at 12 06 25 PM

Component state not updating

So while working on something earlier, I noticed an issue with the stage of the guideline components in stage one not updating. See the video below - the app doesn't move to the second selection guideline when I select a galaxy, and the third guideline still thinks I need 5 galaxies when I've already added one:

state-not-updating.mp4

I tried restarting what I was doing, starting with a fresh environment, etc, but this issue continued to persist in both the notebook and voila, which was pretty puzzling since this worked perfectly fine in the beta and we haven't made any real changes to this stage since then. Note that changes to state controlled directly by the stage template itself seem fine, but the changes controlled in component templates aren't working.

After a bit of investigation, it seems to me that this issue pops up with glue_jupyter >= 0.14.1. Downgrading to 0.14.0 makes everything work fine again. Looking at the changes from that release, I think the particular update that's affecting this is glue-viz/glue-jupyter#325.

I'm not sure exactly why this breaks our updating. The linked PR prevents sending an update if the serialized JSON of the state hasn't changed. Maybe this works fine for updating the stage itself, but necessary subsequent updates needed for component frontends aren't getting sent? The other question is whether there's something in our usage pattern that's bad and needs updating, or whether we just want to work around this.

Anyways, the easiest things to do until we get to the bottom of this are:

  1. Pin glue_jupyter <= 0.14.0. This is quick and easy, but very obviously not a long-term solution, since this is one of our most important dependencies and we'll want future updates.
  2. Create our own subclass of GlueState and override on_state_change to use the old implementation there.

@nmearl Would be curious if you have any thoughts on this

@patudom @johnarban Which version of glue-jupyter are you using in your environment? Have either of you noticed this issue?

Create system for parsing question text to populate educator dashboard

Desired behavior:

  • We need a database that stores the full questions and the short versions of the questions that populate the educator dashboard, so they know what questions are associated with which answers.
  • Teacher can select if they want the long version or short version of the questions displayed when they look at student data
  • Story name is a column in the table that gets pulled by the dashboard.

Short term plan for Hubble:

  • Write a simple analyzer/text parser that can pull the appropriately tagged question text and short-hand version of question into the database table. Add a column that has version that is defaulted to 1.
  • If we change a question significantly, we give it a new tag.
  • We remember to run the analyzer any time we change the questions & it regenerates the tag + question + short question table.
  • We submit the new table to the backend server.
  • There is a check. If a tag has different text than it did before, it adds a new entry and increments the version # associated with that tag and has a timestamp for when that new version was put in.
  • If a tag and text are the same, the server does nothing.
  • If there is a new tag associated with a new question, that goes into the db with version 1 and a timestamp.

Longer term plan for Solara-based new stories:

  • Approach will be the same. We will need to rewrite the analyzer to account for the structure of the solara-based guidelines.

TemplateNotFound error when installing in editable mode

With both the CosmicDS and HubbleDS repositories installed in editable mode, running cosmicds hubble will produce a TemplateNotFound error, even though the template file exists.

Example steps to reproduce:

conda create --name my-env -y python=3.9
conda activate my-env
git clone https://github.com/cosmicds/hubbleds.git
git clone https://github.com/cosmicds/cosmicds.git
cd hubbleds
pip install -e .
cd ../cosmicds
pip install -e .
cosmicds hubble

An example error message (my environment here is called state-testing):

Task exception was never retrieved
future: <Task finished name='Task-9' coro=<NotebookRenderer.generate_content_hybrid() done, defined at /home/jon/opt/anaconda3/envs/state-testing/lib/python3.9/site-packages/voila/notebook_renderer.py:174> exception=TemplateNotFound('index.html.j2')>
Traceback (most recent call last):
  File "/home/jon/opt/anaconda3/envs/state-testing/lib/python3.9/site-packages/voila/notebook_renderer.py", line 185, in generate_content_hybrid
    async for html_snippet, _ in generator:
  File "/home/jon/opt/anaconda3/envs/state-testing/lib/python3.9/site-packages/voila/exporter.py", line 101, in generate_from_notebook_node
    async for output in self.template.generate_async(nb=nb_copy, resources=resources, **extra_context, static_url=self.static_url):
  File "/home/jon/opt/anaconda3/envs/state-testing/lib/python3.9/site-packages/nbconvert/exporters/templateexporter.py", line 160, in template
    self._template_cached = self._load_template()
  File "/home/jon/opt/anaconda3/envs/state-testing/lib/python3.9/site-packages/nbconvert/exporters/templateexporter.py", line 383, in _load_template
    return self.environment.get_template(template_file)
  File "/home/jon/.local/lib/python3.9/site-packages/jinja2/environment.py", line 996, in get_template
    return self._load_template(name, globals)
  File "/home/jon/.local/lib/python3.9/site-packages/jinja2/environment.py", line 957, in _load_template
    template = self.loader.load(self, name, self.make_globals(globals))
  File "/home/jon/.local/lib/python3.9/site-packages/jinja2/loaders.py", line 556, in load
    raise TemplateNotFound(name)
jinja2.exceptions.TemplateNotFound: index.html.j2

I'm seeing this issue on my machine, and I know @patudom has experienced this as well. I think the issue is potentially related to editable mode somehow, as everything works fine if I install directly from git (e.g. pip install git+https://github.com/cosmicds/hubbleds.git and pip install git+https://github.com/cosmicds/cosmicds.git).

I'm looking into this issue, but @nmearl if you have any thoughts that'd be great.

dot plot x ranges out of sync

This seems to only happen with #217 (which I just merged into main). In Stage 3, the x-ranges for the first and 2nd distance measurement dot plots are no longer synchronized.
Screen Shot 2023-04-28 at 3 57 37 PM

WWT controls & linked data selection

The main idea of this issue is to give us a place to discuss any issues we have with the glue-wwt viewer. I think I showed some of these at a previous meeting, but here are a few basic code snippets for controlling the WWT widget.

To access the WWT viewer from the prototype app:

wwt_viewer = app._viewer_handlers['wwt_viewer']

We can access the WWTJupyterWidget that lives in the viewer using the _wwt member value:

wwt_widget = wwt_viewer._wwt

The WWT viewer provides methods for obtaining the current field of view and the center (RA, Dec) of the viewport:

field_of_view = wwt_widget.get_fov()
center = wwt_widget.get_center()
ra, dec = center.ra, center.dec     # as astropy.coordinates.angles.Longitude, astropy.coordinates.angles.Latitude
ra_deg, dec_deg = ra.deg, dec.deg   # value in degrees

We can directly add annotations via Python:

# Circles
circle = wwt_widget.add_circle(center)   # Center is an astropy.units.Quantity object
circle = wwt_widget.add_circle()  # Center is the current viewport center
circle.set_center()  # Change center

# Polygons
polygon = wwt_widget.add_polygon(points) # points is an astropy.units.Quantity object

## We can add points later
polygon.add_points(points)

# Lines work similarly to polygons
line = wwt_widget.add_line(points)
line.add_points(points)

Installation on Windows not working

On some Windows computers, the installation runs with no errors, but "cosmicds hubble" does nothing. (On another Windows computer, the browser opened but had a 404 error.)

@nmearl, we had asked @pkgw about this earlier, so he is also looking into possible causes. I wanted to make sure you are both on the same page and not duplicating efforts. Thanks!

State testing issues

This issue is for reporting bugs noticed during state testing (for more info, see the wiki page here). Please leave a comment here for each issue noticed.

I don't have any sort of guidelines nailed down yet, but a report should at least include:

• The student ID number
• A description of what aspect of the story wasn't properly recreated. Any relevant screenshots would be great.

Known issues:
• The state of the WWT viewer on stage 2 is not recreated (e.g. if you were doing a distance measurement)

Additional requests for simulated Hubble data displays

This relates to the code for generating simulated Hubble data in #4.

  • Age calculations in "HubbleSummary_Overall.csv" should be fixed, per our conversation today.

  • Please also add an additional output file called "HubbleSummary_All.csv" that concatenates all the outputs of "HubbleSummary_Class_.csv" (without duplicating the headers). (I did this by hand and can submit a PR to add my file to the output folder, but it would be nice to have it generated automatically if we re-run the simulation).

  • Screens 1 & 2 should display 1 student's data

  • Screen 3 should allow options to display 1 student's data, their class's data, and all public data from the simulation.

  • Screen 4+ should display the histogram data we discussed today (in figure below).

2021-08-11 Histogram schematics

Build "Draw a Fit Line" functionality

On Screen 2 ("Estimate Age of Universe"), "Draw a Fit Line" button should behave as follows:

  • Turn on interface that lets user click and drag mouse between end points of their desired fit line.
  • We will tell user that the line needs to start at the origin, so the drawn line should always be anchored to origin at one end point
  • There can be a preview line that follows their mouse (at the non-origin endpoint), and the line will "snap" into place when user releases mouse.
  • Button text changes to "Edit Fit Line"
  • If user clicks "Edit Fit Line", they can then reselect the non-origin end-point and adjust it to a new location.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.