-
Notifications
You must be signed in to change notification settings - Fork 3
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
Symbol storage #7
Comments
I'm quite leaning towards creating a separate object as, that would allow a better future proof solution. This object will have the following requirements:
Maybe I'm actually going for a symbols = SymbolCatalog(model_name)
symbols.add_symbol(name, description) # -> None
symbols.get_symbol_descriptor(name).used # -> False
symbols.change_symbol(name, new_symbol)
symbols[name] # -> Symbol(f'{model_name}_{name}')
symbols.get_symbol_descriptor(name).used # -> True
symbols.change_symbol(name, new_symbol) # -> raise ValueError("Symbol ... has already been used")
symbols.get_description(name) # -> description
symbols.get_description(symbol) # -> description
symbols.get_description(unknown) # -> None
# How should one add functions and coordinates and speeds Oh wait, |
While nice catalog handling would be nice, there are just too many complication due to trees and inheritance. Therefore, the approach is to go minimal and flexible. This means using normal objects like dictionaries. Classes are a bit free in what they like to use. The main approach will be to keep the hard code |
A lot of models of course use symbols to define there models. It would be ideal if there was a consistent way of storing the symbols. MoSCoW is used to prioritize the requirements:
The following requirements exist:
Symbol
for constant values.Function
, because that can also be useful, just think about the fact that someone may have a model with a time-varying input force.dynamicsymbols
), which should be accessed separately may have a model with a time-varying input force.dynamicsymbols
), which should be accessed separatelyfree_symbols
function or something, though would this also contain functions?define_objects
(M)lambdify
helper function or something (W, at least not for now).define_kinematics
, whether all generalized coordinates and speeds have been added to the system (C).There are several approaches:
q
andu
matrix, mutable or immutable depending on whether changes are allowed and such.descriptions
property to actually list all of the symbols as keys (retrieving the of the objects if necessary) and give a description for each as value.symbols
, which returns aSymbolsStorage
instance or something, which can either use internalSymbolDescriptor
's or just tuples or dictionaries.The text was updated successfully, but these errors were encountered: