We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This is a new error for me (and @johnarban) for newly created students when the app is first run.
For example, the app runs for student_id=4153 who already had galaxy measurements.
student_id=4153
The following errors are returned if I use create_new_student=True or student_id=4160 whom I just created to test this:
create_new_student=True
student_id=4160
--------------------------------------------------------------------------- JSONDecodeError Traceback (most recent call last) File ~/opt/anaconda3/envs/newbase/lib/python3.8/site-packages/requests/models.py:971, in Response.json(self, **kwargs) 970 try: --> 971 return complexjson.loads(self.text, **kwargs) 972 except JSONDecodeError as e: 973 # Catch JSON-related errors and raise as requests.JSONDecodeError 974 # This aliases json.JSONDecodeError and simplejson.JSONDecodeError File ~/opt/anaconda3/envs/newbase/lib/python3.8/json/__init__.py:357, in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 354 if (cls is None and object_hook is None and 355 parse_int is None and parse_float is None and 356 parse_constant is None and object_pairs_hook is None and not kw): --> 357 return _default_decoder.decode(s) 358 if cls is None: File ~/opt/anaconda3/envs/newbase/lib/python3.8/json/decoder.py:337, in JSONDecoder.decode(self, s, _w) 333 """Return the Python representation of ``s`` (a ``str`` instance 334 containing a JSON document). 335 336 """ --> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 338 end = _w(s, end).end() File ~/opt/anaconda3/envs/newbase/lib/python3.8/json/decoder.py:355, in JSONDecoder.raw_decode(self, s, idx) 354 except StopIteration as err: --> 355 raise JSONDecodeError("Expecting value", s, err.value) from None 356 return obj, end JSONDecodeError: Expecting value: line 1 column 1 (char 0) During handling of the above exception, another exception occurred: JSONDecodeError Traceback (most recent call last) Cell In[1], line 8 3 filterwarnings(action="ignore", category=UserWarning) 5 from cosmicds.app import Application ----> 8 app = Application(story='hubbles_law', update_db=True, show_team_interface=False, allow_advancing=False, create_new_student=True) 9 # app = Application(story='hubbles_law', update_db=True, show_team_interface=True, allow_advancing=True, student_id=4153) 11 app File ~/Documents/GitHub/cosmicds/cosmicds/app.py:66, in Application.__init__(self, story, *args, **kwargs) 64 self.observe(lambda x: self._setup(story, **kwargs), 'hub_user_info') 65 else: ---> 66 self._setup(story, **kwargs) File ~/Documents/GitHub/cosmicds/cosmicds/app.py:105, in Application._setup(self, story, **kwargs) 101 # print(f"Student ID: {self.student_id}") 102 # print(f"Class ID: {self.app_state.classroom['id']}") 104 self._application_handler = JupyterApplication() --> 105 self.story_state = story_registry.setup_story(story, self.session, 106 self.app_state) 108 self._get_student_options() 110 # Initialize from database File ~/Documents/GitHub/cosmicds/cosmicds/registries.py:71, in StoryRegistry.setup_story(self, name, session, app_state) 68 state["stages"] = { int(k) : v for k, v in state["stages"].items() } 69 story_state.update_from_dict(state) ---> 71 story_state.setup_for_student(app_state) 73 for k, v in sorted(story_entry['stages'].items()): 74 stage_cls = v['cls'] File ~/Documents/GitHub/hubbleds/src/hubbleds/story.py:687, in HubblesLaw.setup_for_student(self, app_state) 685 app_state.update_db = False 686 self.fetch_student_data() --> 687 self.fetch_class_data() 688 self.fetch_example_galaxy_data() File ~/Documents/GitHub/hubbleds/src/hubbleds/story.py:627, in HubblesLaw.fetch_class_data(self) 625 timestamp = floor(self.class_last_modified.timestamp() * 1000) 626 class_data_url = f"{class_data_url}?last_checked={timestamp}" --> 627 updated_meas, updated_data = self.fetch_measurement_data_and_update(class_data_url, CLASS_DATA_LABEL, prune_none=True, update_if_empty=False, check_update=check_update) 629 if updated_data is not None: 630 class_id = self.classroom["id"] File ~/Documents/GitHub/hubbleds/src/hubbleds/story.py:524, in HubblesLaw.fetch_measurement_data_and_update(self, url, label, prune_none, make_writeable, check_update, update_if_empty, callbacks) 523 def fetch_measurement_data_and_update(self, url, label, prune_none=False, make_writeable=False, check_update=None, update_if_empty=True, callbacks=None): --> 524 measurements = self.fetch_measurements(url) 525 need_update = check_update is None or check_update(measurements) 526 if not need_update: File ~/Documents/GitHub/hubbleds/src/hubbleds/story.py:520, in HubblesLaw.fetch_measurements(self, url) 518 def fetch_measurements(self, url): 519 response = requests.get(url) --> 520 res_json = response.json() 521 return res_json["measurements"] File ~/opt/anaconda3/envs/newbase/lib/python3.8/site-packages/requests/models.py:975, in Response.json(self, **kwargs) 971 return complexjson.loads(self.text, **kwargs) 972 except JSONDecodeError as e: 973 # Catch JSON-related errors and raise as requests.JSONDecodeError 974 # This aliases json.JSONDecodeError and simplejson.JSONDecodeError --> 975 raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Originally posted by @patudom in #287 (comment)
The text was updated successfully, but these errors were encountered:
@patudom Looks like this was a server-side issue which should be fixed with cosmicds/cds-api#77. Let me know if this pops up again.
Sorry, something went wrong.
Carifio24
Successfully merging a pull request may close this issue.
This is a new error for me (and @johnarban) for newly created students when the app is first run.
For example, the app runs for
student_id=4153
who already had galaxy measurements.The following errors are returned if I use
create_new_student=True
orstudent_id=4160
whom I just created to test this:Originally posted by @patudom in #287 (comment)
The text was updated successfully, but these errors were encountered: