-
Notifications
You must be signed in to change notification settings - Fork 12
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
No known mechanism for handling <class 'datetime.date'> → <class 'datetime.date'>; using default #826
Comments
Could you give an example? |
If a user updates parameters for a date parameter, like # Perform the update
for key,new in pars.items():
if key not in self.keys(): # It's a new parameter and create=True: update directly
self[key] = new
else:
old = self[key] # Get the existing object we're about to update
if isinstance(old, atomic_classes): # It's a number, string, etc: update directly
self[key] = new
elif isinstance(old, Pars): # It's a Pars object: update recursively
old.update(new, create=create)
elif isinstance(old, ss.ndict): # Update module containers
self._update_ndict(key, old, new)
elif isinstance(old, ss.Module): # Update modules
self._update_module(key, old, new)
elif isinstance(old, ss.TimePar):
self._update_timepar(key, old, new)
elif isinstance(old, ss.Dist): # Update a distribution
self._update_dist(key, old, new)
elif callable(old): # It's a function: update directly
self[key] = new
elif isinstance(old, dict):
self[key] = new # Take dictionaries directly, without warning the user
else: # Everything else; not used currently but could be
warnmsg = f'No known mechanism for handling {type(old)} → {type(new)}; using default'
ss.warn(warnmsg)
self[key] = new |
One possible solution is to add |
daniel-klein
added a commit
that referenced
this issue
Jan 7, 2025
…<class 'datetime.date'>; using default #826
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: