bim2sim.kernel package
Kernel module of bim2sim
Holds central target simulation independent logic.
- exception bim2sim.kernel.IFCDomainError
Bases:
Exception
Exception raised if IFCDomain of file and element do not fit.
Subpackages
- bim2sim.kernel.decision package
BoolDecision
Decision
Decision.CANCEL
Decision.SKIP
Decision.SKIPALL
Decision.build_checksum()
Decision.convert()
Decision.deserialize_value()
Decision.freeze()
Decision.get_body()
Decision.get_options()
Decision.get_question()
Decision.get_serializable()
Decision.options
Decision.reset()
Decision.reset_from_deserialized()
Decision.serialize_value()
Decision.skip()
Decision.valid()
Decision.validate()
Decision.value
DecisionBunch
DecisionCancel
DecisionException
DecisionSkip
DecisionSkipAll
GuidDecision
ListDecision
PendingDecisionError
RealDecision
Status
StringDecision
convert()
convert_0_to_0_1()
load()
save()
- Submodules
- bim2sim.kernel.decision.console module
ConsoleDecisionHandler
ConsoleDecisionHandler.collection_progress()
ConsoleDecisionHandler.get_answers_for_bunch()
ConsoleDecisionHandler.get_body_txt()
ConsoleDecisionHandler.get_default_txt()
ConsoleDecisionHandler.get_input_txt()
ConsoleDecisionHandler.get_matches_list()
ConsoleDecisionHandler.get_options_txt()
ConsoleDecisionHandler.parse_bool_input()
ConsoleDecisionHandler.parse_guid_input()
ConsoleDecisionHandler.parse_list_input()
ConsoleDecisionHandler.parse_real_input()
ConsoleDecisionHandler.parse_string_input()
ConsoleDecisionHandler.user_input()
ConsoleDecisionHandler.user_input_live()
- bim2sim.kernel.decision.decisionhandler module
DebugDecisionHandler
DecisionHandler
DecisionHandler.decision_answer_mapping()
DecisionHandler.get_answers_for_bunch()
DecisionHandler.get_body()
DecisionHandler.get_options()
DecisionHandler.get_question()
DecisionHandler.handle()
DecisionHandler.parse()
DecisionHandler.parse_bool_input()
DecisionHandler.parse_guid_input()
DecisionHandler.parse_list_input()
DecisionHandler.parse_real_input()
DecisionHandler.parse_string_input()
DecisionHandler.shutdown()
DecisionHandler.validate()
Submodules
bim2sim.kernel.decorators module
- class bim2sim.kernel.decorators.cached_property(func, name=None, doc=None)
Bases:
property
- bim2sim.kernel.decorators.log(name)
Decorator for logging of entering and leaving method
bim2sim.kernel.ifc_file module
- class bim2sim.kernel.ifc_file.IfcFileClass(ifc_path: Path, reset_guids: bool = False, ifc_domain: IFCDomain = None)
Bases:
object
Combine IfcOpenShell file instance, finder and units together.
Especially if we handle multiple IFC files this dataclass helps us to keep track which finder and units belong to which ifc file.
- Args:
ifc_path: Pathlib object that points to ifc file reset_guids: Boolean that determine if GUIDs should be reset ifc_domain: Domain of the given ifc file if this is known
- get_ifc_units() dict
Returns dict to translate IFC units to pint units
To use units from IFC we get all unit definitions from the ifc and their corresponding measurement elements and map them to pint units.
- Returns:
dict where key is the IfcMeasurement and value the pint unit definition. e.g. ‘IfcLengthMeasure’: meter
- initialize_finder(finder_path)
- static load_ifcopenshell_file(ifc_path) file
Loads the IfcOpenShell file instance
bim2sim.kernel.log module
- class bim2sim.kernel.log.AudienceFilter(audience, name='')
Bases:
Filter
- filter(record: LogRecord) bool
Determine if the specified record is to be logged.
Returns True if the record should be logged, or False otherwise. If deemed appropriate, the record may be modified in-place.
- class bim2sim.kernel.log.CustomFormatter(fmt)
Bases:
Formatter
Custom logging design based on https://stackoverflow.com/questions/384076/how-can-i-color-python-logging-output
- format(record)
Format the specified record as text.
The record’s attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message.
- class bim2sim.kernel.log.ThreadLogFilter(thread_name, *args, **kwargs)
Bases:
Filter
This filter only show log entries for specified thread name.
- filter(record)
Determine if the specified record is to be logged.
Returns True if the record should be logged, or False otherwise. If deemed appropriate, the record may be modified in-place.
- bim2sim.kernel.log.default_logging_setup(verbose=False)
Setup for logging module
This creates the following: * the general logger with name bim2sim as default logger * the file output file bim2sim.log where the logs are stored * the logger quality_logger which stores all information about the quality of existing information of the BIM model
- bim2sim.kernel.log.get_user_logger(name)