section
stringlengths
2
30
filename
stringlengths
1
82
text
stringlengths
783
28M
api
cohort
import csv import json from datetime import datetime from typing import Any, Dict, cast import posthoganalytics from django.conf import settings from django.db.models import QuerySet from django.db.models.expressions import F from django.utils import timezone from posthog.api.forbid_destroy_model import ForbidDestroyModel from posthog.api.person import get_funnel_actor_class from posthog.api.routing import StructuredViewSetMixin from posthog.api.shared import UserBasicSerializer from posthog.api.utils import get_target_entity from posthog.client import sync_execute from posthog.constants import ( CSV_EXPORT_LIMIT, INSIGHT_FUNNELS, INSIGHT_LIFECYCLE, INSIGHT_PATHS, INSIGHT_STICKINESS, INSIGHT_TRENDS, LIMIT, OFFSET, ) from posthog.event_usage import report_user_action from posthog.hogql.context import HogQLContext from posthog.metrics import LABEL_TEAM_ID from posthog.models import Cohort, FeatureFlag, Person, User from posthog.models.async_deletion import AsyncDeletion, DeletionType from posthog.models.cohort.util import get_dependent_cohorts from posthog.models.filters.filter import Filter from posthog.models.filters.lifecycle_filter import LifecycleFilter from posthog.models.filters.path_filter import PathFilter from posthog.models.filters.stickiness_filter import StickinessFilter from posthog.models.person.sql import ( INSERT_COHORT_ALL_PEOPLE_THROUGH_PERSON_ID, PERSON_STATIC_COHORT_TABLE, ) from posthog.permissions import ( ProjectMembershipNecessaryPermissions, TeamMemberAccessPermission, ) from posthog.queries.actor_base_query import ( ActorBaseQuery, get_people, serialize_people, ) from posthog.queries.insight import insight_sync_execute from posthog.queries.paths import PathsActors from posthog.queries.person_query import PersonQuery from posthog.queries.stickiness import StickinessActors from posthog.queries.trends.lifecycle_actors import LifecycleActors from posthog.queries.trends.trends_actors import TrendsActors from posthog.queries.util import get_earliest_timestamp from posthog.renderers import SafeJSONRenderer from posthog.tasks.calculate_cohort import ( calculate_cohort_from_list, insert_cohort_from_insight_filter, update_cohort, ) from posthog.utils import format_query_params_absolute_url from prometheus_client import Counter from rest_framework import serializers, viewsets from rest_framework.decorators import action from rest_framework.exceptions import ValidationError from rest_framework.permissions import IsAuthenticated from rest_framework.request import Request from rest_framework.response import Response from rest_framework.settings import api_settings from rest_framework_csv import renderers as csvrenderers from sentry_sdk.api import capture_exception API_COHORT_PERSON_BYTES_READ_FROM_POSTGRES_COUNTER = Counter( "api_cohort_person_bytes_read_from_postgres", "An estimate of how many bytes we've read from postgres to service person cohort endpoint.", labelnames=[LABEL_TEAM_ID], ) class CohortSerializer(serializers.ModelSerializer): created_by = UserBasicSerializer(read_only=True) earliest_timestamp_func = get_earliest_timestamp class Meta: model = Cohort fields = [ "id", "name", "description", "groups", "deleted", "filters", "is_calculating", "created_by", "created_at", "last_calculation", "errors_calculating", "count", "is_static", ] read_only_fields = [ "id", "is_calculating", "created_by", "created_at", "last_calculation", "errors_calculating", "count", ] def _handle_static(self, cohort: Cohort, context: Dict) -> None: request = self.context["request"] if request.FILES.get("csv"): self._calculate_static_by_csv(request.FILES["csv"], cohort) else: filter_data = request.GET.dict() existing_cohort_id = context.get("from_cohort_id") if existing_cohort_id: filter_data = {**filter_data, "from_cohort_id": existing_cohort_id} if filter_data: insert_cohort_from_insight_filter.delay(cohort.pk, filter_data) def create(self, validated_data: Dict, *args: Any, **kwargs: Any) -> Cohort: request = self.context["request"] validated_data["created_by"] = request.user if not validated_data.get("is_static"): validated_data["is_calculating"] = True cohort = Cohort.objects.create( team_id=self.context["team_id"], **validated_data ) if cohort.is_static: self._handle_static(cohort, self.context) else: update_cohort(cohort) report_user_action( request.user, "cohort created", cohort.get_analytics_metadata() ) return cohort def _calculate_static_by_csv(self, file, cohort: Cohort) -> None: decoded_file = file.read().decode("utf-8").splitlines() reader = csv.reader(decoded_file) distinct_ids_and_emails = [row[0] for row in reader if len(row) > 0 and row] calculate_cohort_from_list.delay(cohort.pk, distinct_ids_and_emails) def validate_filters(self, request_filters: Dict): if isinstance(request_filters, dict) and "properties" in request_filters: if self.context["request"].method == "PATCH": parsed_filter = Filter(data=request_filters) instance = cast(Cohort, self.instance) cohort_id = instance.pk flags: QuerySet[FeatureFlag] = FeatureFlag.objects.filter( team_id=self.context["team_id"], active=True, deleted=False ) cohort_used_in_flags = ( len([flag for flag in flags if cohort_id in flag.get_cohort_ids()]) > 0 ) for prop in parsed_filter.property_groups.flat: if prop.type == "behavioral": if cohort_used_in_flags: raise serializers.ValidationError( detail=f"Behavioral filters cannot be added to cohorts used in feature flags.", code="behavioral_cohort_found", ) if prop.type == "cohort": nested_cohort = Cohort.objects.get(pk=prop.value) dependent_cohorts = get_dependent_cohorts(nested_cohort) for dependent_cohort in [nested_cohort, *dependent_cohorts]: if ( cohort_used_in_flags and len( [ prop for prop in dependent_cohort.properties.flat if prop.type == "behavioral" ] ) > 0 ): raise serializers.ValidationError( detail=f"A dependent cohort ({dependent_cohort.name}) has filters based on events. These cohorts can't be used in feature flags.", code="behavioral_cohort_found", ) return request_filters else: raise ValidationError( "Filters must be a dictionary with a 'properties' key." ) def update( self, cohort: Cohort, validated_data: Dict, *args: Any, **kwargs: Any ) -> Cohort: # type: ignore request = self.context["request"] user = cast(User, request.user) cohort.name = validated_data.get("name", cohort.name) cohort.description = validated_data.get("description", cohort.description) cohort.groups = validated_data.get("groups", cohort.groups) cohort.is_static = validated_data.get("is_static", cohort.is_static) cohort.filters = validated_data.get("filters", cohort.filters) deleted_state = validated_data.get("deleted", None) is_deletion_change = ( deleted_state is not None and cohort.deleted != deleted_state ) if is_deletion_change: cohort.deleted = deleted_state if deleted_state: AsyncDeletion.objects.get_or_create( deletion_type=DeletionType.Cohort_full, team_id=cohort.team.pk, key=f"{cohort.pk}_{cohort.version}", created_by=user, ) else: AsyncDeletion.objects.filter( deletion_type=DeletionType.Cohort_full, team_id=cohort.team.pk, key=f"{cohort.pk}_{cohort.version}", ).delete() elif not cohort.is_static: cohort.is_calculating = True if will_create_loops(cohort): raise ValidationError("Cohorts cannot reference other cohorts in a loop.") cohort.save() if not deleted_state: if cohort.is_static: # You can't update a static cohort using the trend/stickiness thing if request.FILES.get("csv"): self._calculate_static_by_csv(request.FILES["csv"], cohort) else: update_cohort(cohort) report_user_action( request.user, "cohort updated", { **cohort.get_analytics_metadata(), "updated_by_creator": request.user == cohort.created_by, }, ) return cohort def to_representation(self, instance): representation = super().to_representation(instance) representation["filters"] = ( instance.filters if instance.filters else {"properties": instance.properties.to_dict()} ) return representation class CohortViewSet(StructuredViewSetMixin, ForbidDestroyModel, viewsets.ModelViewSet): queryset = Cohort.objects.all() serializer_class = CohortSerializer permission_classes = [ IsAuthenticated, ProjectMembershipNecessaryPermissions, TeamMemberAccessPermission, ] def get_queryset(self) -> QuerySet: queryset = super().get_queryset() if self.action == "list": queryset = queryset.filter(deleted=False) return queryset.prefetch_related("created_by", "team").order_by("-created_at") @action( methods=["GET"], detail=True, ) def duplicate_as_static_cohort(self, request: Request, **kwargs) -> Response: cohort: Cohort = self.get_object() team = self.team if cohort.is_static: raise ValidationError( "Cannot duplicate a static cohort as a static cohort." ) cohort_serializer = CohortSerializer( data={ "name": f"{cohort.name} (static copy)", "is_static": True, }, context={ "request": request, "from_cohort_id": cohort.pk, "team_id": team.pk, }, ) cohort_serializer.is_valid(raise_exception=True) cohort_serializer.save() return Response(cohort_serializer.data) @action( methods=["GET"], detail=True, renderer_classes=[ *api_settings.DEFAULT_RENDERER_CLASSES, csvrenderers.PaginatedCSVRenderer, ], ) def persons(self, request: Request, **kwargs) -> Response: cohort: Cohort = self.get_object() team = self.team filter = Filter(request=request, team=self.team) assert request.user.is_authenticated is_csv_request = ( self.request.accepted_renderer.format == "csv" or request.GET.get("is_csv_export") ) if is_csv_request and not filter.limit: filter = filter.shallow_clone({LIMIT: CSV_EXPORT_LIMIT, OFFSET: 0}) elif not filter.limit: filter = filter.shallow_clone({LIMIT: 100}) if posthoganalytics.feature_enabled( "load-person-fields-from-clickhouse", request.user.distinct_id, person_properties={"email": request.user.email}, ): person_query = PersonQuery( filter, team.pk, cohort=cohort, extra_fields=[ "created_at", "properties", "is_identified", ], include_distinct_ids=True, ) paginated_query, paginated_params = person_query.get_query( paginate=True, filter_future_persons=True ) serialized_actors = insight_sync_execute( paginated_query, {**paginated_params, **filter.hogql_context.values}, filter=filter, query_type="cohort_persons", team_id=team.pk, ) persons = [] for p in serialized_actors: person = Person( uuid=p[0], created_at=p[1], is_identified=p[2], properties=json.loads(p[3]), ) person._distinct_ids = p[4] persons.append(person) serialized_actors = serialize_people(team, data=persons) _should_paginate = len(serialized_actors) >= filter.limit else: query, params = PersonQuery(filter, team.pk, cohort=cohort).get_query( paginate=True ) raw_result = sync_execute(query, {**params, **filter.hogql_context.values}) actor_ids = [row[0] for row in raw_result] actors, serialized_actors = get_people( team, actor_ids, distinct_id_limit=10 ) _should_paginate = len(actor_ids) >= filter.limit next_url = ( format_query_params_absolute_url(request, filter.offset + filter.limit) if _should_paginate else None ) previous_url = ( format_query_params_absolute_url(request, filter.offset - filter.limit) if filter.offset - filter.limit >= 0 else None ) if is_csv_request: KEYS_ORDER = [ "id", "email", "name", "created_at", "properties", "distinct_ids", ] DELETE_KEYS = [ "value_at_data_point", "uuid", "type", "is_identified", "matched_recordings", ] for actor in serialized_actors: if actor["properties"].get("email"): actor["email"] = actor["properties"]["email"] del actor["properties"]["email"] serialized_actors = [ { k: v for k, v in sorted( actor.items(), key=lambda item: KEYS_ORDER.index(item[0]) if item[0] in KEYS_ORDER else 999999, ) if k not in DELETE_KEYS } for actor in serialized_actors ] # TEMPORARY: Work out usage patterns of this endpoint renderer = SafeJSONRenderer() size = len(renderer.render(serialized_actors)) API_COHORT_PERSON_BYTES_READ_FROM_POSTGRES_COUNTER.labels(team_id=team.pk).inc( size ) return Response( {"results": serialized_actors, "next": next_url, "previous": previous_url} ) class LegacyCohortViewSet(CohortViewSet): legacy_team_compatibility = True def will_create_loops(cohort: Cohort) -> bool: # Loops can only be formed when trying to update a Cohort, not when creating one team_id = cohort.team_id # We can model this as a directed graph, where each node is a Cohort and each edge is a reference to another Cohort # There's a loop only if there's a cycle in the directed graph. The "directed" bit is important. # For example, if Cohort A exists, and Cohort B references Cohort A, and Cohort C references both Cohort A & B # then, there's no cycle, because we can compute cohort A, using which we can compute cohort B, using which we can compute cohort C. # However, if cohort A depended on Cohort C, then we'd have a cycle, because we can't compute Cohort A without computing Cohort C, and on & on. # For a good explainer of this algorithm, see: https://www.geeksforgeeks.org/detect-cycle-in-a-graph/ def dfs_loop_helper(current_cohort: Cohort, seen_cohorts, cohorts_on_path): seen_cohorts.add(current_cohort.pk) cohorts_on_path.add(current_cohort.pk) for property in current_cohort.properties.flat: if property.type == "cohort": if property.value in cohorts_on_path: return True elif property.value not in seen_cohorts: try: nested_cohort = Cohort.objects.get( pk=property.value, team_id=team_id ) except Cohort.DoesNotExist: raise ValidationError("Invalid Cohort ID in filter") if dfs_loop_helper(nested_cohort, seen_cohorts, cohorts_on_path): return True cohorts_on_path.remove(current_cohort.pk) return False return dfs_loop_helper(cohort, set(), set()) def insert_cohort_people_into_pg(cohort: Cohort): ids = sync_execute( "SELECT person_id FROM {} where team_id = %(team_id)s AND cohort_id = %(cohort_id)s".format( PERSON_STATIC_COHORT_TABLE ), {"cohort_id": cohort.pk, "team_id": cohort.team.pk}, ) cohort.insert_users_list_by_uuid(items=[str(id[0]) for id in ids]) def insert_cohort_actors_into_ch(cohort: Cohort, filter_data: Dict): from_existing_cohort_id = filter_data.get("from_cohort_id") context: HogQLContext if from_existing_cohort_id: existing_cohort = Cohort.objects.get(pk=from_existing_cohort_id) query = """ SELECT DISTINCT person_id as actor_id FROM cohortpeople WHERE team_id = %(team_id)s AND cohort_id = %(from_cohort_id)s AND version = %(version)s ORDER BY person_id """ params = { "team_id": cohort.team.pk, "from_cohort_id": existing_cohort.pk, "version": existing_cohort.version, } context = Filter(data=filter_data, team=cohort.team).hogql_context else: insight_type = filter_data.get("insight") query_builder: ActorBaseQuery if insight_type == INSIGHT_TRENDS: filter = Filter(data=filter_data, team=cohort.team) entity = get_target_entity(filter) query_builder = TrendsActors(cohort.team, entity, filter) context = filter.hogql_context elif insight_type == INSIGHT_STICKINESS: stickiness_filter = StickinessFilter(data=filter_data, team=cohort.team) entity = get_target_entity(stickiness_filter) query_builder = StickinessActors(cohort.team, entity, stickiness_filter) context = stickiness_filter.hogql_context elif insight_type == INSIGHT_FUNNELS: funnel_filter = Filter(data=filter_data, team=cohort.team) funnel_actor_class = get_funnel_actor_class(funnel_filter) query_builder = funnel_actor_class(filter=funnel_filter, team=cohort.team) context = funnel_filter.hogql_context elif insight_type == INSIGHT_PATHS: path_filter = PathFilter(data=filter_data, team=cohort.team) query_builder = PathsActors(path_filter, cohort.team, funnel_filter=None) context = path_filter.hogql_context elif insight_type == INSIGHT_LIFECYCLE: lifecycle_filter = LifecycleFilter(data=filter_data, team=cohort.team) query_builder = LifecycleActors(team=cohort.team, filter=lifecycle_filter) context = lifecycle_filter.hogql_context else: if settings.DEBUG: raise ValueError( f"Insight type: {insight_type} not supported for cohort creation" ) else: capture_exception( Exception( f"Insight type: {insight_type} not supported for cohort creation" ) ) if query_builder.is_aggregating_by_groups: if settings.DEBUG: raise ValueError( f"Query type: Group based queries are not supported for cohort creation" ) else: capture_exception( Exception( f"Query type: Group based queries are not supported for cohort creation" ) ) else: query, params = query_builder.actor_query(limit_actors=False) insert_actors_into_cohort_by_query(cohort, query, params, context) def insert_actors_into_cohort_by_query( cohort: Cohort, query: str, params: Dict[str, Any], context: HogQLContext ): try: sync_execute( INSERT_COHORT_ALL_PEOPLE_THROUGH_PERSON_ID.format( cohort_table=PERSON_STATIC_COHORT_TABLE, query=query ), { "cohort_id": cohort.pk, "_timestamp": datetime.now(), "team_id": cohort.team.pk, **context.values, **params, }, ) cohort.is_calculating = False cohort.last_calculation = timezone.now() cohort.errors_calculating = 0 cohort.save( update_fields=["errors_calculating", "last_calculation", "is_calculating"] ) except Exception as err: if settings.DEBUG: raise err cohort.is_calculating = False cohort.errors_calculating = F("errors_calculating") + 1 cohort.save(update_fields=["errors_calculating", "is_calculating"]) capture_exception(err)
isso
setup
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- from pathlib import Path from re import sub as re_sub from setuptools import find_packages, setup # https://packaging.python.org/en/latest/guides/making-a-pypi-friendly-readme/ this_directory = Path(__file__).parent long_description = (this_directory / "README.md").read_text() # Filter out "License" section since license already displayed in PyPi sidebar # Remember to keep this in sync with changes to README! long_description = re_sub(r"\n## License\n.*LICENSE.*\n", "", long_description) setup( name="isso", version="0.13.1.dev0", author="Martin Zimmermann", author_email="info@posativ.org", packages=find_packages(), include_package_data=True, zip_safe=False, url="https://github.com/posativ/isso/", license="MIT", description="lightweight Disqus alternative", long_description=long_description, long_description_content_type="text/markdown", python_requires=">=3.7", classifiers=[ "Development Status :: 4 - Beta", "Topic :: Internet", "Topic :: Internet :: WWW/HTTP :: HTTP Servers", "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", ], install_requires=[ "itsdangerous", "Jinja2", "misaka>=2.0,<3.0", "html5lib", "werkzeug>=1.0", "bleach", ], tests_require=["pytest", "pytest-cov"], extras_require={ "doc": ["Sphinx"], }, entry_points={ "console_scripts": ["isso = isso:main"], }, )
schema-checker
block
from .utils import Spec, expand PARAM_SCHEME = expand( base_key=str, # todo: rename/remove id=str, label=str, category=str, dtype=str, default=object, options=list, option_labels=list, option_attributes=Spec(types=dict, required=False, item_scheme=(str, list)), hide=str, ) PORT_SCHEME = expand( label=str, domain=str, id=str, dtype=str, vlen=(int, str), multiplicity=(int, str), optional=(bool, int, str), hide=(bool, str), ) TEMPLATES_SCHEME = expand( imports=str, var_make=str, var_value=str, make=str, callbacks=list, ) CPP_TEMPLATES_SCHEME = expand( includes=list, declarations=str, make=str, var_make=str, callbacks=list, link=list, packages=list, translations=dict, ) BLOCK_SCHEME = expand( id=Spec(types=str, required=True, item_scheme=None), label=str, category=str, flags=(list, str), parameters=Spec(types=list, required=False, item_scheme=PARAM_SCHEME), inputs=Spec(types=list, required=False, item_scheme=PORT_SCHEME), outputs=Spec(types=list, required=False, item_scheme=PORT_SCHEME), asserts=(list, str), value=str, templates=Spec(types=dict, required=False, item_scheme=TEMPLATES_SCHEME), cpp_templates=Spec(types=dict, required=False, item_scheme=CPP_TEMPLATES_SCHEME), documentation=str, grc_source=str, file_format=Spec(types=int, required=True, item_scheme=None), block_wrapper_path=str, # todo: rename/remove )
clients
scgi
#!/usr/bin/python # rtorrent_xmlrpc # (c) 2011 Roger Que <alerante@bellsouth.net> # # Modified portions: # (c) 2013 Dean Gardiner <gardiner91@gmail.com> # # Python module for interacting with rtorrent's XML-RPC interface # directly over SCGI, instead of through an HTTP server intermediary. # Inspired by Glenn Washburn's xmlrpc2scgi.py [1], but subclasses the # built-in xmlrpclib classes so that it is compatible with features # such as MultiCall objects. # # [1] <http://libtorrent.rakshasa.no/wiki/UtilsXmlrpc2scgi> # # Usage: server = SCGIServerProxy('scgi://localhost:7000/') # server = SCGIServerProxy('scgi:///path/to/scgi.sock') # print server.system.listMethods() # mc = xmlrpclib.MultiCall(server) # mc.get_up_rate() # mc.get_down_rate() # print mc() # # # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # In addition, as a special exception, the copyright holders give # permission to link the code of portions of this program with the # OpenSSL library under certain conditions as described in each # individual source file, and distribute linked combinations # including the two. # # You must obey the GNU General Public License in all respects for # all of the code used other than OpenSSL. If you modify file(s) # with this exception, you may extend this exception to your version # of the file(s), but you are not obligated to do so. If you do not # wish to do so, delete this exception statement from your version. # If you delete this exception statement from all source files in the # program, then also delete it here. # # # # Portions based on Python's xmlrpclib: # # Copyright (c) 1999-2002 by Secret Labs AB # Copyright (c) 1999-2002 by Fredrik Lundh # # By obtaining, using, and/or copying this software and/or its # associated documentation, you agree that you have read, understood, # and will comply with the following terms and conditions: # # Permission to use, copy, modify, and distribute this software and # its associated documentation for any purpose and without fee is # hereby granted, provided that the above copyright notice appears in # all copies, and that both that copyright notice and this permission # notice appear in supporting documentation, and that the name of # Secret Labs AB or the author not be used in advertising or publicity # pertaining to distribution of the software without specific, written # prior permission. # # SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD # TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- # ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR # BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY # DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE # OF THIS SOFTWARE. import urllib import xmlrpclib from rtorrent.lib.xmlrpc.transports.scgi import SCGITransport class SCGIServerProxy(xmlrpclib.ServerProxy): def __init__( self, uri, transport=None, encoding=None, verbose=False, allow_none=False, use_datetime=False, ): type, uri = urllib.splittype(uri) if type not in ("scgi"): raise IOError("unsupported XML-RPC protocol") self.__host, self.__handler = urllib.splithost(uri) if not self.__handler: self.__handler = "/" if transport is None: transport = SCGITransport(use_datetime=use_datetime) self.__transport = transport self.__encoding = encoding self.__verbose = verbose self.__allow_none = allow_none def __close(self): self.__transport.close() def __request(self, methodname, params): # call a method on the remote server request = xmlrpclib.dumps( params, methodname, encoding=self.__encoding, allow_none=self.__allow_none ) response = self.__transport.request( self.__host, self.__handler, request, verbose=self.__verbose ) if len(response) == 1: response = response[0] return response def __repr__(self): return "<SCGIServerProxy for %s%s>" % (self.__host, self.__handler) __str__ = __repr__ def __getattr__(self, name): # magic method dispatcher return xmlrpclib._Method(self.__request, name) # note: to call a remote object with an non-standard name, use # result getattr(server, "strange-python-name")(args) def __call__(self, attr): """A workaround to get special attributes on the ServerProxy without interfering with the magic __getattr__ """ if attr == "close": return self.__close elif attr == "transport": return self.__transport raise AttributeError("Attribute %r not found" % (attr,))
filter
qa_filterbank
#!/usr/bin/env python # # Copyright 2012,2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # import math import random import time from gnuradio import blocks, filter, gr, gr_unittest def convolution(A, B): """ Returns a convolution of the A and B vectors of length len(A)-len(B). """ rs = [] for i in range(len(B) - 1, len(A)): r = 0 for j, b in enumerate(B): r += A[i - j] * b rs.append(r) return rs class test_filterbank_vcvcf(gr_unittest.TestCase): def setUp(self): random.seed(0) self.tb = gr.top_block() def tearDown(self): self.tb = None def test_000(self): """ Generates nfilts sets of random complex data. Generates two sets of random taps for each filter. Applies one set of the random taps, gets some output, applies the second set of random taps, gets some more output, The output is then compared with a python-implemented convolution. """ myrand = random.Random(123).random nfilts = 10 ntaps = 5 # Sets some of the taps to be all zeros. zero_filts1 = (3, 7) zero_filts2 = (1, 6, 9) ndatapoints = 100 # Generate some random sets of data data_sets = [] for i in range(0, nfilts): data_sets.append( [ (myrand() - 0.5) + (myrand() - 0.5) * (0 + 1j) for k in range(0, ndatapoints) ] ) # Join them together to pass to vector_source block data = [] for dp in zip(*data_sets): data += dp # Generate some random taps. taps1 = [] taps2 = [] for i in range(0, nfilts): if i in zero_filts1: taps1.append([0] * ntaps) else: taps1.append([myrand() - 0.5 for k in range(0, ntaps)]) if i in zero_filts2: taps2.append([0] * ntaps) else: taps2.append([myrand() - 0.5 for k in range(0, ntaps)]) # Calculate results with a python-implemented convolution. results = [] results2 = [] for ds, ts, ts2 in zip(data_sets, taps1, taps2): results.append(convolution(ds[-(len(ts) - 1) :] + ds, ts)) results2.append(convolution(ds[-(len(ts) - 1) :] + ds, ts2)) # Convert results from 2D arrays to 1D arrays for ease of comparison. comb_results = [] for rs in zip(*results): comb_results += rs comb_results2 = [] for rs in zip(*results2): comb_results2 += rs # Construct the signal-processing chain. src = blocks.vector_source_c(data, True, nfilts) fb = filter.filterbank_vcvcf(taps1) v2s = blocks.vector_to_stream(gr.sizeof_gr_complex, nfilts) s2v = blocks.stream_to_vector(gr.sizeof_gr_complex, nfilts * ndatapoints) snk = blocks.probe_signal_vc(nfilts * ndatapoints) self.tb.connect(src, fb, v2s, s2v, snk) # Run the signal-processing chain. self.tb.start() all_zero = True outdata = None waittime = 0.001 # Wait until we have some data. while (not outdata) or outdata[0] == 0: time.sleep(waittime) outdata = snk.level() # Apply the second set of taps. fb.set_taps(taps2) outdata2 = None # Wait until we have new data. while (not outdata2) or abs(outdata2[0] - outdata[0]) < 1e-6: time.sleep(waittime) outdata2 = snk.level() self.tb.stop() # Compare the datasets. self.assertComplexTuplesAlmostEqual(comb_results, outdata, 6) self.assertComplexTuplesAlmostEqual(comb_results2, outdata2, 6) if __name__ == "__main__": gr_unittest.run(test_filterbank_vcvcf)
funnels
utils
from typing import Type from posthog.constants import FunnelOrderType from posthog.models.filters import Filter from posthog.queries.funnels import ClickhouseFunnelBase def get_funnel_order_class(filter: Filter) -> Type[ClickhouseFunnelBase]: from posthog.queries.funnels import ( ClickhouseFunnel, ClickhouseFunnelStrict, ClickhouseFunnelUnordered, ) if filter.funnel_order_type == FunnelOrderType.UNORDERED: return ClickhouseFunnelUnordered elif filter.funnel_order_type == FunnelOrderType.STRICT: return ClickhouseFunnelStrict return ClickhouseFunnel def get_funnel_order_actor_class(filter: Filter): from posthog.queries.funnels import ( ClickhouseFunnelActors, ClickhouseFunnelStrictActors, ClickhouseFunnelUnorderedActors, ) if filter.funnel_order_type == FunnelOrderType.UNORDERED: return ClickhouseFunnelUnorderedActors elif filter.funnel_order_type == FunnelOrderType.STRICT: return ClickhouseFunnelStrictActors return ClickhouseFunnelActors
utils
named_pipe
import abc import logging import os import random import tempfile import threading from contextlib import suppress from pathlib import Path from typing import Type from streamlink.compat import is_win32 try: from ctypes import ( byref, c_ulong, c_void_p, # type: ignore[attr-defined] cast, windll, ) except ImportError: pass log = logging.getLogger(__name__) _lock = threading.Lock() _id = 0 class NamedPipeBase(abc.ABC): path: Path def __init__(self): global _id # noqa: PLW0603 with _lock: _id += 1 self.name = f"streamlinkpipe-{os.getpid()}-{_id}-{random.randint(0, 9999)}" log.info(f"Creating pipe {self.name}") self._create() @abc.abstractmethod def _create(self) -> None: raise NotImplementedError @abc.abstractmethod def open(self) -> None: raise NotImplementedError @abc.abstractmethod def write(self, data) -> int: raise NotImplementedError @abc.abstractmethod def close(self) -> None: raise NotImplementedError class NamedPipePosix(NamedPipeBase): mode = "wb" permissions = 0o660 fifo = None def _create(self): self.path = Path(tempfile.gettempdir(), self.name) os.mkfifo(self.path, self.permissions) def open(self): self.fifo = open(self.path, self.mode) def write(self, data): return self.fifo.write(data) def close(self): try: if self.fifo is not None: self.fifo.close() except OSError: raise finally: with suppress(OSError): self.path.unlink() self.fifo = None class NamedPipeWindows(NamedPipeBase): bufsize = 8192 pipe = None PIPE_ACCESS_OUTBOUND = 0x00000002 PIPE_TYPE_BYTE = 0x00000000 PIPE_READMODE_BYTE = 0x00000000 PIPE_WAIT = 0x00000000 PIPE_UNLIMITED_INSTANCES = 255 INVALID_HANDLE_VALUE = -1 @staticmethod def _get_last_error(): error_code = windll.kernel32.GetLastError() raise OSError(f"Named pipe error code 0x{error_code:08X}") def _create(self): self.path = Path("\\\\.\\pipe", self.name) self.pipe = windll.kernel32.CreateNamedPipeW( str(self.path), self.PIPE_ACCESS_OUTBOUND, self.PIPE_TYPE_BYTE | self.PIPE_READMODE_BYTE | self.PIPE_WAIT, self.PIPE_UNLIMITED_INSTANCES, self.bufsize, self.bufsize, 0, None, ) if self.pipe == self.INVALID_HANDLE_VALUE: self._get_last_error() def open(self): windll.kernel32.ConnectNamedPipe(self.pipe, None) def write(self, data): written = c_ulong(0) windll.kernel32.WriteFile( self.pipe, cast(data, c_void_p), len(data), byref(written), None, ) return written.value def close(self): try: if self.pipe is not None: windll.kernel32.DisconnectNamedPipe(self.pipe) windll.kernel32.CloseHandle(self.pipe) except OSError: raise finally: self.pipe = None NamedPipe: Type[NamedPipeBase] if not is_win32: NamedPipe = NamedPipePosix else: NamedPipe = NamedPipeWindows
calc
shipModeChange
import wx from eos.saveddata.mode import Mode from logbook import Logger from service.fit import Fit from service.market import Market pyfalog = Logger(__name__) class CalcChangeShipModeCommand(wx.Command): def __init__(self, fitID, itemID): wx.Command.__init__(self, True, "Change Ship Mode") self.fitID = fitID self.itemID = itemID self.savedItemID = None def Do(self): pyfalog.debug( "Doing changing ship mode to {} for fit {}".format(self.itemID, self.fitID) ) fit = Fit.getInstance().getFit(self.fitID) self.savedItemID = fit.mode.item.ID item = Market.getInstance().getItem(self.itemID) mode = Mode(item) fit.mode = mode return True def Undo(self): pyfalog.debug( "Undoing changing ship mode to {} for fit {}".format( self.itemID, self.fitID ) ) cmd = CalcChangeShipModeCommand(self.fitID, self.savedItemID) return cmd.Do()
network
networkmanager
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # SPDX-License-Identifier: GPL-3.0-or-later """Our own QNetworkAccessManager.""" import collections import dataclasses import html from typing import TYPE_CHECKING, Dict, MutableMapping, Optional, Set from qutebrowser.browser import shared from qutebrowser.browser.network import proxy as proxymod from qutebrowser.browser.webkit import cache, certificateerror, cookies from qutebrowser.browser.webkit.network import ( filescheme, networkreply, webkitqutescheme, ) from qutebrowser.config import config from qutebrowser.extensions import interceptors from qutebrowser.misc import objects from qutebrowser.qt.core import QByteArray, QUrl, pyqtSignal, pyqtSlot from qutebrowser.qt.network import ( QNetworkAccessManager, QNetworkProxy, QNetworkReply, QSslConfiguration, ) from qutebrowser.utils import ( debug, log, message, objreg, qtlog, urlutils, usertypes, utils, ) if TYPE_CHECKING: from qutebrowser.mainwindow import prompt HOSTBLOCK_ERROR_STRING = "%HOSTBLOCK%" _proxy_auth_cache: Dict["ProxyId", "prompt.AuthInfo"] = {} @dataclasses.dataclass(frozen=True) class ProxyId: """Information identifying a proxy server.""" type: QNetworkProxy.ProxyType hostname: str port: int def _is_secure_cipher(cipher): """Check if a given SSL cipher (hopefully) isn't broken yet.""" tokens = [e.upper() for e in cipher.name().split("-")] if cipher.usedBits() < 128: # https://codereview.qt-project.org/#/c/75943/ return False # OpenSSL should already protect against this in a better way elif cipher.keyExchangeMethod() == "DH" and utils.is_windows: # https://weakdh.org/ return False elif cipher.encryptionMethod().upper().startswith("RC4"): # https://en.wikipedia.org/wiki/RC4#Security # https://codereview.qt-project.org/#/c/148906/ return False elif cipher.encryptionMethod().upper().startswith("DES"): # https://en.wikipedia.org/wiki/Data_Encryption_Standard#Security_and_cryptanalysis return False elif "MD5" in tokens: # https://www.win.tue.nl/hashclash/rogue-ca/ return False # OpenSSL should already protect against this in a better way # elif (('CBC3' in tokens or 'CBC' in tokens) and (cipher.protocol() not in # [QSsl.SslProtocol.TlsV1_0, QSsl.SslProtocol.TlsV1_1, QSsl.SslProtocol.TlsV1_2])): # # https://en.wikipedia.org/wiki/POODLE # return False ### These things should never happen as those are already filtered out by ### either the SSL libraries or Qt - but let's be sure. elif cipher.authenticationMethod() in ["aNULL", "NULL"]: # Ciphers without authentication. return False elif cipher.encryptionMethod() in ["eNULL", "NULL"]: # Ciphers without encryption. return False elif "EXP" in tokens or "EXPORT" in tokens: # Weak export-grade ciphers return False elif "ADH" in tokens: # No MITM protection return False ### This *should* happen ;) else: return True def init(): """Disable insecure SSL ciphers on old Qt versions.""" ssl_config = QSslConfiguration.defaultConfiguration() default_ciphers = ssl_config.ciphers() log.init.vdebug( # type: ignore[attr-defined] "Default Qt ciphers: {}".format(", ".join(c.name() for c in default_ciphers)) ) good_ciphers = [] bad_ciphers = [] for cipher in default_ciphers: if _is_secure_cipher(cipher): good_ciphers.append(cipher) else: bad_ciphers.append(cipher) if bad_ciphers: log.init.debug( "Disabling bad ciphers: {}".format(", ".join(c.name() for c in bad_ciphers)) ) ssl_config.setCiphers(good_ciphers) _SavedErrorsType = MutableMapping[ urlutils.HostTupleType, Set[certificateerror.CertificateErrorWrapper], ] class NetworkManager(QNetworkAccessManager): """Our own QNetworkAccessManager. Attributes: adopted_downloads: If downloads are running with this QNAM but the associated tab gets closed already, the NAM gets reparented to the DownloadManager. This counts the still running downloads, so the QNAM can clean itself up when this reaches zero again. _scheme_handlers: A dictionary (scheme -> handler) of supported custom schemes. _win_id: The window ID this NetworkManager is associated with. (or None for generic network managers) _tab_id: The tab ID this NetworkManager is associated with. (or None for generic network managers) _rejected_ssl_errors: A {QUrl: {SslError}} dict of rejected errors. _accepted_ssl_errors: A {QUrl: {SslError}} dict of accepted errors. _private: Whether we're in private browsing mode. netrc_used: Whether netrc authentication was performed. Signals: shutting_down: Emitted when the QNAM is shutting down. """ shutting_down = pyqtSignal() def __init__(self, *, win_id, tab_id, private, parent=None): log.init.debug("Initializing NetworkManager") with qtlog.disable_qt_msghandler(): # WORKAROUND for a hang when a message is printed - See: # https://www.riverbankcomputing.com/pipermail/pyqt/2014-November/035045.html # # Still needed on Qt/PyQt 5.15.2 according to #6010. super().__init__(parent) log.init.debug("NetworkManager init done") self.adopted_downloads = 0 self._win_id = win_id self._tab_id = tab_id self._private = private self._scheme_handlers = { "qute": webkitqutescheme.handler, "file": filescheme.handler, } self._set_cookiejar() self._set_cache() self.sslErrors.connect(self.on_ssl_errors) self._rejected_ssl_errors: _SavedErrorsType = collections.defaultdict(set) self._accepted_ssl_errors: _SavedErrorsType = collections.defaultdict(set) self.authenticationRequired.connect(self.on_authentication_required) self.proxyAuthenticationRequired.connect(self.on_proxy_authentication_required) self.netrc_used = False def _set_cookiejar(self): """Set the cookie jar of the NetworkManager correctly.""" if self._private: cookie_jar = cookies.ram_cookie_jar else: cookie_jar = cookies.cookie_jar assert cookie_jar is not None # We have a shared cookie jar - we restore its parent so we don't # take ownership of it. self.setCookieJar(cookie_jar) cookie_jar.setParent(objects.qapp) def _set_cache(self): """Set the cache of the NetworkManager correctly.""" if self._private: return # We have a shared cache - we restore its parent so we don't take # ownership of it. self.setCache(cache.diskcache) cache.diskcache.setParent(objects.qapp) def _get_abort_signals(self, owner=None): """Get a list of signals which should abort a question.""" abort_on = [self.shutting_down] if owner is not None: abort_on.append(owner.destroyed) # This might be a generic network manager, e.g. one belonging to a # DownloadManager. In this case, just skip the webview thing. if self._tab_id is not None: assert self._win_id is not None tab = objreg.get("tab", scope="tab", window=self._win_id, tab=self._tab_id) abort_on.append(tab.load_started) return abort_on def _get_tab(self): """Get the tab this NAM is associated with. Return: The tab if available, None otherwise. """ # There are some scenarios where we can't figure out current_url: # - There's a generic NetworkManager, e.g. for downloads # - The download was in a tab which is now closed. if self._tab_id is None: return None assert self._win_id is not None try: return objreg.get("tab", scope="tab", window=self._win_id, tab=self._tab_id) except KeyError: # https://github.com/qutebrowser/qutebrowser/issues/889 return None def shutdown(self): """Abort all running requests.""" try: self.setNetworkAccessible( QNetworkAccessManager.NetworkAccessibility.NotAccessible ) except AttributeError: # Qt 5 only, deprecated seemingly without replacement. pass self.shutting_down.emit() # No @pyqtSlot here, see # https://github.com/qutebrowser/qutebrowser/issues/2213 def on_ssl_errors(self, reply, qt_errors): """Decide if SSL errors should be ignored or not. This slot is called on SSL/TLS errors by the self.sslErrors signal. Args: reply: The QNetworkReply that is encountering the errors. qt_errors: A list of errors. """ errors = certificateerror.CertificateErrorWrapper(reply, qt_errors) log.network.debug("Certificate errors: {!r}".format(errors)) try: host_tpl: Optional[urlutils.HostTupleType] = urlutils.host_tuple( reply.url() ) except ValueError: host_tpl = None is_accepted = False is_rejected = False else: assert host_tpl is not None is_accepted = errors in self._accepted_ssl_errors[host_tpl] is_rejected = errors in self._rejected_ssl_errors[host_tpl] log.network.debug( "Already accepted: {} / " "rejected {}".format(is_accepted, is_rejected) ) if is_rejected: return elif is_accepted: reply.ignoreSslErrors() return abort_on = self._get_abort_signals(reply) tab = self._get_tab() first_party_url = QUrl() if tab is None else tab.data.last_navigation.url shared.handle_certificate_error( request_url=reply.url(), first_party_url=first_party_url, error=errors, abort_on=abort_on, ) if errors.certificate_was_accepted(): if host_tpl is not None: self._accepted_ssl_errors[host_tpl].add(errors) elif host_tpl is not None: self._rejected_ssl_errors[host_tpl].add(errors) def clear_all_ssl_errors(self): """Clear all remembered SSL errors.""" self._accepted_ssl_errors.clear() self._rejected_ssl_errors.clear() @pyqtSlot(QUrl) def clear_rejected_ssl_errors(self, url): """Clear the rejected SSL errors on a reload. Args: url: The URL to remove. """ try: del self._rejected_ssl_errors[url] except KeyError: pass @pyqtSlot("QNetworkReply*", "QAuthenticator*") def on_authentication_required(self, reply, authenticator): """Called when a website needs authentication.""" url = reply.url() log.network.debug( "Authentication requested for {}, netrc_used {}".format( url.toDisplayString(), self.netrc_used ) ) netrc_success = False if not self.netrc_used: self.netrc_used = True netrc_success = shared.netrc_authentication(url, authenticator) if not netrc_success: log.network.debug("Asking for credentials") abort_on = self._get_abort_signals(reply) shared.authentication_required(url, authenticator, abort_on=abort_on) @pyqtSlot("QNetworkProxy", "QAuthenticator*") def on_proxy_authentication_required(self, proxy, authenticator): """Called when a proxy needs authentication.""" proxy_id = ProxyId(proxy.type(), proxy.hostName(), proxy.port()) if proxy_id in _proxy_auth_cache: authinfo = _proxy_auth_cache[proxy_id] authenticator.setUser(authinfo.user) authenticator.setPassword(authinfo.password) else: msg = "<b>{}</b> says:<br/>{}".format( html.escape(proxy.hostName()), html.escape(authenticator.realm()) ) abort_on = self._get_abort_signals() answer = message.ask( title="Proxy authentication required", text=msg, mode=usertypes.PromptMode.user_pwd, abort_on=abort_on, ) if answer is not None: authenticator.setUser(answer.user) authenticator.setPassword(answer.password) _proxy_auth_cache[proxy_id] = answer @pyqtSlot() def on_adopted_download_destroyed(self): """Check if we can clean up if an adopted download was destroyed. See the description for adopted_downloads for details. """ self.adopted_downloads -= 1 log.downloads.debug( "Adopted download destroyed, {} left.".format(self.adopted_downloads) ) assert self.adopted_downloads >= 0 if self.adopted_downloads == 0: self.deleteLater() @pyqtSlot(object) # DownloadItem def adopt_download(self, download): """Adopt a new DownloadItem.""" self.adopted_downloads += 1 log.downloads.debug( "Adopted download, {} adopted.".format(self.adopted_downloads) ) download.destroyed.connect(self.on_adopted_download_destroyed) download.adopt_download.connect(self.adopt_download) def set_referer(self, req, current_url): """Set the referer header.""" referer_header_conf = config.val.content.headers.referer try: if referer_header_conf == "never": # Note: using ''.encode('ascii') sends a header with no value, # instead of no header at all req.setRawHeader(b"Referer", QByteArray()) elif referer_header_conf == "same-domain" and not urlutils.same_domain( req.url(), current_url ): req.setRawHeader(b"Referer", QByteArray()) # If refer_header_conf is set to 'always', we leave the header # alone as QtWebKit did set it. except urlutils.InvalidUrlError: # req.url() or current_url can be invalid - this happens on # https://www.playstation.com/ for example. pass def createRequest(self, op, req, outgoing_data): """Return a new QNetworkReply object. Args: op: Operation op req: const QNetworkRequest & req outgoing_data: QIODevice * outgoingData Return: A QNetworkReply. """ if proxymod.application_factory is not None: proxy_error = proxymod.application_factory.get_error() if proxy_error is not None: return networkreply.ErrorNetworkReply( req, proxy_error, QNetworkReply.NetworkError.UnknownProxyError, self ) if not req.url().isValid(): log.network.debug( "Ignoring invalid requested URL: {}".format(req.url().errorString()) ) return networkreply.ErrorNetworkReply( req, "Invalid request URL", QNetworkReply.NetworkError.HostNotFoundError, self, ) for header, value in shared.custom_headers(url=req.url()): req.setRawHeader(header, value) tab = self._get_tab() current_url = QUrl() if tab is not None: try: current_url = tab.url() except RuntimeError: # We could be in the middle of the webpage shutdown here. pass request = interceptors.Request( first_party_url=current_url, request_url=req.url() ) interceptors.run(request) if request.is_blocked: return networkreply.ErrorNetworkReply( req, HOSTBLOCK_ERROR_STRING, QNetworkReply.NetworkError.ContentAccessDenied, self, ) if "log-requests" in objects.debug_flags: operation = debug.qenum_key(QNetworkAccessManager, op) operation = operation.replace("Operation", "").upper() log.network.debug( "{} {}, first-party {}".format( operation, req.url().toDisplayString(), current_url.toDisplayString(), ) ) scheme = req.url().scheme() if scheme in self._scheme_handlers: result = self._scheme_handlers[scheme](req, op, current_url) if result is not None: result.setParent(self) return result self.set_referer(req, current_url) return super().createRequest(op, req, outgoing_data)
builtinContextMenus
itemStats
# noinspection PyPackageRequirements import gui.mainFrame import wx from gui.contextMenu import ContextMenuSingle from gui.itemStats import ItemStatsFrame from service.fit import Fit _t = wx.GetTranslation class ItemStats(ContextMenuSingle): def __init__(self): self.mainFrame = gui.mainFrame.MainFrame.getInstance() def display(self, callingWindow, srcContext, mainItem): if srcContext not in ( "marketItemGroup", "marketItemMisc", "fittingModule", "fittingCharge", "fittingShip", "baseShip", "cargoItem", "droneItem", "implantItem", "boosterItem", "skillItem", "projectedModule", "projectedDrone", "projectedCharge", "itemStats", "fighterItem", "implantItemChar", "projectedFighter", "fittingMode", ): return False if ( mainItem is None or getattr(mainItem, "isEmpty", False) ) and srcContext != "fittingShip": return False return True def getText(self, callingWindow, itmContext, mainItem): return _t("{} Stats").format( itmContext if itmContext is not None else _t("Item") ) def activate(self, callingWindow, fullContext, mainItem, i): srcContext = fullContext[0] if srcContext == "fittingShip": fitID = self.mainFrame.getActiveFit() sFit = Fit.getInstance() stuff = sFit.getFit(fitID).ship elif srcContext == "fittingMode": stuff = mainItem.item else: stuff = mainItem if srcContext == "fittingModule" and stuff.isEmpty: return reuse = False if wx.GetMouseState().GetModifiers() == wx.MOD_SHIFT: reuse = True if self.mainFrame.GetActiveStatsWindow() is None and reuse: frame = ItemStatsFrame(stuff, fullContext) elif reuse: lastWnd = self.mainFrame.GetActiveStatsWindow() pos = lastWnd.GetPosition() maximized = lastWnd.IsMaximized() if not maximized: size = lastWnd.GetSize() else: size = wx.DefaultSize pos = wx.DefaultPosition frame = ItemStatsFrame(stuff, fullContext, pos, size, maximized) lastWnd.Close() else: frame = ItemStatsFrame(stuff, fullContext) frame.Show() ItemStats.register()
TechDrawTools
TaskHoleShaftFit
# *************************************************************************** # * Copyright (c) 2023 edi <edi271@a1.net> * # * * # * This program is free software; you can redistribute it and/or modify * # * it under the terms of the GNU Lesser General Public License (LGPL) * # * as published by the Free Software Foundation; either version 2 of * # * the License, or (at your option) any later version. * # * for detail see the LICENCE text file. * # * * # * This program is distributed in the hope that it will be useful, * # * but WITHOUT ANY WARRANTY; without even the implied warranty of * # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * # * GNU Library General Public License for more details. * # * * # * You should have received a copy of the GNU Library General Public * # * License along with this program; if not, write to the Free Software * # * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * # * USA * # * * # *************************************************************************** """Provides the TechDraw HoleShaftFit Task Dialog.""" __title__ = "TechDrawTools.TaskHoleShaftFit" __author__ = "edi" __url__ = "https://www.freecad.org" __version__ = "00.01" __date__ = "2023/02/07" import os from functools import partial import FreeCAD as App import FreeCADGui as Gui translate = App.Qt.translate class TaskHoleShaftFit: def __init__(self, sel): loose = translate("TechDraw_HoleShaftFit", "loose fit") snug = translate("TechDraw_HoleShaftFit", "snug fit") press = translate("TechDraw_HoleShaftFit", "press fit") self.isHole = True self.sel = sel self.holeValues = [ ["h9", "D10", loose], ["h9", "E9", loose], ["h9", "F8", loose], ["h6", "G7", loose], ["c11", "H11", loose], ["f7", "H8", loose], ["h6", "H7", loose], ["h7", "H8", loose], ["k6", "H7", snug], ["n6", "H7", snug], ["r6", "H7", press], ["s6", "H7", press], ["h6", "K7", snug], ["h6", "N7", snug], ["h6", "R7", press], ["h6", "S7", press], ] self.shaftValues = [ ["H11", "c11", loose], ["H8", "f7", loose], ["H7", "h6", loose], ["H8", "h7", loose], ["D10", "h9", loose], ["E9", "h9", loose], ["F8", "h9", loose], ["G7", "h6", loose], ["K7", "h6", snug], ["N7", "h6", snug], ["R7", "h6", press], ["S7", "h6", press], ["H7", "k6", snug], ["H7", "n6", snug], ["H7", "r6", press], ["H7", "s6", press], ] self._uiPath = App.getHomePath() self._uiPath = os.path.join( self._uiPath, "Mod/TechDraw/TechDrawTools/Gui/TaskHoleShaftFit.ui" ) self.form = Gui.PySideUic.loadUi(self._uiPath) self.form.setWindowTitle( translate("TechDraw_HoleShaftFit", "Hole / Shaft Fit ISO 286") ) self.form.rbHoleBase.clicked.connect(partial(self.on_HoleShaftChanged, True)) self.form.rbShaftBase.clicked.connect(partial(self.on_HoleShaftChanged, False)) self.form.cbField.currentIndexChanged.connect(self.on_FieldChanged) def setHoleFields(self): """set hole fields in the combo box""" for i in range(self.form.cbField.count()): self.form.cbField.removeItem(0) for value in self.holeValues: self.form.cbField.addItem(value[1]) self.form.lbBaseField.setText(" " + self.holeValues[0][0] + " /") self.form.lbFitType.setText(self.holeValues[0][2]) def setShaftFields(self): """set shaft fields in the combo box""" for i in range(self.form.cbField.count()): self.form.cbField.removeItem(0) for value in self.shaftValues: self.form.cbField.addItem(value[1]) self.form.lbBaseField.setText(" " + self.shaftValues[0][0] + " /") self.form.lbFitType.setText(self.shaftValues[0][2]) def on_HoleShaftChanged(self, isHole): """slot: change the used base fit hole/shaft""" if isHole: self.isHole = isHole self.setShaftFields() else: self.isHole = isHole self.setHoleFields() def on_FieldChanged(self): """slot: change of the desired field""" currentIndex = self.form.cbField.currentIndex() if self.isHole: self.form.lbBaseField.setText( " " + self.shaftValues[currentIndex][0] + " /" ) self.form.lbFitType.setText(self.shaftValues[currentIndex][2]) else: self.form.lbBaseField.setText( " " + self.holeValues[currentIndex][0] + " /" ) self.form.lbFitType.setText(self.holeValues[currentIndex][2]) def accept(self): """slot: OK pressed""" currentIndex = self.form.cbField.currentIndex() if self.isHole: selectedField = self.shaftValues[currentIndex][1] else: selectedField = self.holeValues[currentIndex][1] fieldChar = selectedField[0] quality = int(selectedField[1:]) dim = self.sel[0].Object value = dim.getRawValue() iso = ISO286() iso.calculate(value, fieldChar, quality) rangeValues = iso.getValues() mainFormat = dim.FormatSpec dim.FormatSpec = mainFormat + selectedField dim.EqualTolerance = False dim.FormatSpecOverTolerance = "(%+.3f)" dim.OverTolerance = rangeValues[0] dim.UnderTolerance = rangeValues[1] Gui.Control.closeDialog() def reject(self): return True class ISO286: """This class represents a subset of the ISO 286 standard""" def getNominalRange(self, measureValue): """return index of selected nominal range field, 0 < measureValue < 500 mm""" measureRanges = [ 0, 3, 6, 10, 14, 18, 24, 30, 40, 50, 65, 80, 100, 120, 140, 160, 180, 200, 225, 250, 280, 315, 355, 400, 450, 500, ] index = 1 while measureValue > measureRanges[index]: index = index + 1 return index - 1 def getITValue(self, valueQuality, valueNominalRange): """return IT-value (value of quality in micrometers)""" """tables IT6 to IT11 from 0 to 500 mm""" IT6 = [ 6, 8, 9, 11, 11, 13, 13, 16, 16, 19, 19, 22, 22, 25, 25, 25, 29, 29, 29, 32, 32, 36, 36, 40, 40, ] IT7 = [ 10, 12, 15, 18, 18, 21, 21, 25, 25, 30, 30, 35, 35, 40, 40, 40, 46, 46, 46, 52, 52, 57, 57, 63, 63, ] IT8 = [ 14, 18, 22, 27, 27, 33, 33, 39, 39, 46, 46, 54, 54, 63, 63, 63, 72, 72, 72, 81, 81, 89, 89, 97, 97, ] IT9 = [ 25, 30, 36, 43, 43, 52, 52, 62, 62, 74, 74, 87, 87, 100, 100, 100, 115, 115, 115, 130, 130, 140, 140, 155, 155, ] IT10 = [ 40, 48, 58, 70, 70, 84, 84, 100, 100, 120, 120, 140, 140, 160, 160, 160, 185, 185, 185, 210, 210, 230, 230, 250, 250, ] IT11 = [ 60, 75, 90, 110, 110, 130, 130, 160, 160, 190, 190, 220, 220, 250, 250, 250, 290, 290, 290, 320, 320, 360, 360, 400, 400, ] qualityTable = [IT6, IT7, IT8, IT9, IT10, IT11] return qualityTable[valueQuality - 6][valueNominalRange] def getFieldValue(self, fieldCharacter, valueNominalRange): """return es or ES value of the field in micrometers""" cField = [ -60, -70, -80, -95, -95, -110, -110, -120, -130, -140, -150, -170, -180, -200, -210, -230, -240, -260, -280, -300, -330, -360, -400, -440, -480, ] fField = [ -6, -10, -13, -16, -16, -20, -20, -25, -25, -30, -30, -36, -36, -43, -43, -43, -50, -50, -50, -56, -56, -62, -62, -68, -68, ] gField = [ -2, -4, -5, -6, -6, -7, -7, -9, -9, -10, -10, -12, -12, -14, -14, -14, -15, -15, -15, -17, -17, -18, -18, -20, -20, ] hField = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ] kField = [ 6, 9, 10, 12, 12, 15, 15, 18, 18, 21, 21, 25, 25, 28, 28, 28, 33, 33, 33, 36, 36, 40, 40, 45, 45, ] nField = [ 10, 16, 19, 23, 23, 28, 28, 33, 33, 39, 39, 45, 45, 52, 52, 60, 60, 66, 66, 73, 73, 80, 80, ] rField = [ 16, 23, 28, 34, 34, 41, 41, 50, 50, 60, 62, 73, 76, 88, 90, 93, 106, 109, 113, 126, 130, 144, 150, 166, 172, ] sField = [ 20, 27, 32, 39, 39, 48, 48, 59, 59, 72, 78, 93, 101, 117, 125, 133, 151, 159, 169, 190, 202, 226, 244, 272, 292, ] DField = [ 60, 78, 98, 120, 120, 149, 149, 180, 180, 220, 220, 260, 260, 305, 305, 305, 355, 355, 355, 400, 400, 440, 440, 480, 480, ] EField = [ 39, 50, 61, 75, 75, 92, 92, 112, 112, 134, 134, 159, 159, 185, 185, 185, 215, 215, 215, 240, 240, 265, 265, 290, 290, ] FField = [ 20, 28, 35, 43, 43, 53, 53, 64, 64, 76, 76, 90, 90, 106, 106, 106, 122, 122, 122, 137, 137, 151, 151, 165, 165, ] GField = [ 12, 16, 20, 24, 24, 28, 28, 34, 34, 40, 40, 47, 47, 54, 54, 54, 61, 61, 61, 69, 69, 75, 75, 83, 83, ] HField = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ] KField = [ 0, 3, 5, 6, 6, 6, 6, 7, 7, 9, 9, 10, 10, 12, 12, 12, 13, 13, 13, 16, 16, 17, 17, 18, 18, ] NField = [ -4, -4, -4, -5, -5, -7, -7, -8, -8, -9, -9, -10, -10, -12, -12, -12, -14, -14, -14, -14, -14, -16, -16, -17, -17, ] RField = [ -10, -11, -13, -16, -16, -20, -20, -25, -25, -30, -32, -38, -41, -48, -50, -53, -60, -63, -67, -74, -78, -87, -93, -103, -109, ] SField = [ -14, -15, -17, -21, -21, -27, -27, -34, -34, -42, -48, -58, -66, -77, -85, -93, -105, -113, -123, -138, -150, -169, -187, -209, -229, ] fieldDict = { "c": cField, "f": fField, "g": gField, "h": hField, "k": kField, "n": nField, "r": rField, "s": sField, "D": DField, "E": EField, "F": FField, "G": GField, "H": HField, "K": KField, "N": NField, "R": RField, "S": SField, } return fieldDict[fieldCharacter][valueNominalRange] def calculate(self, value, fieldChar, quality): """calculate upper and lower field values""" self.nominalRange = self.getNominalRange(value) self.upperValue = self.getFieldValue(fieldChar, self.nominalRange) self.lowerValue = self.upperValue - self.getITValue(quality, self.nominalRange) if fieldChar == "H": self.upperValue = -self.lowerValue self.lowerValue = 0 # hack to print zero tolerance value as (+0.000) if self.upperValue == 0: self.upperValue = 0.1 if self.lowerValue == 0: self.lowerValue = 0.1 def getValues(self): """return range values in mm""" return (self.upperValue / 1000, self.lowerValue / 1000)
QT
WOpeningGuide
from Code import DBgames, OpeningGuide from Code.QT import ( Colocacion, Controles, Iconos, QTVarios, WBG_Games, WBG_InfoMove, WBG_Moves, WBG_Summary, ) from PyQt4 import QtCore, QtGui class WOpeningGuide(QTVarios.WDialogo): def __init__(self, wParent, procesador, fenM2inicial=None, pvInicial=None): icono = Iconos.BookGuide() extparam = "edicionMyOwnBook" titulo = _("Personal Opening Guide") QTVarios.WDialogo.__init__(self, wParent, titulo, icono, extparam) self.procesador = procesador self.configuracion = procesador.configuracion self.fenM2inicial = fenM2inicial self.pvInicial = pvInicial self.bookGuide = OpeningGuide.OpeningGuide(self) self.dbGames = DBgames.DBgames(self.configuracion.ficheroDBgames) dicVideo = self.recuperarDicVideo() self.wmoves = WBG_Moves.WMoves(procesador, self) self.wsummary = WBG_Summary.WSummary(procesador, self, self.dbGames) self.wgames = WBG_Games.WGames(procesador, self, self.dbGames, self.wsummary) self.registrarGrid(self.wsummary.grid) self.registrarGrid(self.wgames.grid) self.ultFocus = None self.splitterMoves = QtGui.QSplitter(self) self.splitterMoves.setOrientation(QtCore.Qt.Vertical) self.splitterMoves.addWidget(self.wmoves) self.splitterMoves.addWidget(self.wsummary) self.tab = Controles.Tab() self.tab.nuevaTab(self.splitterMoves, _("Moves")) self.tab.nuevaTab(self.wgames, _("Games")) self.tab.dispatchChange(self.tabChanged) self.infoMove = WBG_InfoMove.WInfomove(self) self.splitter = splitter = QtGui.QSplitter(self) splitter.addWidget(self.infoMove) splitter.addWidget(self.tab) layout = Colocacion.H().control(splitter).margen(5) self.setLayout(layout) self.wmoves.tree.setFocus() self.recuperarVideo(anchoDefecto=1175) if not dicVideo: dicVideo = { "SPLITTER": [380, 816], "TREE_1": 25, "TREE_2": 25, "TREE_3": 50, "TREE_4": 661, "SPLITTERMOVES": [344, 244], } sz = dicVideo.get("SPLITTER", None) if sz: self.splitter.setSizes(sz) for x in range(1, 6): w = dicVideo.get("TREE_%d" % x, None) if w: self.wmoves.tree.setColumnWidth(x, w) self.inicializa() def cambiaDBgames(self, fich): self.dbGames.close() self.dbGames = DBgames.DBgames(self.configuracion.ficheroDBgames) self.setdbGames() def setdbGames(self): self.wgames.setdbGames(self.dbGames) self.wsummary.setdbGames(self.dbGames) def tabChanged(self, ntab): QtGui.QApplication.processEvents() tablero = self.infoMove.tablero tablero.desactivaTodas() if ntab == 1: self.wgames.actualiza() elif ntab == 0: self.wmoves.actualiza() def inicializa(self): self.wsummary.setInfoMove(self.infoMove) # self.wsummary.actualiza( ) self.wsummary.setwmoves(self.wmoves) self.wgames.setInfoMove(self.infoMove) self.wmoves.setSummary(self.wsummary) self.wmoves.setInfoMove(self.infoMove) self.bookGuide.reset() self.wmoves.setBookGuide(self.bookGuide) self.infoMove.setBookGuide(self.bookGuide) self.wmoves.ponFenM2inicial(self.fenM2inicial, self.pvInicial) def terminar(self): self.salvar() self.accept() def salvar(self): dicExten = { "SPLITTER": self.splitter.sizes(), "SPLITTERMOVES": self.splitterMoves.sizes(), } for x in range(1, 6): dicExten["TREE_%d" % x] = self.wmoves.tree.columnWidth(x) self.guardarVideo(dicExten) self.bookGuide.grabar() self.bookGuide.cerrar() self.dbGames.close() def closeEvent(self, event): self.salvar() def seleccionaPV(self, pv): ma = self.infoMove.movActual mSel = None for uno in ma.children(): if uno.pv() == pv: mSel = uno break if mSel is None: mSel = self.bookGuide.dameMovimiento(ma, pv) siNuevo = True else: siNuevo = False self.wmoves.showChildren(ma) self.wmoves.seleccionado(mSel, True) if siNuevo: for mv in mSel.transpositions(): if mv.item(): mv.item().setIcon(1, Iconos.Transposition())
SCL-output
ifc2x3
# This file was generated by fedex_python. You probably don't want to edit # it since your modifications will be lost if fedex_plus is used to # regenerate it. import sys from SCL.AggregationDataTypes import * from SCL.Builtin import * from SCL.ConstructedDataTypes import * from SCL.Rules import * from SCL.SCLBase import * from SCL.SimpleDataTypes import * from SCL.TypeChecker import check_type schema_name = 'ifc2x3' schema_scope = sys.modules[__name__] # Defined datatype ifcstructuralsurfacetypeenum class ifcstructuralsurfacetypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcloadgrouptypeenum class ifcloadgrouptypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcmodulusoflinearsubgradereactionmeasure class ifcmodulusoflinearsubgradereactionmeasure(REAL): def __init__(self,*kargs): pass # SELECT TYPE ifchatchlinedistanceselect ifchatchlinedistanceselect = SELECT( 'ifconedirectionrepeatfactor', 'ifcpositivelengthmeasure', scope = schema_scope) # SELECT TYPE ifcshell ifcshell = SELECT( 'ifcclosedshell', 'ifcopenshell', scope = schema_scope) # Defined datatype ifcprotectivedevicetypeenum class ifcprotectivedevicetypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifclinearforcemeasure class ifclinearforcemeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcassemblyplaceenum class ifcassemblyplaceenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcroleenum class ifcroleenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcribplatedirectionenum class ifcribplatedirectionenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcsoundpowermeasure class ifcsoundpowermeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcsiunitname class ifcsiunitname(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcairtoairheatrecoverytypeenum class ifcairtoairheatrecoverytypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcanalysistheorytypeenum class ifcanalysistheorytypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcchangeactionenum class ifcchangeactionenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcdoorpaneloperationenum class ifcdoorpaneloperationenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcwindowpaneloperationenum class ifcwindowpaneloperationenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcslabtypeenum class ifcslabtypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcelectricconductancemeasure class ifcelectricconductancemeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifckinematicviscositymeasure class ifckinematicviscositymeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifclinearvelocitymeasure class ifclinearvelocitymeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifctimemeasure class ifctimemeasure(REAL): def __init__(self,*kargs): pass # SELECT TYPE ifcfillstyleselect ifcfillstyleselect = SELECT( 'ifcfillareastylehatching', 'ifcfillareastyletiles', 'ifccolour', 'ifcexternallydefinedhatchstyle', scope = schema_scope) # SELECT TYPE ifcstructuralactivityassignmentselect ifcstructuralactivityassignmentselect = SELECT( 'ifcstructuralitem', 'ifcelement', scope = schema_scope) # Defined datatype ifcreflectancemethodenum class ifcreflectancemethodenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifctransformertypeenum class ifctransformertypeenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifccsgselect ifccsgselect = SELECT( 'ifcbooleanresult', 'ifccsgprimitive3d', scope = schema_scope) # SELECT TYPE ifcmaterialselect ifcmaterialselect = SELECT( 'ifcmaterial', 'ifcmateriallist', 'ifcmateriallayersetusage', 'ifcmateriallayerset', 'ifcmateriallayer', scope = schema_scope) # SELECT TYPE ifcdraughtingcalloutelement ifcdraughtingcalloutelement = SELECT( 'ifcannotationcurveoccurrence', 'ifcannotationtextoccurrence', 'ifcannotationsymboloccurrence', scope = schema_scope) # Defined datatype ifcelectriccapacitancemeasure class ifcelectriccapacitancemeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcfrequencymeasure class ifcfrequencymeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcidentifier class ifcidentifier(STRING): def __init__(self,*kargs): pass # Defined datatype ifcdirectionsenseenum class ifcdirectionsenseenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifcvalue ifcvalue = SELECT( 'ifcmeasurevalue', 'ifcsimplevalue', 'ifcderivedmeasurevalue', scope = schema_scope) # Defined datatype ifcductsilencertypeenum class ifcductsilencertypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifclabel class ifclabel(STRING): def __init__(self,*kargs): pass # Defined datatype ifcactionsourcetypeenum class ifcactionsourcetypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifctendontypeenum class ifctendontypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcpressuremeasure class ifcpressuremeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifctransitioncode class ifctransitioncode(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcenvironmentalimpactcategoryenum class ifcenvironmentalimpactcategoryenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifctextalignment class ifctextalignment(STRING): def __init__(self,*kargs): pass self.wr1() def wr1(self): eval_wr1_wr = (self == ['left','right','center','justify']) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr # Defined datatype ifcthermalresistancemeasure class ifcthermalresistancemeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcelectricmotortypeenum class ifcelectricmotortypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifctanktypeenum class ifctanktypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcforcemeasure class ifcforcemeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcheatexchangertypeenum class ifcheatexchangertypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifccoiltypeenum class ifccoiltypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcrotationalmassmeasure class ifcrotationalmassmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcelectriccurrentenum class ifcelectriccurrentenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifctimeseriesscheduletypeenum class ifctimeseriesscheduletypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcsectionalareaintegralmeasure class ifcsectionalareaintegralmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifclengthmeasure class ifclengthmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcwindowpanelpositionenum class ifcwindowpanelpositionenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcluminousintensitydistributionmeasure class ifcluminousintensitydistributionmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcrotationalstiffnessmeasure class ifcrotationalstiffnessmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcanalysismodeltypeenum class ifcanalysismodeltypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcsoundpressuremeasure class ifcsoundpressuremeasure(REAL): def __init__(self,*kargs): pass # SELECT TYPE ifccolour ifccolour = SELECT( 'ifccolourspecification', 'ifcpredefinedcolour', scope = schema_scope) # Defined datatype ifcspecularroughness class ifcspecularroughness(REAL): def __init__(self,*kargs): pass self.wr1() def wr1(self): eval_wr1_wr = ((0 <= self) and (self <= 1)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr # SELECT TYPE ifcappliedvalueselect ifcappliedvalueselect = SELECT( 'ifcratiomeasure', 'ifcmeasurewithunit', 'ifcmonetarymeasure', scope = schema_scope) # SELECT TYPE ifcclassificationnotationselect ifcclassificationnotationselect = SELECT( 'ifcclassificationnotation', 'ifcclassificationreference', scope = schema_scope) # Defined datatype ifcproceduretypeenum class ifcproceduretypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcheatingvaluemeasure class ifcheatingvaluemeasure(REAL): def __init__(self,*kargs): pass self.wr1() def wr1(self): eval_wr1_wr = (self > 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr # Defined datatype ifcinductancemeasure class ifcinductancemeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifccurtainwalltypeenum class ifccurtainwalltypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcmassperlengthmeasure class ifcmassperlengthmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcthermalloadsourceenum class ifcthermalloadsourceenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifctextstyleselect ifctextstyleselect = SELECT( 'ifctextstylewithboxcharacteristics', 'ifctextstyletextmodel', scope = schema_scope) # Defined datatype ifctexttransformation class ifctexttransformation(STRING): def __init__(self,*kargs): pass self.wr1() def wr1(self): eval_wr1_wr = (self == ['capitalize','uppercase','lowercase','none']) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr # Defined datatype ifcactuatortypeenum class ifcactuatortypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifchumidifiertypeenum class ifchumidifiertypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcconnectiontypeenum class ifcconnectiontypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifccontrollertypeenum class ifccontrollertypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcelectricgeneratortypeenum class ifcelectricgeneratortypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcwasteterminaltypeenum class ifcwasteterminaltypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcshearmodulusmeasure class ifcshearmodulusmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifclamptypeenum class ifclamptypeenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifcpresentationstyleselect ifcpresentationstyleselect = SELECT( 'ifcnullstyle', 'ifccurvestyle', 'ifcsymbolstyle', 'ifcfillareastyle', 'ifctextstyle', 'ifcsurfacestyle', scope = schema_scope) # Defined datatype ifcintegercountratemeasure class ifcintegercountratemeasure(INTEGER): def __init__(self,*kargs): pass # Defined datatype ifcaddresstypeenum class ifcaddresstypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcbenchmarkenum class ifcbenchmarkenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcoccupanttypeenum class ifcoccupanttypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcmassdensitymeasure class ifcmassdensitymeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifccablecarriersegmenttypeenum class ifccablecarriersegmenttypeenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifclightdistributiondatasourceselect ifclightdistributiondatasourceselect = SELECT( 'ifcexternalreference', 'ifclightintensitydistribution', scope = schema_scope) # SELECT TYPE ifcunit ifcunit = SELECT( 'ifcderivedunit', 'ifcnamedunit', 'ifcmonetaryunit', scope = schema_scope) # Defined datatype ifcmodulusofelasticitymeasure class ifcmodulusofelasticitymeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcairterminaltypeenum class ifcairterminaltypeenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifcpointorvertexpoint ifcpointorvertexpoint = SELECT( 'ifcpoint', 'ifcvertexpoint', scope = schema_scope) # Defined datatype ifctransportelementtypeenum class ifctransportelementtypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcelementassemblytypeenum class ifcelementassemblytypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcdocumentstatusenum class ifcdocumentstatusenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifccurvefontorscaledcurvefontselect ifccurvefontorscaledcurvefontselect = SELECT( 'ifccurvestylefontselect', 'ifccurvestylefontandscaling', scope = schema_scope) # Defined datatype ifcspecularexponent class ifcspecularexponent(REAL): def __init__(self,*kargs): pass # SELECT TYPE ifctextfontselect ifctextfontselect = SELECT( 'ifcpredefinedtextfont', 'ifcexternallydefinedtextfont', scope = schema_scope) # Defined datatype ifcactiontypeenum class ifcactiontypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcdynamicviscositymeasure class ifcdynamicviscositymeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifclightemissionsourceenum class ifclightemissionsourceenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcvolumemeasure class ifcvolumemeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcnullstyle class ifcnullstyle(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcluminousintensitymeasure class ifcluminousintensitymeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcmodulusofrotationalsubgradereactionmeasure class ifcmodulusofrotationalsubgradereactionmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcspaceheatertypeenum class ifcspaceheatertypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcpiletypeenum class ifcpiletypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcstackterminaltypeenum class ifcstackterminaltypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcfiltertypeenum class ifcfiltertypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcprojectorderrecordtypeenum class ifcprojectorderrecordtypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcabsorbeddosemeasure class ifcabsorbeddosemeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifclightdistributioncurveenum class ifclightdistributioncurveenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifcmetricvalueselect ifcmetricvalueselect = SELECT( 'ifcdatetimeselect', 'ifcmeasurewithunit', 'ifctable', 'ifctext', 'ifctimeseries', 'ifccostvalue', scope = schema_scope) # Defined datatype ifcobjecttypeenum class ifcobjecttypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcfantypeenum class ifcfantypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcgeometricprojectionenum class ifcgeometricprojectionenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifctrimmingpreference class ifctrimmingpreference(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcinternalorexternalenum class ifcinternalorexternalenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcthermodynamictemperaturemeasure class ifcthermodynamictemperaturemeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcsurfaceside class ifcsurfaceside(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcelectricvoltagemeasure class ifcelectricvoltagemeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcwindowstyleconstructionenum class ifcwindowstyleconstructionenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcductfittingtypeenum class ifcductfittingtypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifctubebundletypeenum class ifctubebundletypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifccountmeasure class ifccountmeasure(NUMBER): def __init__(self,*kargs): pass # Defined datatype ifcrailingtypeenum class ifcrailingtypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcswitchingdevicetypeenum class ifcswitchingdevicetypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcaccelerationmeasure class ifcaccelerationmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifccurvaturemeasure class ifccurvaturemeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcplaneanglemeasure class ifcplaneanglemeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcelectricheatertypeenum class ifcelectricheatertypeenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifcsurfaceorfacesurface ifcsurfaceorfacesurface = SELECT( 'ifcsurface', 'ifcfacesurface', 'ifcfacebasedsurfacemodel', scope = schema_scope) # Defined datatype ifclogicaloperatorenum class ifclogicaloperatorenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifcmeasurevalue ifcmeasurevalue = SELECT( 'ifcvolumemeasure', 'ifctimemeasure', 'ifcthermodynamictemperaturemeasure', 'ifcsolidanglemeasure', 'ifcpositiveratiomeasure', 'ifcratiomeasure', 'ifcpositiveplaneanglemeasure', 'ifcplaneanglemeasure', 'ifcparametervalue', 'ifcnumericmeasure', 'ifcmassmeasure', 'ifcpositivelengthmeasure', 'ifclengthmeasure', 'ifcelectriccurrentmeasure', 'ifcdescriptivemeasure', 'ifccountmeasure', 'ifccontextdependentmeasure', 'ifcareameasure', 'ifcamountofsubstancemeasure', 'ifcluminousintensitymeasure', 'ifcnormalisedratiomeasure', 'ifccomplexnumber', scope = schema_scope) # SELECT TYPE ifclibraryselect ifclibraryselect = SELECT( 'ifclibraryreference', 'ifclibraryinformation', scope = schema_scope) # Defined datatype ifcparametervalue class ifcparametervalue(REAL): def __init__(self,*kargs): pass # Defined datatype ifcthermalconductivitymeasure class ifcthermalconductivitymeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcgasterminaltypeenum class ifcgasterminaltypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcsectiontypeenum class ifcsectiontypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcplanarforcemeasure class ifcplanarforcemeasure(REAL): def __init__(self,*kargs): pass # SELECT TYPE ifcgeometricsetselect ifcgeometricsetselect = SELECT( 'ifcpoint', 'ifccurve', 'ifcsurface', scope = schema_scope) # Defined datatype ifcareameasure class ifcareameasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifccontextdependentmeasure class ifccontextdependentmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifctextfontname class ifctextfontname(STRING): def __init__(self,*kargs): pass # Defined datatype ifclogical class ifclogical(LOGICAL): def __init__(self,*kargs): pass # SELECT TYPE ifcorientationselect ifcorientationselect = SELECT( 'ifcplaneanglemeasure', 'ifcdirection', scope = schema_scope) # Defined datatype ifcthermaladmittancemeasure class ifcthermaladmittancemeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcspacetypeenum class ifcspacetypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcdoseequivalentmeasure class ifcdoseequivalentmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcmolecularweightmeasure class ifcmolecularweightmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcenergysequenceenum class ifcenergysequenceenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifcobjectreferenceselect ifcobjectreferenceselect = SELECT( 'ifcmaterial', 'ifcperson', 'ifcdateandtime', 'ifcmateriallist', 'ifcorganization', 'ifccalendardate', 'ifclocaltime', 'ifcpersonandorganization', 'ifcmateriallayer', 'ifcexternalreference', 'ifctimeseries', 'ifcaddress', 'ifcappliedvalue', scope = schema_scope) # Defined datatype ifcpowermeasure class ifcpowermeasure(REAL): def __init__(self,*kargs): pass # SELECT TYPE ifccurveoredgecurve ifccurveoredgecurve = SELECT( 'ifcboundedcurve', 'ifcedgecurve', scope = schema_scope) # Defined datatype ifccoveringtypeenum class ifccoveringtypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcunitaryequipmenttypeenum class ifcunitaryequipmenttypeenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifcaxis2placement ifcaxis2placement = SELECT( 'ifcaxis2placement2d', 'ifcaxis2placement3d', scope = schema_scope) # Defined datatype ifcbooleanoperator class ifcbooleanoperator(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifccostscheduletypeenum class ifccostscheduletypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcpileconstructionenum class ifcpileconstructionenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcderivedunitenum class ifcderivedunitenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcelectricflowstoragedevicetypeenum class ifcelectricflowstoragedevicetypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifclightfixturetypeenum class ifclightfixturetypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcfontstyle class ifcfontstyle(STRING): def __init__(self,*kargs): pass self.wr1() def wr1(self): eval_wr1_wr = (self == ['normal','italic','oblique']) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr # SELECT TYPE ifctrimmingselect ifctrimmingselect = SELECT( 'ifccartesianpoint', 'ifcparametervalue', scope = schema_scope) # Defined datatype ifcamountofsubstancemeasure class ifcamountofsubstancemeasure(REAL): def __init__(self,*kargs): pass # SELECT TYPE ifcsizeselect ifcsizeselect = SELECT( 'ifcratiomeasure', 'ifclengthmeasure', 'ifcdescriptivemeasure', 'ifcpositivelengthmeasure', 'ifcnormalisedratiomeasure', 'ifcpositiveratiomeasure', scope = schema_scope) # Defined datatype ifcbeamtypeenum class ifcbeamtypeenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifccharacterstyleselect ifccharacterstyleselect = SELECT( 'ifctextstylefordefinedfont', scope = schema_scope) # Defined datatype ifcpropertysourceenum class ifcpropertysourceenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcsoundscaleenum class ifcsoundscaleenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcpumptypeenum class ifcpumptypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcboxalignment class ifcboxalignment(ifclabel): def __init__(self,*kargs): pass self.wr1() def wr1(self): eval_wr1_wr = (self == ['top-left','top-middle','top-right','middle-left','center','middle-right','bottom-left','bottom-middle','bottom-right']) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr # Defined datatype ifcelectricchargemeasure class ifcelectricchargemeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcminuteinhour class ifcminuteinhour(INTEGER): def __init__(self,*kargs): pass self.wr1() def wr1(self): eval_wr1_wr = ((0 <= self) and (self <= 59)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr # Defined datatype ifcinventorytypeenum class ifcinventorytypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcwarpingmomentmeasure class ifcwarpingmomentmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcresourceconsumptionenum class ifcresourceconsumptionenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifctext class ifctext(STRING): def __init__(self,*kargs): pass # Defined datatype ifcairterminalboxtypeenum class ifcairterminalboxtypeenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifcderivedmeasurevalue ifcderivedmeasurevalue = SELECT( 'ifcvolumetricflowratemeasure', 'ifctimestamp', 'ifcthermaltransmittancemeasure', 'ifcthermalresistancemeasure', 'ifcthermaladmittancemeasure', 'ifcpressuremeasure', 'ifcpowermeasure', 'ifcmassflowratemeasure', 'ifcmassdensitymeasure', 'ifclinearvelocitymeasure', 'ifckinematicviscositymeasure', 'ifcintegercountratemeasure', 'ifcheatfluxdensitymeasure', 'ifcfrequencymeasure', 'ifcenergymeasure', 'ifcelectricvoltagemeasure', 'ifcdynamicviscositymeasure', 'ifccompoundplaneanglemeasure', 'ifcangularvelocitymeasure', 'ifcthermalconductivitymeasure', 'ifcmolecularweightmeasure', 'ifcvaporpermeabilitymeasure', 'ifcmoisturediffusivitymeasure', 'ifcisothermalmoisturecapacitymeasure', 'ifcspecificheatcapacitymeasure', 'ifcmonetarymeasure', 'ifcmagneticfluxdensitymeasure', 'ifcmagneticfluxmeasure', 'ifcluminousfluxmeasure', 'ifcforcemeasure', 'ifcinductancemeasure', 'ifcilluminancemeasure', 'ifcelectricresistancemeasure', 'ifcelectricconductancemeasure', 'ifcelectricchargemeasure', 'ifcdoseequivalentmeasure', 'ifcelectriccapacitancemeasure', 'ifcabsorbeddosemeasure', 'ifcradioactivitymeasure', 'ifcrotationalfrequencymeasure', 'ifctorquemeasure', 'ifcaccelerationmeasure', 'ifclinearforcemeasure', 'ifclinearstiffnessmeasure', 'ifcmodulusofsubgradereactionmeasure', 'ifcmodulusofelasticitymeasure', 'ifcmomentofinertiameasure', 'ifcplanarforcemeasure', 'ifcrotationalstiffnessmeasure', 'ifcshearmodulusmeasure', 'ifclinearmomentmeasure', 'ifcluminousintensitydistributionmeasure', 'ifccurvaturemeasure', 'ifcmassperlengthmeasure', 'ifcmodulusoflinearsubgradereactionmeasure', 'ifcmodulusofrotationalsubgradereactionmeasure', 'ifcrotationalmassmeasure', 'ifcsectionalareaintegralmeasure', 'ifcsectionmodulusmeasure', 'ifctemperaturegradientmeasure', 'ifcthermalexpansioncoefficientmeasure', 'ifcwarpingconstantmeasure', 'ifcwarpingmomentmeasure', 'ifcsoundpowermeasure', 'ifcsoundpressuremeasure', 'ifcheatingvaluemeasure', 'ifcphmeasure', 'ifcionconcentrationmeasure', scope = schema_scope) # Defined datatype ifcreinforcingbarroleenum class ifcreinforcingbarroleenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifclinearstiffnessmeasure class ifclinearstiffnessmeasure(REAL): def __init__(self,*kargs): pass # SELECT TYPE ifccolourorfactor ifccolourorfactor = SELECT( 'ifccolourrgb', 'ifcnormalisedratiomeasure', scope = schema_scope) # SELECT TYPE ifcvectorordirection ifcvectorordirection = SELECT( 'ifcdirection', 'ifcvector', scope = schema_scope) # Defined datatype ifcisothermalmoisturecapacitymeasure class ifcisothermalmoisturecapacitymeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcelectricappliancetypeenum class ifcelectricappliancetypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcratiomeasure class ifcratiomeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcfootingtypeenum class ifcfootingtypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcplatetypeenum class ifcplatetypeenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifcsimplevalue ifcsimplevalue = SELECT( 'ifcinteger', 'ifcreal', 'ifcboolean', 'ifcidentifier', 'ifctext', 'ifclabel', 'ifclogical', scope = schema_scope) # Defined datatype ifcinteger class ifcinteger(INTEGER): def __init__(self,*kargs): pass # Defined datatype ifcthermalexpansioncoefficientmeasure class ifcthermalexpansioncoefficientmeasure(REAL): def __init__(self,*kargs): pass # SELECT TYPE ifcdefinedsymbolselect ifcdefinedsymbolselect = SELECT( 'ifcpredefinedsymbol', 'ifcexternallydefinedsymbol', scope = schema_scope) # Defined datatype ifcpositiveplaneanglemeasure class ifcpositiveplaneanglemeasure(ifcplaneanglemeasure): def __init__(self,*kargs): pass self.wr1() def wr1(self): eval_wr1_wr = (self > 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr # Defined datatype ifccooledbeamtypeenum class ifccooledbeamtypeenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifcdatetimeselect ifcdatetimeselect = SELECT( 'ifccalendardate', 'ifclocaltime', 'ifcdateandtime', scope = schema_scope) # Defined datatype ifcdimensioncount class ifcdimensioncount(INTEGER): def __init__(self,*kargs): pass self.wr1() def wr1(self): eval_wr1_wr = ((0 < self) and (self <= 3)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr # Defined datatype ifcmassmeasure class ifcmassmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcdataoriginenum class ifcdataoriginenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcphysicalorvirtualenum class ifcphysicalorvirtualenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcpermeablecoveringoperationenum class ifcpermeablecoveringoperationenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcstairflighttypeenum class ifcstairflighttypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcjunctionboxtypeenum class ifcjunctionboxtypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifctorquemeasure class ifctorquemeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcglobalorlocalenum class ifcglobalorlocalenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcmoisturediffusivitymeasure class ifcmoisturediffusivitymeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcdistributionchamberelementtypeenum class ifcdistributionchamberelementtypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifctextpath class ifctextpath(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcunitenum class ifcunitenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcelectricdistributionpointfunctionenum class ifcelectricdistributionpointfunctionenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcvalvetypeenum class ifcvalvetypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcpresentabletext class ifcpresentabletext(STRING): def __init__(self,*kargs): pass # Defined datatype ifccompressortypeenum class ifccompressortypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifctimeseriesdatatypeenum class ifctimeseriesdatatypeenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifcspecularhighlightselect ifcspecularhighlightselect = SELECT( 'ifcspecularexponent', 'ifcspecularroughness', scope = schema_scope) # Defined datatype ifcdayinmonthnumber class ifcdayinmonthnumber(INTEGER): def __init__(self,*kargs): pass # Defined datatype ifcspecificheatcapacitymeasure class ifcspecificheatcapacitymeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcenergymeasure class ifcenergymeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcdimensionextentusage class ifcdimensionextentusage(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcelectriccurrentmeasure class ifcelectriccurrentmeasure(REAL): def __init__(self,*kargs): pass # SELECT TYPE ifclayereditem ifclayereditem = SELECT( 'ifcrepresentationitem', 'ifcrepresentation', scope = schema_scope) # Defined datatype ifcluminousfluxmeasure class ifcluminousfluxmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcsensortypeenum class ifcsensortypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcsequenceenum class ifcsequenceenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcdescriptivemeasure class ifcdescriptivemeasure(STRING): def __init__(self,*kargs): pass # Defined datatype ifcelementcompositionenum class ifcelementcompositionenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcthermaltransmittancemeasure class ifcthermaltransmittancemeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcreal class ifcreal(REAL): def __init__(self,*kargs): pass # Defined datatype ifcconstraintenum class ifcconstraintenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcdoorpanelpositionenum class ifcdoorpanelpositionenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcflowdirectionenum class ifcflowdirectionenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcsiprefix class ifcsiprefix(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcboilertypeenum class ifcboilertypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifccurrencyenum class ifccurrencyenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcmagneticfluxdensitymeasure class ifcmagneticfluxdensitymeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcservicelifefactortypeenum class ifcservicelifefactortypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifccoolingtowertypeenum class ifccoolingtowertypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcboolean class ifcboolean(BOOLEAN): def __init__(self,*kargs): pass # Defined datatype ifcdaylightsavinghour class ifcdaylightsavinghour(INTEGER): def __init__(self,*kargs): pass self.wr1() def wr1(self): eval_wr1_wr = ((0 <= self) and (self <= 2)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr # Defined datatype ifcbuildingelementproxytypeenum class ifcbuildingelementproxytypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcstructuralcurvetypeenum class ifcstructuralcurvetypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcangularvelocitymeasure class ifcangularvelocitymeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcmonetarymeasure class ifcmonetarymeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcmonthinyearnumber class ifcmonthinyearnumber(INTEGER): def __init__(self,*kargs): pass self.wr1() def wr1(self): eval_wr1_wr = ((1 <= self) and (self <= 12)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr # Defined datatype ifcsectionmodulusmeasure class ifcsectionmodulusmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcdoorstyleconstructionenum class ifcdoorstyleconstructionenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcrooftypeenum class ifcrooftypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcsanitaryterminaltypeenum class ifcsanitaryterminaltypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcdocumentconfidentialityenum class ifcdocumentconfidentialityenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcfiresuppressionterminaltypeenum class ifcfiresuppressionterminaltypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcradioactivitymeasure class ifcradioactivitymeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcsurfacetextureenum class ifcsurfacetextureenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcmomentofinertiameasure class ifcmomentofinertiameasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcwarpingconstantmeasure class ifcwarpingconstantmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcheatfluxdensitymeasure class ifcheatfluxdensitymeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcvaporpermeabilitymeasure class ifcvaporpermeabilitymeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcsecondinminute class ifcsecondinminute(REAL): def __init__(self,*kargs): pass self.wr1() def wr1(self): eval_wr1_wr = ((0 <= self) and (self < 60)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr # Defined datatype ifcvibrationisolatortypeenum class ifcvibrationisolatortypeenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifcbooleanoperand ifcbooleanoperand = SELECT( 'ifcsolidmodel', 'ifchalfspacesolid', 'ifcbooleanresult', 'ifccsgprimitive3d', scope = schema_scope) # Defined datatype ifcflowinstrumenttypeenum class ifcflowinstrumenttypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcfontvariant class ifcfontvariant(STRING): def __init__(self,*kargs): pass self.wr1() def wr1(self): eval_wr1_wr = (self == ['normal','small-caps']) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr # Defined datatype ifcprofiletypeenum class ifcprofiletypeenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifcactorselect ifcactorselect = SELECT( 'ifcorganization', 'ifcperson', 'ifcpersonandorganization', scope = schema_scope) # Defined datatype ifcmagneticfluxmeasure class ifcmagneticfluxmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcyearnumber class ifcyearnumber(INTEGER): def __init__(self,*kargs): pass # Defined datatype ifcgloballyuniqueid class ifcgloballyuniqueid(STRING): def __init__(self,*kargs): pass # Defined datatype ifcevaporativecoolertypeenum class ifcevaporativecoolertypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcaheadorbehind class ifcaheadorbehind(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcfontweight class ifcfontweight(STRING): def __init__(self,*kargs): pass self.wr1() def wr1(self): eval_wr1_wr = (self == ['normal','small-caps','100','200','300','400','500','600','700','800','900']) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr # Defined datatype ifcchillertypeenum class ifcchillertypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcalarmtypeenum class ifcalarmtypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifccablecarrierfittingtypeenum class ifccablecarrierfittingtypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcthermalloadtypeenum class ifcthermalloadtypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifccolumntypeenum class ifccolumntypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcprojectordertypeenum class ifcprojectordertypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcramptypeenum class ifcramptypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcstateenum class ifcstateenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcpipesegmenttypeenum class ifcpipesegmenttypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifchourinday class ifchourinday(INTEGER): def __init__(self,*kargs): pass self.wr1() def wr1(self): eval_wr1_wr = ((0 <= self) and (self < 24)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr # Defined datatype ifcnormalisedratiomeasure class ifcnormalisedratiomeasure(ifcratiomeasure): def __init__(self,*kargs): pass self.wr1() def wr1(self): eval_wr1_wr = ((0 <= self) and (self <= 1)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr # Defined datatype ifcreinforcingbarsurfaceenum class ifcreinforcingbarsurfaceenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcpositivelengthmeasure class ifcpositivelengthmeasure(ifclengthmeasure): def __init__(self,*kargs): pass self.wr1() def wr1(self): eval_wr1_wr = (self > 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr # Defined datatype ifcdampertypeenum class ifcdampertypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifclayersetdirectionenum class ifclayersetdirectionenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcpipefittingtypeenum class ifcpipefittingtypeenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifccurvestylefontselect ifccurvestylefontselect = SELECT( 'ifcpredefinedcurvefont', 'ifccurvestylefont', scope = schema_scope) # Defined datatype ifcstairtypeenum class ifcstairtypeenum(ENUMERATION): def __init__(self,*kargs): pass ifccomplexnumber = ARRAY(1,2,'REAL', scope = schema_scope) ifccompoundplaneanglemeasure = LIST(3,4,'INTEGER', scope = schema_scope) # Defined datatype ifcevaporatortypeenum class ifcevaporatortypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcmembertypeenum class ifcmembertypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcflowmetertypeenum class ifcflowmetertypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcprojectedortruelengthenum class ifcprojectedortruelengthenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcpositiveratiomeasure class ifcpositiveratiomeasure(ifcratiomeasure): def __init__(self,*kargs): pass self.wr1() def wr1(self): eval_wr1_wr = (self > 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr # Defined datatype ifcobjectiveenum class ifcobjectiveenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifcconditioncriterionselect ifcconditioncriterionselect = SELECT( 'ifclabel', 'ifcmeasurewithunit', scope = schema_scope) # Defined datatype ifcrotationalfrequencymeasure class ifcrotationalfrequencymeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcvolumetricflowratemeasure class ifcvolumetricflowratemeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcwindowstyleoperationenum class ifcwindowstyleoperationenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcworkcontroltypeenum class ifcworkcontroltypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifclinearmomentmeasure class ifclinearmomentmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcphmeasure class ifcphmeasure(REAL): def __init__(self,*kargs): pass self.wr21() def wr21(self): eval_wr21_wr = ((0 <= self) and (self <= 14)) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr # Defined datatype ifccondensertypeenum class ifccondensertypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcmotorconnectiontypeenum class ifcmotorconnectiontypeenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifcsymbolstyleselect ifcsymbolstyleselect = SELECT( 'ifccolour', scope = schema_scope) # SELECT TYPE ifcfillareastyletileshapeselect ifcfillareastyletileshapeselect = SELECT( 'ifcfillareastyletilesymbolwithstyle', scope = schema_scope) # Defined datatype ifcmodulusofsubgradereactionmeasure class ifcmodulusofsubgradereactionmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcsolidanglemeasure class ifcsolidanglemeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcwalltypeenum class ifcwalltypeenum(ENUMERATION): def __init__(self,*kargs): pass # SELECT TYPE ifcdocumentselect ifcdocumentselect = SELECT( 'ifcdocumentreference', 'ifcdocumentinformation', scope = schema_scope) # Defined datatype ifcdoorstyleoperationenum class ifcdoorstyleoperationenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcductsegmenttypeenum class ifcductsegmenttypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcionconcentrationmeasure class ifcionconcentrationmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcnumericmeasure class ifcnumericmeasure(NUMBER): def __init__(self,*kargs): pass # Defined datatype ifcmassflowratemeasure class ifcmassflowratemeasure(REAL): def __init__(self,*kargs): pass # SELECT TYPE ifcsurfacestyleelementselect ifcsurfacestyleelementselect = SELECT( 'ifcsurfacestyleshading', 'ifcsurfacestylelighting', 'ifcsurfacestylewithtextures', 'ifcexternallydefinedsurfacestyle', 'ifcsurfacestylerefraction', scope = schema_scope) # Defined datatype ifcoutlettypeenum class ifcoutlettypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifctemperaturegradientmeasure class ifctemperaturegradientmeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifctextdecoration class ifctextdecoration(STRING): def __init__(self,*kargs): pass self.wr1() def wr1(self): eval_wr1_wr = (self == ['none','underline','overline','line-through','blink']) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr # Defined datatype ifctimestamp class ifctimestamp(INTEGER): def __init__(self,*kargs): pass # Defined datatype ifccablesegmenttypeenum class ifccablesegmenttypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcservicelifetypeenum class ifcservicelifetypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcarithmeticoperatorenum class ifcarithmeticoperatorenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcelectricresistancemeasure class ifcelectricresistancemeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcilluminancemeasure class ifcilluminancemeasure(REAL): def __init__(self,*kargs): pass # Defined datatype ifcrampflighttypeenum class ifcrampflighttypeenum(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcbsplinecurveform class ifcbsplinecurveform(ENUMERATION): def __init__(self,*kargs): pass # Defined datatype ifcelectrictimecontroltypeenum class ifcelectrictimecontroltypeenum(ENUMERATION): def __init__(self,*kargs): pass #################### # ENTITY ifcroot # #################### class ifcroot(BaseEntityClass): '''Entity ifcroot definition. :param globalid :type globalid:ifcgloballyuniqueid :param ownerhistory :type ownerhistory:ifcownerhistory :param name :type name:ifclabel :param description :type description:ifctext ''' def __init__( self , globalid,ownerhistory,name,description, ): self.globalid = globalid self.ownerhistory = ownerhistory self.name = name self.description = description @apply def globalid(): def fget( self ): return self._globalid def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument globalid is mantatory and can not be set to None') if not check_type(value,ifcgloballyuniqueid): self._globalid = ifcgloballyuniqueid(value) else: self._globalid = value return property(**locals()) @apply def ownerhistory(): def fget( self ): return self._ownerhistory def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument ownerhistory is mantatory and can not be set to None') if not check_type(value,ifcownerhistory): self._ownerhistory = ifcownerhistory(value) else: self._ownerhistory = value return property(**locals()) @apply def name(): def fget( self ): return self._name def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value else: self._name = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) #################### # ENTITY ifcrelationship # #################### class ifcrelationship(ifcroot): '''Entity ifcrelationship definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ): ifcroot.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) #################### # ENTITY ifcrelconnects # #################### class ifcrelconnects(ifcrelationship): '''Entity ifcrelconnects definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ): ifcrelationship.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) #################### # ENTITY ifcrelinteractionrequirements # #################### class ifcrelinteractionrequirements(ifcrelconnects): '''Entity ifcrelinteractionrequirements definition. :param dailyinteraction :type dailyinteraction:ifccountmeasure :param importancerating :type importancerating:ifcnormalisedratiomeasure :param locationofinteraction :type locationofinteraction:ifcspatialstructureelement :param relatedspaceprogram :type relatedspaceprogram:ifcspaceprogram :param relatingspaceprogram :type relatingspaceprogram:ifcspaceprogram ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , dailyinteraction,importancerating,locationofinteraction,relatedspaceprogram,relatingspaceprogram, ): ifcrelconnects.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.dailyinteraction = dailyinteraction self.importancerating = importancerating self.locationofinteraction = locationofinteraction self.relatedspaceprogram = relatedspaceprogram self.relatingspaceprogram = relatingspaceprogram @apply def dailyinteraction(): def fget( self ): return self._dailyinteraction def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccountmeasure): self._dailyinteraction = ifccountmeasure(value) else: self._dailyinteraction = value else: self._dailyinteraction = value return property(**locals()) @apply def importancerating(): def fget( self ): return self._importancerating def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcnormalisedratiomeasure): self._importancerating = ifcnormalisedratiomeasure(value) else: self._importancerating = value else: self._importancerating = value return property(**locals()) @apply def locationofinteraction(): def fget( self ): return self._locationofinteraction def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcspatialstructureelement): self._locationofinteraction = ifcspatialstructureelement(value) else: self._locationofinteraction = value else: self._locationofinteraction = value return property(**locals()) @apply def relatedspaceprogram(): def fget( self ): return self._relatedspaceprogram def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedspaceprogram is mantatory and can not be set to None') if not check_type(value,ifcspaceprogram): self._relatedspaceprogram = ifcspaceprogram(value) else: self._relatedspaceprogram = value return property(**locals()) @apply def relatingspaceprogram(): def fget( self ): return self._relatingspaceprogram def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingspaceprogram is mantatory and can not be set to None') if not check_type(value,ifcspaceprogram): self._relatingspaceprogram = ifcspaceprogram(value) else: self._relatingspaceprogram = value return property(**locals()) #################### # ENTITY ifcobjectdefinition # #################### class ifcobjectdefinition(ifcroot): '''Entity ifcobjectdefinition definition. :param hasassignments :type hasassignments:SET(0,None,'ifcrelassigns', scope = schema_scope) :param isdecomposedby :type isdecomposedby:SET(0,None,'ifcreldecomposes', scope = schema_scope) :param decomposes :type decomposes:SET(0,1,'ifcreldecomposes', scope = schema_scope) :param hasassociations :type hasassociations:SET(0,None,'ifcrelassociates', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ): ifcroot.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) @apply def hasassignments(): def fget( self ): return self._hasassignments def fset( self, value ): # INVERSE argument raise AssertionError('Argument hasassignments is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def isdecomposedby(): def fget( self ): return self._isdecomposedby def fset( self, value ): # INVERSE argument raise AssertionError('Argument isdecomposedby is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def decomposes(): def fget( self ): return self._decomposes def fset( self, value ): # INVERSE argument raise AssertionError('Argument decomposes is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def hasassociations(): def fget( self ): return self._hasassociations def fset( self, value ): # INVERSE argument raise AssertionError('Argument hasassociations is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcobject # #################### class ifcobject(ifcobjectdefinition): '''Entity ifcobject definition. :param objecttype :type objecttype:ifclabel :param isdefinedby :type isdefinedby:SET(0,None,'ifcreldefines', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , objecttype, ): ifcobjectdefinition.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.objecttype = objecttype @apply def objecttype(): def fget( self ): return self._objecttype def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._objecttype = ifclabel(value) else: self._objecttype = value else: self._objecttype = value return property(**locals()) @apply def isdefinedby(): def fget( self ): return self._isdefinedby def fset( self, value ): # INVERSE argument raise AssertionError('Argument isdefinedby is INVERSE. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (SIZEOF(None) <= 1) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcproduct # #################### class ifcproduct(ifcobject): '''Entity ifcproduct definition. :param objectplacement :type objectplacement:ifcobjectplacement :param representation :type representation:ifcproductrepresentation :param referencedby :type referencedby:SET(0,None,'ifcrelassignstoproduct', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , objectplacement,representation, ): ifcobject.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.objectplacement = objectplacement self.representation = representation @apply def objectplacement(): def fget( self ): return self._objectplacement def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcobjectplacement): self._objectplacement = ifcobjectplacement(value) else: self._objectplacement = value else: self._objectplacement = value return property(**locals()) @apply def representation(): def fget( self ): return self._representation def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcproductrepresentation): self._representation = ifcproductrepresentation(value) else: self._representation = value else: self._representation = value return property(**locals()) @apply def referencedby(): def fget( self ): return self._referencedby def fset( self, value ): # INVERSE argument raise AssertionError('Argument referencedby is INVERSE. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (((EXISTS(self.representation) and EXISTS(self.objectplacement)) or (EXISTS(self.representation) and ( not ('IFC2X3.IFCPRODUCTDEFINITIONSHAPE' == TYPEOF(self.representation))))) or ( not EXISTS(self.representation))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcelement # #################### class ifcelement(ifcproduct): '''Entity ifcelement definition. :param tag :type tag:ifcidentifier :param hasstructuralmember :type hasstructuralmember:SET(0,None,'ifcrelconnectsstructuralelement', scope = schema_scope) :param fillsvoids :type fillsvoids:SET(0,1,'ifcrelfillselement', scope = schema_scope) :param connectedto :type connectedto:SET(0,None,'ifcrelconnectselements', scope = schema_scope) :param hascoverings :type hascoverings:SET(0,None,'ifcrelcoversbldgelements', scope = schema_scope) :param hasprojections :type hasprojections:SET(0,None,'ifcrelprojectselement', scope = schema_scope) :param referencedinstructures :type referencedinstructures:SET(0,None,'ifcrelreferencedinspatialstructure', scope = schema_scope) :param hasports :type hasports:SET(0,None,'ifcrelconnectsporttoelement', scope = schema_scope) :param hasopenings :type hasopenings:SET(0,None,'ifcrelvoidselement', scope = schema_scope) :param isconnectionrealization :type isconnectionrealization:SET(0,None,'ifcrelconnectswithrealizingelements', scope = schema_scope) :param providesboundaries :type providesboundaries:SET(0,None,'ifcrelspaceboundary', scope = schema_scope) :param connectedfrom :type connectedfrom:SET(0,None,'ifcrelconnectselements', scope = schema_scope) :param containedinstructure :type containedinstructure:SET(0,1,'ifcrelcontainedinspatialstructure', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , tag, ): ifcproduct.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , ) self.tag = tag @apply def tag(): def fget( self ): return self._tag def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcidentifier): self._tag = ifcidentifier(value) else: self._tag = value else: self._tag = value return property(**locals()) @apply def hasstructuralmember(): def fget( self ): return self._hasstructuralmember def fset( self, value ): # INVERSE argument raise AssertionError('Argument hasstructuralmember is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def fillsvoids(): def fget( self ): return self._fillsvoids def fset( self, value ): # INVERSE argument raise AssertionError('Argument fillsvoids is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def connectedto(): def fget( self ): return self._connectedto def fset( self, value ): # INVERSE argument raise AssertionError('Argument connectedto is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def hascoverings(): def fget( self ): return self._hascoverings def fset( self, value ): # INVERSE argument raise AssertionError('Argument hascoverings is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def hasprojections(): def fget( self ): return self._hasprojections def fset( self, value ): # INVERSE argument raise AssertionError('Argument hasprojections is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def referencedinstructures(): def fget( self ): return self._referencedinstructures def fset( self, value ): # INVERSE argument raise AssertionError('Argument referencedinstructures is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def hasports(): def fget( self ): return self._hasports def fset( self, value ): # INVERSE argument raise AssertionError('Argument hasports is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def hasopenings(): def fget( self ): return self._hasopenings def fset( self, value ): # INVERSE argument raise AssertionError('Argument hasopenings is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def isconnectionrealization(): def fget( self ): return self._isconnectionrealization def fset( self, value ): # INVERSE argument raise AssertionError('Argument isconnectionrealization is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def providesboundaries(): def fget( self ): return self._providesboundaries def fset( self, value ): # INVERSE argument raise AssertionError('Argument providesboundaries is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def connectedfrom(): def fget( self ): return self._connectedfrom def fset( self, value ): # INVERSE argument raise AssertionError('Argument connectedfrom is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def containedinstructure(): def fget( self ): return self._containedinstructure def fset( self, value ): # INVERSE argument raise AssertionError('Argument containedinstructure is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcvirtualelement # #################### class ifcvirtualelement(ifcelement): '''Entity ifcvirtualelement definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifccurvestylefontpattern # #################### class ifccurvestylefontpattern(BaseEntityClass): '''Entity ifccurvestylefontpattern definition. :param visiblesegmentlength :type visiblesegmentlength:ifclengthmeasure :param invisiblesegmentlength :type invisiblesegmentlength:ifcpositivelengthmeasure ''' def __init__( self , visiblesegmentlength,invisiblesegmentlength, ): self.visiblesegmentlength = visiblesegmentlength self.invisiblesegmentlength = invisiblesegmentlength @apply def visiblesegmentlength(): def fget( self ): return self._visiblesegmentlength def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument visiblesegmentlength is mantatory and can not be set to None') if not check_type(value,ifclengthmeasure): self._visiblesegmentlength = ifclengthmeasure(value) else: self._visiblesegmentlength = value return property(**locals()) @apply def invisiblesegmentlength(): def fget( self ): return self._invisiblesegmentlength def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument invisiblesegmentlength is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._invisiblesegmentlength = ifcpositivelengthmeasure(value) else: self._invisiblesegmentlength = value return property(**locals()) def wr01(self): eval_wr01_wr = (self.visiblesegmentlength >= 0) if not eval_wr01_wr: raise AssertionError('Rule wr01 violated') else: return eval_wr01_wr #################### # ENTITY ifcrelconnectsstructuralactivity # #################### class ifcrelconnectsstructuralactivity(ifcrelconnects): '''Entity ifcrelconnectsstructuralactivity definition. :param relatingelement :type relatingelement:ifcstructuralactivityassignmentselect :param relatedstructuralactivity :type relatedstructuralactivity:ifcstructuralactivity ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , relatingelement,relatedstructuralactivity, ): ifcrelconnects.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.relatingelement = relatingelement self.relatedstructuralactivity = relatedstructuralactivity @apply def relatingelement(): def fget( self ): return self._relatingelement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingelement is mantatory and can not be set to None') if not check_type(value,ifcstructuralactivityassignmentselect): self._relatingelement = ifcstructuralactivityassignmentselect(value) else: self._relatingelement = value return property(**locals()) @apply def relatedstructuralactivity(): def fget( self ): return self._relatedstructuralactivity def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedstructuralactivity is mantatory and can not be set to None') if not check_type(value,ifcstructuralactivity): self._relatedstructuralactivity = ifcstructuralactivity(value) else: self._relatedstructuralactivity = value return property(**locals()) #################### # ENTITY ifcmaterialproperties # #################### class ifcmaterialproperties(BaseEntityClass): '''Entity ifcmaterialproperties definition. :param material :type material:ifcmaterial ''' def __init__( self , material, ): self.material = material @apply def material(): def fget( self ): return self._material def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument material is mantatory and can not be set to None') if not check_type(value,ifcmaterial): self._material = ifcmaterial(value) else: self._material = value return property(**locals()) #################### # ENTITY ifchygroscopicmaterialproperties # #################### class ifchygroscopicmaterialproperties(ifcmaterialproperties): '''Entity ifchygroscopicmaterialproperties definition. :param uppervaporresistancefactor :type uppervaporresistancefactor:ifcpositiveratiomeasure :param lowervaporresistancefactor :type lowervaporresistancefactor:ifcpositiveratiomeasure :param isothermalmoisturecapacity :type isothermalmoisturecapacity:ifcisothermalmoisturecapacitymeasure :param vaporpermeability :type vaporpermeability:ifcvaporpermeabilitymeasure :param moisturediffusivity :type moisturediffusivity:ifcmoisturediffusivitymeasure ''' def __init__( self , inherited0__material , uppervaporresistancefactor,lowervaporresistancefactor,isothermalmoisturecapacity,vaporpermeability,moisturediffusivity, ): ifcmaterialproperties.__init__(self , inherited0__material , ) self.uppervaporresistancefactor = uppervaporresistancefactor self.lowervaporresistancefactor = lowervaporresistancefactor self.isothermalmoisturecapacity = isothermalmoisturecapacity self.vaporpermeability = vaporpermeability self.moisturediffusivity = moisturediffusivity @apply def uppervaporresistancefactor(): def fget( self ): return self._uppervaporresistancefactor def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._uppervaporresistancefactor = ifcpositiveratiomeasure(value) else: self._uppervaporresistancefactor = value else: self._uppervaporresistancefactor = value return property(**locals()) @apply def lowervaporresistancefactor(): def fget( self ): return self._lowervaporresistancefactor def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._lowervaporresistancefactor = ifcpositiveratiomeasure(value) else: self._lowervaporresistancefactor = value else: self._lowervaporresistancefactor = value return property(**locals()) @apply def isothermalmoisturecapacity(): def fget( self ): return self._isothermalmoisturecapacity def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcisothermalmoisturecapacitymeasure): self._isothermalmoisturecapacity = ifcisothermalmoisturecapacitymeasure(value) else: self._isothermalmoisturecapacity = value else: self._isothermalmoisturecapacity = value return property(**locals()) @apply def vaporpermeability(): def fget( self ): return self._vaporpermeability def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcvaporpermeabilitymeasure): self._vaporpermeability = ifcvaporpermeabilitymeasure(value) else: self._vaporpermeability = value else: self._vaporpermeability = value return property(**locals()) @apply def moisturediffusivity(): def fget( self ): return self._moisturediffusivity def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmoisturediffusivitymeasure): self._moisturediffusivity = ifcmoisturediffusivitymeasure(value) else: self._moisturediffusivity = value else: self._moisturediffusivity = value return property(**locals()) #################### # ENTITY ifcrelassigns # #################### class ifcrelassigns(ifcrelationship): '''Entity ifcrelassigns definition. :param relatedobjects :type relatedobjects:SET(1,None,'ifcobjectdefinition', scope = schema_scope) :param relatedobjectstype :type relatedobjectstype:ifcobjecttypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , relatedobjects,relatedobjectstype, ): ifcrelationship.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.relatedobjects = relatedobjects self.relatedobjectstype = relatedobjectstype @apply def relatedobjects(): def fget( self ): return self._relatedobjects def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedobjects is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcobjectdefinition', scope = schema_scope)): self._relatedobjects = SET(value) else: self._relatedobjects = value return property(**locals()) @apply def relatedobjectstype(): def fget( self ): return self._relatedobjectstype def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcobjecttypeenum): self._relatedobjectstype = ifcobjecttypeenum(value) else: self._relatedobjectstype = value else: self._relatedobjectstype = value return property(**locals()) def wr1(self): eval_wr1_wr = ifccorrectobjectassignment(self.relatedobjectstype,self.relatedobjects) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcrelassignstocontrol # #################### class ifcrelassignstocontrol(ifcrelassigns): '''Entity ifcrelassignstocontrol definition. :param relatingcontrol :type relatingcontrol:ifccontrol ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatedobjectstype , relatingcontrol, ): ifcrelassigns.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatedobjectstype , ) self.relatingcontrol = relatingcontrol @apply def relatingcontrol(): def fget( self ): return self._relatingcontrol def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingcontrol is mantatory and can not be set to None') if not check_type(value,ifccontrol): self._relatingcontrol = ifccontrol(value) else: self._relatingcontrol = value return property(**locals()) def wr1(self): eval_wr1_wr = (SIZEOF(None) == 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcrelschedulescostitems # #################### class ifcrelschedulescostitems(ifcrelassignstocontrol): '''Entity ifcrelschedulescostitems definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatedobjectstype , inherited6__relatingcontrol , ): ifcrelassignstocontrol.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatedobjectstype , inherited6__relatingcontrol , ) def wr11(self): eval_wr11_wr = (SIZEOF(None) == 0) if not eval_wr11_wr: raise AssertionError('Rule wr11 violated') else: return eval_wr11_wr def wr12(self): eval_wr12_wr = ('IFC2X3.IFCCOSTSCHEDULE' == TYPEOF(self.self.ifcrelassignstocontrol.self.relatingcontrol)) if not eval_wr12_wr: raise AssertionError('Rule wr12 violated') else: return eval_wr12_wr #################### # ENTITY ifcproperty # #################### class ifcproperty(BaseEntityClass): '''Entity ifcproperty definition. :param name :type name:ifcidentifier :param description :type description:ifctext :param propertyfordependance :type propertyfordependance:SET(0,None,'ifcpropertydependencyrelationship', scope = schema_scope) :param propertydependson :type propertydependson:SET(0,None,'ifcpropertydependencyrelationship', scope = schema_scope) :param partofcomplex :type partofcomplex:SET(0,1,'ifccomplexproperty', scope = schema_scope) ''' def __init__( self , name,description, ): self.name = name self.description = description @apply def name(): def fget( self ): return self._name def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument name is mantatory and can not be set to None') if not check_type(value,ifcidentifier): self._name = ifcidentifier(value) else: self._name = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) @apply def propertyfordependance(): def fget( self ): return self._propertyfordependance def fset( self, value ): # INVERSE argument raise AssertionError('Argument propertyfordependance is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def propertydependson(): def fget( self ): return self._propertydependson def fset( self, value ): # INVERSE argument raise AssertionError('Argument propertydependson is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def partofcomplex(): def fget( self ): return self._partofcomplex def fset( self, value ): # INVERSE argument raise AssertionError('Argument partofcomplex is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcsimpleproperty # #################### class ifcsimpleproperty(ifcproperty): '''Entity ifcsimpleproperty definition. ''' def __init__( self , inherited0__name , inherited1__description , ): ifcproperty.__init__(self , inherited0__name , inherited1__description , ) #################### # ENTITY ifcpropertyenumeratedvalue # #################### class ifcpropertyenumeratedvalue(ifcsimpleproperty): '''Entity ifcpropertyenumeratedvalue definition. :param enumerationvalues :type enumerationvalues:LIST(1,None,'ifcvalue', scope = schema_scope) :param enumerationreference :type enumerationreference:ifcpropertyenumeration ''' def __init__( self , inherited0__name , inherited1__description , enumerationvalues,enumerationreference, ): ifcsimpleproperty.__init__(self , inherited0__name , inherited1__description , ) self.enumerationvalues = enumerationvalues self.enumerationreference = enumerationreference @apply def enumerationvalues(): def fget( self ): return self._enumerationvalues def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument enumerationvalues is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcvalue', scope = schema_scope)): self._enumerationvalues = LIST(value) else: self._enumerationvalues = value return property(**locals()) @apply def enumerationreference(): def fget( self ): return self._enumerationreference def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpropertyenumeration): self._enumerationreference = ifcpropertyenumeration(value) else: self._enumerationreference = value else: self._enumerationreference = value return property(**locals()) def wr1(self): eval_wr1_wr = (( not EXISTS(self.enumerationreference)) or (SIZEOF(None) == SIZEOF(self.enumerationvalues))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcreinforcementbarproperties # #################### class ifcreinforcementbarproperties(BaseEntityClass): '''Entity ifcreinforcementbarproperties definition. :param totalcrosssectionarea :type totalcrosssectionarea:ifcareameasure :param steelgrade :type steelgrade:ifclabel :param barsurface :type barsurface:ifcreinforcingbarsurfaceenum :param effectivedepth :type effectivedepth:ifclengthmeasure :param nominalbardiameter :type nominalbardiameter:ifcpositivelengthmeasure :param barcount :type barcount:ifccountmeasure ''' def __init__( self , totalcrosssectionarea,steelgrade,barsurface,effectivedepth,nominalbardiameter,barcount, ): self.totalcrosssectionarea = totalcrosssectionarea self.steelgrade = steelgrade self.barsurface = barsurface self.effectivedepth = effectivedepth self.nominalbardiameter = nominalbardiameter self.barcount = barcount @apply def totalcrosssectionarea(): def fget( self ): return self._totalcrosssectionarea def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument totalcrosssectionarea is mantatory and can not be set to None') if not check_type(value,ifcareameasure): self._totalcrosssectionarea = ifcareameasure(value) else: self._totalcrosssectionarea = value return property(**locals()) @apply def steelgrade(): def fget( self ): return self._steelgrade def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument steelgrade is mantatory and can not be set to None') if not check_type(value,ifclabel): self._steelgrade = ifclabel(value) else: self._steelgrade = value return property(**locals()) @apply def barsurface(): def fget( self ): return self._barsurface def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcreinforcingbarsurfaceenum): self._barsurface = ifcreinforcingbarsurfaceenum(value) else: self._barsurface = value else: self._barsurface = value return property(**locals()) @apply def effectivedepth(): def fget( self ): return self._effectivedepth def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._effectivedepth = ifclengthmeasure(value) else: self._effectivedepth = value else: self._effectivedepth = value return property(**locals()) @apply def nominalbardiameter(): def fget( self ): return self._nominalbardiameter def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._nominalbardiameter = ifcpositivelengthmeasure(value) else: self._nominalbardiameter = value else: self._nominalbardiameter = value return property(**locals()) @apply def barcount(): def fget( self ): return self._barcount def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccountmeasure): self._barcount = ifccountmeasure(value) else: self._barcount = value else: self._barcount = value return property(**locals()) #################### # ENTITY ifcrepresentationitem # #################### class ifcrepresentationitem(BaseEntityClass): '''Entity ifcrepresentationitem definition. :param layerassignments :type layerassignments:SET(0,None,'ifcpresentationlayerassignment', scope = schema_scope) :param styledbyitem :type styledbyitem:SET(0,1,'ifcstyleditem', scope = schema_scope) ''' # This class does not define any attribute. pass @apply def layerassignments(): def fget( self ): return self._layerassignments def fset( self, value ): # INVERSE argument raise AssertionError('Argument layerassignments is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def styledbyitem(): def fget( self ): return self._styledbyitem def fset( self, value ): # INVERSE argument raise AssertionError('Argument styledbyitem is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcgeometricrepresentationitem # #################### class ifcgeometricrepresentationitem(ifcrepresentationitem): '''Entity ifcgeometricrepresentationitem definition. ''' def __init__( self , ): ifcrepresentationitem.__init__(self , ) #################### # ENTITY ifcsurface # #################### class ifcsurface(ifcgeometricrepresentationitem): '''Entity ifcsurface definition. ''' def __init__( self , ): ifcgeometricrepresentationitem.__init__(self , ) #################### # ENTITY ifcsweptsurface # #################### class ifcsweptsurface(ifcsurface): '''Entity ifcsweptsurface definition. :param sweptcurve :type sweptcurve:ifcprofiledef :param position :type position:ifcaxis2placement3d :param dim :type dim:ifcdimensioncount ''' def __init__( self , sweptcurve,position, ): ifcsurface.__init__(self , ) self.sweptcurve = sweptcurve self.position = position @apply def sweptcurve(): def fget( self ): return self._sweptcurve def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument sweptcurve is mantatory and can not be set to None') if not check_type(value,ifcprofiledef): self._sweptcurve = ifcprofiledef(value) else: self._sweptcurve = value return property(**locals()) @apply def position(): def fget( self ): return self._position def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument position is mantatory and can not be set to None') if not check_type(value,ifcaxis2placement3d): self._position = ifcaxis2placement3d(value) else: self._position = value return property(**locals()) @apply def dim(): def fget( self ): attribute_eval = self.position.self.dim return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = ( not ('IFC2X3.IFCDERIVEDPROFILEDEF' == TYPEOF(self.sweptcurve))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (self.sweptcurve.self.profiletype == ifcprofiletypeenum.self.curve) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr #################### # ENTITY ifcsurfaceofrevolution # #################### class ifcsurfaceofrevolution(ifcsweptsurface): '''Entity ifcsurfaceofrevolution definition. :param axisposition :type axisposition:ifcaxis1placement :param axisline :type axisline:ifcline ''' def __init__( self , inherited0__sweptcurve , inherited1__position , axisposition, ): ifcsweptsurface.__init__(self , inherited0__sweptcurve , inherited1__position , ) self.axisposition = axisposition @apply def axisposition(): def fget( self ): return self._axisposition def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument axisposition is mantatory and can not be set to None') if not check_type(value,ifcaxis1placement): self._axisposition = ifcaxis1placement(value) else: self._axisposition = value return property(**locals()) @apply def axisline(): def fget( self ): attribute_eval = (((ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifccurve()) == ifcline(self.axisposition.self.location,(ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcvector(self.axisposition.self.z,1))) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument axisline is DERIVED. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcprofiledef # #################### class ifcprofiledef(BaseEntityClass): '''Entity ifcprofiledef definition. :param profiletype :type profiletype:ifcprofiletypeenum :param profilename :type profilename:ifclabel ''' def __init__( self , profiletype,profilename, ): self.profiletype = profiletype self.profilename = profilename @apply def profiletype(): def fget( self ): return self._profiletype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument profiletype is mantatory and can not be set to None') if not check_type(value,ifcprofiletypeenum): self._profiletype = ifcprofiletypeenum(value) else: self._profiletype = value return property(**locals()) @apply def profilename(): def fget( self ): return self._profilename def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._profilename = ifclabel(value) else: self._profilename = value else: self._profilename = value return property(**locals()) #################### # ENTITY ifcparameterizedprofiledef # #################### class ifcparameterizedprofiledef(ifcprofiledef): '''Entity ifcparameterizedprofiledef definition. :param position :type position:ifcaxis2placement2d ''' def __init__( self , inherited0__profiletype , inherited1__profilename , position, ): ifcprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , ) self.position = position @apply def position(): def fget( self ): return self._position def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument position is mantatory and can not be set to None') if not check_type(value,ifcaxis2placement2d): self._position = ifcaxis2placement2d(value) else: self._position = value return property(**locals()) #################### # ENTITY ifccranerailashapeprofiledef # #################### class ifccranerailashapeprofiledef(ifcparameterizedprofiledef): '''Entity ifccranerailashapeprofiledef definition. :param overallheight :type overallheight:ifcpositivelengthmeasure :param basewidth2 :type basewidth2:ifcpositivelengthmeasure :param radius :type radius:ifcpositivelengthmeasure :param headwidth :type headwidth:ifcpositivelengthmeasure :param headdepth2 :type headdepth2:ifcpositivelengthmeasure :param headdepth3 :type headdepth3:ifcpositivelengthmeasure :param webthickness :type webthickness:ifcpositivelengthmeasure :param basewidth4 :type basewidth4:ifcpositivelengthmeasure :param basedepth1 :type basedepth1:ifcpositivelengthmeasure :param basedepth2 :type basedepth2:ifcpositivelengthmeasure :param basedepth3 :type basedepth3:ifcpositivelengthmeasure :param centreofgravityiny :type centreofgravityiny:ifcpositivelengthmeasure ''' def __init__( self , inherited0__profiletype , inherited1__profilename , inherited2__position , overallheight,basewidth2,radius,headwidth,headdepth2,headdepth3,webthickness,basewidth4,basedepth1,basedepth2,basedepth3,centreofgravityiny, ): ifcparameterizedprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , inherited2__position , ) self.overallheight = overallheight self.basewidth2 = basewidth2 self.radius = radius self.headwidth = headwidth self.headdepth2 = headdepth2 self.headdepth3 = headdepth3 self.webthickness = webthickness self.basewidth4 = basewidth4 self.basedepth1 = basedepth1 self.basedepth2 = basedepth2 self.basedepth3 = basedepth3 self.centreofgravityiny = centreofgravityiny @apply def overallheight(): def fget( self ): return self._overallheight def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument overallheight is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._overallheight = ifcpositivelengthmeasure(value) else: self._overallheight = value return property(**locals()) @apply def basewidth2(): def fget( self ): return self._basewidth2 def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument basewidth2 is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._basewidth2 = ifcpositivelengthmeasure(value) else: self._basewidth2 = value return property(**locals()) @apply def radius(): def fget( self ): return self._radius def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._radius = ifcpositivelengthmeasure(value) else: self._radius = value else: self._radius = value return property(**locals()) @apply def headwidth(): def fget( self ): return self._headwidth def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument headwidth is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._headwidth = ifcpositivelengthmeasure(value) else: self._headwidth = value return property(**locals()) @apply def headdepth2(): def fget( self ): return self._headdepth2 def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument headdepth2 is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._headdepth2 = ifcpositivelengthmeasure(value) else: self._headdepth2 = value return property(**locals()) @apply def headdepth3(): def fget( self ): return self._headdepth3 def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument headdepth3 is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._headdepth3 = ifcpositivelengthmeasure(value) else: self._headdepth3 = value return property(**locals()) @apply def webthickness(): def fget( self ): return self._webthickness def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument webthickness is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._webthickness = ifcpositivelengthmeasure(value) else: self._webthickness = value return property(**locals()) @apply def basewidth4(): def fget( self ): return self._basewidth4 def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument basewidth4 is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._basewidth4 = ifcpositivelengthmeasure(value) else: self._basewidth4 = value return property(**locals()) @apply def basedepth1(): def fget( self ): return self._basedepth1 def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument basedepth1 is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._basedepth1 = ifcpositivelengthmeasure(value) else: self._basedepth1 = value return property(**locals()) @apply def basedepth2(): def fget( self ): return self._basedepth2 def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument basedepth2 is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._basedepth2 = ifcpositivelengthmeasure(value) else: self._basedepth2 = value return property(**locals()) @apply def basedepth3(): def fget( self ): return self._basedepth3 def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument basedepth3 is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._basedepth3 = ifcpositivelengthmeasure(value) else: self._basedepth3 = value return property(**locals()) @apply def centreofgravityiny(): def fget( self ): return self._centreofgravityiny def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._centreofgravityiny = ifcpositivelengthmeasure(value) else: self._centreofgravityiny = value else: self._centreofgravityiny = value return property(**locals()) #################### # ENTITY ifctypeobject # #################### class ifctypeobject(ifcobjectdefinition): '''Entity ifctypeobject definition. :param applicableoccurrence :type applicableoccurrence:ifclabel :param haspropertysets :type haspropertysets:SET(1,None,'ifcpropertysetdefinition', scope = schema_scope) :param objecttypeof :type objecttypeof:SET(0,1,'ifcreldefinesbytype', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , applicableoccurrence,haspropertysets, ): ifcobjectdefinition.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.applicableoccurrence = applicableoccurrence self.haspropertysets = haspropertysets @apply def applicableoccurrence(): def fget( self ): return self._applicableoccurrence def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._applicableoccurrence = ifclabel(value) else: self._applicableoccurrence = value else: self._applicableoccurrence = value return property(**locals()) @apply def haspropertysets(): def fget( self ): return self._haspropertysets def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,SET(1,None,'ifcpropertysetdefinition', scope = schema_scope)): self._haspropertysets = SET(value) else: self._haspropertysets = value else: self._haspropertysets = value return property(**locals()) @apply def objecttypeof(): def fget( self ): return self._objecttypeof def fset( self, value ): # INVERSE argument raise AssertionError('Argument objecttypeof is INVERSE. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = EXISTS(self.self.ifcroot.self.name) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifctypeproduct # #################### class ifctypeproduct(ifctypeobject): '''Entity ifctypeproduct definition. :param representationmaps :type representationmaps:LIST(1,None,'ifcrepresentationmap', scope = schema_scope) :param tag :type tag:ifclabel ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , representationmaps,tag, ): ifctypeobject.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , ) self.representationmaps = representationmaps self.tag = tag @apply def representationmaps(): def fget( self ): return self._representationmaps def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,LIST(1,None,'ifcrepresentationmap', scope = schema_scope)): self._representationmaps = LIST(value) else: self._representationmaps = value else: self._representationmaps = value return property(**locals()) @apply def tag(): def fget( self ): return self._tag def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._tag = ifclabel(value) else: self._tag = value else: self._tag = value return property(**locals()) def wr41(self): eval_wr41_wr = (( not EXISTS(self.self.ifctypeobject.self.objecttypeof[1])) or (SIZEOF(None) == 0)) if not eval_wr41_wr: raise AssertionError('Rule wr41 violated') else: return eval_wr41_wr #################### # ENTITY ifcelementtype # #################### class ifcelementtype(ifctypeproduct): '''Entity ifcelementtype definition. :param elementtype :type elementtype:ifclabel ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , elementtype, ): ifctypeproduct.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , ) self.elementtype = elementtype @apply def elementtype(): def fget( self ): return self._elementtype def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._elementtype = ifclabel(value) else: self._elementtype = value else: self._elementtype = value return property(**locals()) #################### # ENTITY ifcdistributionelementtype # #################### class ifcdistributionelementtype(ifcelementtype): '''Entity ifcdistributionelementtype definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ): ifcelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) #################### # ENTITY ifcdistributionflowelementtype # #################### class ifcdistributionflowelementtype(ifcdistributionelementtype): '''Entity ifcdistributionflowelementtype definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ): ifcdistributionelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) #################### # ENTITY ifcflowsegmenttype # #################### class ifcflowsegmenttype(ifcdistributionflowelementtype): '''Entity ifcflowsegmenttype definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ): ifcdistributionflowelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) #################### # ENTITY ifccablesegmenttype # #################### class ifccablesegmenttype(ifcflowsegmenttype): '''Entity ifccablesegmenttype definition. :param predefinedtype :type predefinedtype:ifccablesegmenttypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowsegmenttype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifccablesegmenttypeenum): self._predefinedtype = ifccablesegmenttypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcpropertydefinition # #################### class ifcpropertydefinition(ifcroot): '''Entity ifcpropertydefinition definition. :param hasassociations :type hasassociations:SET(0,None,'ifcrelassociates', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ): ifcroot.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) @apply def hasassociations(): def fget( self ): return self._hasassociations def fset( self, value ): # INVERSE argument raise AssertionError('Argument hasassociations is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcpropertysetdefinition # #################### class ifcpropertysetdefinition(ifcpropertydefinition): '''Entity ifcpropertysetdefinition definition. :param propertydefinitionof :type propertydefinitionof:SET(0,1,'ifcreldefinesbyproperties', scope = schema_scope) :param definestype :type definestype:SET(0,1,'ifctypeobject', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ): ifcpropertydefinition.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) @apply def propertydefinitionof(): def fget( self ): return self._propertydefinitionof def fset( self, value ): # INVERSE argument raise AssertionError('Argument propertydefinitionof is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def definestype(): def fget( self ): return self._definestype def fset( self, value ): # INVERSE argument raise AssertionError('Argument definestype is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcelementquantity # #################### class ifcelementquantity(ifcpropertysetdefinition): '''Entity ifcelementquantity definition. :param methodofmeasurement :type methodofmeasurement:ifclabel :param quantities :type quantities:SET(1,None,'ifcphysicalquantity', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , methodofmeasurement,quantities, ): ifcpropertysetdefinition.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.methodofmeasurement = methodofmeasurement self.quantities = quantities @apply def methodofmeasurement(): def fget( self ): return self._methodofmeasurement def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._methodofmeasurement = ifclabel(value) else: self._methodofmeasurement = value else: self._methodofmeasurement = value return property(**locals()) @apply def quantities(): def fget( self ): return self._quantities def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument quantities is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcphysicalquantity', scope = schema_scope)): self._quantities = SET(value) else: self._quantities = value return property(**locals()) #################### # ENTITY ifcenergyconversiondevicetype # #################### class ifcenergyconversiondevicetype(ifcdistributionflowelementtype): '''Entity ifcenergyconversiondevicetype definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ): ifcdistributionflowelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) #################### # ENTITY ifchumidifiertype # #################### class ifchumidifiertype(ifcenergyconversiondevicetype): '''Entity ifchumidifiertype definition. :param predefinedtype :type predefinedtype:ifchumidifiertypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcenergyconversiondevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifchumidifiertypeenum): self._predefinedtype = ifchumidifiertypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifchumidifiertypeenum.self.userdefined) or ((self.predefinedtype == ifchumidifiertypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcstructuralitem # #################### class ifcstructuralitem(ifcproduct): '''Entity ifcstructuralitem definition. :param assignedstructuralactivity :type assignedstructuralactivity:SET(0,None,'ifcrelconnectsstructuralactivity', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , ): ifcproduct.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , ) @apply def assignedstructuralactivity(): def fget( self ): return self._assignedstructuralactivity def fset( self, value ): # INVERSE argument raise AssertionError('Argument assignedstructuralactivity is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcstructuralload # #################### class ifcstructuralload(BaseEntityClass): '''Entity ifcstructuralload definition. :param name :type name:ifclabel ''' def __init__( self , name, ): self.name = name @apply def name(): def fget( self ): return self._name def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value else: self._name = value return property(**locals()) #################### # ENTITY ifcstructuralloadstatic # #################### class ifcstructuralloadstatic(ifcstructuralload): '''Entity ifcstructuralloadstatic definition. ''' def __init__( self , inherited0__name , ): ifcstructuralload.__init__(self , inherited0__name , ) #################### # ENTITY ifcstructuralloadsingledisplacement # #################### class ifcstructuralloadsingledisplacement(ifcstructuralloadstatic): '''Entity ifcstructuralloadsingledisplacement definition. :param displacementx :type displacementx:ifclengthmeasure :param displacementy :type displacementy:ifclengthmeasure :param displacementz :type displacementz:ifclengthmeasure :param rotationaldisplacementrx :type rotationaldisplacementrx:ifcplaneanglemeasure :param rotationaldisplacementry :type rotationaldisplacementry:ifcplaneanglemeasure :param rotationaldisplacementrz :type rotationaldisplacementrz:ifcplaneanglemeasure ''' def __init__( self , inherited0__name , displacementx,displacementy,displacementz,rotationaldisplacementrx,rotationaldisplacementry,rotationaldisplacementrz, ): ifcstructuralloadstatic.__init__(self , inherited0__name , ) self.displacementx = displacementx self.displacementy = displacementy self.displacementz = displacementz self.rotationaldisplacementrx = rotationaldisplacementrx self.rotationaldisplacementry = rotationaldisplacementry self.rotationaldisplacementrz = rotationaldisplacementrz @apply def displacementx(): def fget( self ): return self._displacementx def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._displacementx = ifclengthmeasure(value) else: self._displacementx = value else: self._displacementx = value return property(**locals()) @apply def displacementy(): def fget( self ): return self._displacementy def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._displacementy = ifclengthmeasure(value) else: self._displacementy = value else: self._displacementy = value return property(**locals()) @apply def displacementz(): def fget( self ): return self._displacementz def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._displacementz = ifclengthmeasure(value) else: self._displacementz = value else: self._displacementz = value return property(**locals()) @apply def rotationaldisplacementrx(): def fget( self ): return self._rotationaldisplacementrx def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcplaneanglemeasure): self._rotationaldisplacementrx = ifcplaneanglemeasure(value) else: self._rotationaldisplacementrx = value else: self._rotationaldisplacementrx = value return property(**locals()) @apply def rotationaldisplacementry(): def fget( self ): return self._rotationaldisplacementry def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcplaneanglemeasure): self._rotationaldisplacementry = ifcplaneanglemeasure(value) else: self._rotationaldisplacementry = value else: self._rotationaldisplacementry = value return property(**locals()) @apply def rotationaldisplacementrz(): def fget( self ): return self._rotationaldisplacementrz def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcplaneanglemeasure): self._rotationaldisplacementrz = ifcplaneanglemeasure(value) else: self._rotationaldisplacementrz = value else: self._rotationaldisplacementrz = value return property(**locals()) #################### # ENTITY ifctransportelementtype # #################### class ifctransportelementtype(ifcelementtype): '''Entity ifctransportelementtype definition. :param predefinedtype :type predefinedtype:ifctransportelementtypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifctransportelementtypeenum): self._predefinedtype = ifctransportelementtypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifctrapeziumprofiledef # #################### class ifctrapeziumprofiledef(ifcparameterizedprofiledef): '''Entity ifctrapeziumprofiledef definition. :param bottomxdim :type bottomxdim:ifcpositivelengthmeasure :param topxdim :type topxdim:ifcpositivelengthmeasure :param ydim :type ydim:ifcpositivelengthmeasure :param topxoffset :type topxoffset:ifclengthmeasure ''' def __init__( self , inherited0__profiletype , inherited1__profilename , inherited2__position , bottomxdim,topxdim,ydim,topxoffset, ): ifcparameterizedprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , inherited2__position , ) self.bottomxdim = bottomxdim self.topxdim = topxdim self.ydim = ydim self.topxoffset = topxoffset @apply def bottomxdim(): def fget( self ): return self._bottomxdim def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument bottomxdim is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._bottomxdim = ifcpositivelengthmeasure(value) else: self._bottomxdim = value return property(**locals()) @apply def topxdim(): def fget( self ): return self._topxdim def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument topxdim is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._topxdim = ifcpositivelengthmeasure(value) else: self._topxdim = value return property(**locals()) @apply def ydim(): def fget( self ): return self._ydim def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument ydim is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._ydim = ifcpositivelengthmeasure(value) else: self._ydim = value return property(**locals()) @apply def topxoffset(): def fget( self ): return self._topxoffset def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument topxoffset is mantatory and can not be set to None') if not check_type(value,ifclengthmeasure): self._topxoffset = ifclengthmeasure(value) else: self._topxoffset = value return property(**locals()) #################### # ENTITY ifczshapeprofiledef # #################### class ifczshapeprofiledef(ifcparameterizedprofiledef): '''Entity ifczshapeprofiledef definition. :param depth :type depth:ifcpositivelengthmeasure :param flangewidth :type flangewidth:ifcpositivelengthmeasure :param webthickness :type webthickness:ifcpositivelengthmeasure :param flangethickness :type flangethickness:ifcpositivelengthmeasure :param filletradius :type filletradius:ifcpositivelengthmeasure :param edgeradius :type edgeradius:ifcpositivelengthmeasure ''' def __init__( self , inherited0__profiletype , inherited1__profilename , inherited2__position , depth,flangewidth,webthickness,flangethickness,filletradius,edgeradius, ): ifcparameterizedprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , inherited2__position , ) self.depth = depth self.flangewidth = flangewidth self.webthickness = webthickness self.flangethickness = flangethickness self.filletradius = filletradius self.edgeradius = edgeradius @apply def depth(): def fget( self ): return self._depth def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument depth is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._depth = ifcpositivelengthmeasure(value) else: self._depth = value return property(**locals()) @apply def flangewidth(): def fget( self ): return self._flangewidth def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument flangewidth is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._flangewidth = ifcpositivelengthmeasure(value) else: self._flangewidth = value return property(**locals()) @apply def webthickness(): def fget( self ): return self._webthickness def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument webthickness is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._webthickness = ifcpositivelengthmeasure(value) else: self._webthickness = value return property(**locals()) @apply def flangethickness(): def fget( self ): return self._flangethickness def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument flangethickness is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._flangethickness = ifcpositivelengthmeasure(value) else: self._flangethickness = value return property(**locals()) @apply def filletradius(): def fget( self ): return self._filletradius def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._filletradius = ifcpositivelengthmeasure(value) else: self._filletradius = value else: self._filletradius = value return property(**locals()) @apply def edgeradius(): def fget( self ): return self._edgeradius def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._edgeradius = ifcpositivelengthmeasure(value) else: self._edgeradius = value else: self._edgeradius = value return property(**locals()) def wr21(self): eval_wr21_wr = (self.flangethickness < (self.depth / 2)) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr #################### # ENTITY ifcstyleditem # #################### class ifcstyleditem(ifcrepresentationitem): '''Entity ifcstyleditem definition. :param item :type item:ifcrepresentationitem :param styles :type styles:SET(1,None,'ifcpresentationstyleassignment', scope = schema_scope) :param name :type name:ifclabel ''' def __init__( self , item,styles,name, ): ifcrepresentationitem.__init__(self , ) self.item = item self.styles = styles self.name = name @apply def item(): def fget( self ): return self._item def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcrepresentationitem): self._item = ifcrepresentationitem(value) else: self._item = value else: self._item = value return property(**locals()) @apply def styles(): def fget( self ): return self._styles def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument styles is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcpresentationstyleassignment', scope = schema_scope)): self._styles = SET(value) else: self._styles = value return property(**locals()) @apply def name(): def fget( self ): return self._name def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value else: self._name = value return property(**locals()) def wr11(self): eval_wr11_wr = (SIZEOF(self.styles) == 1) if not eval_wr11_wr: raise AssertionError('Rule wr11 violated') else: return eval_wr11_wr def wr12(self): eval_wr12_wr = ( not ('IFC2X3.IFCSTYLEDITEM' == TYPEOF(self.item))) if not eval_wr12_wr: raise AssertionError('Rule wr12 violated') else: return eval_wr12_wr #################### # ENTITY ifcannotationoccurrence # #################### class ifcannotationoccurrence(ifcstyleditem): '''Entity ifcannotationoccurrence definition. ''' def __init__( self , inherited0__item , inherited1__styles , inherited2__name , ): ifcstyleditem.__init__(self , inherited0__item , inherited1__styles , inherited2__name , ) #################### # ENTITY ifcannotationtextoccurrence # #################### class ifcannotationtextoccurrence(ifcannotationoccurrence): '''Entity ifcannotationtextoccurrence definition. ''' def __init__( self , inherited0__item , inherited1__styles , inherited2__name , ): ifcannotationoccurrence.__init__(self , inherited0__item , inherited1__styles , inherited2__name , ) def wr31(self): eval_wr31_wr = (( not EXISTS(self.self.ifcstyleditem.self.item)) or ('IFC2X3.IFCTEXTLITERAL' == TYPEOF(self.self.ifcstyleditem.self.item))) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifccontrol # #################### class ifccontrol(ifcobject): '''Entity ifccontrol definition. :param controls :type controls:SET(0,None,'ifcrelassignstocontrol', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ): ifcobject.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) @apply def controls(): def fget( self ): return self._controls def fset( self, value ): # INVERSE argument raise AssertionError('Argument controls is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifccostitem # #################### class ifccostitem(ifccontrol): '''Entity ifccostitem definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ): ifccontrol.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) #################### # ENTITY ifclightsource # #################### class ifclightsource(ifcgeometricrepresentationitem): '''Entity ifclightsource definition. :param name :type name:ifclabel :param lightcolour :type lightcolour:ifccolourrgb :param ambientintensity :type ambientintensity:ifcnormalisedratiomeasure :param intensity :type intensity:ifcnormalisedratiomeasure ''' def __init__( self , name,lightcolour,ambientintensity,intensity, ): ifcgeometricrepresentationitem.__init__(self , ) self.name = name self.lightcolour = lightcolour self.ambientintensity = ambientintensity self.intensity = intensity @apply def name(): def fget( self ): return self._name def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value else: self._name = value return property(**locals()) @apply def lightcolour(): def fget( self ): return self._lightcolour def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument lightcolour is mantatory and can not be set to None') if not check_type(value,ifccolourrgb): self._lightcolour = ifccolourrgb(value) else: self._lightcolour = value return property(**locals()) @apply def ambientintensity(): def fget( self ): return self._ambientintensity def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcnormalisedratiomeasure): self._ambientintensity = ifcnormalisedratiomeasure(value) else: self._ambientintensity = value else: self._ambientintensity = value return property(**locals()) @apply def intensity(): def fget( self ): return self._intensity def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcnormalisedratiomeasure): self._intensity = ifcnormalisedratiomeasure(value) else: self._intensity = value else: self._intensity = value return property(**locals()) #################### # ENTITY ifcfeatureelement # #################### class ifcfeatureelement(ifcelement): '''Entity ifcfeatureelement definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcfeatureelementaddition # #################### class ifcfeatureelementaddition(ifcfeatureelement): '''Entity ifcfeatureelementaddition definition. :param projectselements :type projectselements:ifcrelprojectselement ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcfeatureelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) @apply def projectselements(): def fget( self ): return self._projectselements def fset( self, value ): # INVERSE argument raise AssertionError('Argument projectselements is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcstructuralconnectioncondition # #################### class ifcstructuralconnectioncondition(BaseEntityClass): '''Entity ifcstructuralconnectioncondition definition. :param name :type name:ifclabel ''' def __init__( self , name, ): self.name = name @apply def name(): def fget( self ): return self._name def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value else: self._name = value return property(**locals()) #################### # ENTITY ifcpoint # #################### class ifcpoint(ifcgeometricrepresentationitem): '''Entity ifcpoint definition. ''' def __init__( self , ): ifcgeometricrepresentationitem.__init__(self , ) #################### # ENTITY ifccartesianpoint # #################### class ifccartesianpoint(ifcpoint): '''Entity ifccartesianpoint definition. :param coordinates :type coordinates:LIST(1,3,'REAL', scope = schema_scope) :param dim :type dim:ifcdimensioncount ''' def __init__( self , coordinates, ): ifcpoint.__init__(self , ) self.coordinates = coordinates @apply def coordinates(): def fget( self ): return self._coordinates def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument coordinates is mantatory and can not be set to None') if not check_type(value,LIST(1,3,'REAL', scope = schema_scope)): self._coordinates = LIST(value) else: self._coordinates = value return property(**locals()) @apply def dim(): def fget( self ): attribute_eval = HIINDEX(self.coordinates) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (HIINDEX(self.coordinates) >= 2) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcexternalreference # #################### class ifcexternalreference(BaseEntityClass): '''Entity ifcexternalreference definition. :param location :type location:ifclabel :param itemreference :type itemreference:ifcidentifier :param name :type name:ifclabel ''' def __init__( self , location,itemreference,name, ): self.location = location self.itemreference = itemreference self.name = name @apply def location(): def fget( self ): return self._location def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._location = ifclabel(value) else: self._location = value else: self._location = value return property(**locals()) @apply def itemreference(): def fget( self ): return self._itemreference def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcidentifier): self._itemreference = ifcidentifier(value) else: self._itemreference = value else: self._itemreference = value return property(**locals()) @apply def name(): def fget( self ): return self._name def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value else: self._name = value return property(**locals()) def wr1(self): eval_wr1_wr = ((EXISTS(self.itemreference) or EXISTS(self.location)) or EXISTS(self.name)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcclassificationreference # #################### class ifcclassificationreference(ifcexternalreference): '''Entity ifcclassificationreference definition. :param referencedsource :type referencedsource:ifcclassification ''' def __init__( self , inherited0__location , inherited1__itemreference , inherited2__name , referencedsource, ): ifcexternalreference.__init__(self , inherited0__location , inherited1__itemreference , inherited2__name , ) self.referencedsource = referencedsource @apply def referencedsource(): def fget( self ): return self._referencedsource def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcclassification): self._referencedsource = ifcclassification(value) else: self._referencedsource = value else: self._referencedsource = value return property(**locals()) #################### # ENTITY ifcderivedunitelement # #################### class ifcderivedunitelement(BaseEntityClass): '''Entity ifcderivedunitelement definition. :param unit :type unit:ifcnamedunit :param exponent :type exponent:INTEGER ''' def __init__( self , unit,exponent, ): self.unit = unit self.exponent = exponent @apply def unit(): def fget( self ): return self._unit def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument unit is mantatory and can not be set to None') if not check_type(value,ifcnamedunit): self._unit = ifcnamedunit(value) else: self._unit = value return property(**locals()) @apply def exponent(): def fget( self ): return self._exponent def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument exponent is mantatory and can not be set to None') if not check_type(value,INTEGER): self._exponent = INTEGER(value) else: self._exponent = value return property(**locals()) #################### # ENTITY ifcbuildingelement # #################### class ifcbuildingelement(ifcelement): '''Entity ifcbuildingelement definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcrailing # #################### class ifcrailing(ifcbuildingelement): '''Entity ifcrailing definition. :param predefinedtype :type predefinedtype:ifcrailingtypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , predefinedtype, ): ifcbuildingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcrailingtypeenum): self._predefinedtype = ifcrailingtypeenum(value) else: self._predefinedtype = value else: self._predefinedtype = value return property(**locals()) def wr61(self): eval_wr61_wr = ((( not EXISTS(self.predefinedtype)) or (self.predefinedtype != ifcrailingtypeenum.self.userdefined)) or ((self.predefinedtype == ifcrailingtypeenum.self.userdefined) and EXISTS(self.self.ifcobject.self.objecttype))) if not eval_wr61_wr: raise AssertionError('Rule wr61 violated') else: return eval_wr61_wr #################### # ENTITY ifccurrencyrelationship # #################### class ifccurrencyrelationship(BaseEntityClass): '''Entity ifccurrencyrelationship definition. :param relatingmonetaryunit :type relatingmonetaryunit:ifcmonetaryunit :param relatedmonetaryunit :type relatedmonetaryunit:ifcmonetaryunit :param exchangerate :type exchangerate:ifcpositiveratiomeasure :param ratedatetime :type ratedatetime:ifcdateandtime :param ratesource :type ratesource:ifclibraryinformation ''' def __init__( self , relatingmonetaryunit,relatedmonetaryunit,exchangerate,ratedatetime,ratesource, ): self.relatingmonetaryunit = relatingmonetaryunit self.relatedmonetaryunit = relatedmonetaryunit self.exchangerate = exchangerate self.ratedatetime = ratedatetime self.ratesource = ratesource @apply def relatingmonetaryunit(): def fget( self ): return self._relatingmonetaryunit def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingmonetaryunit is mantatory and can not be set to None') if not check_type(value,ifcmonetaryunit): self._relatingmonetaryunit = ifcmonetaryunit(value) else: self._relatingmonetaryunit = value return property(**locals()) @apply def relatedmonetaryunit(): def fget( self ): return self._relatedmonetaryunit def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedmonetaryunit is mantatory and can not be set to None') if not check_type(value,ifcmonetaryunit): self._relatedmonetaryunit = ifcmonetaryunit(value) else: self._relatedmonetaryunit = value return property(**locals()) @apply def exchangerate(): def fget( self ): return self._exchangerate def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument exchangerate is mantatory and can not be set to None') if not check_type(value,ifcpositiveratiomeasure): self._exchangerate = ifcpositiveratiomeasure(value) else: self._exchangerate = value return property(**locals()) @apply def ratedatetime(): def fget( self ): return self._ratedatetime def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument ratedatetime is mantatory and can not be set to None') if not check_type(value,ifcdateandtime): self._ratedatetime = ifcdateandtime(value) else: self._ratedatetime = value return property(**locals()) @apply def ratesource(): def fget( self ): return self._ratesource def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclibraryinformation): self._ratesource = ifclibraryinformation(value) else: self._ratesource = value else: self._ratesource = value return property(**locals()) #################### # ENTITY ifcmaterial # #################### class ifcmaterial(BaseEntityClass): '''Entity ifcmaterial definition. :param name :type name:ifclabel :param hasrepresentation :type hasrepresentation:SET(0,1,'ifcmaterialdefinitionrepresentation', scope = schema_scope) :param classifiedas :type classifiedas:SET(0,1,'ifcmaterialclassificationrelationship', scope = schema_scope) ''' def __init__( self , name, ): self.name = name @apply def name(): def fget( self ): return self._name def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument name is mantatory and can not be set to None') if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value return property(**locals()) @apply def hasrepresentation(): def fget( self ): return self._hasrepresentation def fset( self, value ): # INVERSE argument raise AssertionError('Argument hasrepresentation is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def classifiedas(): def fget( self ): return self._classifiedas def fset( self, value ): # INVERSE argument raise AssertionError('Argument classifiedas is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcmember # #################### class ifcmember(ifcbuildingelement): '''Entity ifcmember definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcbuildingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcprofileproperties # #################### class ifcprofileproperties(BaseEntityClass): '''Entity ifcprofileproperties definition. :param profilename :type profilename:ifclabel :param profiledefinition :type profiledefinition:ifcprofiledef ''' def __init__( self , profilename,profiledefinition, ): self.profilename = profilename self.profiledefinition = profiledefinition @apply def profilename(): def fget( self ): return self._profilename def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._profilename = ifclabel(value) else: self._profilename = value else: self._profilename = value return property(**locals()) @apply def profiledefinition(): def fget( self ): return self._profiledefinition def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcprofiledef): self._profiledefinition = ifcprofiledef(value) else: self._profiledefinition = value else: self._profiledefinition = value return property(**locals()) #################### # ENTITY ifcgeneralprofileproperties # #################### class ifcgeneralprofileproperties(ifcprofileproperties): '''Entity ifcgeneralprofileproperties definition. :param physicalweight :type physicalweight:ifcmassperlengthmeasure :param perimeter :type perimeter:ifcpositivelengthmeasure :param minimumplatethickness :type minimumplatethickness:ifcpositivelengthmeasure :param maximumplatethickness :type maximumplatethickness:ifcpositivelengthmeasure :param crosssectionarea :type crosssectionarea:ifcareameasure ''' def __init__( self , inherited0__profilename , inherited1__profiledefinition , physicalweight,perimeter,minimumplatethickness,maximumplatethickness,crosssectionarea, ): ifcprofileproperties.__init__(self , inherited0__profilename , inherited1__profiledefinition , ) self.physicalweight = physicalweight self.perimeter = perimeter self.minimumplatethickness = minimumplatethickness self.maximumplatethickness = maximumplatethickness self.crosssectionarea = crosssectionarea @apply def physicalweight(): def fget( self ): return self._physicalweight def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmassperlengthmeasure): self._physicalweight = ifcmassperlengthmeasure(value) else: self._physicalweight = value else: self._physicalweight = value return property(**locals()) @apply def perimeter(): def fget( self ): return self._perimeter def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._perimeter = ifcpositivelengthmeasure(value) else: self._perimeter = value else: self._perimeter = value return property(**locals()) @apply def minimumplatethickness(): def fget( self ): return self._minimumplatethickness def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._minimumplatethickness = ifcpositivelengthmeasure(value) else: self._minimumplatethickness = value else: self._minimumplatethickness = value return property(**locals()) @apply def maximumplatethickness(): def fget( self ): return self._maximumplatethickness def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._maximumplatethickness = ifcpositivelengthmeasure(value) else: self._maximumplatethickness = value else: self._maximumplatethickness = value return property(**locals()) @apply def crosssectionarea(): def fget( self ): return self._crosssectionarea def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcareameasure): self._crosssectionarea = ifcareameasure(value) else: self._crosssectionarea = value else: self._crosssectionarea = value return property(**locals()) def wr1(self): eval_wr1_wr = (( not EXISTS(self.crosssectionarea)) or (self.crosssectionarea > 0)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcstructuralprofileproperties # #################### class ifcstructuralprofileproperties(ifcgeneralprofileproperties): '''Entity ifcstructuralprofileproperties definition. :param torsionalconstantx :type torsionalconstantx:ifcmomentofinertiameasure :param momentofinertiayz :type momentofinertiayz:ifcmomentofinertiameasure :param momentofinertiay :type momentofinertiay:ifcmomentofinertiameasure :param momentofinertiaz :type momentofinertiaz:ifcmomentofinertiameasure :param warpingconstant :type warpingconstant:ifcwarpingconstantmeasure :param shearcentrez :type shearcentrez:ifclengthmeasure :param shearcentrey :type shearcentrey:ifclengthmeasure :param sheardeformationareaz :type sheardeformationareaz:ifcareameasure :param sheardeformationareay :type sheardeformationareay:ifcareameasure :param maximumsectionmodulusy :type maximumsectionmodulusy:ifcsectionmodulusmeasure :param minimumsectionmodulusy :type minimumsectionmodulusy:ifcsectionmodulusmeasure :param maximumsectionmodulusz :type maximumsectionmodulusz:ifcsectionmodulusmeasure :param minimumsectionmodulusz :type minimumsectionmodulusz:ifcsectionmodulusmeasure :param torsionalsectionmodulus :type torsionalsectionmodulus:ifcsectionmodulusmeasure :param centreofgravityinx :type centreofgravityinx:ifclengthmeasure :param centreofgravityiny :type centreofgravityiny:ifclengthmeasure ''' def __init__( self , inherited0__profilename , inherited1__profiledefinition , inherited2__physicalweight , inherited3__perimeter , inherited4__minimumplatethickness , inherited5__maximumplatethickness , inherited6__crosssectionarea , torsionalconstantx,momentofinertiayz,momentofinertiay,momentofinertiaz,warpingconstant,shearcentrez,shearcentrey,sheardeformationareaz,sheardeformationareay,maximumsectionmodulusy,minimumsectionmodulusy,maximumsectionmodulusz,minimumsectionmodulusz,torsionalsectionmodulus,centreofgravityinx,centreofgravityiny, ): ifcgeneralprofileproperties.__init__(self , inherited0__profilename , inherited1__profiledefinition , inherited2__physicalweight , inherited3__perimeter , inherited4__minimumplatethickness , inherited5__maximumplatethickness , inherited6__crosssectionarea , ) self.torsionalconstantx = torsionalconstantx self.momentofinertiayz = momentofinertiayz self.momentofinertiay = momentofinertiay self.momentofinertiaz = momentofinertiaz self.warpingconstant = warpingconstant self.shearcentrez = shearcentrez self.shearcentrey = shearcentrey self.sheardeformationareaz = sheardeformationareaz self.sheardeformationareay = sheardeformationareay self.maximumsectionmodulusy = maximumsectionmodulusy self.minimumsectionmodulusy = minimumsectionmodulusy self.maximumsectionmodulusz = maximumsectionmodulusz self.minimumsectionmodulusz = minimumsectionmodulusz self.torsionalsectionmodulus = torsionalsectionmodulus self.centreofgravityinx = centreofgravityinx self.centreofgravityiny = centreofgravityiny @apply def torsionalconstantx(): def fget( self ): return self._torsionalconstantx def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmomentofinertiameasure): self._torsionalconstantx = ifcmomentofinertiameasure(value) else: self._torsionalconstantx = value else: self._torsionalconstantx = value return property(**locals()) @apply def momentofinertiayz(): def fget( self ): return self._momentofinertiayz def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmomentofinertiameasure): self._momentofinertiayz = ifcmomentofinertiameasure(value) else: self._momentofinertiayz = value else: self._momentofinertiayz = value return property(**locals()) @apply def momentofinertiay(): def fget( self ): return self._momentofinertiay def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmomentofinertiameasure): self._momentofinertiay = ifcmomentofinertiameasure(value) else: self._momentofinertiay = value else: self._momentofinertiay = value return property(**locals()) @apply def momentofinertiaz(): def fget( self ): return self._momentofinertiaz def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmomentofinertiameasure): self._momentofinertiaz = ifcmomentofinertiameasure(value) else: self._momentofinertiaz = value else: self._momentofinertiaz = value return property(**locals()) @apply def warpingconstant(): def fget( self ): return self._warpingconstant def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcwarpingconstantmeasure): self._warpingconstant = ifcwarpingconstantmeasure(value) else: self._warpingconstant = value else: self._warpingconstant = value return property(**locals()) @apply def shearcentrez(): def fget( self ): return self._shearcentrez def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._shearcentrez = ifclengthmeasure(value) else: self._shearcentrez = value else: self._shearcentrez = value return property(**locals()) @apply def shearcentrey(): def fget( self ): return self._shearcentrey def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._shearcentrey = ifclengthmeasure(value) else: self._shearcentrey = value else: self._shearcentrey = value return property(**locals()) @apply def sheardeformationareaz(): def fget( self ): return self._sheardeformationareaz def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcareameasure): self._sheardeformationareaz = ifcareameasure(value) else: self._sheardeformationareaz = value else: self._sheardeformationareaz = value return property(**locals()) @apply def sheardeformationareay(): def fget( self ): return self._sheardeformationareay def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcareameasure): self._sheardeformationareay = ifcareameasure(value) else: self._sheardeformationareay = value else: self._sheardeformationareay = value return property(**locals()) @apply def maximumsectionmodulusy(): def fget( self ): return self._maximumsectionmodulusy def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcsectionmodulusmeasure): self._maximumsectionmodulusy = ifcsectionmodulusmeasure(value) else: self._maximumsectionmodulusy = value else: self._maximumsectionmodulusy = value return property(**locals()) @apply def minimumsectionmodulusy(): def fget( self ): return self._minimumsectionmodulusy def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcsectionmodulusmeasure): self._minimumsectionmodulusy = ifcsectionmodulusmeasure(value) else: self._minimumsectionmodulusy = value else: self._minimumsectionmodulusy = value return property(**locals()) @apply def maximumsectionmodulusz(): def fget( self ): return self._maximumsectionmodulusz def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcsectionmodulusmeasure): self._maximumsectionmodulusz = ifcsectionmodulusmeasure(value) else: self._maximumsectionmodulusz = value else: self._maximumsectionmodulusz = value return property(**locals()) @apply def minimumsectionmodulusz(): def fget( self ): return self._minimumsectionmodulusz def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcsectionmodulusmeasure): self._minimumsectionmodulusz = ifcsectionmodulusmeasure(value) else: self._minimumsectionmodulusz = value else: self._minimumsectionmodulusz = value return property(**locals()) @apply def torsionalsectionmodulus(): def fget( self ): return self._torsionalsectionmodulus def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcsectionmodulusmeasure): self._torsionalsectionmodulus = ifcsectionmodulusmeasure(value) else: self._torsionalsectionmodulus = value else: self._torsionalsectionmodulus = value return property(**locals()) @apply def centreofgravityinx(): def fget( self ): return self._centreofgravityinx def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._centreofgravityinx = ifclengthmeasure(value) else: self._centreofgravityinx = value else: self._centreofgravityinx = value return property(**locals()) @apply def centreofgravityiny(): def fget( self ): return self._centreofgravityiny def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._centreofgravityiny = ifclengthmeasure(value) else: self._centreofgravityiny = value else: self._centreofgravityiny = value return property(**locals()) def wr21(self): eval_wr21_wr = (( not EXISTS(self.sheardeformationareay)) or (self.sheardeformationareay >= 0)) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr def wr22(self): eval_wr22_wr = (( not EXISTS(self.sheardeformationareaz)) or (self.sheardeformationareaz >= 0)) if not eval_wr22_wr: raise AssertionError('Rule wr22 violated') else: return eval_wr22_wr #################### # ENTITY ifcpropertyconstraintrelationship # #################### class ifcpropertyconstraintrelationship(BaseEntityClass): '''Entity ifcpropertyconstraintrelationship definition. :param relatingconstraint :type relatingconstraint:ifcconstraint :param relatedproperties :type relatedproperties:SET(1,None,'ifcproperty', scope = schema_scope) :param name :type name:ifclabel :param description :type description:ifctext ''' def __init__( self , relatingconstraint,relatedproperties,name,description, ): self.relatingconstraint = relatingconstraint self.relatedproperties = relatedproperties self.name = name self.description = description @apply def relatingconstraint(): def fget( self ): return self._relatingconstraint def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingconstraint is mantatory and can not be set to None') if not check_type(value,ifcconstraint): self._relatingconstraint = ifcconstraint(value) else: self._relatingconstraint = value return property(**locals()) @apply def relatedproperties(): def fget( self ): return self._relatedproperties def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedproperties is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcproperty', scope = schema_scope)): self._relatedproperties = SET(value) else: self._relatedproperties = value return property(**locals()) @apply def name(): def fget( self ): return self._name def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value else: self._name = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) #################### # ENTITY ifccurve # #################### class ifccurve(ifcgeometricrepresentationitem): '''Entity ifccurve definition. :param dim :type dim:ifcdimensioncount ''' def __init__( self , ): ifcgeometricrepresentationitem.__init__(self , ) @apply def dim(): def fget( self ): attribute_eval = ifccurvedim(self) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcboundedcurve # #################### class ifcboundedcurve(ifccurve): '''Entity ifcboundedcurve definition. ''' def __init__( self , ): ifccurve.__init__(self , ) #################### # ENTITY ifcbsplinecurve # #################### class ifcbsplinecurve(ifcboundedcurve): '''Entity ifcbsplinecurve definition. :param degree :type degree:INTEGER :param controlpointslist :type controlpointslist:LIST(2,None,'ifccartesianpoint', scope = schema_scope) :param curveform :type curveform:ifcbsplinecurveform :param closedcurve :type closedcurve:LOGICAL :param selfintersect :type selfintersect:LOGICAL :param controlpoints :type controlpoints:ARRAY(0,255,'ifccartesianpoint', scope = schema_scope) :param upperindexoncontrolpoints :type upperindexoncontrolpoints:INTEGER ''' def __init__( self , degree,controlpointslist,curveform,closedcurve,selfintersect, ): ifcboundedcurve.__init__(self , ) self.degree = degree self.controlpointslist = controlpointslist self.curveform = curveform self.closedcurve = closedcurve self.selfintersect = selfintersect @apply def degree(): def fget( self ): return self._degree def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument degree is mantatory and can not be set to None') if not check_type(value,INTEGER): self._degree = INTEGER(value) else: self._degree = value return property(**locals()) @apply def controlpointslist(): def fget( self ): return self._controlpointslist def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument controlpointslist is mantatory and can not be set to None') if not check_type(value,LIST(2,None,'ifccartesianpoint', scope = schema_scope)): self._controlpointslist = LIST(value) else: self._controlpointslist = value return property(**locals()) @apply def curveform(): def fget( self ): return self._curveform def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument curveform is mantatory and can not be set to None') if not check_type(value,ifcbsplinecurveform): self._curveform = ifcbsplinecurveform(value) else: self._curveform = value return property(**locals()) @apply def closedcurve(): def fget( self ): return self._closedcurve def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument closedcurve is mantatory and can not be set to None') if not check_type(value,LOGICAL): self._closedcurve = LOGICAL(value) else: self._closedcurve = value return property(**locals()) @apply def selfintersect(): def fget( self ): return self._selfintersect def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument selfintersect is mantatory and can not be set to None') if not check_type(value,LOGICAL): self._selfintersect = LOGICAL(value) else: self._selfintersect = value return property(**locals()) @apply def controlpoints(): def fget( self ): attribute_eval = ifclisttoarray(self.controlpointslist,0,self.upperindexoncontrolpoints) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument controlpoints is DERIVED. It is computed and can not be set to any value') return property(**locals()) @apply def upperindexoncontrolpoints(): def fget( self ): attribute_eval = (SIZEOF(self.controlpointslist) - 1) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument upperindexoncontrolpoints is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr41(self): eval_wr41_wr = (SIZEOF(None) == 0) if not eval_wr41_wr: raise AssertionError('Rule wr41 violated') else: return eval_wr41_wr #################### # ENTITY ifcbeziercurve # #################### class ifcbeziercurve(ifcbsplinecurve): '''Entity ifcbeziercurve definition. ''' def __init__( self , inherited0__degree , inherited1__controlpointslist , inherited2__curveform , inherited3__closedcurve , inherited4__selfintersect , ): ifcbsplinecurve.__init__(self , inherited0__degree , inherited1__controlpointslist , inherited2__curveform , inherited3__closedcurve , inherited4__selfintersect , ) #################### # ENTITY ifcrationalbeziercurve # #################### class ifcrationalbeziercurve(ifcbeziercurve): '''Entity ifcrationalbeziercurve definition. :param weightsdata :type weightsdata:LIST(2,None,'REAL', scope = schema_scope) :param weights :type weights:ARRAY(0,255,'REAL', scope = schema_scope) ''' def __init__( self , inherited0__degree , inherited1__controlpointslist , inherited2__curveform , inherited3__closedcurve , inherited4__selfintersect , weightsdata, ): ifcbeziercurve.__init__(self , inherited0__degree , inherited1__controlpointslist , inherited2__curveform , inherited3__closedcurve , inherited4__selfintersect , ) self.weightsdata = weightsdata @apply def weightsdata(): def fget( self ): return self._weightsdata def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument weightsdata is mantatory and can not be set to None') if not check_type(value,LIST(2,None,'REAL', scope = schema_scope)): self._weightsdata = LIST(value) else: self._weightsdata = value return property(**locals()) @apply def weights(): def fget( self ): attribute_eval = ifclisttoarray(self.weightsdata,0,self.self.ifcbsplinecurve.self.upperindexoncontrolpoints) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument weights is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (SIZEOF(self.weightsdata) == SIZEOF(self.self.ifcbsplinecurve.self.controlpointslist)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = ifccurveweightspositive(self) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr #################### # ENTITY ifcgroup # #################### class ifcgroup(ifcobject): '''Entity ifcgroup definition. :param isgroupedby :type isgroupedby:ifcrelassignstogroup ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ): ifcobject.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) @apply def isgroupedby(): def fget( self ): return self._isgroupedby def fset( self, value ): # INVERSE argument raise AssertionError('Argument isgroupedby is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcsystem # #################### class ifcsystem(ifcgroup): '''Entity ifcsystem definition. :param servicesbuildings :type servicesbuildings:SET(0,1,'ifcrelservicesbuildings', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ): ifcgroup.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) @apply def servicesbuildings(): def fget( self ): return self._servicesbuildings def fset( self, value ): # INVERSE argument raise AssertionError('Argument servicesbuildings is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcannotationfillarea # #################### class ifcannotationfillarea(ifcgeometricrepresentationitem): '''Entity ifcannotationfillarea definition. :param outerboundary :type outerboundary:ifccurve :param innerboundaries :type innerboundaries:SET(1,None,'ifccurve', scope = schema_scope) ''' def __init__( self , outerboundary,innerboundaries, ): ifcgeometricrepresentationitem.__init__(self , ) self.outerboundary = outerboundary self.innerboundaries = innerboundaries @apply def outerboundary(): def fget( self ): return self._outerboundary def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument outerboundary is mantatory and can not be set to None') if not check_type(value,ifccurve): self._outerboundary = ifccurve(value) else: self._outerboundary = value return property(**locals()) @apply def innerboundaries(): def fget( self ): return self._innerboundaries def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,SET(1,None,'ifccurve', scope = schema_scope)): self._innerboundaries = SET(value) else: self._innerboundaries = value else: self._innerboundaries = value return property(**locals()) #################### # ENTITY ifcelectricalcircuit # #################### class ifcelectricalcircuit(ifcsystem): '''Entity ifcelectricalcircuit definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ): ifcsystem.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) #################### # ENTITY ifcdoorpanelproperties # #################### class ifcdoorpanelproperties(ifcpropertysetdefinition): '''Entity ifcdoorpanelproperties definition. :param paneldepth :type paneldepth:ifcpositivelengthmeasure :param paneloperation :type paneloperation:ifcdoorpaneloperationenum :param panelwidth :type panelwidth:ifcnormalisedratiomeasure :param panelposition :type panelposition:ifcdoorpanelpositionenum :param shapeaspectstyle :type shapeaspectstyle:ifcshapeaspect ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , paneldepth,paneloperation,panelwidth,panelposition,shapeaspectstyle, ): ifcpropertysetdefinition.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.paneldepth = paneldepth self.paneloperation = paneloperation self.panelwidth = panelwidth self.panelposition = panelposition self.shapeaspectstyle = shapeaspectstyle @apply def paneldepth(): def fget( self ): return self._paneldepth def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._paneldepth = ifcpositivelengthmeasure(value) else: self._paneldepth = value else: self._paneldepth = value return property(**locals()) @apply def paneloperation(): def fget( self ): return self._paneloperation def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument paneloperation is mantatory and can not be set to None') if not check_type(value,ifcdoorpaneloperationenum): self._paneloperation = ifcdoorpaneloperationenum(value) else: self._paneloperation = value return property(**locals()) @apply def panelwidth(): def fget( self ): return self._panelwidth def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcnormalisedratiomeasure): self._panelwidth = ifcnormalisedratiomeasure(value) else: self._panelwidth = value else: self._panelwidth = value return property(**locals()) @apply def panelposition(): def fget( self ): return self._panelposition def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument panelposition is mantatory and can not be set to None') if not check_type(value,ifcdoorpanelpositionenum): self._panelposition = ifcdoorpanelpositionenum(value) else: self._panelposition = value return property(**locals()) @apply def shapeaspectstyle(): def fget( self ): return self._shapeaspectstyle def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcshapeaspect): self._shapeaspectstyle = ifcshapeaspect(value) else: self._shapeaspectstyle = value else: self._shapeaspectstyle = value return property(**locals()) def wr31(self): eval_wr31_wr = (EXISTS(self.self.ifcpropertysetdefinition.self.definestype[1]) and ('IFC2X3.IFCDOORSTYLE' == TYPEOF(self.self.ifcpropertysetdefinition.self.definestype[1]))) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifcpermeablecoveringproperties # #################### class ifcpermeablecoveringproperties(ifcpropertysetdefinition): '''Entity ifcpermeablecoveringproperties definition. :param operationtype :type operationtype:ifcpermeablecoveringoperationenum :param panelposition :type panelposition:ifcwindowpanelpositionenum :param framedepth :type framedepth:ifcpositivelengthmeasure :param framethickness :type framethickness:ifcpositivelengthmeasure :param shapeaspectstyle :type shapeaspectstyle:ifcshapeaspect ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , operationtype,panelposition,framedepth,framethickness,shapeaspectstyle, ): ifcpropertysetdefinition.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.operationtype = operationtype self.panelposition = panelposition self.framedepth = framedepth self.framethickness = framethickness self.shapeaspectstyle = shapeaspectstyle @apply def operationtype(): def fget( self ): return self._operationtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument operationtype is mantatory and can not be set to None') if not check_type(value,ifcpermeablecoveringoperationenum): self._operationtype = ifcpermeablecoveringoperationenum(value) else: self._operationtype = value return property(**locals()) @apply def panelposition(): def fget( self ): return self._panelposition def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument panelposition is mantatory and can not be set to None') if not check_type(value,ifcwindowpanelpositionenum): self._panelposition = ifcwindowpanelpositionenum(value) else: self._panelposition = value return property(**locals()) @apply def framedepth(): def fget( self ): return self._framedepth def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._framedepth = ifcpositivelengthmeasure(value) else: self._framedepth = value else: self._framedepth = value return property(**locals()) @apply def framethickness(): def fget( self ): return self._framethickness def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._framethickness = ifcpositivelengthmeasure(value) else: self._framethickness = value else: self._framethickness = value return property(**locals()) @apply def shapeaspectstyle(): def fget( self ): return self._shapeaspectstyle def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcshapeaspect): self._shapeaspectstyle = ifcshapeaspect(value) else: self._shapeaspectstyle = value else: self._shapeaspectstyle = value return property(**locals()) #################### # ENTITY ifcservicelifefactor # #################### class ifcservicelifefactor(ifcpropertysetdefinition): '''Entity ifcservicelifefactor definition. :param predefinedtype :type predefinedtype:ifcservicelifefactortypeenum :param uppervalue :type uppervalue:ifcmeasurevalue :param mostusedvalue :type mostusedvalue:ifcmeasurevalue :param lowervalue :type lowervalue:ifcmeasurevalue ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , predefinedtype,uppervalue,mostusedvalue,lowervalue, ): ifcpropertysetdefinition.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.predefinedtype = predefinedtype self.uppervalue = uppervalue self.mostusedvalue = mostusedvalue self.lowervalue = lowervalue @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcservicelifefactortypeenum): self._predefinedtype = ifcservicelifefactortypeenum(value) else: self._predefinedtype = value return property(**locals()) @apply def uppervalue(): def fget( self ): return self._uppervalue def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmeasurevalue): self._uppervalue = ifcmeasurevalue(value) else: self._uppervalue = value else: self._uppervalue = value return property(**locals()) @apply def mostusedvalue(): def fget( self ): return self._mostusedvalue def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument mostusedvalue is mantatory and can not be set to None') if not check_type(value,ifcmeasurevalue): self._mostusedvalue = ifcmeasurevalue(value) else: self._mostusedvalue = value return property(**locals()) @apply def lowervalue(): def fget( self ): return self._lowervalue def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmeasurevalue): self._lowervalue = ifcmeasurevalue(value) else: self._lowervalue = value else: self._lowervalue = value return property(**locals()) def wr31(self): eval_wr31_wr = (( not (self.predefinedtype == ifcservicelifefactortypeenum.self.userdefined)) or EXISTS(self.self.ifcobject.self.objecttype)) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifcflowcontrollertype # #################### class ifcflowcontrollertype(ifcdistributionflowelementtype): '''Entity ifcflowcontrollertype definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ): ifcdistributionflowelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) #################### # ENTITY ifcvalvetype # #################### class ifcvalvetype(ifcflowcontrollertype): '''Entity ifcvalvetype definition. :param predefinedtype :type predefinedtype:ifcvalvetypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowcontrollertype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcvalvetypeenum): self._predefinedtype = ifcvalvetypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcvalvetypeenum.self.userdefined) or ((self.predefinedtype == ifcvalvetypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcsolidmodel # #################### class ifcsolidmodel(ifcgeometricrepresentationitem): '''Entity ifcsolidmodel definition. :param dim :type dim:ifcdimensioncount ''' def __init__( self , ): ifcgeometricrepresentationitem.__init__(self , ) @apply def dim(): def fget( self ): attribute_eval = 3 return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcsweptareasolid # #################### class ifcsweptareasolid(ifcsolidmodel): '''Entity ifcsweptareasolid definition. :param sweptarea :type sweptarea:ifcprofiledef :param position :type position:ifcaxis2placement3d ''' def __init__( self , sweptarea,position, ): ifcsolidmodel.__init__(self , ) self.sweptarea = sweptarea self.position = position @apply def sweptarea(): def fget( self ): return self._sweptarea def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument sweptarea is mantatory and can not be set to None') if not check_type(value,ifcprofiledef): self._sweptarea = ifcprofiledef(value) else: self._sweptarea = value return property(**locals()) @apply def position(): def fget( self ): return self._position def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument position is mantatory and can not be set to None') if not check_type(value,ifcaxis2placement3d): self._position = ifcaxis2placement3d(value) else: self._position = value return property(**locals()) def wr22(self): eval_wr22_wr = (self.sweptarea.self.profiletype == ifcprofiletypeenum.self.area) if not eval_wr22_wr: raise AssertionError('Rule wr22 violated') else: return eval_wr22_wr #################### # ENTITY ifcrevolvedareasolid # #################### class ifcrevolvedareasolid(ifcsweptareasolid): '''Entity ifcrevolvedareasolid definition. :param axis :type axis:ifcaxis1placement :param angle :type angle:ifcplaneanglemeasure :param axisline :type axisline:ifcline ''' def __init__( self , inherited0__sweptarea , inherited1__position , axis,angle, ): ifcsweptareasolid.__init__(self , inherited0__sweptarea , inherited1__position , ) self.axis = axis self.angle = angle @apply def axis(): def fget( self ): return self._axis def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument axis is mantatory and can not be set to None') if not check_type(value,ifcaxis1placement): self._axis = ifcaxis1placement(value) else: self._axis = value return property(**locals()) @apply def angle(): def fget( self ): return self._angle def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument angle is mantatory and can not be set to None') if not check_type(value,ifcplaneanglemeasure): self._angle = ifcplaneanglemeasure(value) else: self._angle = value return property(**locals()) @apply def axisline(): def fget( self ): attribute_eval = (((ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifccurve()) == ifcline(self.axis.self.location,(ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcvector(self.axis.self.z,1))) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument axisline is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr31(self): eval_wr31_wr = (self.axis.self.location.self.coordinates[3] == 0) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr def wr32(self): eval_wr32_wr = (self.axis.self.z.self.directionratios[3] == 0) if not eval_wr32_wr: raise AssertionError('Rule wr32 violated') else: return eval_wr32_wr #################### # ENTITY ifctexturecoordinate # #################### class ifctexturecoordinate(BaseEntityClass): '''Entity ifctexturecoordinate definition. :param annotatedsurface :type annotatedsurface:SET(1,1,'ifcannotationsurface', scope = schema_scope) ''' # This class does not define any attribute. pass @apply def annotatedsurface(): def fget( self ): return self._annotatedsurface def fset( self, value ): # INVERSE argument raise AssertionError('Argument annotatedsurface is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifctexturemap # #################### class ifctexturemap(ifctexturecoordinate): '''Entity ifctexturemap definition. :param texturemaps :type texturemaps:SET(1,None,'ifcvertexbasedtexturemap', scope = schema_scope) ''' def __init__( self , texturemaps, ): ifctexturecoordinate.__init__(self , ) self.texturemaps = texturemaps @apply def texturemaps(): def fget( self ): return self._texturemaps def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument texturemaps is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcvertexbasedtexturemap', scope = schema_scope)): self._texturemaps = SET(value) else: self._texturemaps = value return property(**locals()) def wr11(self): eval_wr11_wr = (SIZEOF(['IFC2X3.IFCSHELLBASEDSURFACEMODEL','IFC2X3.IFCFACEBASEDSURFACEMODEL','IFC2X3.IFCFACETEDBREP','IFC2X3.IFCFACETEDBREPWITHVOIDS'] * TYPEOF(self.self.ifctexturecoordinate.self.annotatedsurface[1].self.item)) >= 1) if not eval_wr11_wr: raise AssertionError('Rule wr11 violated') else: return eval_wr11_wr #################### # ENTITY ifcairterminalboxtype # #################### class ifcairterminalboxtype(ifcflowcontrollertype): '''Entity ifcairterminalboxtype definition. :param predefinedtype :type predefinedtype:ifcairterminalboxtypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowcontrollertype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcairterminalboxtypeenum): self._predefinedtype = ifcairterminalboxtypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcairterminalboxtypeenum.self.userdefined) or ((self.predefinedtype == ifcairterminalboxtypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcboundarycondition # #################### class ifcboundarycondition(BaseEntityClass): '''Entity ifcboundarycondition definition. :param name :type name:ifclabel ''' def __init__( self , name, ): self.name = name @apply def name(): def fget( self ): return self._name def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value else: self._name = value return property(**locals()) #################### # ENTITY ifcbuildingelementtype # #################### class ifcbuildingelementtype(ifcelementtype): '''Entity ifcbuildingelementtype definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ): ifcelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) #################### # ENTITY ifcbuildingelementproxytype # #################### class ifcbuildingelementproxytype(ifcbuildingelementtype): '''Entity ifcbuildingelementproxytype definition. :param predefinedtype :type predefinedtype:ifcbuildingelementproxytypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcbuildingelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcbuildingelementproxytypeenum): self._predefinedtype = ifcbuildingelementproxytypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcpresentationstyle # #################### class ifcpresentationstyle(BaseEntityClass): '''Entity ifcpresentationstyle definition. :param name :type name:ifclabel ''' def __init__( self , name, ): self.name = name @apply def name(): def fget( self ): return self._name def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value else: self._name = value return property(**locals()) #################### # ENTITY ifcfillareastyle # #################### class ifcfillareastyle(ifcpresentationstyle): '''Entity ifcfillareastyle definition. :param fillstyles :type fillstyles:SET(1,None,'ifcfillstyleselect', scope = schema_scope) ''' def __init__( self , inherited0__name , fillstyles, ): ifcpresentationstyle.__init__(self , inherited0__name , ) self.fillstyles = fillstyles @apply def fillstyles(): def fget( self ): return self._fillstyles def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument fillstyles is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcfillstyleselect', scope = schema_scope)): self._fillstyles = SET(value) else: self._fillstyles = value return property(**locals()) def wr11(self): eval_wr11_wr = (SIZEOF(None) <= 1) if not eval_wr11_wr: raise AssertionError('Rule wr11 violated') else: return eval_wr11_wr def wr12(self): eval_wr12_wr = (SIZEOF(None) <= 1) if not eval_wr12_wr: raise AssertionError('Rule wr12 violated') else: return eval_wr12_wr def wr13(self): eval_wr13_wr = ifccorrectfillareastyle(self.self.fillstyles) if not eval_wr13_wr: raise AssertionError('Rule wr13 violated') else: return eval_wr13_wr #################### # ENTITY ifccsgsolid # #################### class ifccsgsolid(ifcsolidmodel): '''Entity ifccsgsolid definition. :param treerootexpression :type treerootexpression:ifccsgselect ''' def __init__( self , treerootexpression, ): ifcsolidmodel.__init__(self , ) self.treerootexpression = treerootexpression @apply def treerootexpression(): def fget( self ): return self._treerootexpression def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument treerootexpression is mantatory and can not be set to None') if not check_type(value,ifccsgselect): self._treerootexpression = ifccsgselect(value) else: self._treerootexpression = value return property(**locals()) #################### # ENTITY ifcsurfacetexture # #################### class ifcsurfacetexture(BaseEntityClass): '''Entity ifcsurfacetexture definition. :param repeats :type repeats:BOOLEAN :param repeatt :type repeatt:BOOLEAN :param texturetype :type texturetype:ifcsurfacetextureenum :param texturetransform :type texturetransform:ifccartesiantransformationoperator2d ''' def __init__( self , repeats,repeatt,texturetype,texturetransform, ): self.repeats = repeats self.repeatt = repeatt self.texturetype = texturetype self.texturetransform = texturetransform @apply def repeats(): def fget( self ): return self._repeats def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument repeats is mantatory and can not be set to None') if not check_type(value,BOOLEAN): self._repeats = BOOLEAN(value) else: self._repeats = value return property(**locals()) @apply def repeatt(): def fget( self ): return self._repeatt def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument repeatt is mantatory and can not be set to None') if not check_type(value,BOOLEAN): self._repeatt = BOOLEAN(value) else: self._repeatt = value return property(**locals()) @apply def texturetype(): def fget( self ): return self._texturetype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument texturetype is mantatory and can not be set to None') if not check_type(value,ifcsurfacetextureenum): self._texturetype = ifcsurfacetextureenum(value) else: self._texturetype = value return property(**locals()) @apply def texturetransform(): def fget( self ): return self._texturetransform def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccartesiantransformationoperator2d): self._texturetransform = ifccartesiantransformationoperator2d(value) else: self._texturetransform = value else: self._texturetransform = value return property(**locals()) #################### # ENTITY ifcpixeltexture # #################### class ifcpixeltexture(ifcsurfacetexture): '''Entity ifcpixeltexture definition. :param width :type width:ifcinteger :param height :type height:ifcinteger :param colourcomponents :type colourcomponents:ifcinteger :param pixel :type pixel:LIST(1,None,'(null)', scope = schema_scope) ''' def __init__( self , inherited0__repeats , inherited1__repeatt , inherited2__texturetype , inherited3__texturetransform , width,height,colourcomponents,pixel, ): ifcsurfacetexture.__init__(self , inherited0__repeats , inherited1__repeatt , inherited2__texturetype , inherited3__texturetransform , ) self.width = width self.height = height self.colourcomponents = colourcomponents self.pixel = pixel @apply def width(): def fget( self ): return self._width def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument width is mantatory and can not be set to None') if not check_type(value,ifcinteger): self._width = ifcinteger(value) else: self._width = value return property(**locals()) @apply def height(): def fget( self ): return self._height def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument height is mantatory and can not be set to None') if not check_type(value,ifcinteger): self._height = ifcinteger(value) else: self._height = value return property(**locals()) @apply def colourcomponents(): def fget( self ): return self._colourcomponents def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument colourcomponents is mantatory and can not be set to None') if not check_type(value,ifcinteger): self._colourcomponents = ifcinteger(value) else: self._colourcomponents = value return property(**locals()) @apply def pixel(): def fget( self ): return self._pixel def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument pixel is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'(null)', scope = schema_scope)): self._pixel = LIST(value) else: self._pixel = value return property(**locals()) def wr21(self): eval_wr21_wr = (self.width >= 1) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr def wr22(self): eval_wr22_wr = (self.height >= 1) if not eval_wr22_wr: raise AssertionError('Rule wr22 violated') else: return eval_wr22_wr def wr23(self): eval_wr23_wr = ((1 <= self.colourcomponents) and (self.colourcomponents <= 4)) if not eval_wr23_wr: raise AssertionError('Rule wr23 violated') else: return eval_wr23_wr def wr24(self): eval_wr24_wr = (SIZEOF(self.pixel) == (self.width * self.height)) if not eval_wr24_wr: raise AssertionError('Rule wr24 violated') else: return eval_wr24_wr #################### # ENTITY ifcrelassociates # #################### class ifcrelassociates(ifcrelationship): '''Entity ifcrelassociates definition. :param relatedobjects :type relatedobjects:SET(1,None,'ifcroot', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , relatedobjects, ): ifcrelationship.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.relatedobjects = relatedobjects @apply def relatedobjects(): def fget( self ): return self._relatedobjects def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedobjects is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcroot', scope = schema_scope)): self._relatedobjects = SET(value) else: self._relatedobjects = value return property(**locals()) def wr21(self): eval_wr21_wr = (SIZEOF(None) == 0) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr #################### # ENTITY ifcreldecomposes # #################### class ifcreldecomposes(ifcrelationship): '''Entity ifcreldecomposes definition. :param relatingobject :type relatingobject:ifcobjectdefinition :param relatedobjects :type relatedobjects:SET(1,None,'ifcobjectdefinition', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , relatingobject,relatedobjects, ): ifcrelationship.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.relatingobject = relatingobject self.relatedobjects = relatedobjects @apply def relatingobject(): def fget( self ): return self._relatingobject def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingobject is mantatory and can not be set to None') if not check_type(value,ifcobjectdefinition): self._relatingobject = ifcobjectdefinition(value) else: self._relatingobject = value return property(**locals()) @apply def relatedobjects(): def fget( self ): return self._relatedobjects def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedobjects is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcobjectdefinition', scope = schema_scope)): self._relatedobjects = SET(value) else: self._relatedobjects = value return property(**locals()) def wr31(self): eval_wr31_wr = (SIZEOF(None) == 0) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifcrelnests # #################### class ifcrelnests(ifcreldecomposes): '''Entity ifcrelnests definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatingobject , inherited5__relatedobjects , ): ifcreldecomposes.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatingobject , inherited5__relatedobjects , ) def wr1(self): eval_wr1_wr = (SIZEOF(None) == 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcspatialstructureelementtype # #################### class ifcspatialstructureelementtype(ifcelementtype): '''Entity ifcspatialstructureelementtype definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ): ifcelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) #################### # ENTITY ifcspacetype # #################### class ifcspacetype(ifcspatialstructureelementtype): '''Entity ifcspacetype definition. :param predefinedtype :type predefinedtype:ifcspacetypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcspatialstructureelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcspacetypeenum): self._predefinedtype = ifcspacetypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcplacement # #################### class ifcplacement(ifcgeometricrepresentationitem): '''Entity ifcplacement definition. :param location :type location:ifccartesianpoint :param dim :type dim:ifcdimensioncount ''' def __init__( self , location, ): ifcgeometricrepresentationitem.__init__(self , ) self.location = location @apply def location(): def fget( self ): return self._location def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument location is mantatory and can not be set to None') if not check_type(value,ifccartesianpoint): self._location = ifccartesianpoint(value) else: self._location = value return property(**locals()) @apply def dim(): def fget( self ): attribute_eval = self.location.self.dim return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcaxis1placement # #################### class ifcaxis1placement(ifcplacement): '''Entity ifcaxis1placement definition. :param axis :type axis:ifcdirection :param z :type z:ifcdirection ''' def __init__( self , inherited0__location , axis, ): ifcplacement.__init__(self , inherited0__location , ) self.axis = axis @apply def axis(): def fget( self ): return self._axis def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdirection): self._axis = ifcdirection(value) else: self._axis = value else: self._axis = value return property(**locals()) @apply def z(): def fget( self ): attribute_eval = NVL(ifcnormalise(self.axis),(ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcdirection([0,0,1])) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument z is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (( not EXISTS(self.axis)) or (self.axis.self.dim == 3)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (self.self.ifcplacement.self.location.self.dim == 3) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr #################### # ENTITY ifcelectricgeneratortype # #################### class ifcelectricgeneratortype(ifcenergyconversiondevicetype): '''Entity ifcelectricgeneratortype definition. :param predefinedtype :type predefinedtype:ifcelectricgeneratortypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcenergyconversiondevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcelectricgeneratortypeenum): self._predefinedtype = ifcelectricgeneratortypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcflowfittingtype # #################### class ifcflowfittingtype(ifcdistributionflowelementtype): '''Entity ifcflowfittingtype definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ): ifcdistributionflowelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) #################### # ENTITY ifcpipefittingtype # #################### class ifcpipefittingtype(ifcflowfittingtype): '''Entity ifcpipefittingtype definition. :param predefinedtype :type predefinedtype:ifcpipefittingtypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowfittingtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcpipefittingtypeenum): self._predefinedtype = ifcpipefittingtypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcpipefittingtypeenum.self.userdefined) or ((self.predefinedtype == ifcpipefittingtypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcstructuralconnection # #################### class ifcstructuralconnection(ifcstructuralitem): '''Entity ifcstructuralconnection definition. :param appliedcondition :type appliedcondition:ifcboundarycondition :param connectsstructuralmembers :type connectsstructuralmembers:SET(1,None,'ifcrelconnectsstructuralmember', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , appliedcondition, ): ifcstructuralitem.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , ) self.appliedcondition = appliedcondition @apply def appliedcondition(): def fget( self ): return self._appliedcondition def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcboundarycondition): self._appliedcondition = ifcboundarycondition(value) else: self._appliedcondition = value else: self._appliedcondition = value return property(**locals()) @apply def connectsstructuralmembers(): def fget( self ): return self._connectsstructuralmembers def fset( self, value ): # INVERSE argument raise AssertionError('Argument connectsstructuralmembers is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcfillareastyletilesymbolwithstyle # #################### class ifcfillareastyletilesymbolwithstyle(ifcgeometricrepresentationitem): '''Entity ifcfillareastyletilesymbolwithstyle definition. :param symbol :type symbol:ifcannotationsymboloccurrence ''' def __init__( self , symbol, ): ifcgeometricrepresentationitem.__init__(self , ) self.symbol = symbol @apply def symbol(): def fget( self ): return self._symbol def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument symbol is mantatory and can not be set to None') if not check_type(value,ifcannotationsymboloccurrence): self._symbol = ifcannotationsymboloccurrence(value) else: self._symbol = value return property(**locals()) #################### # ENTITY ifcflowterminaltype # #################### class ifcflowterminaltype(ifcdistributionflowelementtype): '''Entity ifcflowterminaltype definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ): ifcdistributionflowelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) #################### # ENTITY ifcwasteterminaltype # #################### class ifcwasteterminaltype(ifcflowterminaltype): '''Entity ifcwasteterminaltype definition. :param predefinedtype :type predefinedtype:ifcwasteterminaltypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowterminaltype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcwasteterminaltypeenum): self._predefinedtype = ifcwasteterminaltypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcdistributionelement # #################### class ifcdistributionelement(ifcelement): '''Entity ifcdistributionelement definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcdistributioncontrolelement # #################### class ifcdistributioncontrolelement(ifcdistributionelement): '''Entity ifcdistributioncontrolelement definition. :param controlelementid :type controlelementid:ifcidentifier :param assignedtoflowelement :type assignedtoflowelement:SET(0,1,'ifcrelflowcontrolelements', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , controlelementid, ): ifcdistributionelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) self.controlelementid = controlelementid @apply def controlelementid(): def fget( self ): return self._controlelementid def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcidentifier): self._controlelementid = ifcidentifier(value) else: self._controlelementid = value else: self._controlelementid = value return property(**locals()) @apply def assignedtoflowelement(): def fget( self ): return self._assignedtoflowelement def fset( self, value ): # INVERSE argument raise AssertionError('Argument assignedtoflowelement is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcelementcomponenttype # #################### class ifcelementcomponenttype(ifcelementtype): '''Entity ifcelementcomponenttype definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ): ifcelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) #################### # ENTITY ifcfastenertype # #################### class ifcfastenertype(ifcelementcomponenttype): '''Entity ifcfastenertype definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ): ifcelementcomponenttype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) #################### # ENTITY ifclamptype # #################### class ifclamptype(ifcflowterminaltype): '''Entity ifclamptype definition. :param predefinedtype :type predefinedtype:ifclamptypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowterminaltype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifclamptypeenum): self._predefinedtype = ifclamptypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcpredefineditem # #################### class ifcpredefineditem(BaseEntityClass): '''Entity ifcpredefineditem definition. :param name :type name:ifclabel ''' def __init__( self , name, ): self.name = name @apply def name(): def fget( self ): return self._name def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument name is mantatory and can not be set to None') if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value return property(**locals()) #################### # ENTITY ifctrimmedcurve # #################### class ifctrimmedcurve(ifcboundedcurve): '''Entity ifctrimmedcurve definition. :param basiscurve :type basiscurve:ifccurve :param trim1 :type trim1:SET(1,2,'ifctrimmingselect', scope = schema_scope) :param trim2 :type trim2:SET(1,2,'ifctrimmingselect', scope = schema_scope) :param senseagreement :type senseagreement:BOOLEAN :param masterrepresentation :type masterrepresentation:ifctrimmingpreference ''' def __init__( self , basiscurve,trim1,trim2,senseagreement,masterrepresentation, ): ifcboundedcurve.__init__(self , ) self.basiscurve = basiscurve self.trim1 = trim1 self.trim2 = trim2 self.senseagreement = senseagreement self.masterrepresentation = masterrepresentation @apply def basiscurve(): def fget( self ): return self._basiscurve def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument basiscurve is mantatory and can not be set to None') if not check_type(value,ifccurve): self._basiscurve = ifccurve(value) else: self._basiscurve = value return property(**locals()) @apply def trim1(): def fget( self ): return self._trim1 def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument trim1 is mantatory and can not be set to None') if not check_type(value,SET(1,2,'ifctrimmingselect', scope = schema_scope)): self._trim1 = SET(value) else: self._trim1 = value return property(**locals()) @apply def trim2(): def fget( self ): return self._trim2 def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument trim2 is mantatory and can not be set to None') if not check_type(value,SET(1,2,'ifctrimmingselect', scope = schema_scope)): self._trim2 = SET(value) else: self._trim2 = value return property(**locals()) @apply def senseagreement(): def fget( self ): return self._senseagreement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument senseagreement is mantatory and can not be set to None') if not check_type(value,BOOLEAN): self._senseagreement = BOOLEAN(value) else: self._senseagreement = value return property(**locals()) @apply def masterrepresentation(): def fget( self ): return self._masterrepresentation def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument masterrepresentation is mantatory and can not be set to None') if not check_type(value,ifctrimmingpreference): self._masterrepresentation = ifctrimmingpreference(value) else: self._masterrepresentation = value return property(**locals()) def wr41(self): eval_wr41_wr = ((HIINDEX(self.trim1) == 1) or (TYPEOF(self.trim1[1]) != TYPEOF(self.trim1[2]))) if not eval_wr41_wr: raise AssertionError('Rule wr41 violated') else: return eval_wr41_wr def wr42(self): eval_wr42_wr = ((HIINDEX(self.trim2) == 1) or (TYPEOF(self.trim2[1]) != TYPEOF(self.trim2[2]))) if not eval_wr42_wr: raise AssertionError('Rule wr42 violated') else: return eval_wr42_wr def wr43(self): eval_wr43_wr = ( not ('IFC2X3.IFCBOUNDEDCURVE' == TYPEOF(self.basiscurve))) if not eval_wr43_wr: raise AssertionError('Rule wr43 violated') else: return eval_wr43_wr #################### # ENTITY ifcboundarynodecondition # #################### class ifcboundarynodecondition(ifcboundarycondition): '''Entity ifcboundarynodecondition definition. :param linearstiffnessx :type linearstiffnessx:ifclinearstiffnessmeasure :param linearstiffnessy :type linearstiffnessy:ifclinearstiffnessmeasure :param linearstiffnessz :type linearstiffnessz:ifclinearstiffnessmeasure :param rotationalstiffnessx :type rotationalstiffnessx:ifcrotationalstiffnessmeasure :param rotationalstiffnessy :type rotationalstiffnessy:ifcrotationalstiffnessmeasure :param rotationalstiffnessz :type rotationalstiffnessz:ifcrotationalstiffnessmeasure ''' def __init__( self , inherited0__name , linearstiffnessx,linearstiffnessy,linearstiffnessz,rotationalstiffnessx,rotationalstiffnessy,rotationalstiffnessz, ): ifcboundarycondition.__init__(self , inherited0__name , ) self.linearstiffnessx = linearstiffnessx self.linearstiffnessy = linearstiffnessy self.linearstiffnessz = linearstiffnessz self.rotationalstiffnessx = rotationalstiffnessx self.rotationalstiffnessy = rotationalstiffnessy self.rotationalstiffnessz = rotationalstiffnessz @apply def linearstiffnessx(): def fget( self ): return self._linearstiffnessx def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclinearstiffnessmeasure): self._linearstiffnessx = ifclinearstiffnessmeasure(value) else: self._linearstiffnessx = value else: self._linearstiffnessx = value return property(**locals()) @apply def linearstiffnessy(): def fget( self ): return self._linearstiffnessy def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclinearstiffnessmeasure): self._linearstiffnessy = ifclinearstiffnessmeasure(value) else: self._linearstiffnessy = value else: self._linearstiffnessy = value return property(**locals()) @apply def linearstiffnessz(): def fget( self ): return self._linearstiffnessz def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclinearstiffnessmeasure): self._linearstiffnessz = ifclinearstiffnessmeasure(value) else: self._linearstiffnessz = value else: self._linearstiffnessz = value return property(**locals()) @apply def rotationalstiffnessx(): def fget( self ): return self._rotationalstiffnessx def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcrotationalstiffnessmeasure): self._rotationalstiffnessx = ifcrotationalstiffnessmeasure(value) else: self._rotationalstiffnessx = value else: self._rotationalstiffnessx = value return property(**locals()) @apply def rotationalstiffnessy(): def fget( self ): return self._rotationalstiffnessy def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcrotationalstiffnessmeasure): self._rotationalstiffnessy = ifcrotationalstiffnessmeasure(value) else: self._rotationalstiffnessy = value else: self._rotationalstiffnessy = value return property(**locals()) @apply def rotationalstiffnessz(): def fget( self ): return self._rotationalstiffnessz def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcrotationalstiffnessmeasure): self._rotationalstiffnessz = ifcrotationalstiffnessmeasure(value) else: self._rotationalstiffnessz = value else: self._rotationalstiffnessz = value return property(**locals()) #################### # ENTITY ifcboundarynodeconditionwarping # #################### class ifcboundarynodeconditionwarping(ifcboundarynodecondition): '''Entity ifcboundarynodeconditionwarping definition. :param warpingstiffness :type warpingstiffness:ifcwarpingmomentmeasure ''' def __init__( self , inherited0__name , inherited1__linearstiffnessx , inherited2__linearstiffnessy , inherited3__linearstiffnessz , inherited4__rotationalstiffnessx , inherited5__rotationalstiffnessy , inherited6__rotationalstiffnessz , warpingstiffness, ): ifcboundarynodecondition.__init__(self , inherited0__name , inherited1__linearstiffnessx , inherited2__linearstiffnessy , inherited3__linearstiffnessz , inherited4__rotationalstiffnessx , inherited5__rotationalstiffnessy , inherited6__rotationalstiffnessz , ) self.warpingstiffness = warpingstiffness @apply def warpingstiffness(): def fget( self ): return self._warpingstiffness def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcwarpingmomentmeasure): self._warpingstiffness = ifcwarpingmomentmeasure(value) else: self._warpingstiffness = value else: self._warpingstiffness = value return property(**locals()) #################### # ENTITY ifctopologicalrepresentationitem # #################### class ifctopologicalrepresentationitem(ifcrepresentationitem): '''Entity ifctopologicalrepresentationitem definition. ''' def __init__( self , ): ifcrepresentationitem.__init__(self , ) #################### # ENTITY ifcedge # #################### class ifcedge(ifctopologicalrepresentationitem): '''Entity ifcedge definition. :param edgestart :type edgestart:ifcvertex :param edgeend :type edgeend:ifcvertex ''' def __init__( self , edgestart,edgeend, ): ifctopologicalrepresentationitem.__init__(self , ) self.edgestart = edgestart self.edgeend = edgeend @apply def edgestart(): def fget( self ): return self._edgestart def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument edgestart is mantatory and can not be set to None') if not check_type(value,ifcvertex): self._edgestart = ifcvertex(value) else: self._edgestart = value return property(**locals()) @apply def edgeend(): def fget( self ): return self._edgeend def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument edgeend is mantatory and can not be set to None') if not check_type(value,ifcvertex): self._edgeend = ifcvertex(value) else: self._edgeend = value return property(**locals()) #################### # ENTITY ifcsubedge # #################### class ifcsubedge(ifcedge): '''Entity ifcsubedge definition. :param parentedge :type parentedge:ifcedge ''' def __init__( self , inherited0__edgestart , inherited1__edgeend , parentedge, ): ifcedge.__init__(self , inherited0__edgestart , inherited1__edgeend , ) self.parentedge = parentedge @apply def parentedge(): def fget( self ): return self._parentedge def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument parentedge is mantatory and can not be set to None') if not check_type(value,ifcedge): self._parentedge = ifcedge(value) else: self._parentedge = value return property(**locals()) #################### # ENTITY ifcairtoairheatrecoverytype # #################### class ifcairtoairheatrecoverytype(ifcenergyconversiondevicetype): '''Entity ifcairtoairheatrecoverytype definition. :param predefinedtype :type predefinedtype:ifcairtoairheatrecoverytypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcenergyconversiondevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcairtoairheatrecoverytypeenum): self._predefinedtype = ifcairtoairheatrecoverytypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcairtoairheatrecoverytypeenum.self.userdefined) or ((self.predefinedtype == ifcairtoairheatrecoverytypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifccartesiantransformationoperator # #################### class ifccartesiantransformationoperator(ifcgeometricrepresentationitem): '''Entity ifccartesiantransformationoperator definition. :param axis1 :type axis1:ifcdirection :param axis2 :type axis2:ifcdirection :param localorigin :type localorigin:ifccartesianpoint :param scale :type scale:REAL :param scl :type scl:REAL :param dim :type dim:ifcdimensioncount ''' def __init__( self , axis1,axis2,localorigin,scale, ): ifcgeometricrepresentationitem.__init__(self , ) self.axis1 = axis1 self.axis2 = axis2 self.localorigin = localorigin self.scale = scale @apply def axis1(): def fget( self ): return self._axis1 def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdirection): self._axis1 = ifcdirection(value) else: self._axis1 = value else: self._axis1 = value return property(**locals()) @apply def axis2(): def fget( self ): return self._axis2 def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdirection): self._axis2 = ifcdirection(value) else: self._axis2 = value else: self._axis2 = value return property(**locals()) @apply def localorigin(): def fget( self ): return self._localorigin def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument localorigin is mantatory and can not be set to None') if not check_type(value,ifccartesianpoint): self._localorigin = ifccartesianpoint(value) else: self._localorigin = value return property(**locals()) @apply def scale(): def fget( self ): return self._scale def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,REAL): self._scale = REAL(value) else: self._scale = value else: self._scale = value return property(**locals()) @apply def scl(): def fget( self ): attribute_eval = NVL(self.scale,1) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument scl is DERIVED. It is computed and can not be set to any value') return property(**locals()) @apply def dim(): def fget( self ): attribute_eval = self.localorigin.self.dim return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (self.scl > 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifccartesiantransformationoperator3d # #################### class ifccartesiantransformationoperator3d(ifccartesiantransformationoperator): '''Entity ifccartesiantransformationoperator3d definition. :param axis3 :type axis3:ifcdirection :param u :type u:LIST(3,3,'ifcdirection', scope = schema_scope) ''' def __init__( self , inherited0__axis1 , inherited1__axis2 , inherited2__localorigin , inherited3__scale , axis3, ): ifccartesiantransformationoperator.__init__(self , inherited0__axis1 , inherited1__axis2 , inherited2__localorigin , inherited3__scale , ) self.axis3 = axis3 @apply def axis3(): def fget( self ): return self._axis3 def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdirection): self._axis3 = ifcdirection(value) else: self._axis3 = value else: self._axis3 = value return property(**locals()) @apply def u(): def fget( self ): attribute_eval = ifcbaseaxis(3,self.self.ifccartesiantransformationoperator.self.axis1,self.self.ifccartesiantransformationoperator.self.axis2,self.axis3) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument u is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (self.self.ifccartesiantransformationoperator.self.dim == 3) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (( not EXISTS(self.self.ifccartesiantransformationoperator.self.axis1)) or (self.self.ifccartesiantransformationoperator.self.axis1.self.dim == 3)) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr def wr3(self): eval_wr3_wr = (( not EXISTS(self.self.ifccartesiantransformationoperator.self.axis2)) or (self.self.ifccartesiantransformationoperator.self.axis2.self.dim == 3)) if not eval_wr3_wr: raise AssertionError('Rule wr3 violated') else: return eval_wr3_wr def wr4(self): eval_wr4_wr = (( not EXISTS(self.axis3)) or (self.axis3.self.dim == 3)) if not eval_wr4_wr: raise AssertionError('Rule wr4 violated') else: return eval_wr4_wr #################### # ENTITY ifcconnectiongeometry # #################### class ifcconnectiongeometry(BaseEntityClass): '''Entity ifcconnectiongeometry definition. ''' # This class does not define any attribute. pass #################### # ENTITY ifcplanarextent # #################### class ifcplanarextent(ifcgeometricrepresentationitem): '''Entity ifcplanarextent definition. :param sizeinx :type sizeinx:ifclengthmeasure :param sizeiny :type sizeiny:ifclengthmeasure ''' def __init__( self , sizeinx,sizeiny, ): ifcgeometricrepresentationitem.__init__(self , ) self.sizeinx = sizeinx self.sizeiny = sizeiny @apply def sizeinx(): def fget( self ): return self._sizeinx def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument sizeinx is mantatory and can not be set to None') if not check_type(value,ifclengthmeasure): self._sizeinx = ifclengthmeasure(value) else: self._sizeinx = value return property(**locals()) @apply def sizeiny(): def fget( self ): return self._sizeiny def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument sizeiny is mantatory and can not be set to None') if not check_type(value,ifclengthmeasure): self._sizeiny = ifclengthmeasure(value) else: self._sizeiny = value return property(**locals()) #################### # ENTITY ifcplanarbox # #################### class ifcplanarbox(ifcplanarextent): '''Entity ifcplanarbox definition. :param placement :type placement:ifcaxis2placement ''' def __init__( self , inherited0__sizeinx , inherited1__sizeiny , placement, ): ifcplanarextent.__init__(self , inherited0__sizeinx , inherited1__sizeiny , ) self.placement = placement @apply def placement(): def fget( self ): return self._placement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument placement is mantatory and can not be set to None') if not check_type(value,ifcaxis2placement): self._placement = ifcaxis2placement(value) else: self._placement = value return property(**locals()) #################### # ENTITY ifcfooting # #################### class ifcfooting(ifcbuildingelement): '''Entity ifcfooting definition. :param predefinedtype :type predefinedtype:ifcfootingtypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , predefinedtype, ): ifcbuildingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcfootingtypeenum): self._predefinedtype = ifcfootingtypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcfootingtypeenum.self.userdefined) or ((self.predefinedtype == ifcfootingtypeenum.self.userdefined) and EXISTS(self.self.ifcobject.self.objecttype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcpredefinedcolour # #################### class ifcpredefinedcolour(ifcpredefineditem): '''Entity ifcpredefinedcolour definition. ''' def __init__( self , inherited0__name , ): ifcpredefineditem.__init__(self , inherited0__name , ) #################### # ENTITY ifcrelaggregates # #################### class ifcrelaggregates(ifcreldecomposes): '''Entity ifcrelaggregates definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatingobject , inherited5__relatedobjects , ): ifcreldecomposes.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatingobject , inherited5__relatedobjects , ) #################### # ENTITY ifcrelconnectsstructuralelement # #################### class ifcrelconnectsstructuralelement(ifcrelconnects): '''Entity ifcrelconnectsstructuralelement definition. :param relatingelement :type relatingelement:ifcelement :param relatedstructuralmember :type relatedstructuralmember:ifcstructuralmember ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , relatingelement,relatedstructuralmember, ): ifcrelconnects.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.relatingelement = relatingelement self.relatedstructuralmember = relatedstructuralmember @apply def relatingelement(): def fget( self ): return self._relatingelement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingelement is mantatory and can not be set to None') if not check_type(value,ifcelement): self._relatingelement = ifcelement(value) else: self._relatingelement = value return property(**locals()) @apply def relatedstructuralmember(): def fget( self ): return self._relatedstructuralmember def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedstructuralmember is mantatory and can not be set to None') if not check_type(value,ifcstructuralmember): self._relatedstructuralmember = ifcstructuralmember(value) else: self._relatedstructuralmember = value return property(**locals()) #################### # ENTITY ifctextstyle # #################### class ifctextstyle(ifcpresentationstyle): '''Entity ifctextstyle definition. :param textcharacterappearance :type textcharacterappearance:ifccharacterstyleselect :param textstyle :type textstyle:ifctextstyleselect :param textfontstyle :type textfontstyle:ifctextfontselect ''' def __init__( self , inherited0__name , textcharacterappearance,textstyle,textfontstyle, ): ifcpresentationstyle.__init__(self , inherited0__name , ) self.textcharacterappearance = textcharacterappearance self.textstyle = textstyle self.textfontstyle = textfontstyle @apply def textcharacterappearance(): def fget( self ): return self._textcharacterappearance def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccharacterstyleselect): self._textcharacterappearance = ifccharacterstyleselect(value) else: self._textcharacterappearance = value else: self._textcharacterappearance = value return property(**locals()) @apply def textstyle(): def fget( self ): return self._textstyle def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctextstyleselect): self._textstyle = ifctextstyleselect(value) else: self._textstyle = value else: self._textstyle = value return property(**locals()) @apply def textfontstyle(): def fget( self ): return self._textfontstyle def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument textfontstyle is mantatory and can not be set to None') if not check_type(value,ifctextfontselect): self._textfontstyle = ifctextfontselect(value) else: self._textfontstyle = value return property(**locals()) #################### # ENTITY ifcwall # #################### class ifcwall(ifcbuildingelement): '''Entity ifcwall definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcbuildingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) def wr1(self): eval_wr1_wr = (SIZEOF(None) <= 1) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcdistributioncontrolelementtype # #################### class ifcdistributioncontrolelementtype(ifcdistributionelementtype): '''Entity ifcdistributioncontrolelementtype definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ): ifcdistributionelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) #################### # ENTITY ifcactuatortype # #################### class ifcactuatortype(ifcdistributioncontrolelementtype): '''Entity ifcactuatortype definition. :param predefinedtype :type predefinedtype:ifcactuatortypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcdistributioncontrolelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcactuatortypeenum): self._predefinedtype = ifcactuatortypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcfailureconnectioncondition # #################### class ifcfailureconnectioncondition(ifcstructuralconnectioncondition): '''Entity ifcfailureconnectioncondition definition. :param tensionfailurex :type tensionfailurex:ifcforcemeasure :param tensionfailurey :type tensionfailurey:ifcforcemeasure :param tensionfailurez :type tensionfailurez:ifcforcemeasure :param compressionfailurex :type compressionfailurex:ifcforcemeasure :param compressionfailurey :type compressionfailurey:ifcforcemeasure :param compressionfailurez :type compressionfailurez:ifcforcemeasure ''' def __init__( self , inherited0__name , tensionfailurex,tensionfailurey,tensionfailurez,compressionfailurex,compressionfailurey,compressionfailurez, ): ifcstructuralconnectioncondition.__init__(self , inherited0__name , ) self.tensionfailurex = tensionfailurex self.tensionfailurey = tensionfailurey self.tensionfailurez = tensionfailurez self.compressionfailurex = compressionfailurex self.compressionfailurey = compressionfailurey self.compressionfailurez = compressionfailurez @apply def tensionfailurex(): def fget( self ): return self._tensionfailurex def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcforcemeasure): self._tensionfailurex = ifcforcemeasure(value) else: self._tensionfailurex = value else: self._tensionfailurex = value return property(**locals()) @apply def tensionfailurey(): def fget( self ): return self._tensionfailurey def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcforcemeasure): self._tensionfailurey = ifcforcemeasure(value) else: self._tensionfailurey = value else: self._tensionfailurey = value return property(**locals()) @apply def tensionfailurez(): def fget( self ): return self._tensionfailurez def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcforcemeasure): self._tensionfailurez = ifcforcemeasure(value) else: self._tensionfailurez = value else: self._tensionfailurez = value return property(**locals()) @apply def compressionfailurex(): def fget( self ): return self._compressionfailurex def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcforcemeasure): self._compressionfailurex = ifcforcemeasure(value) else: self._compressionfailurex = value else: self._compressionfailurex = value return property(**locals()) @apply def compressionfailurey(): def fget( self ): return self._compressionfailurey def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcforcemeasure): self._compressionfailurey = ifcforcemeasure(value) else: self._compressionfailurey = value else: self._compressionfailurey = value return property(**locals()) @apply def compressionfailurez(): def fget( self ): return self._compressionfailurez def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcforcemeasure): self._compressionfailurez = ifcforcemeasure(value) else: self._compressionfailurez = value else: self._compressionfailurez = value return property(**locals()) #################### # ENTITY ifcsymbolstyle # #################### class ifcsymbolstyle(ifcpresentationstyle): '''Entity ifcsymbolstyle definition. :param styleofsymbol :type styleofsymbol:ifcsymbolstyleselect ''' def __init__( self , inherited0__name , styleofsymbol, ): ifcpresentationstyle.__init__(self , inherited0__name , ) self.styleofsymbol = styleofsymbol @apply def styleofsymbol(): def fget( self ): return self._styleofsymbol def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument styleofsymbol is mantatory and can not be set to None') if not check_type(value,ifcsymbolstyleselect): self._styleofsymbol = ifcsymbolstyleselect(value) else: self._styleofsymbol = value return property(**locals()) #################### # ENTITY ifcstructuralsurfaceconnection # #################### class ifcstructuralsurfaceconnection(ifcstructuralconnection): '''Entity ifcstructuralsurfaceconnection definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedcondition , ): ifcstructuralconnection.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedcondition , ) #################### # ENTITY ifccomplexproperty # #################### class ifccomplexproperty(ifcproperty): '''Entity ifccomplexproperty definition. :param usagename :type usagename:ifcidentifier :param hasproperties :type hasproperties:SET(1,None,'ifcproperty', scope = schema_scope) ''' def __init__( self , inherited0__name , inherited1__description , usagename,hasproperties, ): ifcproperty.__init__(self , inherited0__name , inherited1__description , ) self.usagename = usagename self.hasproperties = hasproperties @apply def usagename(): def fget( self ): return self._usagename def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument usagename is mantatory and can not be set to None') if not check_type(value,ifcidentifier): self._usagename = ifcidentifier(value) else: self._usagename = value return property(**locals()) @apply def hasproperties(): def fget( self ): return self._hasproperties def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument hasproperties is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcproperty', scope = schema_scope)): self._hasproperties = SET(value) else: self._hasproperties = value return property(**locals()) def wr21(self): eval_wr21_wr = (SIZEOF(None) == 0) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr def wr22(self): eval_wr22_wr = ifcuniquepropertyname(self.hasproperties) if not eval_wr22_wr: raise AssertionError('Rule wr22 violated') else: return eval_wr22_wr #################### # ENTITY ifcpredefinedsymbol # #################### class ifcpredefinedsymbol(ifcpredefineditem): '''Entity ifcpredefinedsymbol definition. ''' def __init__( self , inherited0__name , ): ifcpredefineditem.__init__(self , inherited0__name , ) #################### # ENTITY ifcpredefineddimensionsymbol # #################### class ifcpredefineddimensionsymbol(ifcpredefinedsymbol): '''Entity ifcpredefineddimensionsymbol definition. ''' def __init__( self , inherited0__name , ): ifcpredefinedsymbol.__init__(self , inherited0__name , ) def wr31(self): eval_wr31_wr = (self.self.ifcpredefineditem.self.name == ['arc length','conical taper','counterbore','countersink','depth','diameter','plus minus','radius','slope','spherical diameter','spherical radius','square']) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifcboundedsurface # #################### class ifcboundedsurface(ifcsurface): '''Entity ifcboundedsurface definition. ''' def __init__( self , ): ifcsurface.__init__(self , ) #################### # ENTITY ifccurveboundedplane # #################### class ifccurveboundedplane(ifcboundedsurface): '''Entity ifccurveboundedplane definition. :param basissurface :type basissurface:ifcplane :param outerboundary :type outerboundary:ifccurve :param innerboundaries :type innerboundaries:SET(0,None,'ifccurve', scope = schema_scope) :param dim :type dim:ifcdimensioncount ''' def __init__( self , basissurface,outerboundary,innerboundaries, ): ifcboundedsurface.__init__(self , ) self.basissurface = basissurface self.outerboundary = outerboundary self.innerboundaries = innerboundaries @apply def basissurface(): def fget( self ): return self._basissurface def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument basissurface is mantatory and can not be set to None') if not check_type(value,ifcplane): self._basissurface = ifcplane(value) else: self._basissurface = value return property(**locals()) @apply def outerboundary(): def fget( self ): return self._outerboundary def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument outerboundary is mantatory and can not be set to None') if not check_type(value,ifccurve): self._outerboundary = ifccurve(value) else: self._outerboundary = value return property(**locals()) @apply def innerboundaries(): def fget( self ): return self._innerboundaries def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument innerboundaries is mantatory and can not be set to None') if not check_type(value,SET(0,None,'ifccurve', scope = schema_scope)): self._innerboundaries = SET(value) else: self._innerboundaries = value return property(**locals()) @apply def dim(): def fget( self ): attribute_eval = self.basissurface.self.dim return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcface # #################### class ifcface(ifctopologicalrepresentationitem): '''Entity ifcface definition. :param bounds :type bounds:SET(1,None,'ifcfacebound', scope = schema_scope) ''' def __init__( self , bounds, ): ifctopologicalrepresentationitem.__init__(self , ) self.bounds = bounds @apply def bounds(): def fget( self ): return self._bounds def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument bounds is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcfacebound', scope = schema_scope)): self._bounds = SET(value) else: self._bounds = value return property(**locals()) def wr1(self): eval_wr1_wr = (SIZEOF(None) <= 1) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcfacesurface # #################### class ifcfacesurface(ifcface): '''Entity ifcfacesurface definition. :param facesurface :type facesurface:ifcsurface :param samesense :type samesense:BOOLEAN ''' def __init__( self , inherited0__bounds , facesurface,samesense, ): ifcface.__init__(self , inherited0__bounds , ) self.facesurface = facesurface self.samesense = samesense @apply def facesurface(): def fget( self ): return self._facesurface def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument facesurface is mantatory and can not be set to None') if not check_type(value,ifcsurface): self._facesurface = ifcsurface(value) else: self._facesurface = value return property(**locals()) @apply def samesense(): def fget( self ): return self._samesense def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument samesense is mantatory and can not be set to None') if not check_type(value,BOOLEAN): self._samesense = BOOLEAN(value) else: self._samesense = value return property(**locals()) #################### # ENTITY ifcstructuralanalysismodel # #################### class ifcstructuralanalysismodel(ifcsystem): '''Entity ifcstructuralanalysismodel definition. :param predefinedtype :type predefinedtype:ifcanalysismodeltypeenum :param orientationof2dplane :type orientationof2dplane:ifcaxis2placement3d :param loadedby :type loadedby:SET(1,None,'ifcstructuralloadgroup', scope = schema_scope) :param hasresults :type hasresults:SET(1,None,'ifcstructuralresultgroup', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , predefinedtype,orientationof2dplane,loadedby,hasresults, ): ifcsystem.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.predefinedtype = predefinedtype self.orientationof2dplane = orientationof2dplane self.loadedby = loadedby self.hasresults = hasresults @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcanalysismodeltypeenum): self._predefinedtype = ifcanalysismodeltypeenum(value) else: self._predefinedtype = value return property(**locals()) @apply def orientationof2dplane(): def fget( self ): return self._orientationof2dplane def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcaxis2placement3d): self._orientationof2dplane = ifcaxis2placement3d(value) else: self._orientationof2dplane = value else: self._orientationof2dplane = value return property(**locals()) @apply def loadedby(): def fget( self ): return self._loadedby def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,SET(1,None,'ifcstructuralloadgroup', scope = schema_scope)): self._loadedby = SET(value) else: self._loadedby = value else: self._loadedby = value return property(**locals()) @apply def hasresults(): def fget( self ): return self._hasresults def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,SET(1,None,'ifcstructuralresultgroup', scope = schema_scope)): self._hasresults = SET(value) else: self._hasresults = value else: self._hasresults = value return property(**locals()) #################### # ENTITY ifcstructuralloadsingleforce # #################### class ifcstructuralloadsingleforce(ifcstructuralloadstatic): '''Entity ifcstructuralloadsingleforce definition. :param forcex :type forcex:ifcforcemeasure :param forcey :type forcey:ifcforcemeasure :param forcez :type forcez:ifcforcemeasure :param momentx :type momentx:ifctorquemeasure :param momenty :type momenty:ifctorquemeasure :param momentz :type momentz:ifctorquemeasure ''' def __init__( self , inherited0__name , forcex,forcey,forcez,momentx,momenty,momentz, ): ifcstructuralloadstatic.__init__(self , inherited0__name , ) self.forcex = forcex self.forcey = forcey self.forcez = forcez self.momentx = momentx self.momenty = momenty self.momentz = momentz @apply def forcex(): def fget( self ): return self._forcex def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcforcemeasure): self._forcex = ifcforcemeasure(value) else: self._forcex = value else: self._forcex = value return property(**locals()) @apply def forcey(): def fget( self ): return self._forcey def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcforcemeasure): self._forcey = ifcforcemeasure(value) else: self._forcey = value else: self._forcey = value return property(**locals()) @apply def forcez(): def fget( self ): return self._forcez def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcforcemeasure): self._forcez = ifcforcemeasure(value) else: self._forcez = value else: self._forcez = value return property(**locals()) @apply def momentx(): def fget( self ): return self._momentx def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctorquemeasure): self._momentx = ifctorquemeasure(value) else: self._momentx = value else: self._momentx = value return property(**locals()) @apply def momenty(): def fget( self ): return self._momenty def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctorquemeasure): self._momenty = ifctorquemeasure(value) else: self._momenty = value else: self._momenty = value return property(**locals()) @apply def momentz(): def fget( self ): return self._momentz def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctorquemeasure): self._momentz = ifctorquemeasure(value) else: self._momentz = value else: self._momentz = value return property(**locals()) #################### # ENTITY ifcstructuralloadsingleforcewarping # #################### class ifcstructuralloadsingleforcewarping(ifcstructuralloadsingleforce): '''Entity ifcstructuralloadsingleforcewarping definition. :param warpingmoment :type warpingmoment:ifcwarpingmomentmeasure ''' def __init__( self , inherited0__name , inherited1__forcex , inherited2__forcey , inherited3__forcez , inherited4__momentx , inherited5__momenty , inherited6__momentz , warpingmoment, ): ifcstructuralloadsingleforce.__init__(self , inherited0__name , inherited1__forcex , inherited2__forcey , inherited3__forcez , inherited4__momentx , inherited5__momenty , inherited6__momentz , ) self.warpingmoment = warpingmoment @apply def warpingmoment(): def fget( self ): return self._warpingmoment def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcwarpingmomentmeasure): self._warpingmoment = ifcwarpingmomentmeasure(value) else: self._warpingmoment = value else: self._warpingmoment = value return property(**locals()) #################### # ENTITY ifcaxis2placement3d # #################### class ifcaxis2placement3d(ifcplacement): '''Entity ifcaxis2placement3d definition. :param axis :type axis:ifcdirection :param refdirection :type refdirection:ifcdirection :param p :type p:LIST(3,3,'ifcdirection', scope = schema_scope) ''' def __init__( self , inherited0__location , axis,refdirection, ): ifcplacement.__init__(self , inherited0__location , ) self.axis = axis self.refdirection = refdirection @apply def axis(): def fget( self ): return self._axis def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdirection): self._axis = ifcdirection(value) else: self._axis = value else: self._axis = value return property(**locals()) @apply def refdirection(): def fget( self ): return self._refdirection def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdirection): self._refdirection = ifcdirection(value) else: self._refdirection = value else: self._refdirection = value return property(**locals()) @apply def p(): def fget( self ): attribute_eval = ifcbuildaxes(self.axis,self.refdirection) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument p is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (self.self.ifcplacement.self.location.self.dim == 3) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (( not EXISTS(self.axis)) or (self.axis.self.dim == 3)) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr def wr3(self): eval_wr3_wr = (( not EXISTS(self.refdirection)) or (self.refdirection.self.dim == 3)) if not eval_wr3_wr: raise AssertionError('Rule wr3 violated') else: return eval_wr3_wr def wr4(self): eval_wr4_wr = ((( not EXISTS(self.axis)) or ( not EXISTS(self.refdirection))) or (ifccrossproduct(self.axis,self.refdirection).self.magnitude > 0)) if not eval_wr4_wr: raise AssertionError('Rule wr4 violated') else: return eval_wr4_wr def wr5(self): eval_wr5_wr = ( not (EXISTS(self.axis) XOR EXISTS(self.refdirection))) if not eval_wr5_wr: raise AssertionError('Rule wr5 violated') else: return eval_wr5_wr #################### # ENTITY ifchalfspacesolid # #################### class ifchalfspacesolid(ifcgeometricrepresentationitem): '''Entity ifchalfspacesolid definition. :param basesurface :type basesurface:ifcsurface :param agreementflag :type agreementflag:BOOLEAN :param dim :type dim:ifcdimensioncount ''' def __init__( self , basesurface,agreementflag, ): ifcgeometricrepresentationitem.__init__(self , ) self.basesurface = basesurface self.agreementflag = agreementflag @apply def basesurface(): def fget( self ): return self._basesurface def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument basesurface is mantatory and can not be set to None') if not check_type(value,ifcsurface): self._basesurface = ifcsurface(value) else: self._basesurface = value return property(**locals()) @apply def agreementflag(): def fget( self ): return self._agreementflag def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument agreementflag is mantatory and can not be set to None') if not check_type(value,BOOLEAN): self._agreementflag = BOOLEAN(value) else: self._agreementflag = value return property(**locals()) @apply def dim(): def fget( self ): attribute_eval = 3 return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcboxedhalfspace # #################### class ifcboxedhalfspace(ifchalfspacesolid): '''Entity ifcboxedhalfspace definition. :param enclosure :type enclosure:ifcboundingbox ''' def __init__( self , inherited0__basesurface , inherited1__agreementflag , enclosure, ): ifchalfspacesolid.__init__(self , inherited0__basesurface , inherited1__agreementflag , ) self.enclosure = enclosure @apply def enclosure(): def fget( self ): return self._enclosure def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument enclosure is mantatory and can not be set to None') if not check_type(value,ifcboundingbox): self._enclosure = ifcboundingbox(value) else: self._enclosure = value return property(**locals()) def wr1(self): eval_wr1_wr = ( not ('IFC2X3.IFCCURVEBOUNDEDPLANE' == TYPEOF(self.self.ifchalfspacesolid.self.basesurface))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifccompositecurve # #################### class ifccompositecurve(ifcboundedcurve): '''Entity ifccompositecurve definition. :param segments :type segments:LIST(1,None,'ifccompositecurvesegment', scope = schema_scope) :param selfintersect :type selfintersect:LOGICAL :param nsegments :type nsegments:INTEGER :param closedcurve :type closedcurve:LOGICAL ''' def __init__( self , segments,selfintersect, ): ifcboundedcurve.__init__(self , ) self.segments = segments self.selfintersect = selfintersect @apply def segments(): def fget( self ): return self._segments def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument segments is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifccompositecurvesegment', scope = schema_scope)): self._segments = LIST(value) else: self._segments = value return property(**locals()) @apply def selfintersect(): def fget( self ): return self._selfintersect def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument selfintersect is mantatory and can not be set to None') if not check_type(value,LOGICAL): self._selfintersect = LOGICAL(value) else: self._selfintersect = value return property(**locals()) @apply def nsegments(): def fget( self ): attribute_eval = SIZEOF(self.segments) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument nsegments is DERIVED. It is computed and can not be set to any value') return property(**locals()) @apply def closedcurve(): def fget( self ): attribute_eval = (self.segments[self.nsegments].self.transition != discontinuous) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument closedcurve is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr41(self): eval_wr41_wr = ((( not self.closedcurve) and (SIZEOF(None) == 1)) or (self.closedcurve and (SIZEOF(None) == 0))) if not eval_wr41_wr: raise AssertionError('Rule wr41 violated') else: return eval_wr41_wr def wr42(self): eval_wr42_wr = (SIZEOF(None) == 0) if not eval_wr42_wr: raise AssertionError('Rule wr42 violated') else: return eval_wr42_wr #################### # ENTITY ifcroof # #################### class ifcroof(ifcbuildingelement): '''Entity ifcroof definition. :param shapetype :type shapetype:ifcrooftypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , shapetype, ): ifcbuildingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) self.shapetype = shapetype @apply def shapetype(): def fget( self ): return self._shapetype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument shapetype is mantatory and can not be set to None') if not check_type(value,ifcrooftypeenum): self._shapetype = ifcrooftypeenum(value) else: self._shapetype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((HIINDEX(self.self.ifcobjectdefinition.self.isdecomposedby) == 0) or ((HIINDEX(self.self.ifcobjectdefinition.self.isdecomposedby) == 1) and ( not EXISTS(self.self.ifcproduct.self.representation)))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcstructuralloadsingledisplacementdistortion # #################### class ifcstructuralloadsingledisplacementdistortion(ifcstructuralloadsingledisplacement): '''Entity ifcstructuralloadsingledisplacementdistortion definition. :param distortion :type distortion:ifccurvaturemeasure ''' def __init__( self , inherited0__name , inherited1__displacementx , inherited2__displacementy , inherited3__displacementz , inherited4__rotationaldisplacementrx , inherited5__rotationaldisplacementry , inherited6__rotationaldisplacementrz , distortion, ): ifcstructuralloadsingledisplacement.__init__(self , inherited0__name , inherited1__displacementx , inherited2__displacementy , inherited3__displacementz , inherited4__rotationaldisplacementrx , inherited5__rotationaldisplacementry , inherited6__rotationaldisplacementrz , ) self.distortion = distortion @apply def distortion(): def fget( self ): return self._distortion def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccurvaturemeasure): self._distortion = ifccurvaturemeasure(value) else: self._distortion = value else: self._distortion = value return property(**locals()) #################### # ENTITY ifcrepresentation # #################### class ifcrepresentation(BaseEntityClass): '''Entity ifcrepresentation definition. :param contextofitems :type contextofitems:ifcrepresentationcontext :param representationidentifier :type representationidentifier:ifclabel :param representationtype :type representationtype:ifclabel :param items :type items:SET(1,None,'ifcrepresentationitem', scope = schema_scope) :param representationmap :type representationmap:SET(0,1,'ifcrepresentationmap', scope = schema_scope) :param layerassignments :type layerassignments:SET(0,None,'ifcpresentationlayerassignment', scope = schema_scope) :param ofproductrepresentation :type ofproductrepresentation:SET(0,1,'ifcproductrepresentation', scope = schema_scope) ''' def __init__( self , contextofitems,representationidentifier,representationtype,items, ): self.contextofitems = contextofitems self.representationidentifier = representationidentifier self.representationtype = representationtype self.items = items @apply def contextofitems(): def fget( self ): return self._contextofitems def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument contextofitems is mantatory and can not be set to None') if not check_type(value,ifcrepresentationcontext): self._contextofitems = ifcrepresentationcontext(value) else: self._contextofitems = value return property(**locals()) @apply def representationidentifier(): def fget( self ): return self._representationidentifier def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._representationidentifier = ifclabel(value) else: self._representationidentifier = value else: self._representationidentifier = value return property(**locals()) @apply def representationtype(): def fget( self ): return self._representationtype def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._representationtype = ifclabel(value) else: self._representationtype = value else: self._representationtype = value return property(**locals()) @apply def items(): def fget( self ): return self._items def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument items is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcrepresentationitem', scope = schema_scope)): self._items = SET(value) else: self._items = value return property(**locals()) @apply def representationmap(): def fget( self ): return self._representationmap def fset( self, value ): # INVERSE argument raise AssertionError('Argument representationmap is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def layerassignments(): def fget( self ): return self._layerassignments def fset( self, value ): # INVERSE argument raise AssertionError('Argument layerassignments is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def ofproductrepresentation(): def fget( self ): return self._ofproductrepresentation def fset( self, value ): # INVERSE argument raise AssertionError('Argument ofproductrepresentation is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifccompositecurvesegment # #################### class ifccompositecurvesegment(ifcgeometricrepresentationitem): '''Entity ifccompositecurvesegment definition. :param transition :type transition:ifctransitioncode :param samesense :type samesense:BOOLEAN :param parentcurve :type parentcurve:ifccurve :param dim :type dim:ifcdimensioncount :param usingcurves :type usingcurves:SET(1,None,'ifccompositecurve', scope = schema_scope) ''' def __init__( self , transition,samesense,parentcurve, ): ifcgeometricrepresentationitem.__init__(self , ) self.transition = transition self.samesense = samesense self.parentcurve = parentcurve @apply def transition(): def fget( self ): return self._transition def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument transition is mantatory and can not be set to None') if not check_type(value,ifctransitioncode): self._transition = ifctransitioncode(value) else: self._transition = value return property(**locals()) @apply def samesense(): def fget( self ): return self._samesense def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument samesense is mantatory and can not be set to None') if not check_type(value,BOOLEAN): self._samesense = BOOLEAN(value) else: self._samesense = value return property(**locals()) @apply def parentcurve(): def fget( self ): return self._parentcurve def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument parentcurve is mantatory and can not be set to None') if not check_type(value,ifccurve): self._parentcurve = ifccurve(value) else: self._parentcurve = value return property(**locals()) @apply def dim(): def fget( self ): attribute_eval = self.parentcurve.self.dim return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) @apply def usingcurves(): def fget( self ): return self._usingcurves def fset( self, value ): # INVERSE argument raise AssertionError('Argument usingcurves is INVERSE. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = ('IFC2X3.IFCBOUNDEDCURVE' == TYPEOF(self.parentcurve)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcclassificationitem # #################### class ifcclassificationitem(BaseEntityClass): '''Entity ifcclassificationitem definition. :param notation :type notation:ifcclassificationnotationfacet :param itemof :type itemof:ifcclassification :param title :type title:ifclabel :param isclassifieditemin :type isclassifieditemin:SET(0,1,'ifcclassificationitemrelationship', scope = schema_scope) :param isclassifyingitemin :type isclassifyingitemin:SET(0,1,'ifcclassificationitemrelationship', scope = schema_scope) ''' def __init__( self , notation,itemof,title, ): self.notation = notation self.itemof = itemof self.title = title @apply def notation(): def fget( self ): return self._notation def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument notation is mantatory and can not be set to None') if not check_type(value,ifcclassificationnotationfacet): self._notation = ifcclassificationnotationfacet(value) else: self._notation = value return property(**locals()) @apply def itemof(): def fget( self ): return self._itemof def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcclassification): self._itemof = ifcclassification(value) else: self._itemof = value else: self._itemof = value return property(**locals()) @apply def title(): def fget( self ): return self._title def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument title is mantatory and can not be set to None') if not check_type(value,ifclabel): self._title = ifclabel(value) else: self._title = value return property(**locals()) @apply def isclassifieditemin(): def fget( self ): return self._isclassifieditemin def fset( self, value ): # INVERSE argument raise AssertionError('Argument isclassifieditemin is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def isclassifyingitemin(): def fget( self ): return self._isclassifyingitemin def fset( self, value ): # INVERSE argument raise AssertionError('Argument isclassifyingitemin is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcoffsetcurve2d # #################### class ifcoffsetcurve2d(ifccurve): '''Entity ifcoffsetcurve2d definition. :param basiscurve :type basiscurve:ifccurve :param distance :type distance:ifclengthmeasure :param selfintersect :type selfintersect:LOGICAL ''' def __init__( self , basiscurve,distance,selfintersect, ): ifccurve.__init__(self , ) self.basiscurve = basiscurve self.distance = distance self.selfintersect = selfintersect @apply def basiscurve(): def fget( self ): return self._basiscurve def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument basiscurve is mantatory and can not be set to None') if not check_type(value,ifccurve): self._basiscurve = ifccurve(value) else: self._basiscurve = value return property(**locals()) @apply def distance(): def fget( self ): return self._distance def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument distance is mantatory and can not be set to None') if not check_type(value,ifclengthmeasure): self._distance = ifclengthmeasure(value) else: self._distance = value return property(**locals()) @apply def selfintersect(): def fget( self ): return self._selfintersect def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument selfintersect is mantatory and can not be set to None') if not check_type(value,LOGICAL): self._selfintersect = LOGICAL(value) else: self._selfintersect = value return property(**locals()) def wr1(self): eval_wr1_wr = (self.basiscurve.self.dim == 2) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcrelassignstogroup # #################### class ifcrelassignstogroup(ifcrelassigns): '''Entity ifcrelassignstogroup definition. :param relatinggroup :type relatinggroup:ifcgroup ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatedobjectstype , relatinggroup, ): ifcrelassigns.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatedobjectstype , ) self.relatinggroup = relatinggroup @apply def relatinggroup(): def fget( self ): return self._relatinggroup def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatinggroup is mantatory and can not be set to None') if not check_type(value,ifcgroup): self._relatinggroup = ifcgroup(value) else: self._relatinggroup = value return property(**locals()) def wr1(self): eval_wr1_wr = (SIZEOF(None) == 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcequipmentelement # #################### class ifcequipmentelement(ifcelement): '''Entity ifcequipmentelement definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcreinforcementdefinitionproperties # #################### class ifcreinforcementdefinitionproperties(ifcpropertysetdefinition): '''Entity ifcreinforcementdefinitionproperties definition. :param definitiontype :type definitiontype:ifclabel :param reinforcementsectiondefinitions :type reinforcementsectiondefinitions:LIST(1,None,'ifcsectionreinforcementproperties', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , definitiontype,reinforcementsectiondefinitions, ): ifcpropertysetdefinition.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.definitiontype = definitiontype self.reinforcementsectiondefinitions = reinforcementsectiondefinitions @apply def definitiontype(): def fget( self ): return self._definitiontype def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._definitiontype = ifclabel(value) else: self._definitiontype = value else: self._definitiontype = value return property(**locals()) @apply def reinforcementsectiondefinitions(): def fget( self ): return self._reinforcementsectiondefinitions def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument reinforcementsectiondefinitions is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcsectionreinforcementproperties', scope = schema_scope)): self._reinforcementsectiondefinitions = LIST(value) else: self._reinforcementsectiondefinitions = value return property(**locals()) #################### # ENTITY ifcrelassociatesclassification # #################### class ifcrelassociatesclassification(ifcrelassociates): '''Entity ifcrelassociatesclassification definition. :param relatingclassification :type relatingclassification:ifcclassificationnotationselect ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , relatingclassification, ): ifcrelassociates.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , ) self.relatingclassification = relatingclassification @apply def relatingclassification(): def fget( self ): return self._relatingclassification def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingclassification is mantatory and can not be set to None') if not check_type(value,ifcclassificationnotationselect): self._relatingclassification = ifcclassificationnotationselect(value) else: self._relatingclassification = value return property(**locals()) #################### # ENTITY ifcrelvoidselement # #################### class ifcrelvoidselement(ifcrelconnects): '''Entity ifcrelvoidselement definition. :param relatingbuildingelement :type relatingbuildingelement:ifcelement :param relatedopeningelement :type relatedopeningelement:ifcfeatureelementsubtraction ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , relatingbuildingelement,relatedopeningelement, ): ifcrelconnects.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.relatingbuildingelement = relatingbuildingelement self.relatedopeningelement = relatedopeningelement @apply def relatingbuildingelement(): def fget( self ): return self._relatingbuildingelement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingbuildingelement is mantatory and can not be set to None') if not check_type(value,ifcelement): self._relatingbuildingelement = ifcelement(value) else: self._relatingbuildingelement = value return property(**locals()) @apply def relatedopeningelement(): def fget( self ): return self._relatedopeningelement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedopeningelement is mantatory and can not be set to None') if not check_type(value,ifcfeatureelementsubtraction): self._relatedopeningelement = ifcfeatureelementsubtraction(value) else: self._relatedopeningelement = value return property(**locals()) #################### # ENTITY ifcboundaryedgecondition # #################### class ifcboundaryedgecondition(ifcboundarycondition): '''Entity ifcboundaryedgecondition definition. :param linearstiffnessbylengthx :type linearstiffnessbylengthx:ifcmodulusoflinearsubgradereactionmeasure :param linearstiffnessbylengthy :type linearstiffnessbylengthy:ifcmodulusoflinearsubgradereactionmeasure :param linearstiffnessbylengthz :type linearstiffnessbylengthz:ifcmodulusoflinearsubgradereactionmeasure :param rotationalstiffnessbylengthx :type rotationalstiffnessbylengthx:ifcmodulusofrotationalsubgradereactionmeasure :param rotationalstiffnessbylengthy :type rotationalstiffnessbylengthy:ifcmodulusofrotationalsubgradereactionmeasure :param rotationalstiffnessbylengthz :type rotationalstiffnessbylengthz:ifcmodulusofrotationalsubgradereactionmeasure ''' def __init__( self , inherited0__name , linearstiffnessbylengthx,linearstiffnessbylengthy,linearstiffnessbylengthz,rotationalstiffnessbylengthx,rotationalstiffnessbylengthy,rotationalstiffnessbylengthz, ): ifcboundarycondition.__init__(self , inherited0__name , ) self.linearstiffnessbylengthx = linearstiffnessbylengthx self.linearstiffnessbylengthy = linearstiffnessbylengthy self.linearstiffnessbylengthz = linearstiffnessbylengthz self.rotationalstiffnessbylengthx = rotationalstiffnessbylengthx self.rotationalstiffnessbylengthy = rotationalstiffnessbylengthy self.rotationalstiffnessbylengthz = rotationalstiffnessbylengthz @apply def linearstiffnessbylengthx(): def fget( self ): return self._linearstiffnessbylengthx def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmodulusoflinearsubgradereactionmeasure): self._linearstiffnessbylengthx = ifcmodulusoflinearsubgradereactionmeasure(value) else: self._linearstiffnessbylengthx = value else: self._linearstiffnessbylengthx = value return property(**locals()) @apply def linearstiffnessbylengthy(): def fget( self ): return self._linearstiffnessbylengthy def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmodulusoflinearsubgradereactionmeasure): self._linearstiffnessbylengthy = ifcmodulusoflinearsubgradereactionmeasure(value) else: self._linearstiffnessbylengthy = value else: self._linearstiffnessbylengthy = value return property(**locals()) @apply def linearstiffnessbylengthz(): def fget( self ): return self._linearstiffnessbylengthz def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmodulusoflinearsubgradereactionmeasure): self._linearstiffnessbylengthz = ifcmodulusoflinearsubgradereactionmeasure(value) else: self._linearstiffnessbylengthz = value else: self._linearstiffnessbylengthz = value return property(**locals()) @apply def rotationalstiffnessbylengthx(): def fget( self ): return self._rotationalstiffnessbylengthx def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmodulusofrotationalsubgradereactionmeasure): self._rotationalstiffnessbylengthx = ifcmodulusofrotationalsubgradereactionmeasure(value) else: self._rotationalstiffnessbylengthx = value else: self._rotationalstiffnessbylengthx = value return property(**locals()) @apply def rotationalstiffnessbylengthy(): def fget( self ): return self._rotationalstiffnessbylengthy def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmodulusofrotationalsubgradereactionmeasure): self._rotationalstiffnessbylengthy = ifcmodulusofrotationalsubgradereactionmeasure(value) else: self._rotationalstiffnessbylengthy = value else: self._rotationalstiffnessbylengthy = value return property(**locals()) @apply def rotationalstiffnessbylengthz(): def fget( self ): return self._rotationalstiffnessbylengthz def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmodulusofrotationalsubgradereactionmeasure): self._rotationalstiffnessbylengthz = ifcmodulusofrotationalsubgradereactionmeasure(value) else: self._rotationalstiffnessbylengthz = value else: self._rotationalstiffnessbylengthz = value return property(**locals()) #################### # ENTITY ifcflowtreatmentdevicetype # #################### class ifcflowtreatmentdevicetype(ifcdistributionflowelementtype): '''Entity ifcflowtreatmentdevicetype definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ): ifcdistributionflowelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) #################### # ENTITY ifcgeometricset # #################### class ifcgeometricset(ifcgeometricrepresentationitem): '''Entity ifcgeometricset definition. :param elements :type elements:SET(1,None,'ifcgeometricsetselect', scope = schema_scope) :param dim :type dim:ifcdimensioncount ''' def __init__( self , elements, ): ifcgeometricrepresentationitem.__init__(self , ) self.elements = elements @apply def elements(): def fget( self ): return self._elements def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument elements is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcgeometricsetselect', scope = schema_scope)): self._elements = SET(value) else: self._elements = value return property(**locals()) @apply def dim(): def fget( self ): attribute_eval = self.elements[1].self.dim return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr21(self): eval_wr21_wr = (SIZEOF(None) == 0) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr #################### # ENTITY ifcmaterialclassificationrelationship # #################### class ifcmaterialclassificationrelationship(BaseEntityClass): '''Entity ifcmaterialclassificationrelationship definition. :param materialclassifications :type materialclassifications:SET(1,None,'ifcclassificationnotationselect', scope = schema_scope) :param classifiedmaterial :type classifiedmaterial:ifcmaterial ''' def __init__( self , materialclassifications,classifiedmaterial, ): self.materialclassifications = materialclassifications self.classifiedmaterial = classifiedmaterial @apply def materialclassifications(): def fget( self ): return self._materialclassifications def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument materialclassifications is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcclassificationnotationselect', scope = schema_scope)): self._materialclassifications = SET(value) else: self._materialclassifications = value return property(**locals()) @apply def classifiedmaterial(): def fget( self ): return self._classifiedmaterial def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument classifiedmaterial is mantatory and can not be set to None') if not check_type(value,ifcmaterial): self._classifiedmaterial = ifcmaterial(value) else: self._classifiedmaterial = value return property(**locals()) #################### # ENTITY ifcmechanicalmaterialproperties # #################### class ifcmechanicalmaterialproperties(ifcmaterialproperties): '''Entity ifcmechanicalmaterialproperties definition. :param dynamicviscosity :type dynamicviscosity:ifcdynamicviscositymeasure :param youngmodulus :type youngmodulus:ifcmodulusofelasticitymeasure :param shearmodulus :type shearmodulus:ifcmodulusofelasticitymeasure :param poissonratio :type poissonratio:ifcpositiveratiomeasure :param thermalexpansioncoefficient :type thermalexpansioncoefficient:ifcthermalexpansioncoefficientmeasure ''' def __init__( self , inherited0__material , dynamicviscosity,youngmodulus,shearmodulus,poissonratio,thermalexpansioncoefficient, ): ifcmaterialproperties.__init__(self , inherited0__material , ) self.dynamicviscosity = dynamicviscosity self.youngmodulus = youngmodulus self.shearmodulus = shearmodulus self.poissonratio = poissonratio self.thermalexpansioncoefficient = thermalexpansioncoefficient @apply def dynamicviscosity(): def fget( self ): return self._dynamicviscosity def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdynamicviscositymeasure): self._dynamicviscosity = ifcdynamicviscositymeasure(value) else: self._dynamicviscosity = value else: self._dynamicviscosity = value return property(**locals()) @apply def youngmodulus(): def fget( self ): return self._youngmodulus def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmodulusofelasticitymeasure): self._youngmodulus = ifcmodulusofelasticitymeasure(value) else: self._youngmodulus = value else: self._youngmodulus = value return property(**locals()) @apply def shearmodulus(): def fget( self ): return self._shearmodulus def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmodulusofelasticitymeasure): self._shearmodulus = ifcmodulusofelasticitymeasure(value) else: self._shearmodulus = value else: self._shearmodulus = value return property(**locals()) @apply def poissonratio(): def fget( self ): return self._poissonratio def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._poissonratio = ifcpositiveratiomeasure(value) else: self._poissonratio = value else: self._poissonratio = value return property(**locals()) @apply def thermalexpansioncoefficient(): def fget( self ): return self._thermalexpansioncoefficient def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcthermalexpansioncoefficientmeasure): self._thermalexpansioncoefficient = ifcthermalexpansioncoefficientmeasure(value) else: self._thermalexpansioncoefficient = value else: self._thermalexpansioncoefficient = value return property(**locals()) def wr21(self): eval_wr21_wr = (( not EXISTS(self.youngmodulus)) or (self.youngmodulus >= 0)) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr def wr22(self): eval_wr22_wr = (( not EXISTS(self.shearmodulus)) or (self.shearmodulus >= 0)) if not eval_wr22_wr: raise AssertionError('Rule wr22 violated') else: return eval_wr22_wr #################### # ENTITY ifcmechanicalconcretematerialproperties # #################### class ifcmechanicalconcretematerialproperties(ifcmechanicalmaterialproperties): '''Entity ifcmechanicalconcretematerialproperties definition. :param compressivestrength :type compressivestrength:ifcpressuremeasure :param maxaggregatesize :type maxaggregatesize:ifcpositivelengthmeasure :param admixturesdescription :type admixturesdescription:ifctext :param workability :type workability:ifctext :param protectiveporeratio :type protectiveporeratio:ifcnormalisedratiomeasure :param waterimpermeability :type waterimpermeability:ifctext ''' def __init__( self , inherited0__material , inherited1__dynamicviscosity , inherited2__youngmodulus , inherited3__shearmodulus , inherited4__poissonratio , inherited5__thermalexpansioncoefficient , compressivestrength,maxaggregatesize,admixturesdescription,workability,protectiveporeratio,waterimpermeability, ): ifcmechanicalmaterialproperties.__init__(self , inherited0__material , inherited1__dynamicviscosity , inherited2__youngmodulus , inherited3__shearmodulus , inherited4__poissonratio , inherited5__thermalexpansioncoefficient , ) self.compressivestrength = compressivestrength self.maxaggregatesize = maxaggregatesize self.admixturesdescription = admixturesdescription self.workability = workability self.protectiveporeratio = protectiveporeratio self.waterimpermeability = waterimpermeability @apply def compressivestrength(): def fget( self ): return self._compressivestrength def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpressuremeasure): self._compressivestrength = ifcpressuremeasure(value) else: self._compressivestrength = value else: self._compressivestrength = value return property(**locals()) @apply def maxaggregatesize(): def fget( self ): return self._maxaggregatesize def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._maxaggregatesize = ifcpositivelengthmeasure(value) else: self._maxaggregatesize = value else: self._maxaggregatesize = value return property(**locals()) @apply def admixturesdescription(): def fget( self ): return self._admixturesdescription def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._admixturesdescription = ifctext(value) else: self._admixturesdescription = value else: self._admixturesdescription = value return property(**locals()) @apply def workability(): def fget( self ): return self._workability def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._workability = ifctext(value) else: self._workability = value else: self._workability = value return property(**locals()) @apply def protectiveporeratio(): def fget( self ): return self._protectiveporeratio def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcnormalisedratiomeasure): self._protectiveporeratio = ifcnormalisedratiomeasure(value) else: self._protectiveporeratio = value else: self._protectiveporeratio = value return property(**locals()) @apply def waterimpermeability(): def fget( self ): return self._waterimpermeability def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._waterimpermeability = ifctext(value) else: self._waterimpermeability = value else: self._waterimpermeability = value return property(**locals()) #################### # ENTITY ifcrelconnectselements # #################### class ifcrelconnectselements(ifcrelconnects): '''Entity ifcrelconnectselements definition. :param connectiongeometry :type connectiongeometry:ifcconnectiongeometry :param relatingelement :type relatingelement:ifcelement :param relatedelement :type relatedelement:ifcelement ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , connectiongeometry,relatingelement,relatedelement, ): ifcrelconnects.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.connectiongeometry = connectiongeometry self.relatingelement = relatingelement self.relatedelement = relatedelement @apply def connectiongeometry(): def fget( self ): return self._connectiongeometry def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcconnectiongeometry): self._connectiongeometry = ifcconnectiongeometry(value) else: self._connectiongeometry = value else: self._connectiongeometry = value return property(**locals()) @apply def relatingelement(): def fget( self ): return self._relatingelement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingelement is mantatory and can not be set to None') if not check_type(value,ifcelement): self._relatingelement = ifcelement(value) else: self._relatingelement = value return property(**locals()) @apply def relatedelement(): def fget( self ): return self._relatedelement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedelement is mantatory and can not be set to None') if not check_type(value,ifcelement): self._relatedelement = ifcelement(value) else: self._relatedelement = value return property(**locals()) def wr31(self): eval_wr31_wr = (self.relatingelement != self.relatedelement) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifcshapeaspect # #################### class ifcshapeaspect(BaseEntityClass): '''Entity ifcshapeaspect definition. :param shaperepresentations :type shaperepresentations:LIST(1,None,'ifcshapemodel', scope = schema_scope) :param name :type name:ifclabel :param description :type description:ifctext :param productdefinitional :type productdefinitional:LOGICAL :param partofproductdefinitionshape :type partofproductdefinitionshape:ifcproductdefinitionshape ''' def __init__( self , shaperepresentations,name,description,productdefinitional,partofproductdefinitionshape, ): self.shaperepresentations = shaperepresentations self.name = name self.description = description self.productdefinitional = productdefinitional self.partofproductdefinitionshape = partofproductdefinitionshape @apply def shaperepresentations(): def fget( self ): return self._shaperepresentations def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument shaperepresentations is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcshapemodel', scope = schema_scope)): self._shaperepresentations = LIST(value) else: self._shaperepresentations = value return property(**locals()) @apply def name(): def fget( self ): return self._name def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value else: self._name = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) @apply def productdefinitional(): def fget( self ): return self._productdefinitional def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument productdefinitional is mantatory and can not be set to None') if not check_type(value,LOGICAL): self._productdefinitional = LOGICAL(value) else: self._productdefinitional = value return property(**locals()) @apply def partofproductdefinitionshape(): def fget( self ): return self._partofproductdefinitionshape def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument partofproductdefinitionshape is mantatory and can not be set to None') if not check_type(value,ifcproductdefinitionshape): self._partofproductdefinitionshape = ifcproductdefinitionshape(value) else: self._partofproductdefinitionshape = value return property(**locals()) #################### # ENTITY ifcstructuralcurveconnection # #################### class ifcstructuralcurveconnection(ifcstructuralconnection): '''Entity ifcstructuralcurveconnection definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedcondition , ): ifcstructuralconnection.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedcondition , ) #################### # ENTITY ifcushapeprofiledef # #################### class ifcushapeprofiledef(ifcparameterizedprofiledef): '''Entity ifcushapeprofiledef definition. :param depth :type depth:ifcpositivelengthmeasure :param flangewidth :type flangewidth:ifcpositivelengthmeasure :param webthickness :type webthickness:ifcpositivelengthmeasure :param flangethickness :type flangethickness:ifcpositivelengthmeasure :param filletradius :type filletradius:ifcpositivelengthmeasure :param edgeradius :type edgeradius:ifcpositivelengthmeasure :param flangeslope :type flangeslope:ifcplaneanglemeasure :param centreofgravityinx :type centreofgravityinx:ifcpositivelengthmeasure ''' def __init__( self , inherited0__profiletype , inherited1__profilename , inherited2__position , depth,flangewidth,webthickness,flangethickness,filletradius,edgeradius,flangeslope,centreofgravityinx, ): ifcparameterizedprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , inherited2__position , ) self.depth = depth self.flangewidth = flangewidth self.webthickness = webthickness self.flangethickness = flangethickness self.filletradius = filletradius self.edgeradius = edgeradius self.flangeslope = flangeslope self.centreofgravityinx = centreofgravityinx @apply def depth(): def fget( self ): return self._depth def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument depth is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._depth = ifcpositivelengthmeasure(value) else: self._depth = value return property(**locals()) @apply def flangewidth(): def fget( self ): return self._flangewidth def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument flangewidth is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._flangewidth = ifcpositivelengthmeasure(value) else: self._flangewidth = value return property(**locals()) @apply def webthickness(): def fget( self ): return self._webthickness def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument webthickness is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._webthickness = ifcpositivelengthmeasure(value) else: self._webthickness = value return property(**locals()) @apply def flangethickness(): def fget( self ): return self._flangethickness def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument flangethickness is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._flangethickness = ifcpositivelengthmeasure(value) else: self._flangethickness = value return property(**locals()) @apply def filletradius(): def fget( self ): return self._filletradius def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._filletradius = ifcpositivelengthmeasure(value) else: self._filletradius = value else: self._filletradius = value return property(**locals()) @apply def edgeradius(): def fget( self ): return self._edgeradius def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._edgeradius = ifcpositivelengthmeasure(value) else: self._edgeradius = value else: self._edgeradius = value return property(**locals()) @apply def flangeslope(): def fget( self ): return self._flangeslope def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcplaneanglemeasure): self._flangeslope = ifcplaneanglemeasure(value) else: self._flangeslope = value else: self._flangeslope = value return property(**locals()) @apply def centreofgravityinx(): def fget( self ): return self._centreofgravityinx def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._centreofgravityinx = ifcpositivelengthmeasure(value) else: self._centreofgravityinx = value else: self._centreofgravityinx = value return property(**locals()) def wr21(self): eval_wr21_wr = (self.flangethickness < (self.depth / 2)) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr def wr22(self): eval_wr22_wr = (self.webthickness < self.flangewidth) if not eval_wr22_wr: raise AssertionError('Rule wr22 violated') else: return eval_wr22_wr #################### # ENTITY ifcexternallydefinedsurfacestyle # #################### class ifcexternallydefinedsurfacestyle(ifcexternalreference): '''Entity ifcexternallydefinedsurfacestyle definition. ''' def __init__( self , inherited0__location , inherited1__itemreference , inherited2__name , ): ifcexternalreference.__init__(self , inherited0__location , inherited1__itemreference , inherited2__name , ) #################### # ENTITY ifcannotationsurfaceoccurrence # #################### class ifcannotationsurfaceoccurrence(ifcannotationoccurrence): '''Entity ifcannotationsurfaceoccurrence definition. ''' def __init__( self , inherited0__item , inherited1__styles , inherited2__name , ): ifcannotationoccurrence.__init__(self , inherited0__item , inherited1__styles , inherited2__name , ) def wr31(self): eval_wr31_wr = (( not EXISTS(self.self.ifcstyleditem.self.item)) or (SIZEOF(['IFC2X3.IFCSURFACE','IFC2X3.IFCFACEBASEDSURFACEMODEL','IFC2X3.IFCSHELLBASEDSURFACEMODEL','IFC2X3.IFCSOLIDMODEL'] * TYPEOF(self.self.ifcstyleditem.self.item)) > 0)) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifcevaporatortype # #################### class ifcevaporatortype(ifcenergyconversiondevicetype): '''Entity ifcevaporatortype definition. :param predefinedtype :type predefinedtype:ifcevaporatortypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcenergyconversiondevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcevaporatortypeenum): self._predefinedtype = ifcevaporatortypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcevaporatortypeenum.self.userdefined) or ((self.predefinedtype == ifcevaporatortypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcfurniturestandard # #################### class ifcfurniturestandard(ifccontrol): '''Entity ifcfurniturestandard definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ): ifccontrol.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) #################### # ENTITY ifcrectangleprofiledef # #################### class ifcrectangleprofiledef(ifcparameterizedprofiledef): '''Entity ifcrectangleprofiledef definition. :param xdim :type xdim:ifcpositivelengthmeasure :param ydim :type ydim:ifcpositivelengthmeasure ''' def __init__( self , inherited0__profiletype , inherited1__profilename , inherited2__position , xdim,ydim, ): ifcparameterizedprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , inherited2__position , ) self.xdim = xdim self.ydim = ydim @apply def xdim(): def fget( self ): return self._xdim def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument xdim is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._xdim = ifcpositivelengthmeasure(value) else: self._xdim = value return property(**locals()) @apply def ydim(): def fget( self ): return self._ydim def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument ydim is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._ydim = ifcpositivelengthmeasure(value) else: self._ydim = value return property(**locals()) #################### # ENTITY ifcroundedrectangleprofiledef # #################### class ifcroundedrectangleprofiledef(ifcrectangleprofiledef): '''Entity ifcroundedrectangleprofiledef definition. :param roundingradius :type roundingradius:ifcpositivelengthmeasure ''' def __init__( self , inherited0__profiletype , inherited1__profilename , inherited2__position , inherited3__xdim , inherited4__ydim , roundingradius, ): ifcrectangleprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , inherited2__position , inherited3__xdim , inherited4__ydim , ) self.roundingradius = roundingradius @apply def roundingradius(): def fget( self ): return self._roundingradius def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument roundingradius is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._roundingradius = ifcpositivelengthmeasure(value) else: self._roundingradius = value return property(**locals()) def wr31(self): eval_wr31_wr = ((self.roundingradius <= (self.self.ifcrectangleprofiledef.self.xdim / 2)) and (self.roundingradius <= (self.self.ifcrectangleprofiledef.self.ydim / 2))) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifctshapeprofiledef # #################### class ifctshapeprofiledef(ifcparameterizedprofiledef): '''Entity ifctshapeprofiledef definition. :param depth :type depth:ifcpositivelengthmeasure :param flangewidth :type flangewidth:ifcpositivelengthmeasure :param webthickness :type webthickness:ifcpositivelengthmeasure :param flangethickness :type flangethickness:ifcpositivelengthmeasure :param filletradius :type filletradius:ifcpositivelengthmeasure :param flangeedgeradius :type flangeedgeradius:ifcpositivelengthmeasure :param webedgeradius :type webedgeradius:ifcpositivelengthmeasure :param webslope :type webslope:ifcplaneanglemeasure :param flangeslope :type flangeslope:ifcplaneanglemeasure :param centreofgravityiny :type centreofgravityiny:ifcpositivelengthmeasure ''' def __init__( self , inherited0__profiletype , inherited1__profilename , inherited2__position , depth,flangewidth,webthickness,flangethickness,filletradius,flangeedgeradius,webedgeradius,webslope,flangeslope,centreofgravityiny, ): ifcparameterizedprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , inherited2__position , ) self.depth = depth self.flangewidth = flangewidth self.webthickness = webthickness self.flangethickness = flangethickness self.filletradius = filletradius self.flangeedgeradius = flangeedgeradius self.webedgeradius = webedgeradius self.webslope = webslope self.flangeslope = flangeslope self.centreofgravityiny = centreofgravityiny @apply def depth(): def fget( self ): return self._depth def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument depth is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._depth = ifcpositivelengthmeasure(value) else: self._depth = value return property(**locals()) @apply def flangewidth(): def fget( self ): return self._flangewidth def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument flangewidth is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._flangewidth = ifcpositivelengthmeasure(value) else: self._flangewidth = value return property(**locals()) @apply def webthickness(): def fget( self ): return self._webthickness def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument webthickness is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._webthickness = ifcpositivelengthmeasure(value) else: self._webthickness = value return property(**locals()) @apply def flangethickness(): def fget( self ): return self._flangethickness def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument flangethickness is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._flangethickness = ifcpositivelengthmeasure(value) else: self._flangethickness = value return property(**locals()) @apply def filletradius(): def fget( self ): return self._filletradius def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._filletradius = ifcpositivelengthmeasure(value) else: self._filletradius = value else: self._filletradius = value return property(**locals()) @apply def flangeedgeradius(): def fget( self ): return self._flangeedgeradius def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._flangeedgeradius = ifcpositivelengthmeasure(value) else: self._flangeedgeradius = value else: self._flangeedgeradius = value return property(**locals()) @apply def webedgeradius(): def fget( self ): return self._webedgeradius def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._webedgeradius = ifcpositivelengthmeasure(value) else: self._webedgeradius = value else: self._webedgeradius = value return property(**locals()) @apply def webslope(): def fget( self ): return self._webslope def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcplaneanglemeasure): self._webslope = ifcplaneanglemeasure(value) else: self._webslope = value else: self._webslope = value return property(**locals()) @apply def flangeslope(): def fget( self ): return self._flangeslope def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcplaneanglemeasure): self._flangeslope = ifcplaneanglemeasure(value) else: self._flangeslope = value else: self._flangeslope = value return property(**locals()) @apply def centreofgravityiny(): def fget( self ): return self._centreofgravityiny def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._centreofgravityiny = ifcpositivelengthmeasure(value) else: self._centreofgravityiny = value else: self._centreofgravityiny = value return property(**locals()) def wr1(self): eval_wr1_wr = (self.flangethickness < self.depth) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (self.webthickness < self.flangewidth) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr #################### # ENTITY ifcelectricappliancetype # #################### class ifcelectricappliancetype(ifcflowterminaltype): '''Entity ifcelectricappliancetype definition. :param predefinedtype :type predefinedtype:ifcelectricappliancetypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowterminaltype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcelectricappliancetypeenum): self._predefinedtype = ifcelectricappliancetypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcgasterminaltype # #################### class ifcgasterminaltype(ifcflowterminaltype): '''Entity ifcgasterminaltype definition. :param predefinedtype :type predefinedtype:ifcgasterminaltypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowterminaltype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcgasterminaltypeenum): self._predefinedtype = ifcgasterminaltypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcgasterminaltypeenum.self.userdefined) or ((self.predefinedtype == ifcgasterminaltypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifctextliteral # #################### class ifctextliteral(ifcgeometricrepresentationitem): '''Entity ifctextliteral definition. :param literal :type literal:ifcpresentabletext :param placement :type placement:ifcaxis2placement :param path :type path:ifctextpath ''' def __init__( self , literal,placement,path, ): ifcgeometricrepresentationitem.__init__(self , ) self.literal = literal self.placement = placement self.path = path @apply def literal(): def fget( self ): return self._literal def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument literal is mantatory and can not be set to None') if not check_type(value,ifcpresentabletext): self._literal = ifcpresentabletext(value) else: self._literal = value return property(**locals()) @apply def placement(): def fget( self ): return self._placement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument placement is mantatory and can not be set to None') if not check_type(value,ifcaxis2placement): self._placement = ifcaxis2placement(value) else: self._placement = value return property(**locals()) @apply def path(): def fget( self ): return self._path def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument path is mantatory and can not be set to None') if not check_type(value,ifctextpath): self._path = ifctextpath(value) else: self._path = value return property(**locals()) #################### # ENTITY ifcdocumentinformation # #################### class ifcdocumentinformation(BaseEntityClass): '''Entity ifcdocumentinformation definition. :param documentid :type documentid:ifcidentifier :param name :type name:ifclabel :param description :type description:ifctext :param documentreferences :type documentreferences:SET(1,None,'ifcdocumentreference', scope = schema_scope) :param purpose :type purpose:ifctext :param intendeduse :type intendeduse:ifctext :param scope :type scope:ifctext :param revision :type revision:ifclabel :param documentowner :type documentowner:ifcactorselect :param editors :type editors:SET(1,None,'ifcactorselect', scope = schema_scope) :param creationtime :type creationtime:ifcdateandtime :param lastrevisiontime :type lastrevisiontime:ifcdateandtime :param electronicformat :type electronicformat:ifcdocumentelectronicformat :param validfrom :type validfrom:ifccalendardate :param validuntil :type validuntil:ifccalendardate :param confidentiality :type confidentiality:ifcdocumentconfidentialityenum :param status :type status:ifcdocumentstatusenum :param ispointedto :type ispointedto:SET(0,None,'ifcdocumentinformationrelationship', scope = schema_scope) :param ispointer :type ispointer:SET(0,1,'ifcdocumentinformationrelationship', scope = schema_scope) ''' def __init__( self , documentid,name,description,documentreferences,purpose,intendeduse,scope,revision,documentowner,editors,creationtime,lastrevisiontime,electronicformat,validfrom,validuntil,confidentiality,status, ): self.documentid = documentid self.name = name self.description = description self.documentreferences = documentreferences self.purpose = purpose self.intendeduse = intendeduse self.scope = scope self.revision = revision self.documentowner = documentowner self.editors = editors self.creationtime = creationtime self.lastrevisiontime = lastrevisiontime self.electronicformat = electronicformat self.validfrom = validfrom self.validuntil = validuntil self.confidentiality = confidentiality self.status = status @apply def documentid(): def fget( self ): return self._documentid def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument documentid is mantatory and can not be set to None') if not check_type(value,ifcidentifier): self._documentid = ifcidentifier(value) else: self._documentid = value return property(**locals()) @apply def name(): def fget( self ): return self._name def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument name is mantatory and can not be set to None') if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) @apply def documentreferences(): def fget( self ): return self._documentreferences def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,SET(1,None,'ifcdocumentreference', scope = schema_scope)): self._documentreferences = SET(value) else: self._documentreferences = value else: self._documentreferences = value return property(**locals()) @apply def purpose(): def fget( self ): return self._purpose def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._purpose = ifctext(value) else: self._purpose = value else: self._purpose = value return property(**locals()) @apply def intendeduse(): def fget( self ): return self._intendeduse def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._intendeduse = ifctext(value) else: self._intendeduse = value else: self._intendeduse = value return property(**locals()) @apply def scope(): def fget( self ): return self._scope def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._scope = ifctext(value) else: self._scope = value else: self._scope = value return property(**locals()) @apply def revision(): def fget( self ): return self._revision def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._revision = ifclabel(value) else: self._revision = value else: self._revision = value return property(**locals()) @apply def documentowner(): def fget( self ): return self._documentowner def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcactorselect): self._documentowner = ifcactorselect(value) else: self._documentowner = value else: self._documentowner = value return property(**locals()) @apply def editors(): def fget( self ): return self._editors def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,SET(1,None,'ifcactorselect', scope = schema_scope)): self._editors = SET(value) else: self._editors = value else: self._editors = value return property(**locals()) @apply def creationtime(): def fget( self ): return self._creationtime def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdateandtime): self._creationtime = ifcdateandtime(value) else: self._creationtime = value else: self._creationtime = value return property(**locals()) @apply def lastrevisiontime(): def fget( self ): return self._lastrevisiontime def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdateandtime): self._lastrevisiontime = ifcdateandtime(value) else: self._lastrevisiontime = value else: self._lastrevisiontime = value return property(**locals()) @apply def electronicformat(): def fget( self ): return self._electronicformat def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdocumentelectronicformat): self._electronicformat = ifcdocumentelectronicformat(value) else: self._electronicformat = value else: self._electronicformat = value return property(**locals()) @apply def validfrom(): def fget( self ): return self._validfrom def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccalendardate): self._validfrom = ifccalendardate(value) else: self._validfrom = value else: self._validfrom = value return property(**locals()) @apply def validuntil(): def fget( self ): return self._validuntil def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccalendardate): self._validuntil = ifccalendardate(value) else: self._validuntil = value else: self._validuntil = value return property(**locals()) @apply def confidentiality(): def fget( self ): return self._confidentiality def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdocumentconfidentialityenum): self._confidentiality = ifcdocumentconfidentialityenum(value) else: self._confidentiality = value else: self._confidentiality = value return property(**locals()) @apply def status(): def fget( self ): return self._status def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdocumentstatusenum): self._status = ifcdocumentstatusenum(value) else: self._status = value else: self._status = value return property(**locals()) @apply def ispointedto(): def fget( self ): return self._ispointedto def fset( self, value ): # INVERSE argument raise AssertionError('Argument ispointedto is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def ispointer(): def fget( self ): return self._ispointer def fset( self, value ): # INVERSE argument raise AssertionError('Argument ispointer is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcstylemodel # #################### class ifcstylemodel(ifcrepresentation): '''Entity ifcstylemodel definition. ''' def __init__( self , inherited0__contextofitems , inherited1__representationidentifier , inherited2__representationtype , inherited3__items , ): ifcrepresentation.__init__(self , inherited0__contextofitems , inherited1__representationidentifier , inherited2__representationtype , inherited3__items , ) #################### # ENTITY ifcstyledrepresentation # #################### class ifcstyledrepresentation(ifcstylemodel): '''Entity ifcstyledrepresentation definition. ''' def __init__( self , inherited0__contextofitems , inherited1__representationidentifier , inherited2__representationtype , inherited3__items , ): ifcstylemodel.__init__(self , inherited0__contextofitems , inherited1__representationidentifier , inherited2__representationtype , inherited3__items , ) def wr21(self): eval_wr21_wr = (SIZEOF(None) == 0) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr #################### # ENTITY ifcellipseprofiledef # #################### class ifcellipseprofiledef(ifcparameterizedprofiledef): '''Entity ifcellipseprofiledef definition. :param semiaxis1 :type semiaxis1:ifcpositivelengthmeasure :param semiaxis2 :type semiaxis2:ifcpositivelengthmeasure ''' def __init__( self , inherited0__profiletype , inherited1__profilename , inherited2__position , semiaxis1,semiaxis2, ): ifcparameterizedprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , inherited2__position , ) self.semiaxis1 = semiaxis1 self.semiaxis2 = semiaxis2 @apply def semiaxis1(): def fget( self ): return self._semiaxis1 def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument semiaxis1 is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._semiaxis1 = ifcpositivelengthmeasure(value) else: self._semiaxis1 = value return property(**locals()) @apply def semiaxis2(): def fget( self ): return self._semiaxis2 def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument semiaxis2 is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._semiaxis2 = ifcpositivelengthmeasure(value) else: self._semiaxis2 = value return property(**locals()) #################### # ENTITY ifcsectionedspine # #################### class ifcsectionedspine(ifcgeometricrepresentationitem): '''Entity ifcsectionedspine definition. :param spinecurve :type spinecurve:ifccompositecurve :param crosssections :type crosssections:LIST(2,None,'ifcprofiledef', scope = schema_scope) :param crosssectionpositions :type crosssectionpositions:LIST(2,None,'ifcaxis2placement3d', scope = schema_scope) :param dim :type dim:ifcdimensioncount ''' def __init__( self , spinecurve,crosssections,crosssectionpositions, ): ifcgeometricrepresentationitem.__init__(self , ) self.spinecurve = spinecurve self.crosssections = crosssections self.crosssectionpositions = crosssectionpositions @apply def spinecurve(): def fget( self ): return self._spinecurve def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument spinecurve is mantatory and can not be set to None') if not check_type(value,ifccompositecurve): self._spinecurve = ifccompositecurve(value) else: self._spinecurve = value return property(**locals()) @apply def crosssections(): def fget( self ): return self._crosssections def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument crosssections is mantatory and can not be set to None') if not check_type(value,LIST(2,None,'ifcprofiledef', scope = schema_scope)): self._crosssections = LIST(value) else: self._crosssections = value return property(**locals()) @apply def crosssectionpositions(): def fget( self ): return self._crosssectionpositions def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument crosssectionpositions is mantatory and can not be set to None') if not check_type(value,LIST(2,None,'ifcaxis2placement3d', scope = schema_scope)): self._crosssectionpositions = LIST(value) else: self._crosssectionpositions = value return property(**locals()) @apply def dim(): def fget( self ): attribute_eval = 3 return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (SIZEOF(self.crosssections) == SIZEOF(self.crosssectionpositions)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (SIZEOF(None) == 0) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr def wr3(self): eval_wr3_wr = (self.spinecurve.self.dim == 3) if not eval_wr3_wr: raise AssertionError('Rule wr3 violated') else: return eval_wr3_wr #################### # ENTITY ifcvertex # #################### class ifcvertex(ifctopologicalrepresentationitem): '''Entity ifcvertex definition. ''' def __init__( self , ): ifctopologicalrepresentationitem.__init__(self , ) #################### # ENTITY ifcvertexpoint # #################### class ifcvertexpoint(ifcvertex): '''Entity ifcvertexpoint definition. :param vertexgeometry :type vertexgeometry:ifcpoint ''' def __init__( self , vertexgeometry, ): ifcvertex.__init__(self , ) self.vertexgeometry = vertexgeometry @apply def vertexgeometry(): def fget( self ): return self._vertexgeometry def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument vertexgeometry is mantatory and can not be set to None') if not check_type(value,ifcpoint): self._vertexgeometry = ifcpoint(value) else: self._vertexgeometry = value return property(**locals()) #################### # ENTITY ifcwallstandardcase # #################### class ifcwallstandardcase(ifcwall): '''Entity ifcwallstandardcase definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcwall.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) def wr1(self): eval_wr1_wr = (SIZEOF(None) == 1) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifccablecarriersegmenttype # #################### class ifccablecarriersegmenttype(ifcflowsegmenttype): '''Entity ifccablecarriersegmenttype definition. :param predefinedtype :type predefinedtype:ifccablecarriersegmenttypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowsegmenttype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifccablecarriersegmenttypeenum): self._predefinedtype = ifccablecarriersegmenttypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcdraughtingcallout # #################### class ifcdraughtingcallout(ifcgeometricrepresentationitem): '''Entity ifcdraughtingcallout definition. :param contents :type contents:SET(1,None,'ifcdraughtingcalloutelement', scope = schema_scope) :param isrelatedfromcallout :type isrelatedfromcallout:SET(0,None,'ifcdraughtingcalloutrelationship', scope = schema_scope) :param isrelatedtocallout :type isrelatedtocallout:SET(0,None,'ifcdraughtingcalloutrelationship', scope = schema_scope) ''' def __init__( self , contents, ): ifcgeometricrepresentationitem.__init__(self , ) self.contents = contents @apply def contents(): def fget( self ): return self._contents def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument contents is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcdraughtingcalloutelement', scope = schema_scope)): self._contents = SET(value) else: self._contents = value return property(**locals()) @apply def isrelatedfromcallout(): def fget( self ): return self._isrelatedfromcallout def fset( self, value ): # INVERSE argument raise AssertionError('Argument isrelatedfromcallout is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def isrelatedtocallout(): def fget( self ): return self._isrelatedtocallout def fset( self, value ): # INVERSE argument raise AssertionError('Argument isrelatedtocallout is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcdimensioncurvedirectedcallout # #################### class ifcdimensioncurvedirectedcallout(ifcdraughtingcallout): '''Entity ifcdimensioncurvedirectedcallout definition. ''' def __init__( self , inherited0__contents , ): ifcdraughtingcallout.__init__(self , inherited0__contents , ) def wr41(self): eval_wr41_wr = (SIZEOF(None) == 1) if not eval_wr41_wr: raise AssertionError('Rule wr41 violated') else: return eval_wr41_wr def wr42(self): eval_wr42_wr = (SIZEOF(None) <= 2) if not eval_wr42_wr: raise AssertionError('Rule wr42 violated') else: return eval_wr42_wr #################### # ENTITY ifcdiameterdimension # #################### class ifcdiameterdimension(ifcdimensioncurvedirectedcallout): '''Entity ifcdiameterdimension definition. ''' def __init__( self , inherited0__contents , ): ifcdimensioncurvedirectedcallout.__init__(self , inherited0__contents , ) #################### # ENTITY ifcfeatureelementsubtraction # #################### class ifcfeatureelementsubtraction(ifcfeatureelement): '''Entity ifcfeatureelementsubtraction definition. :param voidselements :type voidselements:ifcrelvoidselement ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcfeatureelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) @apply def voidselements(): def fget( self ): return self._voidselements def fset( self, value ): # INVERSE argument raise AssertionError('Argument voidselements is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcedgefeature # #################### class ifcedgefeature(ifcfeatureelementsubtraction): '''Entity ifcedgefeature definition. :param featurelength :type featurelength:ifcpositivelengthmeasure ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , featurelength, ): ifcfeatureelementsubtraction.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) self.featurelength = featurelength @apply def featurelength(): def fget( self ): return self._featurelength def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._featurelength = ifcpositivelengthmeasure(value) else: self._featurelength = value else: self._featurelength = value return property(**locals()) #################### # ENTITY ifcroundededgefeature # #################### class ifcroundededgefeature(ifcedgefeature): '''Entity ifcroundededgefeature definition. :param radius :type radius:ifcpositivelengthmeasure ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , inherited8__featurelength , radius, ): ifcedgefeature.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , inherited8__featurelength , ) self.radius = radius @apply def radius(): def fget( self ): return self._radius def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._radius = ifcpositivelengthmeasure(value) else: self._radius = value else: self._radius = value return property(**locals()) #################### # ENTITY ifcductsilencertype # #################### class ifcductsilencertype(ifcflowtreatmentdevicetype): '''Entity ifcductsilencertype definition. :param predefinedtype :type predefinedtype:ifcductsilencertypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowtreatmentdevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcductsilencertypeenum): self._predefinedtype = ifcductsilencertypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcductsilencertypeenum.self.userdefined) or ((self.predefinedtype == ifcductsilencertypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcrelaxation # #################### class ifcrelaxation(BaseEntityClass): '''Entity ifcrelaxation definition. :param relaxationvalue :type relaxationvalue:ifcnormalisedratiomeasure :param initialstress :type initialstress:ifcnormalisedratiomeasure ''' def __init__( self , relaxationvalue,initialstress, ): self.relaxationvalue = relaxationvalue self.initialstress = initialstress @apply def relaxationvalue(): def fget( self ): return self._relaxationvalue def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relaxationvalue is mantatory and can not be set to None') if not check_type(value,ifcnormalisedratiomeasure): self._relaxationvalue = ifcnormalisedratiomeasure(value) else: self._relaxationvalue = value return property(**locals()) @apply def initialstress(): def fget( self ): return self._initialstress def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument initialstress is mantatory and can not be set to None') if not check_type(value,ifcnormalisedratiomeasure): self._initialstress = ifcnormalisedratiomeasure(value) else: self._initialstress = value return property(**locals()) #################### # ENTITY ifcishapeprofiledef # #################### class ifcishapeprofiledef(ifcparameterizedprofiledef): '''Entity ifcishapeprofiledef definition. :param overallwidth :type overallwidth:ifcpositivelengthmeasure :param overalldepth :type overalldepth:ifcpositivelengthmeasure :param webthickness :type webthickness:ifcpositivelengthmeasure :param flangethickness :type flangethickness:ifcpositivelengthmeasure :param filletradius :type filletradius:ifcpositivelengthmeasure ''' def __init__( self , inherited0__profiletype , inherited1__profilename , inherited2__position , overallwidth,overalldepth,webthickness,flangethickness,filletradius, ): ifcparameterizedprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , inherited2__position , ) self.overallwidth = overallwidth self.overalldepth = overalldepth self.webthickness = webthickness self.flangethickness = flangethickness self.filletradius = filletradius @apply def overallwidth(): def fget( self ): return self._overallwidth def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument overallwidth is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._overallwidth = ifcpositivelengthmeasure(value) else: self._overallwidth = value return property(**locals()) @apply def overalldepth(): def fget( self ): return self._overalldepth def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument overalldepth is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._overalldepth = ifcpositivelengthmeasure(value) else: self._overalldepth = value return property(**locals()) @apply def webthickness(): def fget( self ): return self._webthickness def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument webthickness is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._webthickness = ifcpositivelengthmeasure(value) else: self._webthickness = value return property(**locals()) @apply def flangethickness(): def fget( self ): return self._flangethickness def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument flangethickness is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._flangethickness = ifcpositivelengthmeasure(value) else: self._flangethickness = value return property(**locals()) @apply def filletradius(): def fget( self ): return self._filletradius def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._filletradius = ifcpositivelengthmeasure(value) else: self._filletradius = value else: self._filletradius = value return property(**locals()) def wr1(self): eval_wr1_wr = (self.flangethickness < (self.overalldepth / 2)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (self.webthickness < self.overallwidth) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr def wr3(self): eval_wr3_wr = (( not EXISTS(self.filletradius)) or ((self.filletradius <= ((self.overallwidth - self.webthickness) / 2)) and (self.filletradius <= ((self.overalldepth - (2 * self.flangethickness)) / 2)))) if not eval_wr3_wr: raise AssertionError('Rule wr3 violated') else: return eval_wr3_wr #################### # ENTITY ifcasymmetricishapeprofiledef # #################### class ifcasymmetricishapeprofiledef(ifcishapeprofiledef): '''Entity ifcasymmetricishapeprofiledef definition. :param topflangewidth :type topflangewidth:ifcpositivelengthmeasure :param topflangethickness :type topflangethickness:ifcpositivelengthmeasure :param topflangefilletradius :type topflangefilletradius:ifcpositivelengthmeasure :param centreofgravityiny :type centreofgravityiny:ifcpositivelengthmeasure ''' def __init__( self , inherited0__profiletype , inherited1__profilename , inherited2__position , inherited3__overallwidth , inherited4__overalldepth , inherited5__webthickness , inherited6__flangethickness , inherited7__filletradius , topflangewidth,topflangethickness,topflangefilletradius,centreofgravityiny, ): ifcishapeprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , inherited2__position , inherited3__overallwidth , inherited4__overalldepth , inherited5__webthickness , inherited6__flangethickness , inherited7__filletradius , ) self.topflangewidth = topflangewidth self.topflangethickness = topflangethickness self.topflangefilletradius = topflangefilletradius self.centreofgravityiny = centreofgravityiny @apply def topflangewidth(): def fget( self ): return self._topflangewidth def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument topflangewidth is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._topflangewidth = ifcpositivelengthmeasure(value) else: self._topflangewidth = value return property(**locals()) @apply def topflangethickness(): def fget( self ): return self._topflangethickness def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._topflangethickness = ifcpositivelengthmeasure(value) else: self._topflangethickness = value else: self._topflangethickness = value return property(**locals()) @apply def topflangefilletradius(): def fget( self ): return self._topflangefilletradius def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._topflangefilletradius = ifcpositivelengthmeasure(value) else: self._topflangefilletradius = value else: self._topflangefilletradius = value return property(**locals()) @apply def centreofgravityiny(): def fget( self ): return self._centreofgravityiny def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._centreofgravityiny = ifcpositivelengthmeasure(value) else: self._centreofgravityiny = value else: self._centreofgravityiny = value return property(**locals()) #################### # ENTITY ifcproductsofcombustionproperties # #################### class ifcproductsofcombustionproperties(ifcmaterialproperties): '''Entity ifcproductsofcombustionproperties definition. :param specificheatcapacity :type specificheatcapacity:ifcspecificheatcapacitymeasure :param n20content :type n20content:ifcpositiveratiomeasure :param cocontent :type cocontent:ifcpositiveratiomeasure :param co2content :type co2content:ifcpositiveratiomeasure ''' def __init__( self , inherited0__material , specificheatcapacity,n20content,cocontent,co2content, ): ifcmaterialproperties.__init__(self , inherited0__material , ) self.specificheatcapacity = specificheatcapacity self.n20content = n20content self.cocontent = cocontent self.co2content = co2content @apply def specificheatcapacity(): def fget( self ): return self._specificheatcapacity def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcspecificheatcapacitymeasure): self._specificheatcapacity = ifcspecificheatcapacitymeasure(value) else: self._specificheatcapacity = value else: self._specificheatcapacity = value return property(**locals()) @apply def n20content(): def fget( self ): return self._n20content def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._n20content = ifcpositiveratiomeasure(value) else: self._n20content = value else: self._n20content = value return property(**locals()) @apply def cocontent(): def fget( self ): return self._cocontent def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._cocontent = ifcpositiveratiomeasure(value) else: self._cocontent = value else: self._cocontent = value return property(**locals()) @apply def co2content(): def fget( self ): return self._co2content def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._co2content = ifcpositiveratiomeasure(value) else: self._co2content = value else: self._co2content = value return property(**locals()) #################### # ENTITY ifccartesiantransformationoperator2d # #################### class ifccartesiantransformationoperator2d(ifccartesiantransformationoperator): '''Entity ifccartesiantransformationoperator2d definition. :param u :type u:LIST(2,2,'ifcdirection', scope = schema_scope) ''' def __init__( self , inherited0__axis1 , inherited1__axis2 , inherited2__localorigin , inherited3__scale , ): ifccartesiantransformationoperator.__init__(self , inherited0__axis1 , inherited1__axis2 , inherited2__localorigin , inherited3__scale , ) @apply def u(): def fget( self ): attribute_eval = ifcbaseaxis(2,self.self.ifccartesiantransformationoperator.self.axis1,self.self.ifccartesiantransformationoperator.self.axis2, None ) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument u is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (self.self.ifccartesiantransformationoperator.self.dim == 2) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (( not EXISTS(self.self.ifccartesiantransformationoperator.self.axis1)) or (self.self.ifccartesiantransformationoperator.self.axis1.self.dim == 2)) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr def wr3(self): eval_wr3_wr = (( not EXISTS(self.self.ifccartesiantransformationoperator.self.axis2)) or (self.self.ifccartesiantransformationoperator.self.axis2.self.dim == 2)) if not eval_wr3_wr: raise AssertionError('Rule wr3 violated') else: return eval_wr3_wr #################### # ENTITY ifccartesiantransformationoperator2dnonuniform # #################### class ifccartesiantransformationoperator2dnonuniform(ifccartesiantransformationoperator2d): '''Entity ifccartesiantransformationoperator2dnonuniform definition. :param scale2 :type scale2:REAL :param scl2 :type scl2:REAL ''' def __init__( self , inherited0__axis1 , inherited1__axis2 , inherited2__localorigin , inherited3__scale , scale2, ): ifccartesiantransformationoperator2d.__init__(self , inherited0__axis1 , inherited1__axis2 , inherited2__localorigin , inherited3__scale , ) self.scale2 = scale2 @apply def scale2(): def fget( self ): return self._scale2 def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,REAL): self._scale2 = REAL(value) else: self._scale2 = value else: self._scale2 = value return property(**locals()) @apply def scl2(): def fget( self ): attribute_eval = NVL(self.scale2,self.self.ifccartesiantransformationoperator.self.scl) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument scl2 is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (self.scl2 > 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcdateandtime # #################### class ifcdateandtime(BaseEntityClass): '''Entity ifcdateandtime definition. :param datecomponent :type datecomponent:ifccalendardate :param timecomponent :type timecomponent:ifclocaltime ''' def __init__( self , datecomponent,timecomponent, ): self.datecomponent = datecomponent self.timecomponent = timecomponent @apply def datecomponent(): def fget( self ): return self._datecomponent def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument datecomponent is mantatory and can not be set to None') if not check_type(value,ifccalendardate): self._datecomponent = ifccalendardate(value) else: self._datecomponent = value return property(**locals()) @apply def timecomponent(): def fget( self ): return self._timecomponent def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument timecomponent is mantatory and can not be set to None') if not check_type(value,ifclocaltime): self._timecomponent = ifclocaltime(value) else: self._timecomponent = value return property(**locals()) #################### # ENTITY ifcelementassembly # #################### class ifcelementassembly(ifcelement): '''Entity ifcelementassembly definition. :param assemblyplace :type assemblyplace:ifcassemblyplaceenum :param predefinedtype :type predefinedtype:ifcelementassemblytypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , assemblyplace,predefinedtype, ): ifcelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) self.assemblyplace = assemblyplace self.predefinedtype = predefinedtype @apply def assemblyplace(): def fget( self ): return self._assemblyplace def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcassemblyplaceenum): self._assemblyplace = ifcassemblyplaceenum(value) else: self._assemblyplace = value else: self._assemblyplace = value return property(**locals()) @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcelementassemblytypeenum): self._predefinedtype = ifcelementassemblytypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcelementassemblytypeenum.self.userdefined) or ((self.predefinedtype == ifcelementassemblytypeenum.self.userdefined) and EXISTS(self.self.ifcobject.self.objecttype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcelementcomponent # #################### class ifcelementcomponent(ifcelement): '''Entity ifcelementcomponent definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcaddress # #################### class ifcaddress(BaseEntityClass): '''Entity ifcaddress definition. :param purpose :type purpose:ifcaddresstypeenum :param description :type description:ifctext :param userdefinedpurpose :type userdefinedpurpose:ifclabel :param ofperson :type ofperson:SET(0,None,'ifcperson', scope = schema_scope) :param oforganization :type oforganization:SET(0,None,'ifcorganization', scope = schema_scope) ''' def __init__( self , purpose,description,userdefinedpurpose, ): self.purpose = purpose self.description = description self.userdefinedpurpose = userdefinedpurpose @apply def purpose(): def fget( self ): return self._purpose def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcaddresstypeenum): self._purpose = ifcaddresstypeenum(value) else: self._purpose = value else: self._purpose = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) @apply def userdefinedpurpose(): def fget( self ): return self._userdefinedpurpose def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._userdefinedpurpose = ifclabel(value) else: self._userdefinedpurpose = value else: self._userdefinedpurpose = value return property(**locals()) @apply def ofperson(): def fget( self ): return self._ofperson def fset( self, value ): # INVERSE argument raise AssertionError('Argument ofperson is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def oforganization(): def fget( self ): return self._oforganization def fset( self, value ): # INVERSE argument raise AssertionError('Argument oforganization is INVERSE. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (( not EXISTS(self.purpose)) or ((self.purpose != ifcaddresstypeenum.self.userdefined) or ((self.purpose == ifcaddresstypeenum.self.userdefined) and EXISTS(self.self.userdefinedpurpose)))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifctelecomaddress # #################### class ifctelecomaddress(ifcaddress): '''Entity ifctelecomaddress definition. :param telephonenumbers :type telephonenumbers:LIST(1,None,'STRING', scope = schema_scope) :param facsimilenumbers :type facsimilenumbers:LIST(1,None,'STRING', scope = schema_scope) :param pagernumber :type pagernumber:ifclabel :param electronicmailaddresses :type electronicmailaddresses:LIST(1,None,'STRING', scope = schema_scope) :param wwwhomepageurl :type wwwhomepageurl:ifclabel ''' def __init__( self , inherited0__purpose , inherited1__description , inherited2__userdefinedpurpose , telephonenumbers,facsimilenumbers,pagernumber,electronicmailaddresses,wwwhomepageurl, ): ifcaddress.__init__(self , inherited0__purpose , inherited1__description , inherited2__userdefinedpurpose , ) self.telephonenumbers = telephonenumbers self.facsimilenumbers = facsimilenumbers self.pagernumber = pagernumber self.electronicmailaddresses = electronicmailaddresses self.wwwhomepageurl = wwwhomepageurl @apply def telephonenumbers(): def fget( self ): return self._telephonenumbers def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,LIST(1,None,'STRING', scope = schema_scope)): self._telephonenumbers = LIST(value) else: self._telephonenumbers = value else: self._telephonenumbers = value return property(**locals()) @apply def facsimilenumbers(): def fget( self ): return self._facsimilenumbers def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,LIST(1,None,'STRING', scope = schema_scope)): self._facsimilenumbers = LIST(value) else: self._facsimilenumbers = value else: self._facsimilenumbers = value return property(**locals()) @apply def pagernumber(): def fget( self ): return self._pagernumber def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._pagernumber = ifclabel(value) else: self._pagernumber = value else: self._pagernumber = value return property(**locals()) @apply def electronicmailaddresses(): def fget( self ): return self._electronicmailaddresses def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,LIST(1,None,'STRING', scope = schema_scope)): self._electronicmailaddresses = LIST(value) else: self._electronicmailaddresses = value else: self._electronicmailaddresses = value return property(**locals()) @apply def wwwhomepageurl(): def fget( self ): return self._wwwhomepageurl def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._wwwhomepageurl = ifclabel(value) else: self._wwwhomepageurl = value else: self._wwwhomepageurl = value return property(**locals()) def wr1(self): eval_wr1_wr = ((((EXISTS(self.telephonenumbers) or EXISTS(self.pagernumber)) or EXISTS(self.facsimilenumbers)) or EXISTS(self.electronicmailaddresses)) or EXISTS(self.wwwhomepageurl)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifccurvestylefontandscaling # #################### class ifccurvestylefontandscaling(BaseEntityClass): '''Entity ifccurvestylefontandscaling definition. :param name :type name:ifclabel :param curvefont :type curvefont:ifccurvestylefontselect :param curvefontscaling :type curvefontscaling:ifcpositiveratiomeasure ''' def __init__( self , name,curvefont,curvefontscaling, ): self.name = name self.curvefont = curvefont self.curvefontscaling = curvefontscaling @apply def name(): def fget( self ): return self._name def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value else: self._name = value return property(**locals()) @apply def curvefont(): def fget( self ): return self._curvefont def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument curvefont is mantatory and can not be set to None') if not check_type(value,ifccurvestylefontselect): self._curvefont = ifccurvestylefontselect(value) else: self._curvefont = value return property(**locals()) @apply def curvefontscaling(): def fget( self ): return self._curvefontscaling def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument curvefontscaling is mantatory and can not be set to None') if not check_type(value,ifcpositiveratiomeasure): self._curvefontscaling = ifcpositiveratiomeasure(value) else: self._curvefontscaling = value return property(**locals()) #################### # ENTITY ifcsurfaceoflinearextrusion # #################### class ifcsurfaceoflinearextrusion(ifcsweptsurface): '''Entity ifcsurfaceoflinearextrusion definition. :param extrudeddirection :type extrudeddirection:ifcdirection :param depth :type depth:ifclengthmeasure :param extrusionaxis :type extrusionaxis:ifcvector ''' def __init__( self , inherited0__sweptcurve , inherited1__position , extrudeddirection,depth, ): ifcsweptsurface.__init__(self , inherited0__sweptcurve , inherited1__position , ) self.extrudeddirection = extrudeddirection self.depth = depth @apply def extrudeddirection(): def fget( self ): return self._extrudeddirection def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument extrudeddirection is mantatory and can not be set to None') if not check_type(value,ifcdirection): self._extrudeddirection = ifcdirection(value) else: self._extrudeddirection = value return property(**locals()) @apply def depth(): def fget( self ): return self._depth def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument depth is mantatory and can not be set to None') if not check_type(value,ifclengthmeasure): self._depth = ifclengthmeasure(value) else: self._depth = value return property(**locals()) @apply def extrusionaxis(): def fget( self ): attribute_eval = ((ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcvector(self.extrudeddirection,self.depth)) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument extrusionaxis is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr41(self): eval_wr41_wr = (self.depth > 0) if not eval_wr41_wr: raise AssertionError('Rule wr41 violated') else: return eval_wr41_wr #################### # ENTITY ifccolumntype # #################### class ifccolumntype(ifcbuildingelementtype): '''Entity ifccolumntype definition. :param predefinedtype :type predefinedtype:ifccolumntypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcbuildingelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifccolumntypeenum): self._predefinedtype = ifccolumntypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcproductrepresentation # #################### class ifcproductrepresentation(BaseEntityClass): '''Entity ifcproductrepresentation definition. :param name :type name:ifclabel :param description :type description:ifctext :param representations :type representations:LIST(1,None,'ifcrepresentation', scope = schema_scope) ''' def __init__( self , name,description,representations, ): self.name = name self.description = description self.representations = representations @apply def name(): def fget( self ): return self._name def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value else: self._name = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) @apply def representations(): def fget( self ): return self._representations def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument representations is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcrepresentation', scope = schema_scope)): self._representations = LIST(value) else: self._representations = value return property(**locals()) #################### # ENTITY ifcmaterialdefinitionrepresentation # #################### class ifcmaterialdefinitionrepresentation(ifcproductrepresentation): '''Entity ifcmaterialdefinitionrepresentation definition. :param representedmaterial :type representedmaterial:ifcmaterial ''' def __init__( self , inherited0__name , inherited1__description , inherited2__representations , representedmaterial, ): ifcproductrepresentation.__init__(self , inherited0__name , inherited1__description , inherited2__representations , ) self.representedmaterial = representedmaterial @apply def representedmaterial(): def fget( self ): return self._representedmaterial def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument representedmaterial is mantatory and can not be set to None') if not check_type(value,ifcmaterial): self._representedmaterial = ifcmaterial(value) else: self._representedmaterial = value return property(**locals()) def wr11(self): eval_wr11_wr = (SIZEOF(None) == 0) if not eval_wr11_wr: raise AssertionError('Rule wr11 violated') else: return eval_wr11_wr #################### # ENTITY ifcreldefines # #################### class ifcreldefines(ifcrelationship): '''Entity ifcreldefines definition. :param relatedobjects :type relatedobjects:SET(1,None,'ifcobject', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , relatedobjects, ): ifcrelationship.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.relatedobjects = relatedobjects @apply def relatedobjects(): def fget( self ): return self._relatedobjects def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedobjects is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcobject', scope = schema_scope)): self._relatedobjects = SET(value) else: self._relatedobjects = value return property(**locals()) #################### # ENTITY ifcreldefinesbyproperties # #################### class ifcreldefinesbyproperties(ifcreldefines): '''Entity ifcreldefinesbyproperties definition. :param relatingpropertydefinition :type relatingpropertydefinition:ifcpropertysetdefinition ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , relatingpropertydefinition, ): ifcreldefines.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , ) self.relatingpropertydefinition = relatingpropertydefinition @apply def relatingpropertydefinition(): def fget( self ): return self._relatingpropertydefinition def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingpropertydefinition is mantatory and can not be set to None') if not check_type(value,ifcpropertysetdefinition): self._relatingpropertydefinition = ifcpropertysetdefinition(value) else: self._relatingpropertydefinition = value return property(**locals()) #################### # ENTITY ifcreloverridesproperties # #################### class ifcreloverridesproperties(ifcreldefinesbyproperties): '''Entity ifcreloverridesproperties definition. :param overridingproperties :type overridingproperties:SET(1,None,'ifcproperty', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatingpropertydefinition , overridingproperties, ): ifcreldefinesbyproperties.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatingpropertydefinition , ) self.overridingproperties = overridingproperties @apply def overridingproperties(): def fget( self ): return self._overridingproperties def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument overridingproperties is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcproperty', scope = schema_scope)): self._overridingproperties = SET(value) else: self._overridingproperties = value return property(**locals()) def wr1(self): eval_wr1_wr = (SIZEOF(self.self.ifcreldefines.self.relatedobjects) == 1) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcspacethermalloadproperties # #################### class ifcspacethermalloadproperties(ifcpropertysetdefinition): '''Entity ifcspacethermalloadproperties definition. :param applicablevalueratio :type applicablevalueratio:ifcpositiveratiomeasure :param thermalloadsource :type thermalloadsource:ifcthermalloadsourceenum :param propertysource :type propertysource:ifcpropertysourceenum :param sourcedescription :type sourcedescription:ifctext :param maximumvalue :type maximumvalue:ifcpowermeasure :param minimumvalue :type minimumvalue:ifcpowermeasure :param thermalloadtimeseriesvalues :type thermalloadtimeseriesvalues:ifctimeseries :param userdefinedthermalloadsource :type userdefinedthermalloadsource:ifclabel :param userdefinedpropertysource :type userdefinedpropertysource:ifclabel :param thermalloadtype :type thermalloadtype:ifcthermalloadtypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , applicablevalueratio,thermalloadsource,propertysource,sourcedescription,maximumvalue,minimumvalue,thermalloadtimeseriesvalues,userdefinedthermalloadsource,userdefinedpropertysource,thermalloadtype, ): ifcpropertysetdefinition.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.applicablevalueratio = applicablevalueratio self.thermalloadsource = thermalloadsource self.propertysource = propertysource self.sourcedescription = sourcedescription self.maximumvalue = maximumvalue self.minimumvalue = minimumvalue self.thermalloadtimeseriesvalues = thermalloadtimeseriesvalues self.userdefinedthermalloadsource = userdefinedthermalloadsource self.userdefinedpropertysource = userdefinedpropertysource self.thermalloadtype = thermalloadtype @apply def applicablevalueratio(): def fget( self ): return self._applicablevalueratio def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._applicablevalueratio = ifcpositiveratiomeasure(value) else: self._applicablevalueratio = value else: self._applicablevalueratio = value return property(**locals()) @apply def thermalloadsource(): def fget( self ): return self._thermalloadsource def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument thermalloadsource is mantatory and can not be set to None') if not check_type(value,ifcthermalloadsourceenum): self._thermalloadsource = ifcthermalloadsourceenum(value) else: self._thermalloadsource = value return property(**locals()) @apply def propertysource(): def fget( self ): return self._propertysource def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument propertysource is mantatory and can not be set to None') if not check_type(value,ifcpropertysourceenum): self._propertysource = ifcpropertysourceenum(value) else: self._propertysource = value return property(**locals()) @apply def sourcedescription(): def fget( self ): return self._sourcedescription def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._sourcedescription = ifctext(value) else: self._sourcedescription = value else: self._sourcedescription = value return property(**locals()) @apply def maximumvalue(): def fget( self ): return self._maximumvalue def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument maximumvalue is mantatory and can not be set to None') if not check_type(value,ifcpowermeasure): self._maximumvalue = ifcpowermeasure(value) else: self._maximumvalue = value return property(**locals()) @apply def minimumvalue(): def fget( self ): return self._minimumvalue def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpowermeasure): self._minimumvalue = ifcpowermeasure(value) else: self._minimumvalue = value else: self._minimumvalue = value return property(**locals()) @apply def thermalloadtimeseriesvalues(): def fget( self ): return self._thermalloadtimeseriesvalues def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctimeseries): self._thermalloadtimeseriesvalues = ifctimeseries(value) else: self._thermalloadtimeseriesvalues = value else: self._thermalloadtimeseriesvalues = value return property(**locals()) @apply def userdefinedthermalloadsource(): def fget( self ): return self._userdefinedthermalloadsource def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._userdefinedthermalloadsource = ifclabel(value) else: self._userdefinedthermalloadsource = value else: self._userdefinedthermalloadsource = value return property(**locals()) @apply def userdefinedpropertysource(): def fget( self ): return self._userdefinedpropertysource def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._userdefinedpropertysource = ifclabel(value) else: self._userdefinedpropertysource = value else: self._userdefinedpropertysource = value return property(**locals()) @apply def thermalloadtype(): def fget( self ): return self._thermalloadtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument thermalloadtype is mantatory and can not be set to None') if not check_type(value,ifcthermalloadtypeenum): self._thermalloadtype = ifcthermalloadtypeenum(value) else: self._thermalloadtype = value return property(**locals()) #################### # ENTITY ifcdistributionflowelement # #################### class ifcdistributionflowelement(ifcdistributionelement): '''Entity ifcdistributionflowelement definition. :param hascontrolelements :type hascontrolelements:SET(0,1,'ifcrelflowcontrolelements', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcdistributionelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) @apply def hascontrolelements(): def fget( self ): return self._hascontrolelements def fset( self, value ): # INVERSE argument raise AssertionError('Argument hascontrolelements is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcflowstoragedevice # #################### class ifcflowstoragedevice(ifcdistributionflowelement): '''Entity ifcflowstoragedevice definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcdistributionflowelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcmateriallayersetusage # #################### class ifcmateriallayersetusage(BaseEntityClass): '''Entity ifcmateriallayersetusage definition. :param forlayerset :type forlayerset:ifcmateriallayerset :param layersetdirection :type layersetdirection:ifclayersetdirectionenum :param directionsense :type directionsense:ifcdirectionsenseenum :param offsetfromreferenceline :type offsetfromreferenceline:ifclengthmeasure ''' def __init__( self , forlayerset,layersetdirection,directionsense,offsetfromreferenceline, ): self.forlayerset = forlayerset self.layersetdirection = layersetdirection self.directionsense = directionsense self.offsetfromreferenceline = offsetfromreferenceline @apply def forlayerset(): def fget( self ): return self._forlayerset def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument forlayerset is mantatory and can not be set to None') if not check_type(value,ifcmateriallayerset): self._forlayerset = ifcmateriallayerset(value) else: self._forlayerset = value return property(**locals()) @apply def layersetdirection(): def fget( self ): return self._layersetdirection def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument layersetdirection is mantatory and can not be set to None') if not check_type(value,ifclayersetdirectionenum): self._layersetdirection = ifclayersetdirectionenum(value) else: self._layersetdirection = value return property(**locals()) @apply def directionsense(): def fget( self ): return self._directionsense def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument directionsense is mantatory and can not be set to None') if not check_type(value,ifcdirectionsenseenum): self._directionsense = ifcdirectionsenseenum(value) else: self._directionsense = value return property(**locals()) @apply def offsetfromreferenceline(): def fget( self ): return self._offsetfromreferenceline def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument offsetfromreferenceline is mantatory and can not be set to None') if not check_type(value,ifclengthmeasure): self._offsetfromreferenceline = ifclengthmeasure(value) else: self._offsetfromreferenceline = value return property(**locals()) #################### # ENTITY ifcshapemodel # #################### class ifcshapemodel(ifcrepresentation): '''Entity ifcshapemodel definition. :param ofshapeaspect :type ofshapeaspect:SET(0,1,'ifcshapeaspect', scope = schema_scope) ''' def __init__( self , inherited0__contextofitems , inherited1__representationidentifier , inherited2__representationtype , inherited3__items , ): ifcrepresentation.__init__(self , inherited0__contextofitems , inherited1__representationidentifier , inherited2__representationtype , inherited3__items , ) @apply def ofshapeaspect(): def fget( self ): return self._ofshapeaspect def fset( self, value ): # INVERSE argument raise AssertionError('Argument ofshapeaspect is INVERSE. It is computed and can not be set to any value') return property(**locals()) def wr11(self): eval_wr11_wr = ((SIZEOF(self.self.ifcrepresentation.self.ofproductrepresentation) == 1) XOR (SIZEOF(self.self.ifcrepresentation.self.representationmap) == 1) XOR (SIZEOF(self.ofshapeaspect) == 1)) if not eval_wr11_wr: raise AssertionError('Rule wr11 violated') else: return eval_wr11_wr #################### # ENTITY ifcmateriallayerset # #################### class ifcmateriallayerset(BaseEntityClass): '''Entity ifcmateriallayerset definition. :param materiallayers :type materiallayers:LIST(1,None,'ifcmateriallayer', scope = schema_scope) :param layersetname :type layersetname:ifclabel :param totalthickness :type totalthickness:ifclengthmeasure ''' def __init__( self , materiallayers,layersetname, ): self.materiallayers = materiallayers self.layersetname = layersetname @apply def materiallayers(): def fget( self ): return self._materiallayers def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument materiallayers is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcmateriallayer', scope = schema_scope)): self._materiallayers = LIST(value) else: self._materiallayers = value return property(**locals()) @apply def layersetname(): def fget( self ): return self._layersetname def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._layersetname = ifclabel(value) else: self._layersetname = value else: self._layersetname = value return property(**locals()) @apply def totalthickness(): def fget( self ): attribute_eval = ifcmlstotalthickness(self) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument totalthickness is DERIVED. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcperformancehistory # #################### class ifcperformancehistory(ifccontrol): '''Entity ifcperformancehistory definition. :param lifecyclephase :type lifecyclephase:ifclabel ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , lifecyclephase, ): ifccontrol.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.lifecyclephase = lifecyclephase @apply def lifecyclephase(): def fget( self ): return self._lifecyclephase def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument lifecyclephase is mantatory and can not be set to None') if not check_type(value,ifclabel): self._lifecyclephase = ifclabel(value) else: self._lifecyclephase = value return property(**locals()) #################### # ENTITY ifcductsegmenttype # #################### class ifcductsegmenttype(ifcflowsegmenttype): '''Entity ifcductsegmenttype definition. :param predefinedtype :type predefinedtype:ifcductsegmenttypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowsegmenttype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcductsegmenttypeenum): self._predefinedtype = ifcductsegmenttypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcductsegmenttypeenum.self.userdefined) or ((self.predefinedtype == ifcductsegmenttypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcribplateprofileproperties # #################### class ifcribplateprofileproperties(ifcprofileproperties): '''Entity ifcribplateprofileproperties definition. :param thickness :type thickness:ifcpositivelengthmeasure :param ribheight :type ribheight:ifcpositivelengthmeasure :param ribwidth :type ribwidth:ifcpositivelengthmeasure :param ribspacing :type ribspacing:ifcpositivelengthmeasure :param direction :type direction:ifcribplatedirectionenum ''' def __init__( self , inherited0__profilename , inherited1__profiledefinition , thickness,ribheight,ribwidth,ribspacing,direction, ): ifcprofileproperties.__init__(self , inherited0__profilename , inherited1__profiledefinition , ) self.thickness = thickness self.ribheight = ribheight self.ribwidth = ribwidth self.ribspacing = ribspacing self.direction = direction @apply def thickness(): def fget( self ): return self._thickness def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._thickness = ifcpositivelengthmeasure(value) else: self._thickness = value else: self._thickness = value return property(**locals()) @apply def ribheight(): def fget( self ): return self._ribheight def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._ribheight = ifcpositivelengthmeasure(value) else: self._ribheight = value else: self._ribheight = value return property(**locals()) @apply def ribwidth(): def fget( self ): return self._ribwidth def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._ribwidth = ifcpositivelengthmeasure(value) else: self._ribwidth = value else: self._ribwidth = value return property(**locals()) @apply def ribspacing(): def fget( self ): return self._ribspacing def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._ribspacing = ifcpositivelengthmeasure(value) else: self._ribspacing = value else: self._ribspacing = value return property(**locals()) @apply def direction(): def fget( self ): return self._direction def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument direction is mantatory and can not be set to None') if not check_type(value,ifcribplatedirectionenum): self._direction = ifcribplatedirectionenum(value) else: self._direction = value return property(**locals()) #################### # ENTITY ifcdampertype # #################### class ifcdampertype(ifcflowcontrollertype): '''Entity ifcdampertype definition. :param predefinedtype :type predefinedtype:ifcdampertypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowcontrollertype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcdampertypeenum): self._predefinedtype = ifcdampertypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcdampertypeenum.self.userdefined) or ((self.predefinedtype == ifcdampertypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcphysicalquantity # #################### class ifcphysicalquantity(BaseEntityClass): '''Entity ifcphysicalquantity definition. :param name :type name:ifclabel :param description :type description:ifctext :param partofcomplex :type partofcomplex:SET(0,1,'ifcphysicalcomplexquantity', scope = schema_scope) ''' def __init__( self , name,description, ): self.name = name self.description = description @apply def name(): def fget( self ): return self._name def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument name is mantatory and can not be set to None') if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) @apply def partofcomplex(): def fget( self ): return self._partofcomplex def fset( self, value ): # INVERSE argument raise AssertionError('Argument partofcomplex is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcphysicalsimplequantity # #################### class ifcphysicalsimplequantity(ifcphysicalquantity): '''Entity ifcphysicalsimplequantity definition. :param unit :type unit:ifcnamedunit ''' def __init__( self , inherited0__name , inherited1__description , unit, ): ifcphysicalquantity.__init__(self , inherited0__name , inherited1__description , ) self.unit = unit @apply def unit(): def fget( self ): return self._unit def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcnamedunit): self._unit = ifcnamedunit(value) else: self._unit = value else: self._unit = value return property(**locals()) #################### # ENTITY ifcwindowliningproperties # #################### class ifcwindowliningproperties(ifcpropertysetdefinition): '''Entity ifcwindowliningproperties definition. :param liningdepth :type liningdepth:ifcpositivelengthmeasure :param liningthickness :type liningthickness:ifcpositivelengthmeasure :param transomthickness :type transomthickness:ifcpositivelengthmeasure :param mullionthickness :type mullionthickness:ifcpositivelengthmeasure :param firsttransomoffset :type firsttransomoffset:ifcnormalisedratiomeasure :param secondtransomoffset :type secondtransomoffset:ifcnormalisedratiomeasure :param firstmullionoffset :type firstmullionoffset:ifcnormalisedratiomeasure :param secondmullionoffset :type secondmullionoffset:ifcnormalisedratiomeasure :param shapeaspectstyle :type shapeaspectstyle:ifcshapeaspect ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , liningdepth,liningthickness,transomthickness,mullionthickness,firsttransomoffset,secondtransomoffset,firstmullionoffset,secondmullionoffset,shapeaspectstyle, ): ifcpropertysetdefinition.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.liningdepth = liningdepth self.liningthickness = liningthickness self.transomthickness = transomthickness self.mullionthickness = mullionthickness self.firsttransomoffset = firsttransomoffset self.secondtransomoffset = secondtransomoffset self.firstmullionoffset = firstmullionoffset self.secondmullionoffset = secondmullionoffset self.shapeaspectstyle = shapeaspectstyle @apply def liningdepth(): def fget( self ): return self._liningdepth def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._liningdepth = ifcpositivelengthmeasure(value) else: self._liningdepth = value else: self._liningdepth = value return property(**locals()) @apply def liningthickness(): def fget( self ): return self._liningthickness def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._liningthickness = ifcpositivelengthmeasure(value) else: self._liningthickness = value else: self._liningthickness = value return property(**locals()) @apply def transomthickness(): def fget( self ): return self._transomthickness def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._transomthickness = ifcpositivelengthmeasure(value) else: self._transomthickness = value else: self._transomthickness = value return property(**locals()) @apply def mullionthickness(): def fget( self ): return self._mullionthickness def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._mullionthickness = ifcpositivelengthmeasure(value) else: self._mullionthickness = value else: self._mullionthickness = value return property(**locals()) @apply def firsttransomoffset(): def fget( self ): return self._firsttransomoffset def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcnormalisedratiomeasure): self._firsttransomoffset = ifcnormalisedratiomeasure(value) else: self._firsttransomoffset = value else: self._firsttransomoffset = value return property(**locals()) @apply def secondtransomoffset(): def fget( self ): return self._secondtransomoffset def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcnormalisedratiomeasure): self._secondtransomoffset = ifcnormalisedratiomeasure(value) else: self._secondtransomoffset = value else: self._secondtransomoffset = value return property(**locals()) @apply def firstmullionoffset(): def fget( self ): return self._firstmullionoffset def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcnormalisedratiomeasure): self._firstmullionoffset = ifcnormalisedratiomeasure(value) else: self._firstmullionoffset = value else: self._firstmullionoffset = value return property(**locals()) @apply def secondmullionoffset(): def fget( self ): return self._secondmullionoffset def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcnormalisedratiomeasure): self._secondmullionoffset = ifcnormalisedratiomeasure(value) else: self._secondmullionoffset = value else: self._secondmullionoffset = value return property(**locals()) @apply def shapeaspectstyle(): def fget( self ): return self._shapeaspectstyle def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcshapeaspect): self._shapeaspectstyle = ifcshapeaspect(value) else: self._shapeaspectstyle = value else: self._shapeaspectstyle = value return property(**locals()) def wr31(self): eval_wr31_wr = ( not (( not EXISTS(self.liningdepth)) and EXISTS(self.liningthickness))) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr def wr32(self): eval_wr32_wr = ( not (( not EXISTS(self.firsttransomoffset)) and EXISTS(self.secondtransomoffset))) if not eval_wr32_wr: raise AssertionError('Rule wr32 violated') else: return eval_wr32_wr def wr33(self): eval_wr33_wr = ( not (( not EXISTS(self.firstmullionoffset)) and EXISTS(self.secondmullionoffset))) if not eval_wr33_wr: raise AssertionError('Rule wr33 violated') else: return eval_wr33_wr def wr34(self): eval_wr34_wr = (EXISTS(self.self.ifcpropertysetdefinition.self.definestype[1]) and ('IFC2X3.IFCWINDOWSTYLE' == TYPEOF(self.self.ifcpropertysetdefinition.self.definestype[1]))) if not eval_wr34_wr: raise AssertionError('Rule wr34 violated') else: return eval_wr34_wr #################### # ENTITY ifcorganization # #################### class ifcorganization(BaseEntityClass): '''Entity ifcorganization definition. :param id :type id:ifcidentifier :param name :type name:ifclabel :param description :type description:ifctext :param roles :type roles:LIST(1,None,'ifcactorrole', scope = schema_scope) :param addresses :type addresses:LIST(1,None,'ifcaddress', scope = schema_scope) :param isrelatedby :type isrelatedby:SET(0,None,'ifcorganizationrelationship', scope = schema_scope) :param relates :type relates:SET(0,None,'ifcorganizationrelationship', scope = schema_scope) :param engages :type engages:SET(0,None,'ifcpersonandorganization', scope = schema_scope) ''' def __init__( self , id,name,description,roles,addresses, ): self.id = id self.name = name self.description = description self.roles = roles self.addresses = addresses @apply def id(): def fget( self ): return self._id def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcidentifier): self._id = ifcidentifier(value) else: self._id = value else: self._id = value return property(**locals()) @apply def name(): def fget( self ): return self._name def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument name is mantatory and can not be set to None') if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) @apply def roles(): def fget( self ): return self._roles def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,LIST(1,None,'ifcactorrole', scope = schema_scope)): self._roles = LIST(value) else: self._roles = value else: self._roles = value return property(**locals()) @apply def addresses(): def fget( self ): return self._addresses def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,LIST(1,None,'ifcaddress', scope = schema_scope)): self._addresses = LIST(value) else: self._addresses = value else: self._addresses = value return property(**locals()) @apply def isrelatedby(): def fget( self ): return self._isrelatedby def fset( self, value ): # INVERSE argument raise AssertionError('Argument isrelatedby is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def relates(): def fget( self ): return self._relates def fset( self, value ): # INVERSE argument raise AssertionError('Argument relates is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def engages(): def fget( self ): return self._engages def fset( self, value ): # INVERSE argument raise AssertionError('Argument engages is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcquantitycount # #################### class ifcquantitycount(ifcphysicalsimplequantity): '''Entity ifcquantitycount definition. :param countvalue :type countvalue:ifccountmeasure ''' def __init__( self , inherited0__name , inherited1__description , inherited2__unit , countvalue, ): ifcphysicalsimplequantity.__init__(self , inherited0__name , inherited1__description , inherited2__unit , ) self.countvalue = countvalue @apply def countvalue(): def fget( self ): return self._countvalue def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument countvalue is mantatory and can not be set to None') if not check_type(value,ifccountmeasure): self._countvalue = ifccountmeasure(value) else: self._countvalue = value return property(**locals()) def wr21(self): eval_wr21_wr = (self.countvalue >= 0) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr #################### # ENTITY ifcannotation # #################### class ifcannotation(ifcproduct): '''Entity ifcannotation definition. :param containedinstructure :type containedinstructure:SET(0,1,'ifcrelcontainedinspatialstructure', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , ): ifcproduct.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , ) @apply def containedinstructure(): def fget( self ): return self._containedinstructure def fset( self, value ): # INVERSE argument raise AssertionError('Argument containedinstructure is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcfacebasedsurfacemodel # #################### class ifcfacebasedsurfacemodel(ifcgeometricrepresentationitem): '''Entity ifcfacebasedsurfacemodel definition. :param fbsmfaces :type fbsmfaces:SET(1,None,'ifcconnectedfaceset', scope = schema_scope) :param dim :type dim:ifcdimensioncount ''' def __init__( self , fbsmfaces, ): ifcgeometricrepresentationitem.__init__(self , ) self.fbsmfaces = fbsmfaces @apply def fbsmfaces(): def fget( self ): return self._fbsmfaces def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument fbsmfaces is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcconnectedfaceset', scope = schema_scope)): self._fbsmfaces = SET(value) else: self._fbsmfaces = value return property(**locals()) @apply def dim(): def fget( self ): attribute_eval = 3 return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcpropertyenumeration # #################### class ifcpropertyenumeration(BaseEntityClass): '''Entity ifcpropertyenumeration definition. :param name :type name:ifclabel :param enumerationvalues :type enumerationvalues:LIST(1,None,'ifcvalue', scope = schema_scope) :param unit :type unit:ifcunit ''' def __init__( self , name,enumerationvalues,unit, ): self.name = name self.enumerationvalues = enumerationvalues self.unit = unit @apply def name(): def fget( self ): return self._name def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument name is mantatory and can not be set to None') if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value return property(**locals()) @apply def enumerationvalues(): def fget( self ): return self._enumerationvalues def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument enumerationvalues is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcvalue', scope = schema_scope)): self._enumerationvalues = LIST(value) else: self._enumerationvalues = value return property(**locals()) @apply def unit(): def fget( self ): return self._unit def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcunit): self._unit = ifcunit(value) else: self._unit = value else: self._unit = value return property(**locals()) def wr01(self): eval_wr01_wr = (SIZEOF(None) == 0) if not eval_wr01_wr: raise AssertionError('Rule wr01 violated') else: return eval_wr01_wr #################### # ENTITY ifcrelconnectsports # #################### class ifcrelconnectsports(ifcrelconnects): '''Entity ifcrelconnectsports definition. :param relatingport :type relatingport:ifcport :param relatedport :type relatedport:ifcport :param realizingelement :type realizingelement:ifcelement ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , relatingport,relatedport,realizingelement, ): ifcrelconnects.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.relatingport = relatingport self.relatedport = relatedport self.realizingelement = realizingelement @apply def relatingport(): def fget( self ): return self._relatingport def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingport is mantatory and can not be set to None') if not check_type(value,ifcport): self._relatingport = ifcport(value) else: self._relatingport = value return property(**locals()) @apply def relatedport(): def fget( self ): return self._relatedport def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedport is mantatory and can not be set to None') if not check_type(value,ifcport): self._relatedport = ifcport(value) else: self._relatedport = value return property(**locals()) @apply def realizingelement(): def fget( self ): return self._realizingelement def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcelement): self._realizingelement = ifcelement(value) else: self._realizingelement = value else: self._realizingelement = value return property(**locals()) #################### # ENTITY ifcrectangulartrimmedsurface # #################### class ifcrectangulartrimmedsurface(ifcboundedsurface): '''Entity ifcrectangulartrimmedsurface definition. :param basissurface :type basissurface:ifcsurface :param u1 :type u1:ifcparametervalue :param v1 :type v1:ifcparametervalue :param u2 :type u2:ifcparametervalue :param v2 :type v2:ifcparametervalue :param usense :type usense:BOOLEAN :param vsense :type vsense:BOOLEAN :param dim :type dim:ifcdimensioncount ''' def __init__( self , basissurface,u1,v1,u2,v2,usense,vsense, ): ifcboundedsurface.__init__(self , ) self.basissurface = basissurface self.u1 = u1 self.v1 = v1 self.u2 = u2 self.v2 = v2 self.usense = usense self.vsense = vsense @apply def basissurface(): def fget( self ): return self._basissurface def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument basissurface is mantatory and can not be set to None') if not check_type(value,ifcsurface): self._basissurface = ifcsurface(value) else: self._basissurface = value return property(**locals()) @apply def u1(): def fget( self ): return self._u1 def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument u1 is mantatory and can not be set to None') if not check_type(value,ifcparametervalue): self._u1 = ifcparametervalue(value) else: self._u1 = value return property(**locals()) @apply def v1(): def fget( self ): return self._v1 def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument v1 is mantatory and can not be set to None') if not check_type(value,ifcparametervalue): self._v1 = ifcparametervalue(value) else: self._v1 = value return property(**locals()) @apply def u2(): def fget( self ): return self._u2 def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument u2 is mantatory and can not be set to None') if not check_type(value,ifcparametervalue): self._u2 = ifcparametervalue(value) else: self._u2 = value return property(**locals()) @apply def v2(): def fget( self ): return self._v2 def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument v2 is mantatory and can not be set to None') if not check_type(value,ifcparametervalue): self._v2 = ifcparametervalue(value) else: self._v2 = value return property(**locals()) @apply def usense(): def fget( self ): return self._usense def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument usense is mantatory and can not be set to None') if not check_type(value,BOOLEAN): self._usense = BOOLEAN(value) else: self._usense = value return property(**locals()) @apply def vsense(): def fget( self ): return self._vsense def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument vsense is mantatory and can not be set to None') if not check_type(value,BOOLEAN): self._vsense = BOOLEAN(value) else: self._vsense = value return property(**locals()) @apply def dim(): def fget( self ): attribute_eval = self.basissurface.self.dim return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (self.u1 != self.u2) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (self.v1 != self.v2) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr def wr3(self): eval_wr3_wr = (((('IFC2X3.IFCELEMENTARYSURFACE' == TYPEOF(self.basissurface)) and ( not ('IFC2X3.IFCPLANE' == TYPEOF(self.basissurface)))) or ('IFC2X3.IFCSURFACEOFREVOLUTION' == TYPEOF(self.basissurface))) or (self.usense == (self.u2 > self.u1))) if not eval_wr3_wr: raise AssertionError('Rule wr3 violated') else: return eval_wr3_wr def wr4(self): eval_wr4_wr = (self.vsense == (self.v2 > self.v1)) if not eval_wr4_wr: raise AssertionError('Rule wr4 violated') else: return eval_wr4_wr #################### # ENTITY ifcspatialstructureelement # #################### class ifcspatialstructureelement(ifcproduct): '''Entity ifcspatialstructureelement definition. :param longname :type longname:ifclabel :param compositiontype :type compositiontype:ifcelementcompositionenum :param referenceselements :type referenceselements:SET(0,None,'ifcrelreferencedinspatialstructure', scope = schema_scope) :param servicedbysystems :type servicedbysystems:SET(0,None,'ifcrelservicesbuildings', scope = schema_scope) :param containselements :type containselements:SET(0,None,'ifcrelcontainedinspatialstructure', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , longname,compositiontype, ): ifcproduct.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , ) self.longname = longname self.compositiontype = compositiontype @apply def longname(): def fget( self ): return self._longname def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._longname = ifclabel(value) else: self._longname = value else: self._longname = value return property(**locals()) @apply def compositiontype(): def fget( self ): return self._compositiontype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument compositiontype is mantatory and can not be set to None') if not check_type(value,ifcelementcompositionenum): self._compositiontype = ifcelementcompositionenum(value) else: self._compositiontype = value return property(**locals()) @apply def referenceselements(): def fget( self ): return self._referenceselements def fset( self, value ): # INVERSE argument raise AssertionError('Argument referenceselements is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def servicedbysystems(): def fget( self ): return self._servicedbysystems def fset( self, value ): # INVERSE argument raise AssertionError('Argument servicedbysystems is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def containselements(): def fget( self ): return self._containselements def fset( self, value ): # INVERSE argument raise AssertionError('Argument containselements is INVERSE. It is computed and can not be set to any value') return property(**locals()) def wr41(self): eval_wr41_wr = (((HIINDEX(self.self.ifcobjectdefinition.self.decomposes) == 1) and ('IFC2X3.IFCRELAGGREGATES' == TYPEOF(self.self.ifcobjectdefinition.self.decomposes[1]))) and (('IFC2X3.IFCPROJECT' == TYPEOF(self.self.ifcobjectdefinition.self.decomposes[1].self.relatingobject)) or ('IFC2X3.IFCSPATIALSTRUCTUREELEMENT' == TYPEOF(self.self.ifcobjectdefinition.self.decomposes[1].self.relatingobject)))) if not eval_wr41_wr: raise AssertionError('Rule wr41 violated') else: return eval_wr41_wr #################### # ENTITY ifcbuilding # #################### class ifcbuilding(ifcspatialstructureelement): '''Entity ifcbuilding definition. :param elevationofrefheight :type elevationofrefheight:ifclengthmeasure :param elevationofterrain :type elevationofterrain:ifclengthmeasure :param buildingaddress :type buildingaddress:ifcpostaladdress ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__longname , inherited8__compositiontype , elevationofrefheight,elevationofterrain,buildingaddress, ): ifcspatialstructureelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__longname , inherited8__compositiontype , ) self.elevationofrefheight = elevationofrefheight self.elevationofterrain = elevationofterrain self.buildingaddress = buildingaddress @apply def elevationofrefheight(): def fget( self ): return self._elevationofrefheight def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._elevationofrefheight = ifclengthmeasure(value) else: self._elevationofrefheight = value else: self._elevationofrefheight = value return property(**locals()) @apply def elevationofterrain(): def fget( self ): return self._elevationofterrain def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._elevationofterrain = ifclengthmeasure(value) else: self._elevationofterrain = value else: self._elevationofterrain = value return property(**locals()) @apply def buildingaddress(): def fget( self ): return self._buildingaddress def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpostaladdress): self._buildingaddress = ifcpostaladdress(value) else: self._buildingaddress = value else: self._buildingaddress = value return property(**locals()) #################### # ENTITY ifccolumn # #################### class ifccolumn(ifcbuildingelement): '''Entity ifccolumn definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcbuildingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcextrudedareasolid # #################### class ifcextrudedareasolid(ifcsweptareasolid): '''Entity ifcextrudedareasolid definition. :param extrudeddirection :type extrudeddirection:ifcdirection :param depth :type depth:ifcpositivelengthmeasure ''' def __init__( self , inherited0__sweptarea , inherited1__position , extrudeddirection,depth, ): ifcsweptareasolid.__init__(self , inherited0__sweptarea , inherited1__position , ) self.extrudeddirection = extrudeddirection self.depth = depth @apply def extrudeddirection(): def fget( self ): return self._extrudeddirection def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument extrudeddirection is mantatory and can not be set to None') if not check_type(value,ifcdirection): self._extrudeddirection = ifcdirection(value) else: self._extrudeddirection = value return property(**locals()) @apply def depth(): def fget( self ): return self._depth def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument depth is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._depth = ifcpositivelengthmeasure(value) else: self._depth = value return property(**locals()) def wr31(self): eval_wr31_wr = (ifcdotproduct((ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcdirection([0,0,1]),self.self.extrudeddirection) != 0) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifcmechanicalsteelmaterialproperties # #################### class ifcmechanicalsteelmaterialproperties(ifcmechanicalmaterialproperties): '''Entity ifcmechanicalsteelmaterialproperties definition. :param yieldstress :type yieldstress:ifcpressuremeasure :param ultimatestress :type ultimatestress:ifcpressuremeasure :param ultimatestrain :type ultimatestrain:ifcpositiveratiomeasure :param hardeningmodule :type hardeningmodule:ifcmodulusofelasticitymeasure :param proportionalstress :type proportionalstress:ifcpressuremeasure :param plasticstrain :type plasticstrain:ifcpositiveratiomeasure :param relaxations :type relaxations:SET(1,None,'ifcrelaxation', scope = schema_scope) ''' def __init__( self , inherited0__material , inherited1__dynamicviscosity , inherited2__youngmodulus , inherited3__shearmodulus , inherited4__poissonratio , inherited5__thermalexpansioncoefficient , yieldstress,ultimatestress,ultimatestrain,hardeningmodule,proportionalstress,plasticstrain,relaxations, ): ifcmechanicalmaterialproperties.__init__(self , inherited0__material , inherited1__dynamicviscosity , inherited2__youngmodulus , inherited3__shearmodulus , inherited4__poissonratio , inherited5__thermalexpansioncoefficient , ) self.yieldstress = yieldstress self.ultimatestress = ultimatestress self.ultimatestrain = ultimatestrain self.hardeningmodule = hardeningmodule self.proportionalstress = proportionalstress self.plasticstrain = plasticstrain self.relaxations = relaxations @apply def yieldstress(): def fget( self ): return self._yieldstress def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpressuremeasure): self._yieldstress = ifcpressuremeasure(value) else: self._yieldstress = value else: self._yieldstress = value return property(**locals()) @apply def ultimatestress(): def fget( self ): return self._ultimatestress def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpressuremeasure): self._ultimatestress = ifcpressuremeasure(value) else: self._ultimatestress = value else: self._ultimatestress = value return property(**locals()) @apply def ultimatestrain(): def fget( self ): return self._ultimatestrain def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._ultimatestrain = ifcpositiveratiomeasure(value) else: self._ultimatestrain = value else: self._ultimatestrain = value return property(**locals()) @apply def hardeningmodule(): def fget( self ): return self._hardeningmodule def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmodulusofelasticitymeasure): self._hardeningmodule = ifcmodulusofelasticitymeasure(value) else: self._hardeningmodule = value else: self._hardeningmodule = value return property(**locals()) @apply def proportionalstress(): def fget( self ): return self._proportionalstress def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpressuremeasure): self._proportionalstress = ifcpressuremeasure(value) else: self._proportionalstress = value else: self._proportionalstress = value return property(**locals()) @apply def plasticstrain(): def fget( self ): return self._plasticstrain def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._plasticstrain = ifcpositiveratiomeasure(value) else: self._plasticstrain = value else: self._plasticstrain = value return property(**locals()) @apply def relaxations(): def fget( self ): return self._relaxations def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,SET(1,None,'ifcrelaxation', scope = schema_scope)): self._relaxations = SET(value) else: self._relaxations = value else: self._relaxations = value return property(**locals()) def wr31(self): eval_wr31_wr = (( not EXISTS(self.yieldstress)) or (self.yieldstress >= 0)) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr def wr32(self): eval_wr32_wr = (( not EXISTS(self.ultimatestress)) or (self.ultimatestress >= 0)) if not eval_wr32_wr: raise AssertionError('Rule wr32 violated') else: return eval_wr32_wr def wr33(self): eval_wr33_wr = (( not EXISTS(self.hardeningmodule)) or (self.hardeningmodule >= 0)) if not eval_wr33_wr: raise AssertionError('Rule wr33 violated') else: return eval_wr33_wr def wr34(self): eval_wr34_wr = (( not EXISTS(self.proportionalstress)) or (self.proportionalstress >= 0)) if not eval_wr34_wr: raise AssertionError('Rule wr34 violated') else: return eval_wr34_wr #################### # ENTITY ifcfurnishingelementtype # #################### class ifcfurnishingelementtype(ifcelementtype): '''Entity ifcfurnishingelementtype definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ): ifcelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) #################### # ENTITY ifcsystemfurnitureelementtype # #################### class ifcsystemfurnitureelementtype(ifcfurnishingelementtype): '''Entity ifcsystemfurnitureelementtype definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ): ifcfurnishingelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) #################### # ENTITY ifcthermalmaterialproperties # #################### class ifcthermalmaterialproperties(ifcmaterialproperties): '''Entity ifcthermalmaterialproperties definition. :param specificheatcapacity :type specificheatcapacity:ifcspecificheatcapacitymeasure :param boilingpoint :type boilingpoint:ifcthermodynamictemperaturemeasure :param freezingpoint :type freezingpoint:ifcthermodynamictemperaturemeasure :param thermalconductivity :type thermalconductivity:ifcthermalconductivitymeasure ''' def __init__( self , inherited0__material , specificheatcapacity,boilingpoint,freezingpoint,thermalconductivity, ): ifcmaterialproperties.__init__(self , inherited0__material , ) self.specificheatcapacity = specificheatcapacity self.boilingpoint = boilingpoint self.freezingpoint = freezingpoint self.thermalconductivity = thermalconductivity @apply def specificheatcapacity(): def fget( self ): return self._specificheatcapacity def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcspecificheatcapacitymeasure): self._specificheatcapacity = ifcspecificheatcapacitymeasure(value) else: self._specificheatcapacity = value else: self._specificheatcapacity = value return property(**locals()) @apply def boilingpoint(): def fget( self ): return self._boilingpoint def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcthermodynamictemperaturemeasure): self._boilingpoint = ifcthermodynamictemperaturemeasure(value) else: self._boilingpoint = value else: self._boilingpoint = value return property(**locals()) @apply def freezingpoint(): def fget( self ): return self._freezingpoint def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcthermodynamictemperaturemeasure): self._freezingpoint = ifcthermodynamictemperaturemeasure(value) else: self._freezingpoint = value else: self._freezingpoint = value return property(**locals()) @apply def thermalconductivity(): def fget( self ): return self._thermalconductivity def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcthermalconductivitymeasure): self._thermalconductivity = ifcthermalconductivitymeasure(value) else: self._thermalconductivity = value else: self._thermalconductivity = value return property(**locals()) #################### # ENTITY ifccsgprimitive3d # #################### class ifccsgprimitive3d(ifcgeometricrepresentationitem): '''Entity ifccsgprimitive3d definition. :param position :type position:ifcaxis2placement3d :param dim :type dim:ifcdimensioncount ''' def __init__( self , position, ): ifcgeometricrepresentationitem.__init__(self , ) self.position = position @apply def position(): def fget( self ): return self._position def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument position is mantatory and can not be set to None') if not check_type(value,ifcaxis2placement3d): self._position = ifcaxis2placement3d(value) else: self._position = value return property(**locals()) @apply def dim(): def fget( self ): attribute_eval = 3 return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcrightcircularcylinder # #################### class ifcrightcircularcylinder(ifccsgprimitive3d): '''Entity ifcrightcircularcylinder definition. :param height :type height:ifcpositivelengthmeasure :param radius :type radius:ifcpositivelengthmeasure ''' def __init__( self , inherited0__position , height,radius, ): ifccsgprimitive3d.__init__(self , inherited0__position , ) self.height = height self.radius = radius @apply def height(): def fget( self ): return self._height def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument height is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._height = ifcpositivelengthmeasure(value) else: self._height = value return property(**locals()) @apply def radius(): def fget( self ): return self._radius def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument radius is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._radius = ifcpositivelengthmeasure(value) else: self._radius = value return property(**locals()) #################### # ENTITY ifctextliteralwithextent # #################### class ifctextliteralwithextent(ifctextliteral): '''Entity ifctextliteralwithextent definition. :param extent :type extent:ifcplanarextent :param boxalignment :type boxalignment:ifcboxalignment ''' def __init__( self , inherited0__literal , inherited1__placement , inherited2__path , extent,boxalignment, ): ifctextliteral.__init__(self , inherited0__literal , inherited1__placement , inherited2__path , ) self.extent = extent self.boxalignment = boxalignment @apply def extent(): def fget( self ): return self._extent def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument extent is mantatory and can not be set to None') if not check_type(value,ifcplanarextent): self._extent = ifcplanarextent(value) else: self._extent = value return property(**locals()) @apply def boxalignment(): def fget( self ): return self._boxalignment def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument boxalignment is mantatory and can not be set to None') if not check_type(value,ifcboxalignment): self._boxalignment = ifcboxalignment(value) else: self._boxalignment = value return property(**locals()) def wr31(self): eval_wr31_wr = ( not ('IFC2X3.IFCPLANARBOX' == TYPEOF(self.extent))) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifcconstraint # #################### class ifcconstraint(BaseEntityClass): '''Entity ifcconstraint definition. :param name :type name:ifclabel :param description :type description:ifctext :param constraintgrade :type constraintgrade:ifcconstraintenum :param constraintsource :type constraintsource:ifclabel :param creatingactor :type creatingactor:ifcactorselect :param creationtime :type creationtime:ifcdatetimeselect :param userdefinedgrade :type userdefinedgrade:ifclabel :param classifiedas :type classifiedas:SET(0,None,'ifcconstraintclassificationrelationship', scope = schema_scope) :param relatesconstraints :type relatesconstraints:SET(0,None,'ifcconstraintrelationship', scope = schema_scope) :param isrelatedwith :type isrelatedwith:SET(0,None,'ifcconstraintrelationship', scope = schema_scope) :param propertiesforconstraint :type propertiesforconstraint:SET(0,None,'ifcpropertyconstraintrelationship', scope = schema_scope) :param aggregates :type aggregates:SET(0,None,'ifcconstraintaggregationrelationship', scope = schema_scope) :param isaggregatedin :type isaggregatedin:SET(0,None,'ifcconstraintaggregationrelationship', scope = schema_scope) ''' def __init__( self , name,description,constraintgrade,constraintsource,creatingactor,creationtime,userdefinedgrade, ): self.name = name self.description = description self.constraintgrade = constraintgrade self.constraintsource = constraintsource self.creatingactor = creatingactor self.creationtime = creationtime self.userdefinedgrade = userdefinedgrade @apply def name(): def fget( self ): return self._name def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument name is mantatory and can not be set to None') if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) @apply def constraintgrade(): def fget( self ): return self._constraintgrade def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument constraintgrade is mantatory and can not be set to None') if not check_type(value,ifcconstraintenum): self._constraintgrade = ifcconstraintenum(value) else: self._constraintgrade = value return property(**locals()) @apply def constraintsource(): def fget( self ): return self._constraintsource def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._constraintsource = ifclabel(value) else: self._constraintsource = value else: self._constraintsource = value return property(**locals()) @apply def creatingactor(): def fget( self ): return self._creatingactor def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcactorselect): self._creatingactor = ifcactorselect(value) else: self._creatingactor = value else: self._creatingactor = value return property(**locals()) @apply def creationtime(): def fget( self ): return self._creationtime def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdatetimeselect): self._creationtime = ifcdatetimeselect(value) else: self._creationtime = value else: self._creationtime = value return property(**locals()) @apply def userdefinedgrade(): def fget( self ): return self._userdefinedgrade def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._userdefinedgrade = ifclabel(value) else: self._userdefinedgrade = value else: self._userdefinedgrade = value return property(**locals()) @apply def classifiedas(): def fget( self ): return self._classifiedas def fset( self, value ): # INVERSE argument raise AssertionError('Argument classifiedas is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def relatesconstraints(): def fget( self ): return self._relatesconstraints def fset( self, value ): # INVERSE argument raise AssertionError('Argument relatesconstraints is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def isrelatedwith(): def fget( self ): return self._isrelatedwith def fset( self, value ): # INVERSE argument raise AssertionError('Argument isrelatedwith is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def propertiesforconstraint(): def fget( self ): return self._propertiesforconstraint def fset( self, value ): # INVERSE argument raise AssertionError('Argument propertiesforconstraint is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def aggregates(): def fget( self ): return self._aggregates def fset( self, value ): # INVERSE argument raise AssertionError('Argument aggregates is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def isaggregatedin(): def fget( self ): return self._isaggregatedin def fset( self, value ): # INVERSE argument raise AssertionError('Argument isaggregatedin is INVERSE. It is computed and can not be set to any value') return property(**locals()) def wr11(self): eval_wr11_wr = ((self.constraintgrade != ifcconstraintenum.self.userdefined) or ((self.constraintgrade == ifcconstraintenum.self.userdefined) and EXISTS(self.self.ifcconstraint.self.userdefinedgrade))) if not eval_wr11_wr: raise AssertionError('Rule wr11 violated') else: return eval_wr11_wr #################### # ENTITY ifcobjective # #################### class ifcobjective(ifcconstraint): '''Entity ifcobjective definition. :param benchmarkvalues :type benchmarkvalues:ifcmetric :param resultvalues :type resultvalues:ifcmetric :param objectivequalifier :type objectivequalifier:ifcobjectiveenum :param userdefinedqualifier :type userdefinedqualifier:ifclabel ''' def __init__( self , inherited0__name , inherited1__description , inherited2__constraintgrade , inherited3__constraintsource , inherited4__creatingactor , inherited5__creationtime , inherited6__userdefinedgrade , benchmarkvalues,resultvalues,objectivequalifier,userdefinedqualifier, ): ifcconstraint.__init__(self , inherited0__name , inherited1__description , inherited2__constraintgrade , inherited3__constraintsource , inherited4__creatingactor , inherited5__creationtime , inherited6__userdefinedgrade , ) self.benchmarkvalues = benchmarkvalues self.resultvalues = resultvalues self.objectivequalifier = objectivequalifier self.userdefinedqualifier = userdefinedqualifier @apply def benchmarkvalues(): def fget( self ): return self._benchmarkvalues def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmetric): self._benchmarkvalues = ifcmetric(value) else: self._benchmarkvalues = value else: self._benchmarkvalues = value return property(**locals()) @apply def resultvalues(): def fget( self ): return self._resultvalues def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmetric): self._resultvalues = ifcmetric(value) else: self._resultvalues = value else: self._resultvalues = value return property(**locals()) @apply def objectivequalifier(): def fget( self ): return self._objectivequalifier def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument objectivequalifier is mantatory and can not be set to None') if not check_type(value,ifcobjectiveenum): self._objectivequalifier = ifcobjectiveenum(value) else: self._objectivequalifier = value return property(**locals()) @apply def userdefinedqualifier(): def fget( self ): return self._userdefinedqualifier def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._userdefinedqualifier = ifclabel(value) else: self._userdefinedqualifier = value else: self._userdefinedqualifier = value return property(**locals()) def wr21(self): eval_wr21_wr = ((self.objectivequalifier != ifcobjectiveenum.self.userdefined) or ((self.objectivequalifier == ifcobjectiveenum.self.userdefined) and EXISTS(self.self.ifcobjective.self.userdefinedqualifier))) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr #################### # ENTITY ifcbuildingelementcomponent # #################### class ifcbuildingelementcomponent(ifcbuildingelement): '''Entity ifcbuildingelementcomponent definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcbuildingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcreinforcingelement # #################### class ifcreinforcingelement(ifcbuildingelementcomponent): '''Entity ifcreinforcingelement definition. :param steelgrade :type steelgrade:ifclabel ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , steelgrade, ): ifcbuildingelementcomponent.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) self.steelgrade = steelgrade @apply def steelgrade(): def fget( self ): return self._steelgrade def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._steelgrade = ifclabel(value) else: self._steelgrade = value else: self._steelgrade = value return property(**locals()) #################### # ENTITY ifcreinforcingmesh # #################### class ifcreinforcingmesh(ifcreinforcingelement): '''Entity ifcreinforcingmesh definition. :param meshlength :type meshlength:ifcpositivelengthmeasure :param meshwidth :type meshwidth:ifcpositivelengthmeasure :param longitudinalbarnominaldiameter :type longitudinalbarnominaldiameter:ifcpositivelengthmeasure :param transversebarnominaldiameter :type transversebarnominaldiameter:ifcpositivelengthmeasure :param longitudinalbarcrosssectionarea :type longitudinalbarcrosssectionarea:ifcareameasure :param transversebarcrosssectionarea :type transversebarcrosssectionarea:ifcareameasure :param longitudinalbarspacing :type longitudinalbarspacing:ifcpositivelengthmeasure :param transversebarspacing :type transversebarspacing:ifcpositivelengthmeasure ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , inherited8__steelgrade , meshlength,meshwidth,longitudinalbarnominaldiameter,transversebarnominaldiameter,longitudinalbarcrosssectionarea,transversebarcrosssectionarea,longitudinalbarspacing,transversebarspacing, ): ifcreinforcingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , inherited8__steelgrade , ) self.meshlength = meshlength self.meshwidth = meshwidth self.longitudinalbarnominaldiameter = longitudinalbarnominaldiameter self.transversebarnominaldiameter = transversebarnominaldiameter self.longitudinalbarcrosssectionarea = longitudinalbarcrosssectionarea self.transversebarcrosssectionarea = transversebarcrosssectionarea self.longitudinalbarspacing = longitudinalbarspacing self.transversebarspacing = transversebarspacing @apply def meshlength(): def fget( self ): return self._meshlength def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._meshlength = ifcpositivelengthmeasure(value) else: self._meshlength = value else: self._meshlength = value return property(**locals()) @apply def meshwidth(): def fget( self ): return self._meshwidth def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._meshwidth = ifcpositivelengthmeasure(value) else: self._meshwidth = value else: self._meshwidth = value return property(**locals()) @apply def longitudinalbarnominaldiameter(): def fget( self ): return self._longitudinalbarnominaldiameter def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument longitudinalbarnominaldiameter is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._longitudinalbarnominaldiameter = ifcpositivelengthmeasure(value) else: self._longitudinalbarnominaldiameter = value return property(**locals()) @apply def transversebarnominaldiameter(): def fget( self ): return self._transversebarnominaldiameter def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument transversebarnominaldiameter is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._transversebarnominaldiameter = ifcpositivelengthmeasure(value) else: self._transversebarnominaldiameter = value return property(**locals()) @apply def longitudinalbarcrosssectionarea(): def fget( self ): return self._longitudinalbarcrosssectionarea def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument longitudinalbarcrosssectionarea is mantatory and can not be set to None') if not check_type(value,ifcareameasure): self._longitudinalbarcrosssectionarea = ifcareameasure(value) else: self._longitudinalbarcrosssectionarea = value return property(**locals()) @apply def transversebarcrosssectionarea(): def fget( self ): return self._transversebarcrosssectionarea def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument transversebarcrosssectionarea is mantatory and can not be set to None') if not check_type(value,ifcareameasure): self._transversebarcrosssectionarea = ifcareameasure(value) else: self._transversebarcrosssectionarea = value return property(**locals()) @apply def longitudinalbarspacing(): def fget( self ): return self._longitudinalbarspacing def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument longitudinalbarspacing is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._longitudinalbarspacing = ifcpositivelengthmeasure(value) else: self._longitudinalbarspacing = value return property(**locals()) @apply def transversebarspacing(): def fget( self ): return self._transversebarspacing def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument transversebarspacing is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._transversebarspacing = ifcpositivelengthmeasure(value) else: self._transversebarspacing = value return property(**locals()) #################### # ENTITY ifctubebundletype # #################### class ifctubebundletype(ifcenergyconversiondevicetype): '''Entity ifctubebundletype definition. :param predefinedtype :type predefinedtype:ifctubebundletypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcenergyconversiondevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifctubebundletypeenum): self._predefinedtype = ifctubebundletypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifctubebundletypeenum.self.userdefined) or ((self.predefinedtype == ifctubebundletypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcdoorliningproperties # #################### class ifcdoorliningproperties(ifcpropertysetdefinition): '''Entity ifcdoorliningproperties definition. :param liningdepth :type liningdepth:ifcpositivelengthmeasure :param liningthickness :type liningthickness:ifcpositivelengthmeasure :param thresholddepth :type thresholddepth:ifcpositivelengthmeasure :param thresholdthickness :type thresholdthickness:ifcpositivelengthmeasure :param transomthickness :type transomthickness:ifcpositivelengthmeasure :param transomoffset :type transomoffset:ifclengthmeasure :param liningoffset :type liningoffset:ifclengthmeasure :param thresholdoffset :type thresholdoffset:ifclengthmeasure :param casingthickness :type casingthickness:ifcpositivelengthmeasure :param casingdepth :type casingdepth:ifcpositivelengthmeasure :param shapeaspectstyle :type shapeaspectstyle:ifcshapeaspect ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , liningdepth,liningthickness,thresholddepth,thresholdthickness,transomthickness,transomoffset,liningoffset,thresholdoffset,casingthickness,casingdepth,shapeaspectstyle, ): ifcpropertysetdefinition.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.liningdepth = liningdepth self.liningthickness = liningthickness self.thresholddepth = thresholddepth self.thresholdthickness = thresholdthickness self.transomthickness = transomthickness self.transomoffset = transomoffset self.liningoffset = liningoffset self.thresholdoffset = thresholdoffset self.casingthickness = casingthickness self.casingdepth = casingdepth self.shapeaspectstyle = shapeaspectstyle @apply def liningdepth(): def fget( self ): return self._liningdepth def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._liningdepth = ifcpositivelengthmeasure(value) else: self._liningdepth = value else: self._liningdepth = value return property(**locals()) @apply def liningthickness(): def fget( self ): return self._liningthickness def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._liningthickness = ifcpositivelengthmeasure(value) else: self._liningthickness = value else: self._liningthickness = value return property(**locals()) @apply def thresholddepth(): def fget( self ): return self._thresholddepth def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._thresholddepth = ifcpositivelengthmeasure(value) else: self._thresholddepth = value else: self._thresholddepth = value return property(**locals()) @apply def thresholdthickness(): def fget( self ): return self._thresholdthickness def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._thresholdthickness = ifcpositivelengthmeasure(value) else: self._thresholdthickness = value else: self._thresholdthickness = value return property(**locals()) @apply def transomthickness(): def fget( self ): return self._transomthickness def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._transomthickness = ifcpositivelengthmeasure(value) else: self._transomthickness = value else: self._transomthickness = value return property(**locals()) @apply def transomoffset(): def fget( self ): return self._transomoffset def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._transomoffset = ifclengthmeasure(value) else: self._transomoffset = value else: self._transomoffset = value return property(**locals()) @apply def liningoffset(): def fget( self ): return self._liningoffset def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._liningoffset = ifclengthmeasure(value) else: self._liningoffset = value else: self._liningoffset = value return property(**locals()) @apply def thresholdoffset(): def fget( self ): return self._thresholdoffset def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._thresholdoffset = ifclengthmeasure(value) else: self._thresholdoffset = value else: self._thresholdoffset = value return property(**locals()) @apply def casingthickness(): def fget( self ): return self._casingthickness def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._casingthickness = ifcpositivelengthmeasure(value) else: self._casingthickness = value else: self._casingthickness = value return property(**locals()) @apply def casingdepth(): def fget( self ): return self._casingdepth def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._casingdepth = ifcpositivelengthmeasure(value) else: self._casingdepth = value else: self._casingdepth = value return property(**locals()) @apply def shapeaspectstyle(): def fget( self ): return self._shapeaspectstyle def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcshapeaspect): self._shapeaspectstyle = ifcshapeaspect(value) else: self._shapeaspectstyle = value else: self._shapeaspectstyle = value return property(**locals()) def wr31(self): eval_wr31_wr = ( not (( not EXISTS(self.liningdepth)) and EXISTS(self.liningthickness))) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr def wr32(self): eval_wr32_wr = ( not (( not EXISTS(self.thresholddepth)) and EXISTS(self.thresholdthickness))) if not eval_wr32_wr: raise AssertionError('Rule wr32 violated') else: return eval_wr32_wr def wr33(self): eval_wr33_wr = ((EXISTS(self.transomoffset) and EXISTS(self.transomthickness)) XOR (( not EXISTS(self.transomoffset)) and ( not EXISTS(self.transomthickness)))) if not eval_wr33_wr: raise AssertionError('Rule wr33 violated') else: return eval_wr33_wr def wr34(self): eval_wr34_wr = ((EXISTS(self.casingdepth) and EXISTS(self.casingthickness)) XOR (( not EXISTS(self.casingdepth)) and ( not EXISTS(self.casingthickness)))) if not eval_wr34_wr: raise AssertionError('Rule wr34 violated') else: return eval_wr34_wr def wr35(self): eval_wr35_wr = (EXISTS(self.self.ifcpropertysetdefinition.self.definestype[1]) and ('IFC2X3.IFCDOORSTYLE' == TYPEOF(self.self.ifcpropertysetdefinition.self.definestype[1]))) if not eval_wr35_wr: raise AssertionError('Rule wr35 violated') else: return eval_wr35_wr #################### # ENTITY ifcstructuralmember # #################### class ifcstructuralmember(ifcstructuralitem): '''Entity ifcstructuralmember definition. :param referenceselement :type referenceselement:SET(0,None,'ifcrelconnectsstructuralelement', scope = schema_scope) :param connectedby :type connectedby:SET(0,None,'ifcrelconnectsstructuralmember', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , ): ifcstructuralitem.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , ) @apply def referenceselement(): def fget( self ): return self._referenceselement def fset( self, value ): # INVERSE argument raise AssertionError('Argument referenceselement is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def connectedby(): def fget( self ): return self._connectedby def fset( self, value ): # INVERSE argument raise AssertionError('Argument connectedby is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcstructuralsurfacemember # #################### class ifcstructuralsurfacemember(ifcstructuralmember): '''Entity ifcstructuralsurfacemember definition. :param predefinedtype :type predefinedtype:ifcstructuralsurfacetypeenum :param thickness :type thickness:ifcpositivelengthmeasure ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , predefinedtype,thickness, ): ifcstructuralmember.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , ) self.predefinedtype = predefinedtype self.thickness = thickness @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcstructuralsurfacetypeenum): self._predefinedtype = ifcstructuralsurfacetypeenum(value) else: self._predefinedtype = value return property(**locals()) @apply def thickness(): def fget( self ): return self._thickness def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._thickness = ifcpositivelengthmeasure(value) else: self._thickness = value else: self._thickness = value return property(**locals()) #################### # ENTITY ifcedgecurve # #################### class ifcedgecurve(ifcedge): '''Entity ifcedgecurve definition. :param edgegeometry :type edgegeometry:ifccurve :param samesense :type samesense:BOOLEAN ''' def __init__( self , inherited0__edgestart , inherited1__edgeend , edgegeometry,samesense, ): ifcedge.__init__(self , inherited0__edgestart , inherited1__edgeend , ) self.edgegeometry = edgegeometry self.samesense = samesense @apply def edgegeometry(): def fget( self ): return self._edgegeometry def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument edgegeometry is mantatory and can not be set to None') if not check_type(value,ifccurve): self._edgegeometry = ifccurve(value) else: self._edgegeometry = value return property(**locals()) @apply def samesense(): def fget( self ): return self._samesense def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument samesense is mantatory and can not be set to None') if not check_type(value,BOOLEAN): self._samesense = BOOLEAN(value) else: self._samesense = value return property(**locals()) #################### # ENTITY ifcflowtreatmentdevice # #################### class ifcflowtreatmentdevice(ifcdistributionflowelement): '''Entity ifcflowtreatmentdevice definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcdistributionflowelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifclightfixturetype # #################### class ifclightfixturetype(ifcflowterminaltype): '''Entity ifclightfixturetype definition. :param predefinedtype :type predefinedtype:ifclightfixturetypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowterminaltype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifclightfixturetypeenum): self._predefinedtype = ifclightfixturetypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcline # #################### class ifcline(ifccurve): '''Entity ifcline definition. :param pnt :type pnt:ifccartesianpoint :param dir :type dir:ifcvector ''' def __init__( self , pnt,dir, ): ifccurve.__init__(self , ) self.pnt = pnt self.dir = dir @apply def pnt(): def fget( self ): return self._pnt def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument pnt is mantatory and can not be set to None') if not check_type(value,ifccartesianpoint): self._pnt = ifccartesianpoint(value) else: self._pnt = value return property(**locals()) @apply def dir(): def fget( self ): return self._dir def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument dir is mantatory and can not be set to None') if not check_type(value,ifcvector): self._dir = ifcvector(value) else: self._dir = value return property(**locals()) def wr1(self): eval_wr1_wr = (self.dir.self.dim == self.pnt.self.dim) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcconic # #################### class ifcconic(ifccurve): '''Entity ifcconic definition. :param position :type position:ifcaxis2placement ''' def __init__( self , position, ): ifccurve.__init__(self , ) self.position = position @apply def position(): def fget( self ): return self._position def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument position is mantatory and can not be set to None') if not check_type(value,ifcaxis2placement): self._position = ifcaxis2placement(value) else: self._position = value return property(**locals()) #################### # ENTITY ifcrelconnectsporttoelement # #################### class ifcrelconnectsporttoelement(ifcrelconnects): '''Entity ifcrelconnectsporttoelement definition. :param relatingport :type relatingport:ifcport :param relatedelement :type relatedelement:ifcelement ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , relatingport,relatedelement, ): ifcrelconnects.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.relatingport = relatingport self.relatedelement = relatedelement @apply def relatingport(): def fget( self ): return self._relatingport def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingport is mantatory and can not be set to None') if not check_type(value,ifcport): self._relatingport = ifcport(value) else: self._relatingport = value return property(**locals()) @apply def relatedelement(): def fget( self ): return self._relatedelement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedelement is mantatory and can not be set to None') if not check_type(value,ifcelement): self._relatedelement = ifcelement(value) else: self._relatedelement = value return property(**locals()) #################### # ENTITY ifcequipmentstandard # #################### class ifcequipmentstandard(ifccontrol): '''Entity ifcequipmentstandard definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ): ifccontrol.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) #################### # ENTITY ifcflowmetertype # #################### class ifcflowmetertype(ifcflowcontrollertype): '''Entity ifcflowmetertype definition. :param predefinedtype :type predefinedtype:ifcflowmetertypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowcontrollertype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcflowmetertypeenum): self._predefinedtype = ifcflowmetertypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcflowmetertypeenum.self.userdefined) or ((self.predefinedtype == ifcflowmetertypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcprojectorderrecord # #################### class ifcprojectorderrecord(ifccontrol): '''Entity ifcprojectorderrecord definition. :param records :type records:LIST(1,None,'ifcrelassignstoprojectorder', scope = schema_scope) :param predefinedtype :type predefinedtype:ifcprojectorderrecordtypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , records,predefinedtype, ): ifccontrol.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.records = records self.predefinedtype = predefinedtype @apply def records(): def fget( self ): return self._records def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument records is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcrelassignstoprojectorder', scope = schema_scope)): self._records = LIST(value) else: self._records = value return property(**locals()) @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcprojectorderrecordtypeenum): self._predefinedtype = ifcprojectorderrecordtypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcquantityarea # #################### class ifcquantityarea(ifcphysicalsimplequantity): '''Entity ifcquantityarea definition. :param areavalue :type areavalue:ifcareameasure ''' def __init__( self , inherited0__name , inherited1__description , inherited2__unit , areavalue, ): ifcphysicalsimplequantity.__init__(self , inherited0__name , inherited1__description , inherited2__unit , ) self.areavalue = areavalue @apply def areavalue(): def fget( self ): return self._areavalue def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument areavalue is mantatory and can not be set to None') if not check_type(value,ifcareameasure): self._areavalue = ifcareameasure(value) else: self._areavalue = value return property(**locals()) def wr21(self): eval_wr21_wr = (( not EXISTS(self.self.ifcphysicalsimplequantity.self.unit)) or (self.self.ifcphysicalsimplequantity.self.unit.self.unittype == ifcunitenum.self.areaunit)) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr def wr22(self): eval_wr22_wr = (self.areavalue >= 0) if not eval_wr22_wr: raise AssertionError('Rule wr22 violated') else: return eval_wr22_wr #################### # ENTITY ifcworkcontrol # #################### class ifcworkcontrol(ifccontrol): '''Entity ifcworkcontrol definition. :param identifier :type identifier:ifcidentifier :param creationdate :type creationdate:ifcdatetimeselect :param creators :type creators:SET(1,None,'ifcperson', scope = schema_scope) :param purpose :type purpose:ifclabel :param duration :type duration:ifctimemeasure :param totalfloat :type totalfloat:ifctimemeasure :param starttime :type starttime:ifcdatetimeselect :param finishtime :type finishtime:ifcdatetimeselect :param workcontroltype :type workcontroltype:ifcworkcontroltypeenum :param userdefinedcontroltype :type userdefinedcontroltype:ifclabel ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , identifier,creationdate,creators,purpose,duration,totalfloat,starttime,finishtime,workcontroltype,userdefinedcontroltype, ): ifccontrol.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.identifier = identifier self.creationdate = creationdate self.creators = creators self.purpose = purpose self.duration = duration self.totalfloat = totalfloat self.starttime = starttime self.finishtime = finishtime self.workcontroltype = workcontroltype self.userdefinedcontroltype = userdefinedcontroltype @apply def identifier(): def fget( self ): return self._identifier def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument identifier is mantatory and can not be set to None') if not check_type(value,ifcidentifier): self._identifier = ifcidentifier(value) else: self._identifier = value return property(**locals()) @apply def creationdate(): def fget( self ): return self._creationdate def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument creationdate is mantatory and can not be set to None') if not check_type(value,ifcdatetimeselect): self._creationdate = ifcdatetimeselect(value) else: self._creationdate = value return property(**locals()) @apply def creators(): def fget( self ): return self._creators def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,SET(1,None,'ifcperson', scope = schema_scope)): self._creators = SET(value) else: self._creators = value else: self._creators = value return property(**locals()) @apply def purpose(): def fget( self ): return self._purpose def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._purpose = ifclabel(value) else: self._purpose = value else: self._purpose = value return property(**locals()) @apply def duration(): def fget( self ): return self._duration def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctimemeasure): self._duration = ifctimemeasure(value) else: self._duration = value else: self._duration = value return property(**locals()) @apply def totalfloat(): def fget( self ): return self._totalfloat def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctimemeasure): self._totalfloat = ifctimemeasure(value) else: self._totalfloat = value else: self._totalfloat = value return property(**locals()) @apply def starttime(): def fget( self ): return self._starttime def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument starttime is mantatory and can not be set to None') if not check_type(value,ifcdatetimeselect): self._starttime = ifcdatetimeselect(value) else: self._starttime = value return property(**locals()) @apply def finishtime(): def fget( self ): return self._finishtime def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdatetimeselect): self._finishtime = ifcdatetimeselect(value) else: self._finishtime = value else: self._finishtime = value return property(**locals()) @apply def workcontroltype(): def fget( self ): return self._workcontroltype def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcworkcontroltypeenum): self._workcontroltype = ifcworkcontroltypeenum(value) else: self._workcontroltype = value else: self._workcontroltype = value return property(**locals()) @apply def userdefinedcontroltype(): def fget( self ): return self._userdefinedcontroltype def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._userdefinedcontroltype = ifclabel(value) else: self._userdefinedcontroltype = value else: self._userdefinedcontroltype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.workcontroltype != ifcworkcontroltypeenum.self.userdefined) or ((self.workcontroltype == ifcworkcontroltypeenum.self.userdefined) and EXISTS(self.self.ifcworkcontrol.self.userdefinedcontroltype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcworkplan # #################### class ifcworkplan(ifcworkcontrol): '''Entity ifcworkplan definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__identifier , inherited6__creationdate , inherited7__creators , inherited8__purpose , inherited9__duration , inherited10__totalfloat , inherited11__starttime , inherited12__finishtime , inherited13__workcontroltype , inherited14__userdefinedcontroltype , ): ifcworkcontrol.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__identifier , inherited6__creationdate , inherited7__creators , inherited8__purpose , inherited9__duration , inherited10__totalfloat , inherited11__starttime , inherited12__finishtime , inherited13__workcontroltype , inherited14__userdefinedcontroltype , ) #################### # ENTITY ifcenergyconversiondevice # #################### class ifcenergyconversiondevice(ifcdistributionflowelement): '''Entity ifcenergyconversiondevice definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcdistributionflowelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcpropertydependencyrelationship # #################### class ifcpropertydependencyrelationship(BaseEntityClass): '''Entity ifcpropertydependencyrelationship definition. :param dependingproperty :type dependingproperty:ifcproperty :param dependantproperty :type dependantproperty:ifcproperty :param name :type name:ifclabel :param description :type description:ifctext :param expression :type expression:ifctext ''' def __init__( self , dependingproperty,dependantproperty,name,description,expression, ): self.dependingproperty = dependingproperty self.dependantproperty = dependantproperty self.name = name self.description = description self.expression = expression @apply def dependingproperty(): def fget( self ): return self._dependingproperty def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument dependingproperty is mantatory and can not be set to None') if not check_type(value,ifcproperty): self._dependingproperty = ifcproperty(value) else: self._dependingproperty = value return property(**locals()) @apply def dependantproperty(): def fget( self ): return self._dependantproperty def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument dependantproperty is mantatory and can not be set to None') if not check_type(value,ifcproperty): self._dependantproperty = ifcproperty(value) else: self._dependantproperty = value return property(**locals()) @apply def name(): def fget( self ): return self._name def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value else: self._name = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) @apply def expression(): def fget( self ): return self._expression def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._expression = ifctext(value) else: self._expression = value else: self._expression = value return property(**locals()) def wr1(self): eval_wr1_wr = (self.dependingproperty != self.dependantproperty) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcrelspaceboundary # #################### class ifcrelspaceboundary(ifcrelconnects): '''Entity ifcrelspaceboundary definition. :param relatingspace :type relatingspace:ifcspace :param relatedbuildingelement :type relatedbuildingelement:ifcelement :param connectiongeometry :type connectiongeometry:ifcconnectiongeometry :param physicalorvirtualboundary :type physicalorvirtualboundary:ifcphysicalorvirtualenum :param internalorexternalboundary :type internalorexternalboundary:ifcinternalorexternalenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , relatingspace,relatedbuildingelement,connectiongeometry,physicalorvirtualboundary,internalorexternalboundary, ): ifcrelconnects.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.relatingspace = relatingspace self.relatedbuildingelement = relatedbuildingelement self.connectiongeometry = connectiongeometry self.physicalorvirtualboundary = physicalorvirtualboundary self.internalorexternalboundary = internalorexternalboundary @apply def relatingspace(): def fget( self ): return self._relatingspace def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingspace is mantatory and can not be set to None') if not check_type(value,ifcspace): self._relatingspace = ifcspace(value) else: self._relatingspace = value return property(**locals()) @apply def relatedbuildingelement(): def fget( self ): return self._relatedbuildingelement def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcelement): self._relatedbuildingelement = ifcelement(value) else: self._relatedbuildingelement = value else: self._relatedbuildingelement = value return property(**locals()) @apply def connectiongeometry(): def fget( self ): return self._connectiongeometry def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcconnectiongeometry): self._connectiongeometry = ifcconnectiongeometry(value) else: self._connectiongeometry = value else: self._connectiongeometry = value return property(**locals()) @apply def physicalorvirtualboundary(): def fget( self ): return self._physicalorvirtualboundary def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument physicalorvirtualboundary is mantatory and can not be set to None') if not check_type(value,ifcphysicalorvirtualenum): self._physicalorvirtualboundary = ifcphysicalorvirtualenum(value) else: self._physicalorvirtualboundary = value return property(**locals()) @apply def internalorexternalboundary(): def fget( self ): return self._internalorexternalboundary def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument internalorexternalboundary is mantatory and can not be set to None') if not check_type(value,ifcinternalorexternalenum): self._internalorexternalboundary = ifcinternalorexternalenum(value) else: self._internalorexternalboundary = value return property(**locals()) def wr1(self): eval_wr1_wr = ((((self.physicalorvirtualboundary == ifcphysicalorvirtualenum.self.physical) and (EXISTS(self.relatedbuildingelement) and ( not ('IFC2X3.IFCVIRTUALELEMENT' == TYPEOF(self.relatedbuildingelement))))) or ((self.physicalorvirtualboundary == ifcphysicalorvirtualenum.self.virtual) and (( not EXISTS(self.relatedbuildingelement)) or ('IFC2X3.IFCVIRTUALELEMENT' == TYPEOF(self.relatedbuildingelement))))) or (self.physicalorvirtualboundary == ifcphysicalorvirtualenum.self.notdefined)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcappliedvalue # #################### class ifcappliedvalue(BaseEntityClass): '''Entity ifcappliedvalue definition. :param name :type name:ifclabel :param description :type description:ifctext :param appliedvalue :type appliedvalue:ifcappliedvalueselect :param unitbasis :type unitbasis:ifcmeasurewithunit :param applicabledate :type applicabledate:ifcdatetimeselect :param fixeduntildate :type fixeduntildate:ifcdatetimeselect :param valuesreferenced :type valuesreferenced:SET(0,None,'ifcreferencesvaluedocument', scope = schema_scope) :param valueofcomponents :type valueofcomponents:SET(0,None,'ifcappliedvaluerelationship', scope = schema_scope) :param iscomponentin :type iscomponentin:SET(0,None,'ifcappliedvaluerelationship', scope = schema_scope) ''' def __init__( self , name,description,appliedvalue,unitbasis,applicabledate,fixeduntildate, ): self.name = name self.description = description self.appliedvalue = appliedvalue self.unitbasis = unitbasis self.applicabledate = applicabledate self.fixeduntildate = fixeduntildate @apply def name(): def fget( self ): return self._name def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value else: self._name = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) @apply def appliedvalue(): def fget( self ): return self._appliedvalue def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcappliedvalueselect): self._appliedvalue = ifcappliedvalueselect(value) else: self._appliedvalue = value else: self._appliedvalue = value return property(**locals()) @apply def unitbasis(): def fget( self ): return self._unitbasis def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmeasurewithunit): self._unitbasis = ifcmeasurewithunit(value) else: self._unitbasis = value else: self._unitbasis = value return property(**locals()) @apply def applicabledate(): def fget( self ): return self._applicabledate def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdatetimeselect): self._applicabledate = ifcdatetimeselect(value) else: self._applicabledate = value else: self._applicabledate = value return property(**locals()) @apply def fixeduntildate(): def fget( self ): return self._fixeduntildate def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdatetimeselect): self._fixeduntildate = ifcdatetimeselect(value) else: self._fixeduntildate = value else: self._fixeduntildate = value return property(**locals()) @apply def valuesreferenced(): def fget( self ): return self._valuesreferenced def fset( self, value ): # INVERSE argument raise AssertionError('Argument valuesreferenced is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def valueofcomponents(): def fget( self ): return self._valueofcomponents def fset( self, value ): # INVERSE argument raise AssertionError('Argument valueofcomponents is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def iscomponentin(): def fget( self ): return self._iscomponentin def fset( self, value ): # INVERSE argument raise AssertionError('Argument iscomponentin is INVERSE. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (EXISTS(self.appliedvalue) or EXISTS(self.valueofcomponents)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcenvironmentalimpactvalue # #################### class ifcenvironmentalimpactvalue(ifcappliedvalue): '''Entity ifcenvironmentalimpactvalue definition. :param impacttype :type impacttype:ifclabel :param category :type category:ifcenvironmentalimpactcategoryenum :param userdefinedcategory :type userdefinedcategory:ifclabel ''' def __init__( self , inherited0__name , inherited1__description , inherited2__appliedvalue , inherited3__unitbasis , inherited4__applicabledate , inherited5__fixeduntildate , impacttype,category,userdefinedcategory, ): ifcappliedvalue.__init__(self , inherited0__name , inherited1__description , inherited2__appliedvalue , inherited3__unitbasis , inherited4__applicabledate , inherited5__fixeduntildate , ) self.impacttype = impacttype self.category = category self.userdefinedcategory = userdefinedcategory @apply def impacttype(): def fget( self ): return self._impacttype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument impacttype is mantatory and can not be set to None') if not check_type(value,ifclabel): self._impacttype = ifclabel(value) else: self._impacttype = value return property(**locals()) @apply def category(): def fget( self ): return self._category def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument category is mantatory and can not be set to None') if not check_type(value,ifcenvironmentalimpactcategoryenum): self._category = ifcenvironmentalimpactcategoryenum(value) else: self._category = value return property(**locals()) @apply def userdefinedcategory(): def fget( self ): return self._userdefinedcategory def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._userdefinedcategory = ifclabel(value) else: self._userdefinedcategory = value else: self._userdefinedcategory = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.category != ifcenvironmentalimpactcategoryenum.self.userdefined) or ((self.category == ifcenvironmentalimpactcategoryenum.self.userdefined) and EXISTS(self.self.ifcenvironmentalimpactvalue.self.userdefinedcategory))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcfillareastylehatching # #################### class ifcfillareastylehatching(ifcgeometricrepresentationitem): '''Entity ifcfillareastylehatching definition. :param hatchlineappearance :type hatchlineappearance:ifccurvestyle :param startofnexthatchline :type startofnexthatchline:ifchatchlinedistanceselect :param pointofreferencehatchline :type pointofreferencehatchline:ifccartesianpoint :param patternstart :type patternstart:ifccartesianpoint :param hatchlineangle :type hatchlineangle:ifcplaneanglemeasure ''' def __init__( self , hatchlineappearance,startofnexthatchline,pointofreferencehatchline,patternstart,hatchlineangle, ): ifcgeometricrepresentationitem.__init__(self , ) self.hatchlineappearance = hatchlineappearance self.startofnexthatchline = startofnexthatchline self.pointofreferencehatchline = pointofreferencehatchline self.patternstart = patternstart self.hatchlineangle = hatchlineangle @apply def hatchlineappearance(): def fget( self ): return self._hatchlineappearance def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument hatchlineappearance is mantatory and can not be set to None') if not check_type(value,ifccurvestyle): self._hatchlineappearance = ifccurvestyle(value) else: self._hatchlineappearance = value return property(**locals()) @apply def startofnexthatchline(): def fget( self ): return self._startofnexthatchline def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument startofnexthatchline is mantatory and can not be set to None') if not check_type(value,ifchatchlinedistanceselect): self._startofnexthatchline = ifchatchlinedistanceselect(value) else: self._startofnexthatchline = value return property(**locals()) @apply def pointofreferencehatchline(): def fget( self ): return self._pointofreferencehatchline def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccartesianpoint): self._pointofreferencehatchline = ifccartesianpoint(value) else: self._pointofreferencehatchline = value else: self._pointofreferencehatchline = value return property(**locals()) @apply def patternstart(): def fget( self ): return self._patternstart def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccartesianpoint): self._patternstart = ifccartesianpoint(value) else: self._patternstart = value else: self._patternstart = value return property(**locals()) @apply def hatchlineangle(): def fget( self ): return self._hatchlineangle def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument hatchlineangle is mantatory and can not be set to None') if not check_type(value,ifcplaneanglemeasure): self._hatchlineangle = ifcplaneanglemeasure(value) else: self._hatchlineangle = value return property(**locals()) def wr21(self): eval_wr21_wr = ( not ('IFC2X3.IFCTWODIRECTIONREPEATFACTOR' == TYPEOF(self.startofnexthatchline))) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr def wr22(self): eval_wr22_wr = (( not EXISTS(self.patternstart)) or (self.patternstart.self.dim == 2)) if not eval_wr22_wr: raise AssertionError('Rule wr22 violated') else: return eval_wr22_wr def wr23(self): eval_wr23_wr = (( not EXISTS(self.pointofreferencehatchline)) or (self.pointofreferencehatchline.self.dim == 2)) if not eval_wr23_wr: raise AssertionError('Rule wr23 violated') else: return eval_wr23_wr #################### # ENTITY ifcheatexchangertype # #################### class ifcheatexchangertype(ifcenergyconversiondevicetype): '''Entity ifcheatexchangertype definition. :param predefinedtype :type predefinedtype:ifcheatexchangertypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcenergyconversiondevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcheatexchangertypeenum): self._predefinedtype = ifcheatexchangertypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcheatexchangertypeenum.self.userdefined) or ((self.predefinedtype == ifcheatexchangertypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifconedirectionrepeatfactor # #################### class ifconedirectionrepeatfactor(ifcgeometricrepresentationitem): '''Entity ifconedirectionrepeatfactor definition. :param repeatfactor :type repeatfactor:ifcvector ''' def __init__( self , repeatfactor, ): ifcgeometricrepresentationitem.__init__(self , ) self.repeatfactor = repeatfactor @apply def repeatfactor(): def fget( self ): return self._repeatfactor def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument repeatfactor is mantatory and can not be set to None') if not check_type(value,ifcvector): self._repeatfactor = ifcvector(value) else: self._repeatfactor = value return property(**locals()) #################### # ENTITY ifcpolygonalboundedhalfspace # #################### class ifcpolygonalboundedhalfspace(ifchalfspacesolid): '''Entity ifcpolygonalboundedhalfspace definition. :param position :type position:ifcaxis2placement3d :param polygonalboundary :type polygonalboundary:ifcboundedcurve ''' def __init__( self , inherited0__basesurface , inherited1__agreementflag , position,polygonalboundary, ): ifchalfspacesolid.__init__(self , inherited0__basesurface , inherited1__agreementflag , ) self.position = position self.polygonalboundary = polygonalboundary @apply def position(): def fget( self ): return self._position def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument position is mantatory and can not be set to None') if not check_type(value,ifcaxis2placement3d): self._position = ifcaxis2placement3d(value) else: self._position = value return property(**locals()) @apply def polygonalboundary(): def fget( self ): return self._polygonalboundary def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument polygonalboundary is mantatory and can not be set to None') if not check_type(value,ifcboundedcurve): self._polygonalboundary = ifcboundedcurve(value) else: self._polygonalboundary = value return property(**locals()) def wr41(self): eval_wr41_wr = (self.polygonalboundary.self.dim == 2) if not eval_wr41_wr: raise AssertionError('Rule wr41 violated') else: return eval_wr41_wr def wr42(self): eval_wr42_wr = (SIZEOF(TYPEOF(self.polygonalboundary) * ['IFC2X3.IFCPOLYLINE','IFC2X3.IFCCOMPOSITECURVE']) == 1) if not eval_wr42_wr: raise AssertionError('Rule wr42 violated') else: return eval_wr42_wr #################### # ENTITY ifccondensertype # #################### class ifccondensertype(ifcenergyconversiondevicetype): '''Entity ifccondensertype definition. :param predefinedtype :type predefinedtype:ifccondensertypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcenergyconversiondevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifccondensertypeenum): self._predefinedtype = ifccondensertypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifccondensertypeenum.self.userdefined) or ((self.predefinedtype == ifccondensertypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcslab # #################### class ifcslab(ifcbuildingelement): '''Entity ifcslab definition. :param predefinedtype :type predefinedtype:ifcslabtypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , predefinedtype, ): ifcbuildingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcslabtypeenum): self._predefinedtype = ifcslabtypeenum(value) else: self._predefinedtype = value else: self._predefinedtype = value return property(**locals()) def wr61(self): eval_wr61_wr = ((( not EXISTS(self.predefinedtype)) or (self.predefinedtype != ifcslabtypeenum.self.userdefined)) or ((self.predefinedtype == ifcslabtypeenum.self.userdefined) and EXISTS(self.self.ifcobject.self.objecttype))) if not eval_wr61_wr: raise AssertionError('Rule wr61 violated') else: return eval_wr61_wr #################### # ENTITY ifccoolingtowertype # #################### class ifccoolingtowertype(ifcenergyconversiondevicetype): '''Entity ifccoolingtowertype definition. :param predefinedtype :type predefinedtype:ifccoolingtowertypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcenergyconversiondevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifccoolingtowertypeenum): self._predefinedtype = ifccoolingtowertypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifccoolingtowertypeenum.self.userdefined) or ((self.predefinedtype == ifccoolingtowertypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcpredefinedtextfont # #################### class ifcpredefinedtextfont(ifcpredefineditem): '''Entity ifcpredefinedtextfont definition. ''' def __init__( self , inherited0__name , ): ifcpredefineditem.__init__(self , inherited0__name , ) #################### # ENTITY ifcdraughtingpredefinedtextfont # #################### class ifcdraughtingpredefinedtextfont(ifcpredefinedtextfont): '''Entity ifcdraughtingpredefinedtextfont definition. ''' def __init__( self , inherited0__name , ): ifcpredefinedtextfont.__init__(self , inherited0__name , ) def wr31(self): eval_wr31_wr = (self.self.ifcpredefineditem.self.name == ['ISO 3098-1 font A','ISO 3098-1 font B']) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifcannotationcurveoccurrence # #################### class ifcannotationcurveoccurrence(ifcannotationoccurrence): '''Entity ifcannotationcurveoccurrence definition. ''' def __init__( self , inherited0__item , inherited1__styles , inherited2__name , ): ifcannotationoccurrence.__init__(self , inherited0__item , inherited1__styles , inherited2__name , ) def wr31(self): eval_wr31_wr = (( not EXISTS(self.self.ifcstyleditem.self.item)) or ('IFC2X3.IFCCURVE' == TYPEOF(self.self.ifcstyleditem.self.item))) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifcdimensioncurve # #################### class ifcdimensioncurve(ifcannotationcurveoccurrence): '''Entity ifcdimensioncurve definition. :param annotatedbysymbols :type annotatedbysymbols:SET(0,2,'ifcterminatorsymbol', scope = schema_scope) ''' def __init__( self , inherited0__item , inherited1__styles , inherited2__name , ): ifcannotationcurveoccurrence.__init__(self , inherited0__item , inherited1__styles , inherited2__name , ) @apply def annotatedbysymbols(): def fget( self ): return self._annotatedbysymbols def fset( self, value ): # INVERSE argument raise AssertionError('Argument annotatedbysymbols is INVERSE. It is computed and can not be set to any value') return property(**locals()) def wr51(self): eval_wr51_wr = (SIZEOF(USEDIN(self,'IFC2X3.IFCDRAUGHTINGCALLOUT.CONTENTS')) >= 1) if not eval_wr51_wr: raise AssertionError('Rule wr51 violated') else: return eval_wr51_wr def wr52(self): eval_wr52_wr = ((SIZEOF(None) <= 1) and (SIZEOF(None) <= 1)) if not eval_wr52_wr: raise AssertionError('Rule wr52 violated') else: return eval_wr52_wr def wr53(self): eval_wr53_wr = (SIZEOF(None) == 0) if not eval_wr53_wr: raise AssertionError('Rule wr53 violated') else: return eval_wr53_wr #################### # ENTITY ifcclassification # #################### class ifcclassification(BaseEntityClass): '''Entity ifcclassification definition. :param source :type source:ifclabel :param edition :type edition:ifclabel :param editiondate :type editiondate:ifccalendardate :param name :type name:ifclabel :param contains :type contains:SET(0,None,'ifcclassificationitem', scope = schema_scope) ''' def __init__( self , source,edition,editiondate,name, ): self.source = source self.edition = edition self.editiondate = editiondate self.name = name @apply def source(): def fget( self ): return self._source def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument source is mantatory and can not be set to None') if not check_type(value,ifclabel): self._source = ifclabel(value) else: self._source = value return property(**locals()) @apply def edition(): def fget( self ): return self._edition def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument edition is mantatory and can not be set to None') if not check_type(value,ifclabel): self._edition = ifclabel(value) else: self._edition = value return property(**locals()) @apply def editiondate(): def fget( self ): return self._editiondate def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccalendardate): self._editiondate = ifccalendardate(value) else: self._editiondate = value else: self._editiondate = value return property(**locals()) @apply def name(): def fget( self ): return self._name def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument name is mantatory and can not be set to None') if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value return property(**locals()) @apply def contains(): def fget( self ): return self._contains def fset( self, value ): # INVERSE argument raise AssertionError('Argument contains is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcdraughtingcalloutrelationship # #################### class ifcdraughtingcalloutrelationship(BaseEntityClass): '''Entity ifcdraughtingcalloutrelationship definition. :param name :type name:ifclabel :param description :type description:ifctext :param relatingdraughtingcallout :type relatingdraughtingcallout:ifcdraughtingcallout :param relateddraughtingcallout :type relateddraughtingcallout:ifcdraughtingcallout ''' def __init__( self , name,description,relatingdraughtingcallout,relateddraughtingcallout, ): self.name = name self.description = description self.relatingdraughtingcallout = relatingdraughtingcallout self.relateddraughtingcallout = relateddraughtingcallout @apply def name(): def fget( self ): return self._name def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value else: self._name = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) @apply def relatingdraughtingcallout(): def fget( self ): return self._relatingdraughtingcallout def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingdraughtingcallout is mantatory and can not be set to None') if not check_type(value,ifcdraughtingcallout): self._relatingdraughtingcallout = ifcdraughtingcallout(value) else: self._relatingdraughtingcallout = value return property(**locals()) @apply def relateddraughtingcallout(): def fget( self ): return self._relateddraughtingcallout def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relateddraughtingcallout is mantatory and can not be set to None') if not check_type(value,ifcdraughtingcallout): self._relateddraughtingcallout = ifcdraughtingcallout(value) else: self._relateddraughtingcallout = value return property(**locals()) #################### # ENTITY ifcgridaxis # #################### class ifcgridaxis(BaseEntityClass): '''Entity ifcgridaxis definition. :param axistag :type axistag:ifclabel :param axiscurve :type axiscurve:ifccurve :param samesense :type samesense:ifcboolean :param partofw :type partofw:SET(0,1,'ifcgrid', scope = schema_scope) :param partofv :type partofv:SET(0,1,'ifcgrid', scope = schema_scope) :param partofu :type partofu:SET(0,1,'ifcgrid', scope = schema_scope) :param hasintersections :type hasintersections:SET(0,None,'ifcvirtualgridintersection', scope = schema_scope) ''' def __init__( self , axistag,axiscurve,samesense, ): self.axistag = axistag self.axiscurve = axiscurve self.samesense = samesense @apply def axistag(): def fget( self ): return self._axistag def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._axistag = ifclabel(value) else: self._axistag = value else: self._axistag = value return property(**locals()) @apply def axiscurve(): def fget( self ): return self._axiscurve def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument axiscurve is mantatory and can not be set to None') if not check_type(value,ifccurve): self._axiscurve = ifccurve(value) else: self._axiscurve = value return property(**locals()) @apply def samesense(): def fget( self ): return self._samesense def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument samesense is mantatory and can not be set to None') if not check_type(value,ifcboolean): self._samesense = ifcboolean(value) else: self._samesense = value return property(**locals()) @apply def partofw(): def fget( self ): return self._partofw def fset( self, value ): # INVERSE argument raise AssertionError('Argument partofw is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def partofv(): def fget( self ): return self._partofv def fset( self, value ): # INVERSE argument raise AssertionError('Argument partofv is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def partofu(): def fget( self ): return self._partofu def fset( self, value ): # INVERSE argument raise AssertionError('Argument partofu is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def hasintersections(): def fget( self ): return self._hasintersections def fset( self, value ): # INVERSE argument raise AssertionError('Argument hasintersections is INVERSE. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (self.axiscurve.self.dim == 2) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = ((SIZEOF(self.partofu) == 1) XOR (SIZEOF(self.partofv) == 1) XOR (SIZEOF(self.partofw) == 1)) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr #################### # ENTITY ifctransportelement # #################### class ifctransportelement(ifcelement): '''Entity ifctransportelement definition. :param operationtype :type operationtype:ifctransportelementtypeenum :param capacitybyweight :type capacitybyweight:ifcmassmeasure :param capacitybynumber :type capacitybynumber:ifccountmeasure ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , operationtype,capacitybyweight,capacitybynumber, ): ifcelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) self.operationtype = operationtype self.capacitybyweight = capacitybyweight self.capacitybynumber = capacitybynumber @apply def operationtype(): def fget( self ): return self._operationtype def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctransportelementtypeenum): self._operationtype = ifctransportelementtypeenum(value) else: self._operationtype = value else: self._operationtype = value return property(**locals()) @apply def capacitybyweight(): def fget( self ): return self._capacitybyweight def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmassmeasure): self._capacitybyweight = ifcmassmeasure(value) else: self._capacitybyweight = value else: self._capacitybyweight = value return property(**locals()) @apply def capacitybynumber(): def fget( self ): return self._capacitybynumber def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccountmeasure): self._capacitybynumber = ifccountmeasure(value) else: self._capacitybynumber = value else: self._capacitybynumber = value return property(**locals()) #################### # ENTITY ifcderivedunit # #################### class ifcderivedunit(BaseEntityClass): '''Entity ifcderivedunit definition. :param elements :type elements:SET(1,None,'ifcderivedunitelement', scope = schema_scope) :param unittype :type unittype:ifcderivedunitenum :param userdefinedtype :type userdefinedtype:ifclabel :param dimensions :type dimensions:ifcdimensionalexponents ''' def __init__( self , elements,unittype,userdefinedtype, ): self.elements = elements self.unittype = unittype self.userdefinedtype = userdefinedtype @apply def elements(): def fget( self ): return self._elements def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument elements is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcderivedunitelement', scope = schema_scope)): self._elements = SET(value) else: self._elements = value return property(**locals()) @apply def unittype(): def fget( self ): return self._unittype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument unittype is mantatory and can not be set to None') if not check_type(value,ifcderivedunitenum): self._unittype = ifcderivedunitenum(value) else: self._unittype = value return property(**locals()) @apply def userdefinedtype(): def fget( self ): return self._userdefinedtype def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._userdefinedtype = ifclabel(value) else: self._userdefinedtype = value else: self._userdefinedtype = value return property(**locals()) @apply def dimensions(): def fget( self ): attribute_eval = ifcderivedimensionalexponents(self.elements) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dimensions is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = ((SIZEOF(self.elements) > 1) or ((SIZEOF(self.elements) == 1) and (self.elements[1].self.exponent != 1))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = ((self.unittype != ifcderivedunitenum.self.userdefined) or ((self.unittype == ifcderivedunitenum.self.userdefined) and EXISTS(self.self.userdefinedtype))) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr #################### # ENTITY ifccontrollertype # #################### class ifccontrollertype(ifcdistributioncontrolelementtype): '''Entity ifccontrollertype definition. :param predefinedtype :type predefinedtype:ifccontrollertypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcdistributioncontrolelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifccontrollertypeenum): self._predefinedtype = ifccontrollertypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcrelassignstoproduct # #################### class ifcrelassignstoproduct(ifcrelassigns): '''Entity ifcrelassignstoproduct definition. :param relatingproduct :type relatingproduct:ifcproduct ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatedobjectstype , relatingproduct, ): ifcrelassigns.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatedobjectstype , ) self.relatingproduct = relatingproduct @apply def relatingproduct(): def fget( self ): return self._relatingproduct def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingproduct is mantatory and can not be set to None') if not check_type(value,ifcproduct): self._relatingproduct = ifcproduct(value) else: self._relatingproduct = value return property(**locals()) def wr1(self): eval_wr1_wr = (SIZEOF(None) == 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcelectricheatertype # #################### class ifcelectricheatertype(ifcflowterminaltype): '''Entity ifcelectricheatertype definition. :param predefinedtype :type predefinedtype:ifcelectricheatertypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowterminaltype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcelectricheatertypeenum): self._predefinedtype = ifcelectricheatertypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcrepresentationcontext # #################### class ifcrepresentationcontext(BaseEntityClass): '''Entity ifcrepresentationcontext definition. :param contextidentifier :type contextidentifier:ifclabel :param contexttype :type contexttype:ifclabel :param representationsincontext :type representationsincontext:SET(0,None,'ifcrepresentation', scope = schema_scope) ''' def __init__( self , contextidentifier,contexttype, ): self.contextidentifier = contextidentifier self.contexttype = contexttype @apply def contextidentifier(): def fget( self ): return self._contextidentifier def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._contextidentifier = ifclabel(value) else: self._contextidentifier = value else: self._contextidentifier = value return property(**locals()) @apply def contexttype(): def fget( self ): return self._contexttype def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._contexttype = ifclabel(value) else: self._contexttype = value else: self._contexttype = value return property(**locals()) @apply def representationsincontext(): def fget( self ): return self._representationsincontext def fset( self, value ): # INVERSE argument raise AssertionError('Argument representationsincontext is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcgeometricrepresentationcontext # #################### class ifcgeometricrepresentationcontext(ifcrepresentationcontext): '''Entity ifcgeometricrepresentationcontext definition. :param coordinatespacedimension :type coordinatespacedimension:ifcdimensioncount :param precision :type precision:REAL :param worldcoordinatesystem :type worldcoordinatesystem:ifcaxis2placement :param truenorth :type truenorth:ifcdirection :param hassubcontexts :type hassubcontexts:SET(0,None,'ifcgeometricrepresentationsubcontext', scope = schema_scope) ''' def __init__( self , inherited0__contextidentifier , inherited1__contexttype , coordinatespacedimension,precision,worldcoordinatesystem,truenorth, ): ifcrepresentationcontext.__init__(self , inherited0__contextidentifier , inherited1__contexttype , ) self.coordinatespacedimension = coordinatespacedimension self.precision = precision self.worldcoordinatesystem = worldcoordinatesystem self.truenorth = truenorth @apply def coordinatespacedimension(): def fget( self ): return self._coordinatespacedimension def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument coordinatespacedimension is mantatory and can not be set to None') if not check_type(value,ifcdimensioncount): self._coordinatespacedimension = ifcdimensioncount(value) else: self._coordinatespacedimension = value return property(**locals()) @apply def precision(): def fget( self ): return self._precision def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,REAL): self._precision = REAL(value) else: self._precision = value else: self._precision = value return property(**locals()) @apply def worldcoordinatesystem(): def fget( self ): return self._worldcoordinatesystem def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument worldcoordinatesystem is mantatory and can not be set to None') if not check_type(value,ifcaxis2placement): self._worldcoordinatesystem = ifcaxis2placement(value) else: self._worldcoordinatesystem = value return property(**locals()) @apply def truenorth(): def fget( self ): return self._truenorth def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdirection): self._truenorth = ifcdirection(value) else: self._truenorth = value else: self._truenorth = value return property(**locals()) @apply def hassubcontexts(): def fget( self ): return self._hassubcontexts def fset( self, value ): # INVERSE argument raise AssertionError('Argument hassubcontexts is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcstairflight # #################### class ifcstairflight(ifcbuildingelement): '''Entity ifcstairflight definition. :param numberofriser :type numberofriser:INTEGER :param numberoftreads :type numberoftreads:INTEGER :param riserheight :type riserheight:ifcpositivelengthmeasure :param treadlength :type treadlength:ifcpositivelengthmeasure ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , numberofriser,numberoftreads,riserheight,treadlength, ): ifcbuildingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) self.numberofriser = numberofriser self.numberoftreads = numberoftreads self.riserheight = riserheight self.treadlength = treadlength @apply def numberofriser(): def fget( self ): return self._numberofriser def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,INTEGER): self._numberofriser = INTEGER(value) else: self._numberofriser = value else: self._numberofriser = value return property(**locals()) @apply def numberoftreads(): def fget( self ): return self._numberoftreads def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,INTEGER): self._numberoftreads = INTEGER(value) else: self._numberoftreads = value else: self._numberoftreads = value return property(**locals()) @apply def riserheight(): def fget( self ): return self._riserheight def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._riserheight = ifcpositivelengthmeasure(value) else: self._riserheight = value else: self._riserheight = value return property(**locals()) @apply def treadlength(): def fget( self ): return self._treadlength def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._treadlength = ifcpositivelengthmeasure(value) else: self._treadlength = value else: self._treadlength = value return property(**locals()) #################### # ENTITY ifcpath # #################### class ifcpath(ifctopologicalrepresentationitem): '''Entity ifcpath definition. :param edgelist :type edgelist:LIST(1,None,'ifcorientededge', scope = schema_scope) ''' def __init__( self , edgelist, ): ifctopologicalrepresentationitem.__init__(self , ) self.edgelist = edgelist @apply def edgelist(): def fget( self ): return self._edgelist def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument edgelist is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcorientededge', scope = schema_scope)): self._edgelist = LIST(value) else: self._edgelist = value return property(**locals()) def wr1(self): eval_wr1_wr = ifcpathheadtotail(self) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcstair # #################### class ifcstair(ifcbuildingelement): '''Entity ifcstair definition. :param shapetype :type shapetype:ifcstairtypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , shapetype, ): ifcbuildingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) self.shapetype = shapetype @apply def shapetype(): def fget( self ): return self._shapetype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument shapetype is mantatory and can not be set to None') if not check_type(value,ifcstairtypeenum): self._shapetype = ifcstairtypeenum(value) else: self._shapetype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((HIINDEX(self.self.ifcobjectdefinition.self.isdecomposedby) == 0) or ((HIINDEX(self.self.ifcobjectdefinition.self.isdecomposedby) == 1) and ( not EXISTS(self.self.ifcproduct.self.representation)))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifc2dcompositecurve # #################### class ifc2dcompositecurve(ifccompositecurve): '''Entity ifc2dcompositecurve definition. ''' def __init__( self , inherited0__segments , inherited1__selfintersect , ): ifccompositecurve.__init__(self , inherited0__segments , inherited1__selfintersect , ) def wr1(self): eval_wr1_wr = self.self.ifccompositecurve.self.closedcurve if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (self.self.ifccurve.self.dim == 2) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr #################### # ENTITY ifcactorrole # #################### class ifcactorrole(BaseEntityClass): '''Entity ifcactorrole definition. :param role :type role:ifcroleenum :param userdefinedrole :type userdefinedrole:ifclabel :param description :type description:ifctext ''' def __init__( self , role,userdefinedrole,description, ): self.role = role self.userdefinedrole = userdefinedrole self.description = description @apply def role(): def fget( self ): return self._role def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument role is mantatory and can not be set to None') if not check_type(value,ifcroleenum): self._role = ifcroleenum(value) else: self._role = value return property(**locals()) @apply def userdefinedrole(): def fget( self ): return self._userdefinedrole def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._userdefinedrole = ifclabel(value) else: self._userdefinedrole = value else: self._userdefinedrole = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.role != ifcroleenum.self.userdefined) or ((self.role == ifcroleenum.self.userdefined) and EXISTS(self.self.userdefinedrole))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcpolyline # #################### class ifcpolyline(ifcboundedcurve): '''Entity ifcpolyline definition. :param points :type points:LIST(2,None,'ifccartesianpoint', scope = schema_scope) ''' def __init__( self , points, ): ifcboundedcurve.__init__(self , ) self.points = points @apply def points(): def fget( self ): return self._points def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument points is mantatory and can not be set to None') if not check_type(value,LIST(2,None,'ifccartesianpoint', scope = schema_scope)): self._points = LIST(value) else: self._points = value return property(**locals()) def wr41(self): eval_wr41_wr = (SIZEOF(None) == 0) if not eval_wr41_wr: raise AssertionError('Rule wr41 violated') else: return eval_wr41_wr #################### # ENTITY ifcgeometriccurveset # #################### class ifcgeometriccurveset(ifcgeometricset): '''Entity ifcgeometriccurveset definition. ''' def __init__( self , inherited0__elements , ): ifcgeometricset.__init__(self , inherited0__elements , ) def wr1(self): eval_wr1_wr = (SIZEOF(None) == 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifctablerow # #################### class ifctablerow(BaseEntityClass): '''Entity ifctablerow definition. :param rowcells :type rowcells:LIST(1,None,'ifcvalue', scope = schema_scope) :param isheading :type isheading:BOOLEAN :param oftable :type oftable:ifctable ''' def __init__( self , rowcells,isheading, ): self.rowcells = rowcells self.isheading = isheading @apply def rowcells(): def fget( self ): return self._rowcells def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument rowcells is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcvalue', scope = schema_scope)): self._rowcells = LIST(value) else: self._rowcells = value return property(**locals()) @apply def isheading(): def fget( self ): return self._isheading def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument isheading is mantatory and can not be set to None') if not check_type(value,BOOLEAN): self._isheading = BOOLEAN(value) else: self._isheading = value return property(**locals()) @apply def oftable(): def fget( self ): return self._oftable def fset( self, value ): # INVERSE argument raise AssertionError('Argument oftable is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcconnectionsurfacegeometry # #################### class ifcconnectionsurfacegeometry(ifcconnectiongeometry): '''Entity ifcconnectionsurfacegeometry definition. :param surfaceonrelatingelement :type surfaceonrelatingelement:ifcsurfaceorfacesurface :param surfaceonrelatedelement :type surfaceonrelatedelement:ifcsurfaceorfacesurface ''' def __init__( self , surfaceonrelatingelement,surfaceonrelatedelement, ): ifcconnectiongeometry.__init__(self , ) self.surfaceonrelatingelement = surfaceonrelatingelement self.surfaceonrelatedelement = surfaceonrelatedelement @apply def surfaceonrelatingelement(): def fget( self ): return self._surfaceonrelatingelement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument surfaceonrelatingelement is mantatory and can not be set to None') if not check_type(value,ifcsurfaceorfacesurface): self._surfaceonrelatingelement = ifcsurfaceorfacesurface(value) else: self._surfaceonrelatingelement = value return property(**locals()) @apply def surfaceonrelatedelement(): def fget( self ): return self._surfaceonrelatedelement def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcsurfaceorfacesurface): self._surfaceonrelatedelement = ifcsurfaceorfacesurface(value) else: self._surfaceonrelatedelement = value else: self._surfaceonrelatedelement = value return property(**locals()) #################### # ENTITY ifcopticalmaterialproperties # #################### class ifcopticalmaterialproperties(ifcmaterialproperties): '''Entity ifcopticalmaterialproperties definition. :param visibletransmittance :type visibletransmittance:ifcpositiveratiomeasure :param solartransmittance :type solartransmittance:ifcpositiveratiomeasure :param thermalirtransmittance :type thermalirtransmittance:ifcpositiveratiomeasure :param thermaliremissivityback :type thermaliremissivityback:ifcpositiveratiomeasure :param thermaliremissivityfront :type thermaliremissivityfront:ifcpositiveratiomeasure :param visiblereflectanceback :type visiblereflectanceback:ifcpositiveratiomeasure :param visiblereflectancefront :type visiblereflectancefront:ifcpositiveratiomeasure :param solarreflectancefront :type solarreflectancefront:ifcpositiveratiomeasure :param solarreflectanceback :type solarreflectanceback:ifcpositiveratiomeasure ''' def __init__( self , inherited0__material , visibletransmittance,solartransmittance,thermalirtransmittance,thermaliremissivityback,thermaliremissivityfront,visiblereflectanceback,visiblereflectancefront,solarreflectancefront,solarreflectanceback, ): ifcmaterialproperties.__init__(self , inherited0__material , ) self.visibletransmittance = visibletransmittance self.solartransmittance = solartransmittance self.thermalirtransmittance = thermalirtransmittance self.thermaliremissivityback = thermaliremissivityback self.thermaliremissivityfront = thermaliremissivityfront self.visiblereflectanceback = visiblereflectanceback self.visiblereflectancefront = visiblereflectancefront self.solarreflectancefront = solarreflectancefront self.solarreflectanceback = solarreflectanceback @apply def visibletransmittance(): def fget( self ): return self._visibletransmittance def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._visibletransmittance = ifcpositiveratiomeasure(value) else: self._visibletransmittance = value else: self._visibletransmittance = value return property(**locals()) @apply def solartransmittance(): def fget( self ): return self._solartransmittance def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._solartransmittance = ifcpositiveratiomeasure(value) else: self._solartransmittance = value else: self._solartransmittance = value return property(**locals()) @apply def thermalirtransmittance(): def fget( self ): return self._thermalirtransmittance def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._thermalirtransmittance = ifcpositiveratiomeasure(value) else: self._thermalirtransmittance = value else: self._thermalirtransmittance = value return property(**locals()) @apply def thermaliremissivityback(): def fget( self ): return self._thermaliremissivityback def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._thermaliremissivityback = ifcpositiveratiomeasure(value) else: self._thermaliremissivityback = value else: self._thermaliremissivityback = value return property(**locals()) @apply def thermaliremissivityfront(): def fget( self ): return self._thermaliremissivityfront def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._thermaliremissivityfront = ifcpositiveratiomeasure(value) else: self._thermaliremissivityfront = value else: self._thermaliremissivityfront = value return property(**locals()) @apply def visiblereflectanceback(): def fget( self ): return self._visiblereflectanceback def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._visiblereflectanceback = ifcpositiveratiomeasure(value) else: self._visiblereflectanceback = value else: self._visiblereflectanceback = value return property(**locals()) @apply def visiblereflectancefront(): def fget( self ): return self._visiblereflectancefront def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._visiblereflectancefront = ifcpositiveratiomeasure(value) else: self._visiblereflectancefront = value else: self._visiblereflectancefront = value return property(**locals()) @apply def solarreflectancefront(): def fget( self ): return self._solarreflectancefront def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._solarreflectancefront = ifcpositiveratiomeasure(value) else: self._solarreflectancefront = value else: self._solarreflectancefront = value return property(**locals()) @apply def solarreflectanceback(): def fget( self ): return self._solarreflectanceback def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._solarreflectanceback = ifcpositiveratiomeasure(value) else: self._solarreflectanceback = value else: self._solarreflectanceback = value return property(**locals()) #################### # ENTITY ifcprojectioncurve # #################### class ifcprojectioncurve(ifcannotationcurveoccurrence): '''Entity ifcprojectioncurve definition. ''' def __init__( self , inherited0__item , inherited1__styles , inherited2__name , ): ifcannotationcurveoccurrence.__init__(self , inherited0__item , inherited1__styles , inherited2__name , ) #################### # ENTITY ifcsoundvalue # #################### class ifcsoundvalue(ifcpropertysetdefinition): '''Entity ifcsoundvalue definition. :param soundleveltimeseries :type soundleveltimeseries:ifctimeseries :param frequency :type frequency:ifcfrequencymeasure :param soundlevelsinglevalue :type soundlevelsinglevalue:ifcderivedmeasurevalue ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , soundleveltimeseries,frequency,soundlevelsinglevalue, ): ifcpropertysetdefinition.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.soundleveltimeseries = soundleveltimeseries self.frequency = frequency self.soundlevelsinglevalue = soundlevelsinglevalue @apply def soundleveltimeseries(): def fget( self ): return self._soundleveltimeseries def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctimeseries): self._soundleveltimeseries = ifctimeseries(value) else: self._soundleveltimeseries = value else: self._soundleveltimeseries = value return property(**locals()) @apply def frequency(): def fget( self ): return self._frequency def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument frequency is mantatory and can not be set to None') if not check_type(value,ifcfrequencymeasure): self._frequency = ifcfrequencymeasure(value) else: self._frequency = value return property(**locals()) @apply def soundlevelsinglevalue(): def fget( self ): return self._soundlevelsinglevalue def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcderivedmeasurevalue): self._soundlevelsinglevalue = ifcderivedmeasurevalue(value) else: self._soundlevelsinglevalue = value else: self._soundlevelsinglevalue = value return property(**locals()) #################### # ENTITY ifccalendardate # #################### class ifccalendardate(BaseEntityClass): '''Entity ifccalendardate definition. :param daycomponent :type daycomponent:ifcdayinmonthnumber :param monthcomponent :type monthcomponent:ifcmonthinyearnumber :param yearcomponent :type yearcomponent:ifcyearnumber ''' def __init__( self , daycomponent,monthcomponent,yearcomponent, ): self.daycomponent = daycomponent self.monthcomponent = monthcomponent self.yearcomponent = yearcomponent @apply def daycomponent(): def fget( self ): return self._daycomponent def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument daycomponent is mantatory and can not be set to None') if not check_type(value,ifcdayinmonthnumber): self._daycomponent = ifcdayinmonthnumber(value) else: self._daycomponent = value return property(**locals()) @apply def monthcomponent(): def fget( self ): return self._monthcomponent def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument monthcomponent is mantatory and can not be set to None') if not check_type(value,ifcmonthinyearnumber): self._monthcomponent = ifcmonthinyearnumber(value) else: self._monthcomponent = value return property(**locals()) @apply def yearcomponent(): def fget( self ): return self._yearcomponent def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument yearcomponent is mantatory and can not be set to None') if not check_type(value,ifcyearnumber): self._yearcomponent = ifcyearnumber(value) else: self._yearcomponent = value return property(**locals()) def wr21(self): eval_wr21_wr = ifcvalidcalendardate(self) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr #################### # ENTITY ifcderivedprofiledef # #################### class ifcderivedprofiledef(ifcprofiledef): '''Entity ifcderivedprofiledef definition. :param parentprofile :type parentprofile:ifcprofiledef :param operator :type operator:ifccartesiantransformationoperator2d :param label :type label:ifclabel ''' def __init__( self , inherited0__profiletype , inherited1__profilename , parentprofile,operator,label, ): ifcprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , ) self.parentprofile = parentprofile self.operator = operator self.label = label @apply def parentprofile(): def fget( self ): return self._parentprofile def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument parentprofile is mantatory and can not be set to None') if not check_type(value,ifcprofiledef): self._parentprofile = ifcprofiledef(value) else: self._parentprofile = value return property(**locals()) @apply def operator(): def fget( self ): return self._operator def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument operator is mantatory and can not be set to None') if not check_type(value,ifccartesiantransformationoperator2d): self._operator = ifccartesiantransformationoperator2d(value) else: self._operator = value return property(**locals()) @apply def label(): def fget( self ): return self._label def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._label = ifclabel(value) else: self._label = value else: self._label = value return property(**locals()) def wr1(self): eval_wr1_wr = (self.self.ifcprofiledef.self.profiletype == self.parentprofile.self.profiletype) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcflowmovingdevicetype # #################### class ifcflowmovingdevicetype(ifcdistributionflowelementtype): '''Entity ifcflowmovingdevicetype definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ): ifcdistributionflowelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) #################### # ENTITY ifcfantype # #################### class ifcfantype(ifcflowmovingdevicetype): '''Entity ifcfantype definition. :param predefinedtype :type predefinedtype:ifcfantypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowmovingdevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcfantypeenum): self._predefinedtype = ifcfantypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcfantypeenum.self.userdefined) or ((self.predefinedtype == ifcfantypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcobjectplacement # #################### class ifcobjectplacement(BaseEntityClass): '''Entity ifcobjectplacement definition. :param placesobject :type placesobject:SET(1,1,'ifcproduct', scope = schema_scope) :param referencedbyplacements :type referencedbyplacements:SET(0,None,'ifclocalplacement', scope = schema_scope) ''' # This class does not define any attribute. pass @apply def placesobject(): def fget( self ): return self._placesobject def fset( self, value ): # INVERSE argument raise AssertionError('Argument placesobject is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def referencedbyplacements(): def fget( self ): return self._referencedbyplacements def fset( self, value ): # INVERSE argument raise AssertionError('Argument referencedbyplacements is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcgridplacement # #################### class ifcgridplacement(ifcobjectplacement): '''Entity ifcgridplacement definition. :param placementlocation :type placementlocation:ifcvirtualgridintersection :param placementrefdirection :type placementrefdirection:ifcvirtualgridintersection ''' def __init__( self , placementlocation,placementrefdirection, ): ifcobjectplacement.__init__(self , ) self.placementlocation = placementlocation self.placementrefdirection = placementrefdirection @apply def placementlocation(): def fget( self ): return self._placementlocation def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument placementlocation is mantatory and can not be set to None') if not check_type(value,ifcvirtualgridintersection): self._placementlocation = ifcvirtualgridintersection(value) else: self._placementlocation = value return property(**locals()) @apply def placementrefdirection(): def fget( self ): return self._placementrefdirection def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcvirtualgridintersection): self._placementrefdirection = ifcvirtualgridintersection(value) else: self._placementrefdirection = value else: self._placementrefdirection = value return property(**locals()) #################### # ENTITY ifctextstylefontmodel # #################### class ifctextstylefontmodel(ifcpredefinedtextfont): '''Entity ifctextstylefontmodel definition. :param fontfamily :type fontfamily:LIST(1,None,'STRING', scope = schema_scope) :param fontstyle :type fontstyle:ifcfontstyle :param fontvariant :type fontvariant:ifcfontvariant :param fontweight :type fontweight:ifcfontweight :param fontsize :type fontsize:ifcsizeselect ''' def __init__( self , inherited0__name , fontfamily,fontstyle,fontvariant,fontweight,fontsize, ): ifcpredefinedtextfont.__init__(self , inherited0__name , ) self.fontfamily = fontfamily self.fontstyle = fontstyle self.fontvariant = fontvariant self.fontweight = fontweight self.fontsize = fontsize @apply def fontfamily(): def fget( self ): return self._fontfamily def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,LIST(1,None,'STRING', scope = schema_scope)): self._fontfamily = LIST(value) else: self._fontfamily = value else: self._fontfamily = value return property(**locals()) @apply def fontstyle(): def fget( self ): return self._fontstyle def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcfontstyle): self._fontstyle = ifcfontstyle(value) else: self._fontstyle = value else: self._fontstyle = value return property(**locals()) @apply def fontvariant(): def fget( self ): return self._fontvariant def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcfontvariant): self._fontvariant = ifcfontvariant(value) else: self._fontvariant = value else: self._fontvariant = value return property(**locals()) @apply def fontweight(): def fget( self ): return self._fontweight def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcfontweight): self._fontweight = ifcfontweight(value) else: self._fontweight = value else: self._fontweight = value return property(**locals()) @apply def fontsize(): def fget( self ): return self._fontsize def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument fontsize is mantatory and can not be set to None') if not check_type(value,ifcsizeselect): self._fontsize = ifcsizeselect(value) else: self._fontsize = value return property(**locals()) def wr31(self): eval_wr31_wr = (('IFC2X3.IFCLENGTHMEASURE' == TYPEOF(self.self.fontsize)) and (self.self.fontsize > 0)) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifcflowfitting # #################### class ifcflowfitting(ifcdistributionflowelement): '''Entity ifcflowfitting definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcdistributionflowelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcprotectivedevicetype # #################### class ifcprotectivedevicetype(ifcflowcontrollertype): '''Entity ifcprotectivedevicetype definition. :param predefinedtype :type predefinedtype:ifcprotectivedevicetypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowcontrollertype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcprotectivedevicetypeenum): self._predefinedtype = ifcprotectivedevicetypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifccircleprofiledef # #################### class ifccircleprofiledef(ifcparameterizedprofiledef): '''Entity ifccircleprofiledef definition. :param radius :type radius:ifcpositivelengthmeasure ''' def __init__( self , inherited0__profiletype , inherited1__profilename , inherited2__position , radius, ): ifcparameterizedprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , inherited2__position , ) self.radius = radius @apply def radius(): def fget( self ): return self._radius def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument radius is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._radius = ifcpositivelengthmeasure(value) else: self._radius = value return property(**locals()) #################### # ENTITY ifcwindowpanelproperties # #################### class ifcwindowpanelproperties(ifcpropertysetdefinition): '''Entity ifcwindowpanelproperties definition. :param operationtype :type operationtype:ifcwindowpaneloperationenum :param panelposition :type panelposition:ifcwindowpanelpositionenum :param framedepth :type framedepth:ifcpositivelengthmeasure :param framethickness :type framethickness:ifcpositivelengthmeasure :param shapeaspectstyle :type shapeaspectstyle:ifcshapeaspect ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , operationtype,panelposition,framedepth,framethickness,shapeaspectstyle, ): ifcpropertysetdefinition.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.operationtype = operationtype self.panelposition = panelposition self.framedepth = framedepth self.framethickness = framethickness self.shapeaspectstyle = shapeaspectstyle @apply def operationtype(): def fget( self ): return self._operationtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument operationtype is mantatory and can not be set to None') if not check_type(value,ifcwindowpaneloperationenum): self._operationtype = ifcwindowpaneloperationenum(value) else: self._operationtype = value return property(**locals()) @apply def panelposition(): def fget( self ): return self._panelposition def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument panelposition is mantatory and can not be set to None') if not check_type(value,ifcwindowpanelpositionenum): self._panelposition = ifcwindowpanelpositionenum(value) else: self._panelposition = value return property(**locals()) @apply def framedepth(): def fget( self ): return self._framedepth def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._framedepth = ifcpositivelengthmeasure(value) else: self._framedepth = value else: self._framedepth = value return property(**locals()) @apply def framethickness(): def fget( self ): return self._framethickness def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._framethickness = ifcpositivelengthmeasure(value) else: self._framethickness = value else: self._framethickness = value return property(**locals()) @apply def shapeaspectstyle(): def fget( self ): return self._shapeaspectstyle def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcshapeaspect): self._shapeaspectstyle = ifcshapeaspect(value) else: self._shapeaspectstyle = value else: self._shapeaspectstyle = value return property(**locals()) #################### # ENTITY ifcdimensionalexponents # #################### class ifcdimensionalexponents(BaseEntityClass): '''Entity ifcdimensionalexponents definition. :param lengthexponent :type lengthexponent:INTEGER :param massexponent :type massexponent:INTEGER :param timeexponent :type timeexponent:INTEGER :param electriccurrentexponent :type electriccurrentexponent:INTEGER :param thermodynamictemperatureexponent :type thermodynamictemperatureexponent:INTEGER :param amountofsubstanceexponent :type amountofsubstanceexponent:INTEGER :param luminousintensityexponent :type luminousintensityexponent:INTEGER ''' def __init__( self , lengthexponent,massexponent,timeexponent,electriccurrentexponent,thermodynamictemperatureexponent,amountofsubstanceexponent,luminousintensityexponent, ): self.lengthexponent = lengthexponent self.massexponent = massexponent self.timeexponent = timeexponent self.electriccurrentexponent = electriccurrentexponent self.thermodynamictemperatureexponent = thermodynamictemperatureexponent self.amountofsubstanceexponent = amountofsubstanceexponent self.luminousintensityexponent = luminousintensityexponent @apply def lengthexponent(): def fget( self ): return self._lengthexponent def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument lengthexponent is mantatory and can not be set to None') if not check_type(value,INTEGER): self._lengthexponent = INTEGER(value) else: self._lengthexponent = value return property(**locals()) @apply def massexponent(): def fget( self ): return self._massexponent def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument massexponent is mantatory and can not be set to None') if not check_type(value,INTEGER): self._massexponent = INTEGER(value) else: self._massexponent = value return property(**locals()) @apply def timeexponent(): def fget( self ): return self._timeexponent def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument timeexponent is mantatory and can not be set to None') if not check_type(value,INTEGER): self._timeexponent = INTEGER(value) else: self._timeexponent = value return property(**locals()) @apply def electriccurrentexponent(): def fget( self ): return self._electriccurrentexponent def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument electriccurrentexponent is mantatory and can not be set to None') if not check_type(value,INTEGER): self._electriccurrentexponent = INTEGER(value) else: self._electriccurrentexponent = value return property(**locals()) @apply def thermodynamictemperatureexponent(): def fget( self ): return self._thermodynamictemperatureexponent def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument thermodynamictemperatureexponent is mantatory and can not be set to None') if not check_type(value,INTEGER): self._thermodynamictemperatureexponent = INTEGER(value) else: self._thermodynamictemperatureexponent = value return property(**locals()) @apply def amountofsubstanceexponent(): def fget( self ): return self._amountofsubstanceexponent def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument amountofsubstanceexponent is mantatory and can not be set to None') if not check_type(value,INTEGER): self._amountofsubstanceexponent = INTEGER(value) else: self._amountofsubstanceexponent = value return property(**locals()) @apply def luminousintensityexponent(): def fget( self ): return self._luminousintensityexponent def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument luminousintensityexponent is mantatory and can not be set to None') if not check_type(value,INTEGER): self._luminousintensityexponent = INTEGER(value) else: self._luminousintensityexponent = value return property(**locals()) #################### # ENTITY ifcextendedmaterialproperties # #################### class ifcextendedmaterialproperties(ifcmaterialproperties): '''Entity ifcextendedmaterialproperties definition. :param extendedproperties :type extendedproperties:SET(1,None,'ifcproperty', scope = schema_scope) :param description :type description:ifctext :param name :type name:ifclabel ''' def __init__( self , inherited0__material , extendedproperties,description,name, ): ifcmaterialproperties.__init__(self , inherited0__material , ) self.extendedproperties = extendedproperties self.description = description self.name = name @apply def extendedproperties(): def fget( self ): return self._extendedproperties def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument extendedproperties is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcproperty', scope = schema_scope)): self._extendedproperties = SET(value) else: self._extendedproperties = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) @apply def name(): def fget( self ): return self._name def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument name is mantatory and can not be set to None') if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value return property(**locals()) #################### # ENTITY ifcmetric # #################### class ifcmetric(ifcconstraint): '''Entity ifcmetric definition. :param benchmark :type benchmark:ifcbenchmarkenum :param valuesource :type valuesource:ifclabel :param datavalue :type datavalue:ifcmetricvalueselect ''' def __init__( self , inherited0__name , inherited1__description , inherited2__constraintgrade , inherited3__constraintsource , inherited4__creatingactor , inherited5__creationtime , inherited6__userdefinedgrade , benchmark,valuesource,datavalue, ): ifcconstraint.__init__(self , inherited0__name , inherited1__description , inherited2__constraintgrade , inherited3__constraintsource , inherited4__creatingactor , inherited5__creationtime , inherited6__userdefinedgrade , ) self.benchmark = benchmark self.valuesource = valuesource self.datavalue = datavalue @apply def benchmark(): def fget( self ): return self._benchmark def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument benchmark is mantatory and can not be set to None') if not check_type(value,ifcbenchmarkenum): self._benchmark = ifcbenchmarkenum(value) else: self._benchmark = value return property(**locals()) @apply def valuesource(): def fget( self ): return self._valuesource def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._valuesource = ifclabel(value) else: self._valuesource = value else: self._valuesource = value return property(**locals()) @apply def datavalue(): def fget( self ): return self._datavalue def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument datavalue is mantatory and can not be set to None') if not check_type(value,ifcmetricvalueselect): self._datavalue = ifcmetricvalueselect(value) else: self._datavalue = value return property(**locals()) #################### # ENTITY ifcpredefinedpointmarkersymbol # #################### class ifcpredefinedpointmarkersymbol(ifcpredefinedsymbol): '''Entity ifcpredefinedpointmarkersymbol definition. ''' def __init__( self , inherited0__name , ): ifcpredefinedsymbol.__init__(self , inherited0__name , ) def wr31(self): eval_wr31_wr = (self.self.ifcpredefineditem.self.name == ['asterisk','circle','dot','plus','square','triangle','x']) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifcapprovalpropertyrelationship # #################### class ifcapprovalpropertyrelationship(BaseEntityClass): '''Entity ifcapprovalpropertyrelationship definition. :param approvedproperties :type approvedproperties:SET(1,None,'ifcproperty', scope = schema_scope) :param approval :type approval:ifcapproval ''' def __init__( self , approvedproperties,approval, ): self.approvedproperties = approvedproperties self.approval = approval @apply def approvedproperties(): def fget( self ): return self._approvedproperties def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument approvedproperties is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcproperty', scope = schema_scope)): self._approvedproperties = SET(value) else: self._approvedproperties = value return property(**locals()) @apply def approval(): def fget( self ): return self._approval def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument approval is mantatory and can not be set to None') if not check_type(value,ifcapproval): self._approval = ifcapproval(value) else: self._approval = value return property(**locals()) #################### # ENTITY ifccoordinateduniversaltimeoffset # #################### class ifccoordinateduniversaltimeoffset(BaseEntityClass): '''Entity ifccoordinateduniversaltimeoffset definition. :param houroffset :type houroffset:ifchourinday :param minuteoffset :type minuteoffset:ifcminuteinhour :param sense :type sense:ifcaheadorbehind ''' def __init__( self , houroffset,minuteoffset,sense, ): self.houroffset = houroffset self.minuteoffset = minuteoffset self.sense = sense @apply def houroffset(): def fget( self ): return self._houroffset def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument houroffset is mantatory and can not be set to None') if not check_type(value,ifchourinday): self._houroffset = ifchourinday(value) else: self._houroffset = value return property(**locals()) @apply def minuteoffset(): def fget( self ): return self._minuteoffset def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcminuteinhour): self._minuteoffset = ifcminuteinhour(value) else: self._minuteoffset = value else: self._minuteoffset = value return property(**locals()) @apply def sense(): def fget( self ): return self._sense def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument sense is mantatory and can not be set to None') if not check_type(value,ifcaheadorbehind): self._sense = ifcaheadorbehind(value) else: self._sense = value return property(**locals()) #################### # ENTITY ifcrelconnectswithrealizingelements # #################### class ifcrelconnectswithrealizingelements(ifcrelconnectselements): '''Entity ifcrelconnectswithrealizingelements definition. :param realizingelements :type realizingelements:SET(1,None,'ifcelement', scope = schema_scope) :param connectiontype :type connectiontype:ifclabel ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__connectiongeometry , inherited5__relatingelement , inherited6__relatedelement , realizingelements,connectiontype, ): ifcrelconnectselements.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__connectiongeometry , inherited5__relatingelement , inherited6__relatedelement , ) self.realizingelements = realizingelements self.connectiontype = connectiontype @apply def realizingelements(): def fget( self ): return self._realizingelements def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument realizingelements is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcelement', scope = schema_scope)): self._realizingelements = SET(value) else: self._realizingelements = value return property(**locals()) @apply def connectiontype(): def fget( self ): return self._connectiontype def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._connectiontype = ifclabel(value) else: self._connectiontype = value else: self._connectiontype = value return property(**locals()) #################### # ENTITY ifcprocess # #################### class ifcprocess(ifcobject): '''Entity ifcprocess definition. :param operateson :type operateson:SET(0,None,'ifcrelassignstoprocess', scope = schema_scope) :param issuccessorfrom :type issuccessorfrom:SET(0,None,'ifcrelsequence', scope = schema_scope) :param ispredecessorto :type ispredecessorto:SET(0,None,'ifcrelsequence', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ): ifcobject.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) @apply def operateson(): def fget( self ): return self._operateson def fset( self, value ): # INVERSE argument raise AssertionError('Argument operateson is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def issuccessorfrom(): def fget( self ): return self._issuccessorfrom def fset( self, value ): # INVERSE argument raise AssertionError('Argument issuccessorfrom is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def ispredecessorto(): def fget( self ): return self._ispredecessorto def fset( self, value ): # INVERSE argument raise AssertionError('Argument ispredecessorto is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifctask # #################### class ifctask(ifcprocess): '''Entity ifctask definition. :param taskid :type taskid:ifcidentifier :param status :type status:ifclabel :param workmethod :type workmethod:ifclabel :param ismilestone :type ismilestone:BOOLEAN :param priority :type priority:INTEGER ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , taskid,status,workmethod,ismilestone,priority, ): ifcprocess.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.taskid = taskid self.status = status self.workmethod = workmethod self.ismilestone = ismilestone self.priority = priority @apply def taskid(): def fget( self ): return self._taskid def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument taskid is mantatory and can not be set to None') if not check_type(value,ifcidentifier): self._taskid = ifcidentifier(value) else: self._taskid = value return property(**locals()) @apply def status(): def fget( self ): return self._status def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._status = ifclabel(value) else: self._status = value else: self._status = value return property(**locals()) @apply def workmethod(): def fget( self ): return self._workmethod def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._workmethod = ifclabel(value) else: self._workmethod = value else: self._workmethod = value return property(**locals()) @apply def ismilestone(): def fget( self ): return self._ismilestone def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument ismilestone is mantatory and can not be set to None') if not check_type(value,BOOLEAN): self._ismilestone = BOOLEAN(value) else: self._ismilestone = value return property(**locals()) @apply def priority(): def fget( self ): return self._priority def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,INTEGER): self._priority = INTEGER(value) else: self._priority = value else: self._priority = value return property(**locals()) def wr1(self): eval_wr1_wr = (SIZEOF(None) == 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (SIZEOF(None) == 0) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr def wr3(self): eval_wr3_wr = EXISTS(self.self.ifcroot.self.name) if not eval_wr3_wr: raise AssertionError('Rule wr3 violated') else: return eval_wr3_wr #################### # ENTITY ifcresource # #################### class ifcresource(ifcobject): '''Entity ifcresource definition. :param resourceof :type resourceof:SET(0,None,'ifcrelassignstoresource', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ): ifcobject.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) @apply def resourceof(): def fget( self ): return self._resourceof def fset( self, value ): # INVERSE argument raise AssertionError('Argument resourceof is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcconstructionresource # #################### class ifcconstructionresource(ifcresource): '''Entity ifcconstructionresource definition. :param resourceidentifier :type resourceidentifier:ifcidentifier :param resourcegroup :type resourcegroup:ifclabel :param resourceconsumption :type resourceconsumption:ifcresourceconsumptionenum :param basequantity :type basequantity:ifcmeasurewithunit ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , resourceidentifier,resourcegroup,resourceconsumption,basequantity, ): ifcresource.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.resourceidentifier = resourceidentifier self.resourcegroup = resourcegroup self.resourceconsumption = resourceconsumption self.basequantity = basequantity @apply def resourceidentifier(): def fget( self ): return self._resourceidentifier def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcidentifier): self._resourceidentifier = ifcidentifier(value) else: self._resourceidentifier = value else: self._resourceidentifier = value return property(**locals()) @apply def resourcegroup(): def fget( self ): return self._resourcegroup def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._resourcegroup = ifclabel(value) else: self._resourcegroup = value else: self._resourcegroup = value return property(**locals()) @apply def resourceconsumption(): def fget( self ): return self._resourceconsumption def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcresourceconsumptionenum): self._resourceconsumption = ifcresourceconsumptionenum(value) else: self._resourceconsumption = value else: self._resourceconsumption = value return property(**locals()) @apply def basequantity(): def fget( self ): return self._basequantity def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmeasurewithunit): self._basequantity = ifcmeasurewithunit(value) else: self._basequantity = value else: self._basequantity = value return property(**locals()) #################### # ENTITY ifccrewresource # #################### class ifccrewresource(ifcconstructionresource): '''Entity ifccrewresource definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__resourceidentifier , inherited6__resourcegroup , inherited7__resourceconsumption , inherited8__basequantity , ): ifcconstructionresource.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__resourceidentifier , inherited6__resourcegroup , inherited7__resourceconsumption , inherited8__basequantity , ) #################### # ENTITY ifcmanifoldsolidbrep # #################### class ifcmanifoldsolidbrep(ifcsolidmodel): '''Entity ifcmanifoldsolidbrep definition. :param outer :type outer:ifcclosedshell ''' def __init__( self , outer, ): ifcsolidmodel.__init__(self , ) self.outer = outer @apply def outer(): def fget( self ): return self._outer def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument outer is mantatory and can not be set to None') if not check_type(value,ifcclosedshell): self._outer = ifcclosedshell(value) else: self._outer = value return property(**locals()) #################### # ENTITY ifcfacetedbrep # #################### class ifcfacetedbrep(ifcmanifoldsolidbrep): '''Entity ifcfacetedbrep definition. ''' def __init__( self , inherited0__outer , ): ifcmanifoldsolidbrep.__init__(self , inherited0__outer , ) #################### # ENTITY ifcbooleanresult # #################### class ifcbooleanresult(ifcgeometricrepresentationitem): '''Entity ifcbooleanresult definition. :param operator :type operator:ifcbooleanoperator :param firstoperand :type firstoperand:ifcbooleanoperand :param secondoperand :type secondoperand:ifcbooleanoperand :param dim :type dim:ifcdimensioncount ''' def __init__( self , operator,firstoperand,secondoperand, ): ifcgeometricrepresentationitem.__init__(self , ) self.operator = operator self.firstoperand = firstoperand self.secondoperand = secondoperand @apply def operator(): def fget( self ): return self._operator def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument operator is mantatory and can not be set to None') if not check_type(value,ifcbooleanoperator): self._operator = ifcbooleanoperator(value) else: self._operator = value return property(**locals()) @apply def firstoperand(): def fget( self ): return self._firstoperand def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument firstoperand is mantatory and can not be set to None') if not check_type(value,ifcbooleanoperand): self._firstoperand = ifcbooleanoperand(value) else: self._firstoperand = value return property(**locals()) @apply def secondoperand(): def fget( self ): return self._secondoperand def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument secondoperand is mantatory and can not be set to None') if not check_type(value,ifcbooleanoperand): self._secondoperand = ifcbooleanoperand(value) else: self._secondoperand = value return property(**locals()) @apply def dim(): def fget( self ): attribute_eval = self.firstoperand.self.dim return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (self.firstoperand.self.dim == self.secondoperand.self.dim) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcslabtype # #################### class ifcslabtype(ifcbuildingelementtype): '''Entity ifcslabtype definition. :param predefinedtype :type predefinedtype:ifcslabtypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcbuildingelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcslabtypeenum): self._predefinedtype = ifcslabtypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifctextstyletextmodel # #################### class ifctextstyletextmodel(BaseEntityClass): '''Entity ifctextstyletextmodel definition. :param textindent :type textindent:ifcsizeselect :param textalign :type textalign:ifctextalignment :param textdecoration :type textdecoration:ifctextdecoration :param letterspacing :type letterspacing:ifcsizeselect :param wordspacing :type wordspacing:ifcsizeselect :param texttransform :type texttransform:ifctexttransformation :param lineheight :type lineheight:ifcsizeselect ''' def __init__( self , textindent,textalign,textdecoration,letterspacing,wordspacing,texttransform,lineheight, ): self.textindent = textindent self.textalign = textalign self.textdecoration = textdecoration self.letterspacing = letterspacing self.wordspacing = wordspacing self.texttransform = texttransform self.lineheight = lineheight @apply def textindent(): def fget( self ): return self._textindent def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcsizeselect): self._textindent = ifcsizeselect(value) else: self._textindent = value else: self._textindent = value return property(**locals()) @apply def textalign(): def fget( self ): return self._textalign def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctextalignment): self._textalign = ifctextalignment(value) else: self._textalign = value else: self._textalign = value return property(**locals()) @apply def textdecoration(): def fget( self ): return self._textdecoration def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctextdecoration): self._textdecoration = ifctextdecoration(value) else: self._textdecoration = value else: self._textdecoration = value return property(**locals()) @apply def letterspacing(): def fget( self ): return self._letterspacing def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcsizeselect): self._letterspacing = ifcsizeselect(value) else: self._letterspacing = value else: self._letterspacing = value return property(**locals()) @apply def wordspacing(): def fget( self ): return self._wordspacing def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcsizeselect): self._wordspacing = ifcsizeselect(value) else: self._wordspacing = value else: self._wordspacing = value return property(**locals()) @apply def texttransform(): def fget( self ): return self._texttransform def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctexttransformation): self._texttransform = ifctexttransformation(value) else: self._texttransform = value else: self._texttransform = value return property(**locals()) @apply def lineheight(): def fget( self ): return self._lineheight def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcsizeselect): self._lineheight = ifcsizeselect(value) else: self._lineheight = value else: self._lineheight = value return property(**locals()) #################### # ENTITY ifcunitassignment # #################### class ifcunitassignment(BaseEntityClass): '''Entity ifcunitassignment definition. :param units :type units:SET(1,None,'ifcunit', scope = schema_scope) ''' def __init__( self , units, ): self.units = units @apply def units(): def fget( self ): return self._units def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument units is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcunit', scope = schema_scope)): self._units = SET(value) else: self._units = value return property(**locals()) def wr01(self): eval_wr01_wr = ifccorrectunitassignment(self.units) if not eval_wr01_wr: raise AssertionError('Rule wr01 violated') else: return eval_wr01_wr #################### # ENTITY ifcbeam # #################### class ifcbeam(ifcbuildingelement): '''Entity ifcbeam definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcbuildingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcevaporativecoolertype # #################### class ifcevaporativecoolertype(ifcenergyconversiondevicetype): '''Entity ifcevaporativecoolertype definition. :param predefinedtype :type predefinedtype:ifcevaporativecoolertypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcenergyconversiondevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcevaporativecoolertypeenum): self._predefinedtype = ifcevaporativecoolertypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcevaporativecoolertypeenum.self.userdefined) or ((self.predefinedtype == ifcevaporativecoolertypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcelementarysurface # #################### class ifcelementarysurface(ifcsurface): '''Entity ifcelementarysurface definition. :param position :type position:ifcaxis2placement3d :param dim :type dim:ifcdimensioncount ''' def __init__( self , position, ): ifcsurface.__init__(self , ) self.position = position @apply def position(): def fget( self ): return self._position def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument position is mantatory and can not be set to None') if not check_type(value,ifcaxis2placement3d): self._position = ifcaxis2placement3d(value) else: self._position = value return property(**locals()) @apply def dim(): def fget( self ): attribute_eval = self.position.self.dim return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcalarmtype # #################### class ifcalarmtype(ifcdistributioncontrolelementtype): '''Entity ifcalarmtype definition. :param predefinedtype :type predefinedtype:ifcalarmtypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcdistributioncontrolelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcalarmtypeenum): self._predefinedtype = ifcalarmtypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcmembertype # #################### class ifcmembertype(ifcbuildingelementtype): '''Entity ifcmembertype definition. :param predefinedtype :type predefinedtype:ifcmembertypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcbuildingelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcmembertypeenum): self._predefinedtype = ifcmembertypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcrelflowcontrolelements # #################### class ifcrelflowcontrolelements(ifcrelconnects): '''Entity ifcrelflowcontrolelements definition. :param relatedcontrolelements :type relatedcontrolelements:SET(1,None,'ifcdistributioncontrolelement', scope = schema_scope) :param relatingflowelement :type relatingflowelement:ifcdistributionflowelement ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , relatedcontrolelements,relatingflowelement, ): ifcrelconnects.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.relatedcontrolelements = relatedcontrolelements self.relatingflowelement = relatingflowelement @apply def relatedcontrolelements(): def fget( self ): return self._relatedcontrolelements def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedcontrolelements is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcdistributioncontrolelement', scope = schema_scope)): self._relatedcontrolelements = SET(value) else: self._relatedcontrolelements = value return property(**locals()) @apply def relatingflowelement(): def fget( self ): return self._relatingflowelement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingflowelement is mantatory and can not be set to None') if not check_type(value,ifcdistributionflowelement): self._relatingflowelement = ifcdistributionflowelement(value) else: self._relatingflowelement = value return property(**locals()) #################### # ENTITY ifcvertexbasedtexturemap # #################### class ifcvertexbasedtexturemap(BaseEntityClass): '''Entity ifcvertexbasedtexturemap definition. :param texturevertices :type texturevertices:LIST(3,None,'ifctexturevertex', scope = schema_scope) :param texturepoints :type texturepoints:LIST(3,None,'ifccartesianpoint', scope = schema_scope) ''' def __init__( self , texturevertices,texturepoints, ): self.texturevertices = texturevertices self.texturepoints = texturepoints @apply def texturevertices(): def fget( self ): return self._texturevertices def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument texturevertices is mantatory and can not be set to None') if not check_type(value,LIST(3,None,'ifctexturevertex', scope = schema_scope)): self._texturevertices = LIST(value) else: self._texturevertices = value return property(**locals()) @apply def texturepoints(): def fget( self ): return self._texturepoints def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument texturepoints is mantatory and can not be set to None') if not check_type(value,LIST(3,None,'ifccartesianpoint', scope = schema_scope)): self._texturepoints = LIST(value) else: self._texturepoints = value return property(**locals()) #################### # ENTITY ifcpropertylistvalue # #################### class ifcpropertylistvalue(ifcsimpleproperty): '''Entity ifcpropertylistvalue definition. :param listvalues :type listvalues:LIST(1,None,'ifcvalue', scope = schema_scope) :param unit :type unit:ifcunit ''' def __init__( self , inherited0__name , inherited1__description , listvalues,unit, ): ifcsimpleproperty.__init__(self , inherited0__name , inherited1__description , ) self.listvalues = listvalues self.unit = unit @apply def listvalues(): def fget( self ): return self._listvalues def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument listvalues is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcvalue', scope = schema_scope)): self._listvalues = LIST(value) else: self._listvalues = value return property(**locals()) @apply def unit(): def fget( self ): return self._unit def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcunit): self._unit = ifcunit(value) else: self._unit = value else: self._unit = value return property(**locals()) def wr31(self): eval_wr31_wr = (SIZEOF(None) == 0) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifcstructuralactivity # #################### class ifcstructuralactivity(ifcproduct): '''Entity ifcstructuralactivity definition. :param appliedload :type appliedload:ifcstructuralload :param globalorlocal :type globalorlocal:ifcglobalorlocalenum :param assignedtostructuralitem :type assignedtostructuralitem:ifcrelconnectsstructuralactivity ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , appliedload,globalorlocal, ): ifcproduct.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , ) self.appliedload = appliedload self.globalorlocal = globalorlocal @apply def appliedload(): def fget( self ): return self._appliedload def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument appliedload is mantatory and can not be set to None') if not check_type(value,ifcstructuralload): self._appliedload = ifcstructuralload(value) else: self._appliedload = value return property(**locals()) @apply def globalorlocal(): def fget( self ): return self._globalorlocal def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument globalorlocal is mantatory and can not be set to None') if not check_type(value,ifcglobalorlocalenum): self._globalorlocal = ifcglobalorlocalenum(value) else: self._globalorlocal = value return property(**locals()) @apply def assignedtostructuralitem(): def fget( self ): return self._assignedtostructuralitem def fset( self, value ): # INVERSE argument raise AssertionError('Argument assignedtostructuralitem is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcstructuralaction # #################### class ifcstructuralaction(ifcstructuralactivity): '''Entity ifcstructuralaction definition. :param destabilizingload :type destabilizingload:BOOLEAN :param causedby :type causedby:ifcstructuralreaction ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedload , inherited8__globalorlocal , destabilizingload,causedby, ): ifcstructuralactivity.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedload , inherited8__globalorlocal , ) self.destabilizingload = destabilizingload self.causedby = causedby @apply def destabilizingload(): def fget( self ): return self._destabilizingload def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument destabilizingload is mantatory and can not be set to None') if not check_type(value,BOOLEAN): self._destabilizingload = BOOLEAN(value) else: self._destabilizingload = value return property(**locals()) @apply def causedby(): def fget( self ): return self._causedby def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcstructuralreaction): self._causedby = ifcstructuralreaction(value) else: self._causedby = value else: self._causedby = value return property(**locals()) #################### # ENTITY ifcsurfacestylerefraction # #################### class ifcsurfacestylerefraction(BaseEntityClass): '''Entity ifcsurfacestylerefraction definition. :param refractionindex :type refractionindex:ifcreal :param dispersionfactor :type dispersionfactor:ifcreal ''' def __init__( self , refractionindex,dispersionfactor, ): self.refractionindex = refractionindex self.dispersionfactor = dispersionfactor @apply def refractionindex(): def fget( self ): return self._refractionindex def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcreal): self._refractionindex = ifcreal(value) else: self._refractionindex = value else: self._refractionindex = value return property(**locals()) @apply def dispersionfactor(): def fget( self ): return self._dispersionfactor def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcreal): self._dispersionfactor = ifcreal(value) else: self._dispersionfactor = value else: self._dispersionfactor = value return property(**locals()) #################### # ENTITY ifcpredefinedcurvefont # #################### class ifcpredefinedcurvefont(ifcpredefineditem): '''Entity ifcpredefinedcurvefont definition. ''' def __init__( self , inherited0__name , ): ifcpredefineditem.__init__(self , inherited0__name , ) #################### # ENTITY ifcrampflight # #################### class ifcrampflight(ifcbuildingelement): '''Entity ifcrampflight definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcbuildingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcdiscreteaccessory # #################### class ifcdiscreteaccessory(ifcelementcomponent): '''Entity ifcdiscreteaccessory definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcelementcomponent.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcperson # #################### class ifcperson(BaseEntityClass): '''Entity ifcperson definition. :param id :type id:ifcidentifier :param familyname :type familyname:ifclabel :param givenname :type givenname:ifclabel :param middlenames :type middlenames:LIST(1,None,'STRING', scope = schema_scope) :param prefixtitles :type prefixtitles:LIST(1,None,'STRING', scope = schema_scope) :param suffixtitles :type suffixtitles:LIST(1,None,'STRING', scope = schema_scope) :param roles :type roles:LIST(1,None,'ifcactorrole', scope = schema_scope) :param addresses :type addresses:LIST(1,None,'ifcaddress', scope = schema_scope) :param engagedin :type engagedin:SET(0,None,'ifcpersonandorganization', scope = schema_scope) ''' def __init__( self , id,familyname,givenname,middlenames,prefixtitles,suffixtitles,roles,addresses, ): self.id = id self.familyname = familyname self.givenname = givenname self.middlenames = middlenames self.prefixtitles = prefixtitles self.suffixtitles = suffixtitles self.roles = roles self.addresses = addresses @apply def id(): def fget( self ): return self._id def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcidentifier): self._id = ifcidentifier(value) else: self._id = value else: self._id = value return property(**locals()) @apply def familyname(): def fget( self ): return self._familyname def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._familyname = ifclabel(value) else: self._familyname = value else: self._familyname = value return property(**locals()) @apply def givenname(): def fget( self ): return self._givenname def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._givenname = ifclabel(value) else: self._givenname = value else: self._givenname = value return property(**locals()) @apply def middlenames(): def fget( self ): return self._middlenames def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,LIST(1,None,'STRING', scope = schema_scope)): self._middlenames = LIST(value) else: self._middlenames = value else: self._middlenames = value return property(**locals()) @apply def prefixtitles(): def fget( self ): return self._prefixtitles def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,LIST(1,None,'STRING', scope = schema_scope)): self._prefixtitles = LIST(value) else: self._prefixtitles = value else: self._prefixtitles = value return property(**locals()) @apply def suffixtitles(): def fget( self ): return self._suffixtitles def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,LIST(1,None,'STRING', scope = schema_scope)): self._suffixtitles = LIST(value) else: self._suffixtitles = value else: self._suffixtitles = value return property(**locals()) @apply def roles(): def fget( self ): return self._roles def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,LIST(1,None,'ifcactorrole', scope = schema_scope)): self._roles = LIST(value) else: self._roles = value else: self._roles = value return property(**locals()) @apply def addresses(): def fget( self ): return self._addresses def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,LIST(1,None,'ifcaddress', scope = schema_scope)): self._addresses = LIST(value) else: self._addresses = value else: self._addresses = value return property(**locals()) @apply def engagedin(): def fget( self ): return self._engagedin def fset( self, value ): # INVERSE argument raise AssertionError('Argument engagedin is INVERSE. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (EXISTS(self.familyname) or EXISTS(self.givenname)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcairterminaltype # #################### class ifcairterminaltype(ifcflowterminaltype): '''Entity ifcairterminaltype definition. :param predefinedtype :type predefinedtype:ifcairterminaltypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowterminaltype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcairterminaltypeenum): self._predefinedtype = ifcairterminaltypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcairterminaltypeenum.self.userdefined) or ((self.predefinedtype == ifcairterminaltypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcfacebound # #################### class ifcfacebound(ifctopologicalrepresentationitem): '''Entity ifcfacebound definition. :param bound :type bound:ifcloop :param orientation :type orientation:BOOLEAN ''' def __init__( self , bound,orientation, ): ifctopologicalrepresentationitem.__init__(self , ) self.bound = bound self.orientation = orientation @apply def bound(): def fget( self ): return self._bound def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument bound is mantatory and can not be set to None') if not check_type(value,ifcloop): self._bound = ifcloop(value) else: self._bound = value return property(**locals()) @apply def orientation(): def fget( self ): return self._orientation def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument orientation is mantatory and can not be set to None') if not check_type(value,BOOLEAN): self._orientation = BOOLEAN(value) else: self._orientation = value return property(**locals()) #################### # ENTITY ifcclassificationnotation # #################### class ifcclassificationnotation(BaseEntityClass): '''Entity ifcclassificationnotation definition. :param notationfacets :type notationfacets:SET(1,None,'ifcclassificationnotationfacet', scope = schema_scope) ''' def __init__( self , notationfacets, ): self.notationfacets = notationfacets @apply def notationfacets(): def fget( self ): return self._notationfacets def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument notationfacets is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcclassificationnotationfacet', scope = schema_scope)): self._notationfacets = SET(value) else: self._notationfacets = value return property(**locals()) #################### # ENTITY ifcsurfacestylelighting # #################### class ifcsurfacestylelighting(BaseEntityClass): '''Entity ifcsurfacestylelighting definition. :param diffusetransmissioncolour :type diffusetransmissioncolour:ifccolourrgb :param diffusereflectioncolour :type diffusereflectioncolour:ifccolourrgb :param transmissioncolour :type transmissioncolour:ifccolourrgb :param reflectancecolour :type reflectancecolour:ifccolourrgb ''' def __init__( self , diffusetransmissioncolour,diffusereflectioncolour,transmissioncolour,reflectancecolour, ): self.diffusetransmissioncolour = diffusetransmissioncolour self.diffusereflectioncolour = diffusereflectioncolour self.transmissioncolour = transmissioncolour self.reflectancecolour = reflectancecolour @apply def diffusetransmissioncolour(): def fget( self ): return self._diffusetransmissioncolour def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument diffusetransmissioncolour is mantatory and can not be set to None') if not check_type(value,ifccolourrgb): self._diffusetransmissioncolour = ifccolourrgb(value) else: self._diffusetransmissioncolour = value return property(**locals()) @apply def diffusereflectioncolour(): def fget( self ): return self._diffusereflectioncolour def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument diffusereflectioncolour is mantatory and can not be set to None') if not check_type(value,ifccolourrgb): self._diffusereflectioncolour = ifccolourrgb(value) else: self._diffusereflectioncolour = value return property(**locals()) @apply def transmissioncolour(): def fget( self ): return self._transmissioncolour def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument transmissioncolour is mantatory and can not be set to None') if not check_type(value,ifccolourrgb): self._transmissioncolour = ifccolourrgb(value) else: self._transmissioncolour = value return property(**locals()) @apply def reflectancecolour(): def fget( self ): return self._reflectancecolour def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument reflectancecolour is mantatory and can not be set to None') if not check_type(value,ifccolourrgb): self._reflectancecolour = ifccolourrgb(value) else: self._reflectancecolour = value return property(**locals()) #################### # ENTITY ifctendon # #################### class ifctendon(ifcreinforcingelement): '''Entity ifctendon definition. :param predefinedtype :type predefinedtype:ifctendontypeenum :param nominaldiameter :type nominaldiameter:ifcpositivelengthmeasure :param crosssectionarea :type crosssectionarea:ifcareameasure :param tensionforce :type tensionforce:ifcforcemeasure :param prestress :type prestress:ifcpressuremeasure :param frictioncoefficient :type frictioncoefficient:ifcnormalisedratiomeasure :param anchorageslip :type anchorageslip:ifcpositivelengthmeasure :param mincurvatureradius :type mincurvatureradius:ifcpositivelengthmeasure ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , inherited8__steelgrade , predefinedtype,nominaldiameter,crosssectionarea,tensionforce,prestress,frictioncoefficient,anchorageslip,mincurvatureradius, ): ifcreinforcingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , inherited8__steelgrade , ) self.predefinedtype = predefinedtype self.nominaldiameter = nominaldiameter self.crosssectionarea = crosssectionarea self.tensionforce = tensionforce self.prestress = prestress self.frictioncoefficient = frictioncoefficient self.anchorageslip = anchorageslip self.mincurvatureradius = mincurvatureradius @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifctendontypeenum): self._predefinedtype = ifctendontypeenum(value) else: self._predefinedtype = value return property(**locals()) @apply def nominaldiameter(): def fget( self ): return self._nominaldiameter def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument nominaldiameter is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._nominaldiameter = ifcpositivelengthmeasure(value) else: self._nominaldiameter = value return property(**locals()) @apply def crosssectionarea(): def fget( self ): return self._crosssectionarea def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument crosssectionarea is mantatory and can not be set to None') if not check_type(value,ifcareameasure): self._crosssectionarea = ifcareameasure(value) else: self._crosssectionarea = value return property(**locals()) @apply def tensionforce(): def fget( self ): return self._tensionforce def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcforcemeasure): self._tensionforce = ifcforcemeasure(value) else: self._tensionforce = value else: self._tensionforce = value return property(**locals()) @apply def prestress(): def fget( self ): return self._prestress def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpressuremeasure): self._prestress = ifcpressuremeasure(value) else: self._prestress = value else: self._prestress = value return property(**locals()) @apply def frictioncoefficient(): def fget( self ): return self._frictioncoefficient def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcnormalisedratiomeasure): self._frictioncoefficient = ifcnormalisedratiomeasure(value) else: self._frictioncoefficient = value else: self._frictioncoefficient = value return property(**locals()) @apply def anchorageslip(): def fget( self ): return self._anchorageslip def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._anchorageslip = ifcpositivelengthmeasure(value) else: self._anchorageslip = value else: self._anchorageslip = value return property(**locals()) @apply def mincurvatureradius(): def fget( self ): return self._mincurvatureradius def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._mincurvatureradius = ifcpositivelengthmeasure(value) else: self._mincurvatureradius = value else: self._mincurvatureradius = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifctendontypeenum.self.userdefined) or ((self.predefinedtype == ifctendontypeenum.self.userdefined) and EXISTS(self.self.ifcobject.self.objecttype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcownerhistory # #################### class ifcownerhistory(BaseEntityClass): '''Entity ifcownerhistory definition. :param owninguser :type owninguser:ifcpersonandorganization :param owningapplication :type owningapplication:ifcapplication :param state :type state:ifcstateenum :param changeaction :type changeaction:ifcchangeactionenum :param lastmodifieddate :type lastmodifieddate:ifctimestamp :param lastmodifyinguser :type lastmodifyinguser:ifcpersonandorganization :param lastmodifyingapplication :type lastmodifyingapplication:ifcapplication :param creationdate :type creationdate:ifctimestamp ''' def __init__( self , owninguser,owningapplication,state,changeaction,lastmodifieddate,lastmodifyinguser,lastmodifyingapplication,creationdate, ): self.owninguser = owninguser self.owningapplication = owningapplication self.state = state self.changeaction = changeaction self.lastmodifieddate = lastmodifieddate self.lastmodifyinguser = lastmodifyinguser self.lastmodifyingapplication = lastmodifyingapplication self.creationdate = creationdate @apply def owninguser(): def fget( self ): return self._owninguser def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument owninguser is mantatory and can not be set to None') if not check_type(value,ifcpersonandorganization): self._owninguser = ifcpersonandorganization(value) else: self._owninguser = value return property(**locals()) @apply def owningapplication(): def fget( self ): return self._owningapplication def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument owningapplication is mantatory and can not be set to None') if not check_type(value,ifcapplication): self._owningapplication = ifcapplication(value) else: self._owningapplication = value return property(**locals()) @apply def state(): def fget( self ): return self._state def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcstateenum): self._state = ifcstateenum(value) else: self._state = value else: self._state = value return property(**locals()) @apply def changeaction(): def fget( self ): return self._changeaction def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument changeaction is mantatory and can not be set to None') if not check_type(value,ifcchangeactionenum): self._changeaction = ifcchangeactionenum(value) else: self._changeaction = value return property(**locals()) @apply def lastmodifieddate(): def fget( self ): return self._lastmodifieddate def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctimestamp): self._lastmodifieddate = ifctimestamp(value) else: self._lastmodifieddate = value else: self._lastmodifieddate = value return property(**locals()) @apply def lastmodifyinguser(): def fget( self ): return self._lastmodifyinguser def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpersonandorganization): self._lastmodifyinguser = ifcpersonandorganization(value) else: self._lastmodifyinguser = value else: self._lastmodifyinguser = value return property(**locals()) @apply def lastmodifyingapplication(): def fget( self ): return self._lastmodifyingapplication def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcapplication): self._lastmodifyingapplication = ifcapplication(value) else: self._lastmodifyingapplication = value else: self._lastmodifyingapplication = value return property(**locals()) @apply def creationdate(): def fget( self ): return self._creationdate def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument creationdate is mantatory and can not be set to None') if not check_type(value,ifctimestamp): self._creationdate = ifctimestamp(value) else: self._creationdate = value return property(**locals()) #################### # ENTITY ifcservicelife # #################### class ifcservicelife(ifccontrol): '''Entity ifcservicelife definition. :param servicelifetype :type servicelifetype:ifcservicelifetypeenum :param servicelifeduration :type servicelifeduration:ifctimemeasure ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , servicelifetype,servicelifeduration, ): ifccontrol.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.servicelifetype = servicelifetype self.servicelifeduration = servicelifeduration @apply def servicelifetype(): def fget( self ): return self._servicelifetype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument servicelifetype is mantatory and can not be set to None') if not check_type(value,ifcservicelifetypeenum): self._servicelifetype = ifcservicelifetypeenum(value) else: self._servicelifetype = value return property(**locals()) @apply def servicelifeduration(): def fget( self ): return self._servicelifeduration def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument servicelifeduration is mantatory and can not be set to None') if not check_type(value,ifctimemeasure): self._servicelifeduration = ifctimemeasure(value) else: self._servicelifeduration = value return property(**locals()) #################### # ENTITY ifcsurfacestylewithtextures # #################### class ifcsurfacestylewithtextures(BaseEntityClass): '''Entity ifcsurfacestylewithtextures definition. :param textures :type textures:LIST(1,None,'ifcsurfacetexture', scope = schema_scope) ''' def __init__( self , textures, ): self.textures = textures @apply def textures(): def fget( self ): return self._textures def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument textures is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcsurfacetexture', scope = schema_scope)): self._textures = LIST(value) else: self._textures = value return property(**locals()) #################### # ENTITY ifcproject # #################### class ifcproject(ifcobject): '''Entity ifcproject definition. :param longname :type longname:ifclabel :param phase :type phase:ifclabel :param representationcontexts :type representationcontexts:SET(1,None,'ifcrepresentationcontext', scope = schema_scope) :param unitsincontext :type unitsincontext:ifcunitassignment ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , longname,phase,representationcontexts,unitsincontext, ): ifcobject.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.longname = longname self.phase = phase self.representationcontexts = representationcontexts self.unitsincontext = unitsincontext @apply def longname(): def fget( self ): return self._longname def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._longname = ifclabel(value) else: self._longname = value else: self._longname = value return property(**locals()) @apply def phase(): def fget( self ): return self._phase def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._phase = ifclabel(value) else: self._phase = value else: self._phase = value return property(**locals()) @apply def representationcontexts(): def fget( self ): return self._representationcontexts def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument representationcontexts is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcrepresentationcontext', scope = schema_scope)): self._representationcontexts = SET(value) else: self._representationcontexts = value return property(**locals()) @apply def unitsincontext(): def fget( self ): return self._unitsincontext def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument unitsincontext is mantatory and can not be set to None') if not check_type(value,ifcunitassignment): self._unitsincontext = ifcunitassignment(value) else: self._unitsincontext = value return property(**locals()) def wr31(self): eval_wr31_wr = EXISTS(self.self.ifcroot.self.name) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr def wr32(self): eval_wr32_wr = (SIZEOF(None) == 0) if not eval_wr32_wr: raise AssertionError('Rule wr32 violated') else: return eval_wr32_wr def wr33(self): eval_wr33_wr = (SIZEOF(self.self.ifcobjectdefinition.self.decomposes) == 0) if not eval_wr33_wr: raise AssertionError('Rule wr33 violated') else: return eval_wr33_wr #################### # ENTITY ifcflowstoragedevicetype # #################### class ifcflowstoragedevicetype(ifcdistributionflowelementtype): '''Entity ifcflowstoragedevicetype definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ): ifcdistributionflowelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) #################### # ENTITY ifcelectricflowstoragedevicetype # #################### class ifcelectricflowstoragedevicetype(ifcflowstoragedevicetype): '''Entity ifcelectricflowstoragedevicetype definition. :param predefinedtype :type predefinedtype:ifcelectricflowstoragedevicetypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowstoragedevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcelectricflowstoragedevicetypeenum): self._predefinedtype = ifcelectricflowstoragedevicetypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcplane # #################### class ifcplane(ifcelementarysurface): '''Entity ifcplane definition. ''' def __init__( self , inherited0__position , ): ifcelementarysurface.__init__(self , inherited0__position , ) #################### # ENTITY ifccolourspecification # #################### class ifccolourspecification(BaseEntityClass): '''Entity ifccolourspecification definition. :param name :type name:ifclabel ''' def __init__( self , name, ): self.name = name @apply def name(): def fget( self ): return self._name def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value else: self._name = value return property(**locals()) #################### # ENTITY ifccolourrgb # #################### class ifccolourrgb(ifccolourspecification): '''Entity ifccolourrgb definition. :param red :type red:ifcnormalisedratiomeasure :param green :type green:ifcnormalisedratiomeasure :param blue :type blue:ifcnormalisedratiomeasure ''' def __init__( self , inherited0__name , red,green,blue, ): ifccolourspecification.__init__(self , inherited0__name , ) self.red = red self.green = green self.blue = blue @apply def red(): def fget( self ): return self._red def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument red is mantatory and can not be set to None') if not check_type(value,ifcnormalisedratiomeasure): self._red = ifcnormalisedratiomeasure(value) else: self._red = value return property(**locals()) @apply def green(): def fget( self ): return self._green def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument green is mantatory and can not be set to None') if not check_type(value,ifcnormalisedratiomeasure): self._green = ifcnormalisedratiomeasure(value) else: self._green = value return property(**locals()) @apply def blue(): def fget( self ): return self._blue def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument blue is mantatory and can not be set to None') if not check_type(value,ifcnormalisedratiomeasure): self._blue = ifcnormalisedratiomeasure(value) else: self._blue = value return property(**locals()) #################### # ENTITY ifcfluidflowproperties # #################### class ifcfluidflowproperties(ifcpropertysetdefinition): '''Entity ifcfluidflowproperties definition. :param propertysource :type propertysource:ifcpropertysourceenum :param flowconditiontimeseries :type flowconditiontimeseries:ifctimeseries :param velocitytimeseries :type velocitytimeseries:ifctimeseries :param flowratetimeseries :type flowratetimeseries:ifctimeseries :param fluid :type fluid:ifcmaterial :param pressuretimeseries :type pressuretimeseries:ifctimeseries :param userdefinedpropertysource :type userdefinedpropertysource:ifclabel :param temperaturesinglevalue :type temperaturesinglevalue:ifcthermodynamictemperaturemeasure :param wetbulbtemperaturesinglevalue :type wetbulbtemperaturesinglevalue:ifcthermodynamictemperaturemeasure :param wetbulbtemperaturetimeseries :type wetbulbtemperaturetimeseries:ifctimeseries :param temperaturetimeseries :type temperaturetimeseries:ifctimeseries :param flowratesinglevalue :type flowratesinglevalue:ifcderivedmeasurevalue :param flowconditionsinglevalue :type flowconditionsinglevalue:ifcpositiveratiomeasure :param velocitysinglevalue :type velocitysinglevalue:ifclinearvelocitymeasure :param pressuresinglevalue :type pressuresinglevalue:ifcpressuremeasure ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , propertysource,flowconditiontimeseries,velocitytimeseries,flowratetimeseries,fluid,pressuretimeseries,userdefinedpropertysource,temperaturesinglevalue,wetbulbtemperaturesinglevalue,wetbulbtemperaturetimeseries,temperaturetimeseries,flowratesinglevalue,flowconditionsinglevalue,velocitysinglevalue,pressuresinglevalue, ): ifcpropertysetdefinition.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.propertysource = propertysource self.flowconditiontimeseries = flowconditiontimeseries self.velocitytimeseries = velocitytimeseries self.flowratetimeseries = flowratetimeseries self.fluid = fluid self.pressuretimeseries = pressuretimeseries self.userdefinedpropertysource = userdefinedpropertysource self.temperaturesinglevalue = temperaturesinglevalue self.wetbulbtemperaturesinglevalue = wetbulbtemperaturesinglevalue self.wetbulbtemperaturetimeseries = wetbulbtemperaturetimeseries self.temperaturetimeseries = temperaturetimeseries self.flowratesinglevalue = flowratesinglevalue self.flowconditionsinglevalue = flowconditionsinglevalue self.velocitysinglevalue = velocitysinglevalue self.pressuresinglevalue = pressuresinglevalue @apply def propertysource(): def fget( self ): return self._propertysource def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument propertysource is mantatory and can not be set to None') if not check_type(value,ifcpropertysourceenum): self._propertysource = ifcpropertysourceenum(value) else: self._propertysource = value return property(**locals()) @apply def flowconditiontimeseries(): def fget( self ): return self._flowconditiontimeseries def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctimeseries): self._flowconditiontimeseries = ifctimeseries(value) else: self._flowconditiontimeseries = value else: self._flowconditiontimeseries = value return property(**locals()) @apply def velocitytimeseries(): def fget( self ): return self._velocitytimeseries def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctimeseries): self._velocitytimeseries = ifctimeseries(value) else: self._velocitytimeseries = value else: self._velocitytimeseries = value return property(**locals()) @apply def flowratetimeseries(): def fget( self ): return self._flowratetimeseries def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctimeseries): self._flowratetimeseries = ifctimeseries(value) else: self._flowratetimeseries = value else: self._flowratetimeseries = value return property(**locals()) @apply def fluid(): def fget( self ): return self._fluid def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument fluid is mantatory and can not be set to None') if not check_type(value,ifcmaterial): self._fluid = ifcmaterial(value) else: self._fluid = value return property(**locals()) @apply def pressuretimeseries(): def fget( self ): return self._pressuretimeseries def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctimeseries): self._pressuretimeseries = ifctimeseries(value) else: self._pressuretimeseries = value else: self._pressuretimeseries = value return property(**locals()) @apply def userdefinedpropertysource(): def fget( self ): return self._userdefinedpropertysource def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._userdefinedpropertysource = ifclabel(value) else: self._userdefinedpropertysource = value else: self._userdefinedpropertysource = value return property(**locals()) @apply def temperaturesinglevalue(): def fget( self ): return self._temperaturesinglevalue def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcthermodynamictemperaturemeasure): self._temperaturesinglevalue = ifcthermodynamictemperaturemeasure(value) else: self._temperaturesinglevalue = value else: self._temperaturesinglevalue = value return property(**locals()) @apply def wetbulbtemperaturesinglevalue(): def fget( self ): return self._wetbulbtemperaturesinglevalue def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcthermodynamictemperaturemeasure): self._wetbulbtemperaturesinglevalue = ifcthermodynamictemperaturemeasure(value) else: self._wetbulbtemperaturesinglevalue = value else: self._wetbulbtemperaturesinglevalue = value return property(**locals()) @apply def wetbulbtemperaturetimeseries(): def fget( self ): return self._wetbulbtemperaturetimeseries def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctimeseries): self._wetbulbtemperaturetimeseries = ifctimeseries(value) else: self._wetbulbtemperaturetimeseries = value else: self._wetbulbtemperaturetimeseries = value return property(**locals()) @apply def temperaturetimeseries(): def fget( self ): return self._temperaturetimeseries def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctimeseries): self._temperaturetimeseries = ifctimeseries(value) else: self._temperaturetimeseries = value else: self._temperaturetimeseries = value return property(**locals()) @apply def flowratesinglevalue(): def fget( self ): return self._flowratesinglevalue def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcderivedmeasurevalue): self._flowratesinglevalue = ifcderivedmeasurevalue(value) else: self._flowratesinglevalue = value else: self._flowratesinglevalue = value return property(**locals()) @apply def flowconditionsinglevalue(): def fget( self ): return self._flowconditionsinglevalue def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._flowconditionsinglevalue = ifcpositiveratiomeasure(value) else: self._flowconditionsinglevalue = value else: self._flowconditionsinglevalue = value return property(**locals()) @apply def velocitysinglevalue(): def fget( self ): return self._velocitysinglevalue def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclinearvelocitymeasure): self._velocitysinglevalue = ifclinearvelocitymeasure(value) else: self._velocitysinglevalue = value else: self._velocitysinglevalue = value return property(**locals()) @apply def pressuresinglevalue(): def fget( self ): return self._pressuresinglevalue def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpressuremeasure): self._pressuresinglevalue = ifcpressuremeasure(value) else: self._pressuresinglevalue = value else: self._pressuresinglevalue = value return property(**locals()) #################### # ENTITY ifcreinforcingbar # #################### class ifcreinforcingbar(ifcreinforcingelement): '''Entity ifcreinforcingbar definition. :param nominaldiameter :type nominaldiameter:ifcpositivelengthmeasure :param crosssectionarea :type crosssectionarea:ifcareameasure :param barlength :type barlength:ifcpositivelengthmeasure :param barrole :type barrole:ifcreinforcingbarroleenum :param barsurface :type barsurface:ifcreinforcingbarsurfaceenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , inherited8__steelgrade , nominaldiameter,crosssectionarea,barlength,barrole,barsurface, ): ifcreinforcingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , inherited8__steelgrade , ) self.nominaldiameter = nominaldiameter self.crosssectionarea = crosssectionarea self.barlength = barlength self.barrole = barrole self.barsurface = barsurface @apply def nominaldiameter(): def fget( self ): return self._nominaldiameter def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument nominaldiameter is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._nominaldiameter = ifcpositivelengthmeasure(value) else: self._nominaldiameter = value return property(**locals()) @apply def crosssectionarea(): def fget( self ): return self._crosssectionarea def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument crosssectionarea is mantatory and can not be set to None') if not check_type(value,ifcareameasure): self._crosssectionarea = ifcareameasure(value) else: self._crosssectionarea = value return property(**locals()) @apply def barlength(): def fget( self ): return self._barlength def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._barlength = ifcpositivelengthmeasure(value) else: self._barlength = value else: self._barlength = value return property(**locals()) @apply def barrole(): def fget( self ): return self._barrole def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument barrole is mantatory and can not be set to None') if not check_type(value,ifcreinforcingbarroleenum): self._barrole = ifcreinforcingbarroleenum(value) else: self._barrole = value return property(**locals()) @apply def barsurface(): def fget( self ): return self._barsurface def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcreinforcingbarsurfaceenum): self._barsurface = ifcreinforcingbarsurfaceenum(value) else: self._barsurface = value else: self._barsurface = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.barrole != ifcreinforcingbarroleenum.self.userdefined) or ((self.barrole == ifcreinforcingbarroleenum.self.userdefined) and EXISTS(self.self.ifcobject.self.objecttype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcpermit # #################### class ifcpermit(ifccontrol): '''Entity ifcpermit definition. :param permitid :type permitid:ifcidentifier ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , permitid, ): ifccontrol.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.permitid = permitid @apply def permitid(): def fget( self ): return self._permitid def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument permitid is mantatory and can not be set to None') if not check_type(value,ifcidentifier): self._permitid = ifcidentifier(value) else: self._permitid = value return property(**locals()) #################### # ENTITY ifcreferencesvaluedocument # #################### class ifcreferencesvaluedocument(BaseEntityClass): '''Entity ifcreferencesvaluedocument definition. :param referenceddocument :type referenceddocument:ifcdocumentselect :param referencingvalues :type referencingvalues:SET(1,None,'ifcappliedvalue', scope = schema_scope) :param name :type name:ifclabel :param description :type description:ifctext ''' def __init__( self , referenceddocument,referencingvalues,name,description, ): self.referenceddocument = referenceddocument self.referencingvalues = referencingvalues self.name = name self.description = description @apply def referenceddocument(): def fget( self ): return self._referenceddocument def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument referenceddocument is mantatory and can not be set to None') if not check_type(value,ifcdocumentselect): self._referenceddocument = ifcdocumentselect(value) else: self._referenceddocument = value return property(**locals()) @apply def referencingvalues(): def fget( self ): return self._referencingvalues def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument referencingvalues is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcappliedvalue', scope = schema_scope)): self._referencingvalues = SET(value) else: self._referencingvalues = value return property(**locals()) @apply def name(): def fget( self ): return self._name def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value else: self._name = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) #################### # ENTITY ifcsurfacestyleshading # #################### class ifcsurfacestyleshading(BaseEntityClass): '''Entity ifcsurfacestyleshading definition. :param surfacecolour :type surfacecolour:ifccolourrgb ''' def __init__( self , surfacecolour, ): self.surfacecolour = surfacecolour @apply def surfacecolour(): def fget( self ): return self._surfacecolour def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument surfacecolour is mantatory and can not be set to None') if not check_type(value,ifccolourrgb): self._surfacecolour = ifccolourrgb(value) else: self._surfacecolour = value return property(**locals()) #################### # ENTITY ifcsurfacestylerendering # #################### class ifcsurfacestylerendering(ifcsurfacestyleshading): '''Entity ifcsurfacestylerendering definition. :param transparency :type transparency:ifcnormalisedratiomeasure :param diffusecolour :type diffusecolour:ifccolourorfactor :param transmissioncolour :type transmissioncolour:ifccolourorfactor :param diffusetransmissioncolour :type diffusetransmissioncolour:ifccolourorfactor :param reflectioncolour :type reflectioncolour:ifccolourorfactor :param specularcolour :type specularcolour:ifccolourorfactor :param specularhighlight :type specularhighlight:ifcspecularhighlightselect :param reflectancemethod :type reflectancemethod:ifcreflectancemethodenum ''' def __init__( self , inherited0__surfacecolour , transparency,diffusecolour,transmissioncolour,diffusetransmissioncolour,reflectioncolour,specularcolour,specularhighlight,reflectancemethod, ): ifcsurfacestyleshading.__init__(self , inherited0__surfacecolour , ) self.transparency = transparency self.diffusecolour = diffusecolour self.transmissioncolour = transmissioncolour self.diffusetransmissioncolour = diffusetransmissioncolour self.reflectioncolour = reflectioncolour self.specularcolour = specularcolour self.specularhighlight = specularhighlight self.reflectancemethod = reflectancemethod @apply def transparency(): def fget( self ): return self._transparency def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcnormalisedratiomeasure): self._transparency = ifcnormalisedratiomeasure(value) else: self._transparency = value else: self._transparency = value return property(**locals()) @apply def diffusecolour(): def fget( self ): return self._diffusecolour def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccolourorfactor): self._diffusecolour = ifccolourorfactor(value) else: self._diffusecolour = value else: self._diffusecolour = value return property(**locals()) @apply def transmissioncolour(): def fget( self ): return self._transmissioncolour def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccolourorfactor): self._transmissioncolour = ifccolourorfactor(value) else: self._transmissioncolour = value else: self._transmissioncolour = value return property(**locals()) @apply def diffusetransmissioncolour(): def fget( self ): return self._diffusetransmissioncolour def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccolourorfactor): self._diffusetransmissioncolour = ifccolourorfactor(value) else: self._diffusetransmissioncolour = value else: self._diffusetransmissioncolour = value return property(**locals()) @apply def reflectioncolour(): def fget( self ): return self._reflectioncolour def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccolourorfactor): self._reflectioncolour = ifccolourorfactor(value) else: self._reflectioncolour = value else: self._reflectioncolour = value return property(**locals()) @apply def specularcolour(): def fget( self ): return self._specularcolour def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccolourorfactor): self._specularcolour = ifccolourorfactor(value) else: self._specularcolour = value else: self._specularcolour = value return property(**locals()) @apply def specularhighlight(): def fget( self ): return self._specularhighlight def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcspecularhighlightselect): self._specularhighlight = ifcspecularhighlightselect(value) else: self._specularhighlight = value else: self._specularhighlight = value return property(**locals()) @apply def reflectancemethod(): def fget( self ): return self._reflectancemethod def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument reflectancemethod is mantatory and can not be set to None') if not check_type(value,ifcreflectancemethodenum): self._reflectancemethod = ifcreflectancemethodenum(value) else: self._reflectancemethod = value return property(**locals()) #################### # ENTITY ifcelectrictimecontroltype # #################### class ifcelectrictimecontroltype(ifcflowcontrollertype): '''Entity ifcelectrictimecontroltype definition. :param predefinedtype :type predefinedtype:ifcelectrictimecontroltypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowcontrollertype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcelectrictimecontroltypeenum): self._predefinedtype = ifcelectrictimecontroltypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcstackterminaltype # #################### class ifcstackterminaltype(ifcflowterminaltype): '''Entity ifcstackterminaltype definition. :param predefinedtype :type predefinedtype:ifcstackterminaltypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowterminaltype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcstackterminaltypeenum): self._predefinedtype = ifcstackterminaltypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcstructuralplanaraction # #################### class ifcstructuralplanaraction(ifcstructuralaction): '''Entity ifcstructuralplanaraction definition. :param projectedortrue :type projectedortrue:ifcprojectedortruelengthenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedload , inherited8__globalorlocal , inherited9__destabilizingload , inherited10__causedby , projectedortrue, ): ifcstructuralaction.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedload , inherited8__globalorlocal , inherited9__destabilizingload , inherited10__causedby , ) self.projectedortrue = projectedortrue @apply def projectedortrue(): def fget( self ): return self._projectedortrue def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument projectedortrue is mantatory and can not be set to None') if not check_type(value,ifcprojectedortruelengthenum): self._projectedortrue = ifcprojectedortruelengthenum(value) else: self._projectedortrue = value return property(**locals()) def wr61(self): eval_wr61_wr = (SIZEOF(['IFC2X3.IFCSTRUCTURALLOADPLANARFORCE','IFC2X3.IFCSTRUCTURALLOADTEMPERATURE'] * TYPEOF(self.self.ifcstructuralactivity.self.appliedload)) == 1) if not eval_wr61_wr: raise AssertionError('Rule wr61 violated') else: return eval_wr61_wr #################### # ENTITY ifcstructuralplanaractionvarying # #################### class ifcstructuralplanaractionvarying(ifcstructuralplanaraction): '''Entity ifcstructuralplanaractionvarying definition. :param varyingappliedloadlocation :type varyingappliedloadlocation:ifcshapeaspect :param subsequentappliedloads :type subsequentappliedloads:LIST(2,None,'ifcstructuralload', scope = schema_scope) :param varyingappliedloads :type varyingappliedloads:LIST(3,None,'ifcstructuralload', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedload , inherited8__globalorlocal , inherited9__destabilizingload , inherited10__causedby , inherited11__projectedortrue , varyingappliedloadlocation,subsequentappliedloads, ): ifcstructuralplanaraction.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedload , inherited8__globalorlocal , inherited9__destabilizingload , inherited10__causedby , inherited11__projectedortrue , ) self.varyingappliedloadlocation = varyingappliedloadlocation self.subsequentappliedloads = subsequentappliedloads @apply def varyingappliedloadlocation(): def fget( self ): return self._varyingappliedloadlocation def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument varyingappliedloadlocation is mantatory and can not be set to None') if not check_type(value,ifcshapeaspect): self._varyingappliedloadlocation = ifcshapeaspect(value) else: self._varyingappliedloadlocation = value return property(**locals()) @apply def subsequentappliedloads(): def fget( self ): return self._subsequentappliedloads def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument subsequentappliedloads is mantatory and can not be set to None') if not check_type(value,LIST(2,None,'ifcstructuralload', scope = schema_scope)): self._subsequentappliedloads = LIST(value) else: self._subsequentappliedloads = value return property(**locals()) @apply def varyingappliedloads(): def fget( self ): attribute_eval = ifcaddtobeginoflist(self.self.ifcstructuralactivity.self.appliedload,self.subsequentappliedloads) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument varyingappliedloads is DERIVED. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcport # #################### class ifcport(ifcproduct): '''Entity ifcport definition. :param containedin :type containedin:ifcrelconnectsporttoelement :param connectedfrom :type connectedfrom:SET(0,1,'ifcrelconnectsports', scope = schema_scope) :param connectedto :type connectedto:SET(0,1,'ifcrelconnectsports', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , ): ifcproduct.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , ) @apply def containedin(): def fget( self ): return self._containedin def fset( self, value ): # INVERSE argument raise AssertionError('Argument containedin is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def connectedfrom(): def fget( self ): return self._connectedfrom def fset( self, value ): # INVERSE argument raise AssertionError('Argument connectedfrom is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def connectedto(): def fget( self ): return self._connectedto def fset( self, value ): # INVERSE argument raise AssertionError('Argument connectedto is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcchillertype # #################### class ifcchillertype(ifcenergyconversiondevicetype): '''Entity ifcchillertype definition. :param predefinedtype :type predefinedtype:ifcchillertypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcenergyconversiondevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcchillertypeenum): self._predefinedtype = ifcchillertypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcchillertypeenum.self.userdefined) or ((self.predefinedtype == ifcchillertypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifccooledbeamtype # #################### class ifccooledbeamtype(ifcenergyconversiondevicetype): '''Entity ifccooledbeamtype definition. :param predefinedtype :type predefinedtype:ifccooledbeamtypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcenergyconversiondevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifccooledbeamtypeenum): self._predefinedtype = ifccooledbeamtypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifccooledbeamtypeenum.self.userdefined) or ((self.predefinedtype == ifccooledbeamtypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifccranerailfshapeprofiledef # #################### class ifccranerailfshapeprofiledef(ifcparameterizedprofiledef): '''Entity ifccranerailfshapeprofiledef definition. :param overallheight :type overallheight:ifcpositivelengthmeasure :param headwidth :type headwidth:ifcpositivelengthmeasure :param radius :type radius:ifcpositivelengthmeasure :param headdepth2 :type headdepth2:ifcpositivelengthmeasure :param headdepth3 :type headdepth3:ifcpositivelengthmeasure :param webthickness :type webthickness:ifcpositivelengthmeasure :param basedepth1 :type basedepth1:ifcpositivelengthmeasure :param basedepth2 :type basedepth2:ifcpositivelengthmeasure :param centreofgravityiny :type centreofgravityiny:ifcpositivelengthmeasure ''' def __init__( self , inherited0__profiletype , inherited1__profilename , inherited2__position , overallheight,headwidth,radius,headdepth2,headdepth3,webthickness,basedepth1,basedepth2,centreofgravityiny, ): ifcparameterizedprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , inherited2__position , ) self.overallheight = overallheight self.headwidth = headwidth self.radius = radius self.headdepth2 = headdepth2 self.headdepth3 = headdepth3 self.webthickness = webthickness self.basedepth1 = basedepth1 self.basedepth2 = basedepth2 self.centreofgravityiny = centreofgravityiny @apply def overallheight(): def fget( self ): return self._overallheight def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument overallheight is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._overallheight = ifcpositivelengthmeasure(value) else: self._overallheight = value return property(**locals()) @apply def headwidth(): def fget( self ): return self._headwidth def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument headwidth is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._headwidth = ifcpositivelengthmeasure(value) else: self._headwidth = value return property(**locals()) @apply def radius(): def fget( self ): return self._radius def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._radius = ifcpositivelengthmeasure(value) else: self._radius = value else: self._radius = value return property(**locals()) @apply def headdepth2(): def fget( self ): return self._headdepth2 def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument headdepth2 is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._headdepth2 = ifcpositivelengthmeasure(value) else: self._headdepth2 = value return property(**locals()) @apply def headdepth3(): def fget( self ): return self._headdepth3 def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument headdepth3 is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._headdepth3 = ifcpositivelengthmeasure(value) else: self._headdepth3 = value return property(**locals()) @apply def webthickness(): def fget( self ): return self._webthickness def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument webthickness is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._webthickness = ifcpositivelengthmeasure(value) else: self._webthickness = value return property(**locals()) @apply def basedepth1(): def fget( self ): return self._basedepth1 def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument basedepth1 is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._basedepth1 = ifcpositivelengthmeasure(value) else: self._basedepth1 = value return property(**locals()) @apply def basedepth2(): def fget( self ): return self._basedepth2 def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument basedepth2 is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._basedepth2 = ifcpositivelengthmeasure(value) else: self._basedepth2 = value return property(**locals()) @apply def centreofgravityiny(): def fget( self ): return self._centreofgravityiny def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._centreofgravityiny = ifcpositivelengthmeasure(value) else: self._centreofgravityiny = value else: self._centreofgravityiny = value return property(**locals()) #################### # ENTITY ifcpersonandorganization # #################### class ifcpersonandorganization(BaseEntityClass): '''Entity ifcpersonandorganization definition. :param theperson :type theperson:ifcperson :param theorganization :type theorganization:ifcorganization :param roles :type roles:LIST(1,None,'ifcactorrole', scope = schema_scope) ''' def __init__( self , theperson,theorganization,roles, ): self.theperson = theperson self.theorganization = theorganization self.roles = roles @apply def theperson(): def fget( self ): return self._theperson def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument theperson is mantatory and can not be set to None') if not check_type(value,ifcperson): self._theperson = ifcperson(value) else: self._theperson = value return property(**locals()) @apply def theorganization(): def fget( self ): return self._theorganization def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument theorganization is mantatory and can not be set to None') if not check_type(value,ifcorganization): self._theorganization = ifcorganization(value) else: self._theorganization = value return property(**locals()) @apply def roles(): def fget( self ): return self._roles def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,LIST(1,None,'ifcactorrole', scope = schema_scope)): self._roles = LIST(value) else: self._roles = value else: self._roles = value return property(**locals()) #################### # ENTITY ifcpostaladdress # #################### class ifcpostaladdress(ifcaddress): '''Entity ifcpostaladdress definition. :param internallocation :type internallocation:ifclabel :param addresslines :type addresslines:LIST(1,None,'STRING', scope = schema_scope) :param postalbox :type postalbox:ifclabel :param town :type town:ifclabel :param region :type region:ifclabel :param postalcode :type postalcode:ifclabel :param country :type country:ifclabel ''' def __init__( self , inherited0__purpose , inherited1__description , inherited2__userdefinedpurpose , internallocation,addresslines,postalbox,town,region,postalcode,country, ): ifcaddress.__init__(self , inherited0__purpose , inherited1__description , inherited2__userdefinedpurpose , ) self.internallocation = internallocation self.addresslines = addresslines self.postalbox = postalbox self.town = town self.region = region self.postalcode = postalcode self.country = country @apply def internallocation(): def fget( self ): return self._internallocation def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._internallocation = ifclabel(value) else: self._internallocation = value else: self._internallocation = value return property(**locals()) @apply def addresslines(): def fget( self ): return self._addresslines def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,LIST(1,None,'STRING', scope = schema_scope)): self._addresslines = LIST(value) else: self._addresslines = value else: self._addresslines = value return property(**locals()) @apply def postalbox(): def fget( self ): return self._postalbox def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._postalbox = ifclabel(value) else: self._postalbox = value else: self._postalbox = value return property(**locals()) @apply def town(): def fget( self ): return self._town def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._town = ifclabel(value) else: self._town = value else: self._town = value return property(**locals()) @apply def region(): def fget( self ): return self._region def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._region = ifclabel(value) else: self._region = value else: self._region = value return property(**locals()) @apply def postalcode(): def fget( self ): return self._postalcode def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._postalcode = ifclabel(value) else: self._postalcode = value else: self._postalcode = value return property(**locals()) @apply def country(): def fget( self ): return self._country def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._country = ifclabel(value) else: self._country = value else: self._country = value return property(**locals()) def wr1(self): eval_wr1_wr = ((((((EXISTS(self.internallocation) or EXISTS(self.addresslines)) or EXISTS(self.postalbox)) or EXISTS(self.postalcode)) or EXISTS(self.town)) or EXISTS(self.region)) or EXISTS(self.country)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifccondition # #################### class ifccondition(ifcgroup): '''Entity ifccondition definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ): ifcgroup.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) #################### # ENTITY ifcmappeditem # #################### class ifcmappeditem(ifcrepresentationitem): '''Entity ifcmappeditem definition. :param mappingsource :type mappingsource:ifcrepresentationmap :param mappingtarget :type mappingtarget:ifccartesiantransformationoperator ''' def __init__( self , mappingsource,mappingtarget, ): ifcrepresentationitem.__init__(self , ) self.mappingsource = mappingsource self.mappingtarget = mappingtarget @apply def mappingsource(): def fget( self ): return self._mappingsource def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument mappingsource is mantatory and can not be set to None') if not check_type(value,ifcrepresentationmap): self._mappingsource = ifcrepresentationmap(value) else: self._mappingsource = value return property(**locals()) @apply def mappingtarget(): def fget( self ): return self._mappingtarget def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument mappingtarget is mantatory and can not be set to None') if not check_type(value,ifccartesiantransformationoperator): self._mappingtarget = ifccartesiantransformationoperator(value) else: self._mappingtarget = value return property(**locals()) #################### # ENTITY ifcmove # #################### class ifcmove(ifctask): '''Entity ifcmove definition. :param movefrom :type movefrom:ifcspatialstructureelement :param moveto :type moveto:ifcspatialstructureelement :param punchlist :type punchlist:LIST(1,None,'STRING', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__taskid , inherited6__status , inherited7__workmethod , inherited8__ismilestone , inherited9__priority , movefrom,moveto,punchlist, ): ifctask.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__taskid , inherited6__status , inherited7__workmethod , inherited8__ismilestone , inherited9__priority , ) self.movefrom = movefrom self.moveto = moveto self.punchlist = punchlist @apply def movefrom(): def fget( self ): return self._movefrom def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument movefrom is mantatory and can not be set to None') if not check_type(value,ifcspatialstructureelement): self._movefrom = ifcspatialstructureelement(value) else: self._movefrom = value return property(**locals()) @apply def moveto(): def fget( self ): return self._moveto def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument moveto is mantatory and can not be set to None') if not check_type(value,ifcspatialstructureelement): self._moveto = ifcspatialstructureelement(value) else: self._moveto = value return property(**locals()) @apply def punchlist(): def fget( self ): return self._punchlist def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,LIST(1,None,'STRING', scope = schema_scope)): self._punchlist = LIST(value) else: self._punchlist = value else: self._punchlist = value return property(**locals()) def wr1(self): eval_wr1_wr = (SIZEOF(self.self.ifcprocess.self.operateson) >= 1) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (SIZEOF(None) >= 1) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr def wr3(self): eval_wr3_wr = EXISTS(self.self.ifcroot.self.name) if not eval_wr3_wr: raise AssertionError('Rule wr3 violated') else: return eval_wr3_wr #################### # ENTITY ifcoutlettype # #################### class ifcoutlettype(ifcflowterminaltype): '''Entity ifcoutlettype definition. :param predefinedtype :type predefinedtype:ifcoutlettypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowterminaltype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcoutlettypeenum): self._predefinedtype = ifcoutlettypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcconstraintclassificationrelationship # #################### class ifcconstraintclassificationrelationship(BaseEntityClass): '''Entity ifcconstraintclassificationrelationship definition. :param classifiedconstraint :type classifiedconstraint:ifcconstraint :param relatedclassifications :type relatedclassifications:SET(1,None,'ifcclassificationnotationselect', scope = schema_scope) ''' def __init__( self , classifiedconstraint,relatedclassifications, ): self.classifiedconstraint = classifiedconstraint self.relatedclassifications = relatedclassifications @apply def classifiedconstraint(): def fget( self ): return self._classifiedconstraint def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument classifiedconstraint is mantatory and can not be set to None') if not check_type(value,ifcconstraint): self._classifiedconstraint = ifcconstraint(value) else: self._classifiedconstraint = value return property(**locals()) @apply def relatedclassifications(): def fget( self ): return self._relatedclassifications def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedclassifications is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcclassificationnotationselect', scope = schema_scope)): self._relatedclassifications = SET(value) else: self._relatedclassifications = value return property(**locals()) #################### # ENTITY ifcgeneralmaterialproperties # #################### class ifcgeneralmaterialproperties(ifcmaterialproperties): '''Entity ifcgeneralmaterialproperties definition. :param molecularweight :type molecularweight:ifcmolecularweightmeasure :param porosity :type porosity:ifcnormalisedratiomeasure :param massdensity :type massdensity:ifcmassdensitymeasure ''' def __init__( self , inherited0__material , molecularweight,porosity,massdensity, ): ifcmaterialproperties.__init__(self , inherited0__material , ) self.molecularweight = molecularweight self.porosity = porosity self.massdensity = massdensity @apply def molecularweight(): def fget( self ): return self._molecularweight def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmolecularweightmeasure): self._molecularweight = ifcmolecularweightmeasure(value) else: self._molecularweight = value else: self._molecularweight = value return property(**locals()) @apply def porosity(): def fget( self ): return self._porosity def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcnormalisedratiomeasure): self._porosity = ifcnormalisedratiomeasure(value) else: self._porosity = value else: self._porosity = value return property(**locals()) @apply def massdensity(): def fget( self ): return self._massdensity def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmassdensitymeasure): self._massdensity = ifcmassdensitymeasure(value) else: self._massdensity = value else: self._massdensity = value return property(**locals()) #################### # ENTITY ifcannotationsymboloccurrence # #################### class ifcannotationsymboloccurrence(ifcannotationoccurrence): '''Entity ifcannotationsymboloccurrence definition. ''' def __init__( self , inherited0__item , inherited1__styles , inherited2__name , ): ifcannotationoccurrence.__init__(self , inherited0__item , inherited1__styles , inherited2__name , ) def wr31(self): eval_wr31_wr = (( not EXISTS(self.self.ifcstyleditem.self.item)) or ('IFC2X3.IFCDEFINEDSYMBOL' == TYPEOF(self.self.ifcstyleditem.self.item))) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifcterminatorsymbol # #################### class ifcterminatorsymbol(ifcannotationsymboloccurrence): '''Entity ifcterminatorsymbol definition. :param annotatedcurve :type annotatedcurve:ifcannotationcurveoccurrence ''' def __init__( self , inherited0__item , inherited1__styles , inherited2__name , annotatedcurve, ): ifcannotationsymboloccurrence.__init__(self , inherited0__item , inherited1__styles , inherited2__name , ) self.annotatedcurve = annotatedcurve @apply def annotatedcurve(): def fget( self ): return self._annotatedcurve def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument annotatedcurve is mantatory and can not be set to None') if not check_type(value,ifcannotationcurveoccurrence): self._annotatedcurve = ifcannotationcurveoccurrence(value) else: self._annotatedcurve = value return property(**locals()) #################### # ENTITY ifcconstraintrelationship # #################### class ifcconstraintrelationship(BaseEntityClass): '''Entity ifcconstraintrelationship definition. :param name :type name:ifclabel :param description :type description:ifctext :param relatingconstraint :type relatingconstraint:ifcconstraint :param relatedconstraints :type relatedconstraints:SET(1,None,'ifcconstraint', scope = schema_scope) ''' def __init__( self , name,description,relatingconstraint,relatedconstraints, ): self.name = name self.description = description self.relatingconstraint = relatingconstraint self.relatedconstraints = relatedconstraints @apply def name(): def fget( self ): return self._name def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value else: self._name = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) @apply def relatingconstraint(): def fget( self ): return self._relatingconstraint def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingconstraint is mantatory and can not be set to None') if not check_type(value,ifcconstraint): self._relatingconstraint = ifcconstraint(value) else: self._relatingconstraint = value return property(**locals()) @apply def relatedconstraints(): def fget( self ): return self._relatedconstraints def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedconstraints is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcconstraint', scope = schema_scope)): self._relatedconstraints = SET(value) else: self._relatedconstraints = value return property(**locals()) def wr11(self): eval_wr11_wr = (SIZEOF(None) == 0) if not eval_wr11_wr: raise AssertionError('Rule wr11 violated') else: return eval_wr11_wr #################### # ENTITY ifcpointoncurve # #################### class ifcpointoncurve(ifcpoint): '''Entity ifcpointoncurve definition. :param basiscurve :type basiscurve:ifccurve :param pointparameter :type pointparameter:ifcparametervalue :param dim :type dim:ifcdimensioncount ''' def __init__( self , basiscurve,pointparameter, ): ifcpoint.__init__(self , ) self.basiscurve = basiscurve self.pointparameter = pointparameter @apply def basiscurve(): def fget( self ): return self._basiscurve def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument basiscurve is mantatory and can not be set to None') if not check_type(value,ifccurve): self._basiscurve = ifccurve(value) else: self._basiscurve = value return property(**locals()) @apply def pointparameter(): def fget( self ): return self._pointparameter def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument pointparameter is mantatory and can not be set to None') if not check_type(value,ifcparametervalue): self._pointparameter = ifcparametervalue(value) else: self._pointparameter = value return property(**locals()) @apply def dim(): def fget( self ): attribute_eval = self.basiscurve.self.dim return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcrelsequence # #################### class ifcrelsequence(ifcrelconnects): '''Entity ifcrelsequence definition. :param relatingprocess :type relatingprocess:ifcprocess :param relatedprocess :type relatedprocess:ifcprocess :param timelag :type timelag:ifctimemeasure :param sequencetype :type sequencetype:ifcsequenceenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , relatingprocess,relatedprocess,timelag,sequencetype, ): ifcrelconnects.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.relatingprocess = relatingprocess self.relatedprocess = relatedprocess self.timelag = timelag self.sequencetype = sequencetype @apply def relatingprocess(): def fget( self ): return self._relatingprocess def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingprocess is mantatory and can not be set to None') if not check_type(value,ifcprocess): self._relatingprocess = ifcprocess(value) else: self._relatingprocess = value return property(**locals()) @apply def relatedprocess(): def fget( self ): return self._relatedprocess def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedprocess is mantatory and can not be set to None') if not check_type(value,ifcprocess): self._relatedprocess = ifcprocess(value) else: self._relatedprocess = value return property(**locals()) @apply def timelag(): def fget( self ): return self._timelag def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument timelag is mantatory and can not be set to None') if not check_type(value,ifctimemeasure): self._timelag = ifctimemeasure(value) else: self._timelag = value return property(**locals()) @apply def sequencetype(): def fget( self ): return self._sequencetype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument sequencetype is mantatory and can not be set to None') if not check_type(value,ifcsequenceenum): self._sequencetype = ifcsequenceenum(value) else: self._sequencetype = value return property(**locals()) def wr1(self): eval_wr1_wr = (self.relatingprocess != self.relatedprocess) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcfacetedbrepwithvoids # #################### class ifcfacetedbrepwithvoids(ifcmanifoldsolidbrep): '''Entity ifcfacetedbrepwithvoids definition. :param voids :type voids:SET(1,None,'ifcclosedshell', scope = schema_scope) ''' def __init__( self , inherited0__outer , voids, ): ifcmanifoldsolidbrep.__init__(self , inherited0__outer , ) self.voids = voids @apply def voids(): def fget( self ): return self._voids def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument voids is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcclosedshell', scope = schema_scope)): self._voids = SET(value) else: self._voids = value return property(**locals()) #################### # ENTITY ifcrelassignstasks # #################### class ifcrelassignstasks(ifcrelassignstocontrol): '''Entity ifcrelassignstasks definition. :param timefortask :type timefortask:ifcscheduletimecontrol ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatedobjectstype , inherited6__relatingcontrol , timefortask, ): ifcrelassignstocontrol.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatedobjectstype , inherited6__relatingcontrol , ) self.timefortask = timefortask @apply def timefortask(): def fget( self ): return self._timefortask def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcscheduletimecontrol): self._timefortask = ifcscheduletimecontrol(value) else: self._timefortask = value else: self._timefortask = value return property(**locals()) def wr1(self): eval_wr1_wr = (HIINDEX(self.self.ifcrelassigns.self.relatedobjects) == 1) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = ('IFC2X3.IFCTASK' == TYPEOF(self.self.ifcrelassigns.self.relatedobjects[1])) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr def wr3(self): eval_wr3_wr = ('IFC2X3.IFCWORKCONTROL' == TYPEOF(self.self.ifcrelassignstocontrol.self.relatingcontrol)) if not eval_wr3_wr: raise AssertionError('Rule wr3 violated') else: return eval_wr3_wr #################### # ENTITY ifccoiltype # #################### class ifccoiltype(ifcenergyconversiondevicetype): '''Entity ifccoiltype definition. :param predefinedtype :type predefinedtype:ifccoiltypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcenergyconversiondevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifccoiltypeenum): self._predefinedtype = ifccoiltypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifccoiltypeenum.self.userdefined) or ((self.predefinedtype == ifccoiltypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcfurnishingelement # #################### class ifcfurnishingelement(ifcelement): '''Entity ifcfurnishingelement definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcrelconnectsstructuralmember # #################### class ifcrelconnectsstructuralmember(ifcrelconnects): '''Entity ifcrelconnectsstructuralmember definition. :param relatingstructuralmember :type relatingstructuralmember:ifcstructuralmember :param relatedstructuralconnection :type relatedstructuralconnection:ifcstructuralconnection :param appliedcondition :type appliedcondition:ifcboundarycondition :param additionalconditions :type additionalconditions:ifcstructuralconnectioncondition :param supportedlength :type supportedlength:ifclengthmeasure :param conditioncoordinatesystem :type conditioncoordinatesystem:ifcaxis2placement3d ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , relatingstructuralmember,relatedstructuralconnection,appliedcondition,additionalconditions,supportedlength,conditioncoordinatesystem, ): ifcrelconnects.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.relatingstructuralmember = relatingstructuralmember self.relatedstructuralconnection = relatedstructuralconnection self.appliedcondition = appliedcondition self.additionalconditions = additionalconditions self.supportedlength = supportedlength self.conditioncoordinatesystem = conditioncoordinatesystem @apply def relatingstructuralmember(): def fget( self ): return self._relatingstructuralmember def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingstructuralmember is mantatory and can not be set to None') if not check_type(value,ifcstructuralmember): self._relatingstructuralmember = ifcstructuralmember(value) else: self._relatingstructuralmember = value return property(**locals()) @apply def relatedstructuralconnection(): def fget( self ): return self._relatedstructuralconnection def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedstructuralconnection is mantatory and can not be set to None') if not check_type(value,ifcstructuralconnection): self._relatedstructuralconnection = ifcstructuralconnection(value) else: self._relatedstructuralconnection = value return property(**locals()) @apply def appliedcondition(): def fget( self ): return self._appliedcondition def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcboundarycondition): self._appliedcondition = ifcboundarycondition(value) else: self._appliedcondition = value else: self._appliedcondition = value return property(**locals()) @apply def additionalconditions(): def fget( self ): return self._additionalconditions def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcstructuralconnectioncondition): self._additionalconditions = ifcstructuralconnectioncondition(value) else: self._additionalconditions = value else: self._additionalconditions = value return property(**locals()) @apply def supportedlength(): def fget( self ): return self._supportedlength def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._supportedlength = ifclengthmeasure(value) else: self._supportedlength = value else: self._supportedlength = value return property(**locals()) @apply def conditioncoordinatesystem(): def fget( self ): return self._conditioncoordinatesystem def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcaxis2placement3d): self._conditioncoordinatesystem = ifcaxis2placement3d(value) else: self._conditioncoordinatesystem = value else: self._conditioncoordinatesystem = value return property(**locals()) #################### # ENTITY ifcrelconnectswitheccentricity # #################### class ifcrelconnectswitheccentricity(ifcrelconnectsstructuralmember): '''Entity ifcrelconnectswitheccentricity definition. :param connectionconstraint :type connectionconstraint:ifcconnectiongeometry ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatingstructuralmember , inherited5__relatedstructuralconnection , inherited6__appliedcondition , inherited7__additionalconditions , inherited8__supportedlength , inherited9__conditioncoordinatesystem , connectionconstraint, ): ifcrelconnectsstructuralmember.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatingstructuralmember , inherited5__relatedstructuralconnection , inherited6__appliedcondition , inherited7__additionalconditions , inherited8__supportedlength , inherited9__conditioncoordinatesystem , ) self.connectionconstraint = connectionconstraint @apply def connectionconstraint(): def fget( self ): return self._connectionconstraint def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument connectionconstraint is mantatory and can not be set to None') if not check_type(value,ifcconnectiongeometry): self._connectionconstraint = ifcconnectiongeometry(value) else: self._connectionconstraint = value return property(**locals()) #################### # ENTITY ifcrelfillselement # #################### class ifcrelfillselement(ifcrelconnects): '''Entity ifcrelfillselement definition. :param relatingopeningelement :type relatingopeningelement:ifcopeningelement :param relatedbuildingelement :type relatedbuildingelement:ifcelement ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , relatingopeningelement,relatedbuildingelement, ): ifcrelconnects.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.relatingopeningelement = relatingopeningelement self.relatedbuildingelement = relatedbuildingelement @apply def relatingopeningelement(): def fget( self ): return self._relatingopeningelement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingopeningelement is mantatory and can not be set to None') if not check_type(value,ifcopeningelement): self._relatingopeningelement = ifcopeningelement(value) else: self._relatingopeningelement = value return property(**locals()) @apply def relatedbuildingelement(): def fget( self ): return self._relatedbuildingelement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedbuildingelement is mantatory and can not be set to None') if not check_type(value,ifcelement): self._relatedbuildingelement = ifcelement(value) else: self._relatedbuildingelement = value return property(**locals()) #################### # ENTITY ifcrepresentationmap # #################### class ifcrepresentationmap(BaseEntityClass): '''Entity ifcrepresentationmap definition. :param mappingorigin :type mappingorigin:ifcaxis2placement :param mappedrepresentation :type mappedrepresentation:ifcrepresentation :param mapusage :type mapusage:SET(0,None,'ifcmappeditem', scope = schema_scope) ''' def __init__( self , mappingorigin,mappedrepresentation, ): self.mappingorigin = mappingorigin self.mappedrepresentation = mappedrepresentation @apply def mappingorigin(): def fget( self ): return self._mappingorigin def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument mappingorigin is mantatory and can not be set to None') if not check_type(value,ifcaxis2placement): self._mappingorigin = ifcaxis2placement(value) else: self._mappingorigin = value return property(**locals()) @apply def mappedrepresentation(): def fget( self ): return self._mappedrepresentation def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument mappedrepresentation is mantatory and can not be set to None') if not check_type(value,ifcrepresentation): self._mappedrepresentation = ifcrepresentation(value) else: self._mappedrepresentation = value return property(**locals()) @apply def mapusage(): def fget( self ): return self._mapusage def fset( self, value ): # INVERSE argument raise AssertionError('Argument mapusage is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcstructurallinearaction # #################### class ifcstructurallinearaction(ifcstructuralaction): '''Entity ifcstructurallinearaction definition. :param projectedortrue :type projectedortrue:ifcprojectedortruelengthenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedload , inherited8__globalorlocal , inherited9__destabilizingload , inherited10__causedby , projectedortrue, ): ifcstructuralaction.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedload , inherited8__globalorlocal , inherited9__destabilizingload , inherited10__causedby , ) self.projectedortrue = projectedortrue @apply def projectedortrue(): def fget( self ): return self._projectedortrue def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument projectedortrue is mantatory and can not be set to None') if not check_type(value,ifcprojectedortruelengthenum): self._projectedortrue = ifcprojectedortruelengthenum(value) else: self._projectedortrue = value return property(**locals()) def wr61(self): eval_wr61_wr = (SIZEOF(['IFC2X3.IFCSTRUCTURALLOADLINEARFORCE','IFC2X3.IFCSTRUCTURALLOADTEMPERATURE'] * TYPEOF(self.self.ifcstructuralactivity.self.appliedload)) == 1) if not eval_wr61_wr: raise AssertionError('Rule wr61 violated') else: return eval_wr61_wr #################### # ENTITY ifcstructurallinearactionvarying # #################### class ifcstructurallinearactionvarying(ifcstructurallinearaction): '''Entity ifcstructurallinearactionvarying definition. :param varyingappliedloadlocation :type varyingappliedloadlocation:ifcshapeaspect :param subsequentappliedloads :type subsequentappliedloads:LIST(1,None,'ifcstructuralload', scope = schema_scope) :param varyingappliedloads :type varyingappliedloads:LIST(2,None,'ifcstructuralload', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedload , inherited8__globalorlocal , inherited9__destabilizingload , inherited10__causedby , inherited11__projectedortrue , varyingappliedloadlocation,subsequentappliedloads, ): ifcstructurallinearaction.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedload , inherited8__globalorlocal , inherited9__destabilizingload , inherited10__causedby , inherited11__projectedortrue , ) self.varyingappliedloadlocation = varyingappliedloadlocation self.subsequentappliedloads = subsequentappliedloads @apply def varyingappliedloadlocation(): def fget( self ): return self._varyingappliedloadlocation def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument varyingappliedloadlocation is mantatory and can not be set to None') if not check_type(value,ifcshapeaspect): self._varyingappliedloadlocation = ifcshapeaspect(value) else: self._varyingappliedloadlocation = value return property(**locals()) @apply def subsequentappliedloads(): def fget( self ): return self._subsequentappliedloads def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument subsequentappliedloads is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcstructuralload', scope = schema_scope)): self._subsequentappliedloads = LIST(value) else: self._subsequentappliedloads = value return property(**locals()) @apply def varyingappliedloads(): def fget( self ): attribute_eval = ifcaddtobeginoflist(self.self.ifcstructuralactivity.self.appliedload,self.subsequentappliedloads) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument varyingappliedloads is DERIVED. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcflowcontroller # #################### class ifcflowcontroller(ifcdistributionflowelement): '''Entity ifcflowcontroller definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcdistributionflowelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcvirtualgridintersection # #################### class ifcvirtualgridintersection(BaseEntityClass): '''Entity ifcvirtualgridintersection definition. :param intersectingaxes :type intersectingaxes:LIST(2,2,'ifcgridaxis', scope = schema_scope) :param offsetdistances :type offsetdistances:LIST(2,3,'REAL', scope = schema_scope) ''' def __init__( self , intersectingaxes,offsetdistances, ): self.intersectingaxes = intersectingaxes self.offsetdistances = offsetdistances @apply def intersectingaxes(): def fget( self ): return self._intersectingaxes def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument intersectingaxes is mantatory and can not be set to None') if not check_type(value,LIST(2,2,'ifcgridaxis', scope = schema_scope)): self._intersectingaxes = LIST(value) else: self._intersectingaxes = value return property(**locals()) @apply def offsetdistances(): def fget( self ): return self._offsetdistances def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument offsetdistances is mantatory and can not be set to None') if not check_type(value,LIST(2,3,'REAL', scope = schema_scope)): self._offsetdistances = LIST(value) else: self._offsetdistances = value return property(**locals()) #################### # ENTITY ifclightsourceambient # #################### class ifclightsourceambient(ifclightsource): '''Entity ifclightsourceambient definition. ''' def __init__( self , inherited0__name , inherited1__lightcolour , inherited2__ambientintensity , inherited3__intensity , ): ifclightsource.__init__(self , inherited0__name , inherited1__lightcolour , inherited2__ambientintensity , inherited3__intensity , ) #################### # ENTITY ifcrelreferencedinspatialstructure # #################### class ifcrelreferencedinspatialstructure(ifcrelconnects): '''Entity ifcrelreferencedinspatialstructure definition. :param relatedelements :type relatedelements:SET(1,None,'ifcproduct', scope = schema_scope) :param relatingstructure :type relatingstructure:ifcspatialstructureelement ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , relatedelements,relatingstructure, ): ifcrelconnects.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.relatedelements = relatedelements self.relatingstructure = relatingstructure @apply def relatedelements(): def fget( self ): return self._relatedelements def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedelements is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcproduct', scope = schema_scope)): self._relatedelements = SET(value) else: self._relatedelements = value return property(**locals()) @apply def relatingstructure(): def fget( self ): return self._relatingstructure def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingstructure is mantatory and can not be set to None') if not check_type(value,ifcspatialstructureelement): self._relatingstructure = ifcspatialstructureelement(value) else: self._relatingstructure = value return property(**locals()) def wr31(self): eval_wr31_wr = (SIZEOF(None) == 0) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifccostvalue # #################### class ifccostvalue(ifcappliedvalue): '''Entity ifccostvalue definition. :param costtype :type costtype:ifclabel :param condition :type condition:ifctext ''' def __init__( self , inherited0__name , inherited1__description , inherited2__appliedvalue , inherited3__unitbasis , inherited4__applicabledate , inherited5__fixeduntildate , costtype,condition, ): ifcappliedvalue.__init__(self , inherited0__name , inherited1__description , inherited2__appliedvalue , inherited3__unitbasis , inherited4__applicabledate , inherited5__fixeduntildate , ) self.costtype = costtype self.condition = condition @apply def costtype(): def fget( self ): return self._costtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument costtype is mantatory and can not be set to None') if not check_type(value,ifclabel): self._costtype = ifclabel(value) else: self._costtype = value return property(**locals()) @apply def condition(): def fget( self ): return self._condition def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._condition = ifctext(value) else: self._condition = value else: self._condition = value return property(**locals()) #################### # ENTITY ifcflowmovingdevice # #################### class ifcflowmovingdevice(ifcdistributionflowelement): '''Entity ifcflowmovingdevice definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcdistributionflowelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifctwodirectionrepeatfactor # #################### class ifctwodirectionrepeatfactor(ifconedirectionrepeatfactor): '''Entity ifctwodirectionrepeatfactor definition. :param secondrepeatfactor :type secondrepeatfactor:ifcvector ''' def __init__( self , inherited0__repeatfactor , secondrepeatfactor, ): ifconedirectionrepeatfactor.__init__(self , inherited0__repeatfactor , ) self.secondrepeatfactor = secondrepeatfactor @apply def secondrepeatfactor(): def fget( self ): return self._secondrepeatfactor def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument secondrepeatfactor is mantatory and can not be set to None') if not check_type(value,ifcvector): self._secondrepeatfactor = ifcvector(value) else: self._secondrepeatfactor = value return property(**locals()) #################### # ENTITY ifcimagetexture # #################### class ifcimagetexture(ifcsurfacetexture): '''Entity ifcimagetexture definition. :param urlreference :type urlreference:ifcidentifier ''' def __init__( self , inherited0__repeats , inherited1__repeatt , inherited2__texturetype , inherited3__texturetransform , urlreference, ): ifcsurfacetexture.__init__(self , inherited0__repeats , inherited1__repeatt , inherited2__texturetype , inherited3__texturetransform , ) self.urlreference = urlreference @apply def urlreference(): def fget( self ): return self._urlreference def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument urlreference is mantatory and can not be set to None') if not check_type(value,ifcidentifier): self._urlreference = ifcidentifier(value) else: self._urlreference = value return property(**locals()) #################### # ENTITY ifcloop # #################### class ifcloop(ifctopologicalrepresentationitem): '''Entity ifcloop definition. ''' def __init__( self , ): ifctopologicalrepresentationitem.__init__(self , ) #################### # ENTITY ifcvertexloop # #################### class ifcvertexloop(ifcloop): '''Entity ifcvertexloop definition. :param loopvertex :type loopvertex:ifcvertex ''' def __init__( self , loopvertex, ): ifcloop.__init__(self , ) self.loopvertex = loopvertex @apply def loopvertex(): def fget( self ): return self._loopvertex def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument loopvertex is mantatory and can not be set to None') if not check_type(value,ifcvertex): self._loopvertex = ifcvertex(value) else: self._loopvertex = value return property(**locals()) #################### # ENTITY ifcarbitraryclosedprofiledef # #################### class ifcarbitraryclosedprofiledef(ifcprofiledef): '''Entity ifcarbitraryclosedprofiledef definition. :param outercurve :type outercurve:ifccurve ''' def __init__( self , inherited0__profiletype , inherited1__profilename , outercurve, ): ifcprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , ) self.outercurve = outercurve @apply def outercurve(): def fget( self ): return self._outercurve def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument outercurve is mantatory and can not be set to None') if not check_type(value,ifccurve): self._outercurve = ifccurve(value) else: self._outercurve = value return property(**locals()) def wr1(self): eval_wr1_wr = (self.outercurve.self.dim == 2) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = ( not ('IFC2X3.IFCLINE' == TYPEOF(self.outercurve))) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr def wr3(self): eval_wr3_wr = ( not ('IFC2X3.IFCOFFSETCURVE2D' == TYPEOF(self.outercurve))) if not eval_wr3_wr: raise AssertionError('Rule wr3 violated') else: return eval_wr3_wr #################### # ENTITY ifcarbitraryprofiledefwithvoids # #################### class ifcarbitraryprofiledefwithvoids(ifcarbitraryclosedprofiledef): '''Entity ifcarbitraryprofiledefwithvoids definition. :param innercurves :type innercurves:SET(1,None,'ifccurve', scope = schema_scope) ''' def __init__( self , inherited0__profiletype , inherited1__profilename , inherited2__outercurve , innercurves, ): ifcarbitraryclosedprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , inherited2__outercurve , ) self.innercurves = innercurves @apply def innercurves(): def fget( self ): return self._innercurves def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument innercurves is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifccurve', scope = schema_scope)): self._innercurves = SET(value) else: self._innercurves = value return property(**locals()) def wr1(self): eval_wr1_wr = (self.self.ifcprofiledef.self.profiletype == area) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (SIZEOF(None) == 0) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr def wr3(self): eval_wr3_wr = (SIZEOF(None) == 0) if not eval_wr3_wr: raise AssertionError('Rule wr3 violated') else: return eval_wr3_wr #################### # ENTITY ifcsanitaryterminaltype # #################### class ifcsanitaryterminaltype(ifcflowterminaltype): '''Entity ifcsanitaryterminaltype definition. :param predefinedtype :type predefinedtype:ifcsanitaryterminaltypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowterminaltype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcsanitaryterminaltypeenum): self._predefinedtype = ifcsanitaryterminaltypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcswitchingdevicetype # #################### class ifcswitchingdevicetype(ifcflowcontrollertype): '''Entity ifcswitchingdevicetype definition. :param predefinedtype :type predefinedtype:ifcswitchingdevicetypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowcontrollertype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcswitchingdevicetypeenum): self._predefinedtype = ifcswitchingdevicetypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcapproval # #################### class ifcapproval(BaseEntityClass): '''Entity ifcapproval definition. :param description :type description:ifctext :param approvaldatetime :type approvaldatetime:ifcdatetimeselect :param approvalstatus :type approvalstatus:ifclabel :param approvallevel :type approvallevel:ifclabel :param approvalqualifier :type approvalqualifier:ifctext :param name :type name:ifclabel :param identifier :type identifier:ifcidentifier :param actors :type actors:SET(0,None,'ifcapprovalactorrelationship', scope = schema_scope) :param isrelatedwith :type isrelatedwith:SET(0,None,'ifcapprovalrelationship', scope = schema_scope) :param relates :type relates:SET(0,None,'ifcapprovalrelationship', scope = schema_scope) ''' def __init__( self , description,approvaldatetime,approvalstatus,approvallevel,approvalqualifier,name,identifier, ): self.description = description self.approvaldatetime = approvaldatetime self.approvalstatus = approvalstatus self.approvallevel = approvallevel self.approvalqualifier = approvalqualifier self.name = name self.identifier = identifier @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) @apply def approvaldatetime(): def fget( self ): return self._approvaldatetime def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument approvaldatetime is mantatory and can not be set to None') if not check_type(value,ifcdatetimeselect): self._approvaldatetime = ifcdatetimeselect(value) else: self._approvaldatetime = value return property(**locals()) @apply def approvalstatus(): def fget( self ): return self._approvalstatus def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._approvalstatus = ifclabel(value) else: self._approvalstatus = value else: self._approvalstatus = value return property(**locals()) @apply def approvallevel(): def fget( self ): return self._approvallevel def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._approvallevel = ifclabel(value) else: self._approvallevel = value else: self._approvallevel = value return property(**locals()) @apply def approvalqualifier(): def fget( self ): return self._approvalqualifier def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._approvalqualifier = ifctext(value) else: self._approvalqualifier = value else: self._approvalqualifier = value return property(**locals()) @apply def name(): def fget( self ): return self._name def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument name is mantatory and can not be set to None') if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value return property(**locals()) @apply def identifier(): def fget( self ): return self._identifier def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument identifier is mantatory and can not be set to None') if not check_type(value,ifcidentifier): self._identifier = ifcidentifier(value) else: self._identifier = value return property(**locals()) @apply def actors(): def fget( self ): return self._actors def fset( self, value ): # INVERSE argument raise AssertionError('Argument actors is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def isrelatedwith(): def fget( self ): return self._isrelatedwith def fset( self, value ): # INVERSE argument raise AssertionError('Argument isrelatedwith is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def relates(): def fget( self ): return self._relates def fset( self, value ): # INVERSE argument raise AssertionError('Argument relates is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifccostschedule # #################### class ifccostschedule(ifccontrol): '''Entity ifccostschedule definition. :param submittedby :type submittedby:ifcactorselect :param preparedby :type preparedby:ifcactorselect :param submittedon :type submittedon:ifcdatetimeselect :param status :type status:ifclabel :param targetusers :type targetusers:SET(1,None,'ifcactorselect', scope = schema_scope) :param updatedate :type updatedate:ifcdatetimeselect :param id :type id:ifcidentifier :param predefinedtype :type predefinedtype:ifccostscheduletypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , submittedby,preparedby,submittedon,status,targetusers,updatedate,id,predefinedtype, ): ifccontrol.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.submittedby = submittedby self.preparedby = preparedby self.submittedon = submittedon self.status = status self.targetusers = targetusers self.updatedate = updatedate self.id = id self.predefinedtype = predefinedtype @apply def submittedby(): def fget( self ): return self._submittedby def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcactorselect): self._submittedby = ifcactorselect(value) else: self._submittedby = value else: self._submittedby = value return property(**locals()) @apply def preparedby(): def fget( self ): return self._preparedby def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcactorselect): self._preparedby = ifcactorselect(value) else: self._preparedby = value else: self._preparedby = value return property(**locals()) @apply def submittedon(): def fget( self ): return self._submittedon def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdatetimeselect): self._submittedon = ifcdatetimeselect(value) else: self._submittedon = value else: self._submittedon = value return property(**locals()) @apply def status(): def fget( self ): return self._status def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._status = ifclabel(value) else: self._status = value else: self._status = value return property(**locals()) @apply def targetusers(): def fget( self ): return self._targetusers def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,SET(1,None,'ifcactorselect', scope = schema_scope)): self._targetusers = SET(value) else: self._targetusers = value else: self._targetusers = value return property(**locals()) @apply def updatedate(): def fget( self ): return self._updatedate def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdatetimeselect): self._updatedate = ifcdatetimeselect(value) else: self._updatedate = value else: self._updatedate = value return property(**locals()) @apply def id(): def fget( self ): return self._id def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument id is mantatory and can not be set to None') if not check_type(value,ifcidentifier): self._id = ifcidentifier(value) else: self._id = value return property(**locals()) @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifccostscheduletypeenum): self._predefinedtype = ifccostscheduletypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifclibraryreference # #################### class ifclibraryreference(ifcexternalreference): '''Entity ifclibraryreference definition. :param referenceintolibrary :type referenceintolibrary:SET(0,1,'ifclibraryinformation', scope = schema_scope) ''' def __init__( self , inherited0__location , inherited1__itemreference , inherited2__name , ): ifcexternalreference.__init__(self , inherited0__location , inherited1__itemreference , inherited2__name , ) @apply def referenceintolibrary(): def fget( self ): return self._referenceintolibrary def fset( self, value ): # INVERSE argument raise AssertionError('Argument referenceintolibrary is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcmateriallist # #################### class ifcmateriallist(BaseEntityClass): '''Entity ifcmateriallist definition. :param materials :type materials:LIST(1,None,'ifcmaterial', scope = schema_scope) ''' def __init__( self , materials, ): self.materials = materials @apply def materials(): def fget( self ): return self._materials def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument materials is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcmaterial', scope = schema_scope)): self._materials = LIST(value) else: self._materials = value return property(**locals()) #################### # ENTITY ifcplatetype # #################### class ifcplatetype(ifcbuildingelementtype): '''Entity ifcplatetype definition. :param predefinedtype :type predefinedtype:ifcplatetypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcbuildingelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcplatetypeenum): self._predefinedtype = ifcplatetypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcreldefinesbytype # #################### class ifcreldefinesbytype(ifcreldefines): '''Entity ifcreldefinesbytype definition. :param relatingtype :type relatingtype:ifctypeobject ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , relatingtype, ): ifcreldefines.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , ) self.relatingtype = relatingtype @apply def relatingtype(): def fget( self ): return self._relatingtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingtype is mantatory and can not be set to None') if not check_type(value,ifctypeobject): self._relatingtype = ifctypeobject(value) else: self._relatingtype = value return property(**locals()) #################### # ENTITY ifctable # #################### class ifctable(BaseEntityClass): '''Entity ifctable definition. :param name :type name:STRING :param rows :type rows:LIST(1,None,'ifctablerow', scope = schema_scope) :param numberofcellsinrow :type numberofcellsinrow:INTEGER :param numberofheadings :type numberofheadings:INTEGER :param numberofdatarows :type numberofdatarows:INTEGER ''' def __init__( self , name,rows, ): self.name = name self.rows = rows @apply def name(): def fget( self ): return self._name def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument name is mantatory and can not be set to None') if not check_type(value,STRING): self._name = STRING(value) else: self._name = value return property(**locals()) @apply def rows(): def fget( self ): return self._rows def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument rows is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifctablerow', scope = schema_scope)): self._rows = LIST(value) else: self._rows = value return property(**locals()) @apply def numberofcellsinrow(): def fget( self ): attribute_eval = HIINDEX(self.rows[1].self.rowcells) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument numberofcellsinrow is DERIVED. It is computed and can not be set to any value') return property(**locals()) @apply def numberofheadings(): def fget( self ): attribute_eval = SIZEOF(None) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument numberofheadings is DERIVED. It is computed and can not be set to any value') return property(**locals()) @apply def numberofdatarows(): def fget( self ): attribute_eval = SIZEOF(None) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument numberofdatarows is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (SIZEOF(None) == 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (SIZEOF(None) == 0) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr def wr3(self): eval_wr3_wr = ((0 <= self.numberofheadings) and (self.numberofheadings <= 1)) if not eval_wr3_wr: raise AssertionError('Rule wr3 violated') else: return eval_wr3_wr #################### # ENTITY ifcrailingtype # #################### class ifcrailingtype(ifcbuildingelementtype): '''Entity ifcrailingtype definition. :param predefinedtype :type predefinedtype:ifcrailingtypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcbuildingelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcrailingtypeenum): self._predefinedtype = ifcrailingtypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcfurnituretype # #################### class ifcfurnituretype(ifcfurnishingelementtype): '''Entity ifcfurnituretype definition. :param assemblyplace :type assemblyplace:ifcassemblyplaceenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , assemblyplace, ): ifcfurnishingelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.assemblyplace = assemblyplace @apply def assemblyplace(): def fget( self ): return self._assemblyplace def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument assemblyplace is mantatory and can not be set to None') if not check_type(value,ifcassemblyplaceenum): self._assemblyplace = ifcassemblyplaceenum(value) else: self._assemblyplace = value return property(**locals()) #################### # ENTITY ifcdefinedsymbol # #################### class ifcdefinedsymbol(ifcgeometricrepresentationitem): '''Entity ifcdefinedsymbol definition. :param definition :type definition:ifcdefinedsymbolselect :param target :type target:ifccartesiantransformationoperator2d ''' def __init__( self , definition,target, ): ifcgeometricrepresentationitem.__init__(self , ) self.definition = definition self.target = target @apply def definition(): def fget( self ): return self._definition def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument definition is mantatory and can not be set to None') if not check_type(value,ifcdefinedsymbolselect): self._definition = ifcdefinedsymbolselect(value) else: self._definition = value return property(**locals()) @apply def target(): def fget( self ): return self._target def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument target is mantatory and can not be set to None') if not check_type(value,ifccartesiantransformationoperator2d): self._target = ifccartesiantransformationoperator2d(value) else: self._target = value return property(**locals()) #################### # ENTITY ifcfiresuppressionterminaltype # #################### class ifcfiresuppressionterminaltype(ifcflowterminaltype): '''Entity ifcfiresuppressionterminaltype definition. :param predefinedtype :type predefinedtype:ifcfiresuppressionterminaltypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowterminaltype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcfiresuppressionterminaltypeenum): self._predefinedtype = ifcfiresuppressionterminaltypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifctendonanchor # #################### class ifctendonanchor(ifcreinforcingelement): '''Entity ifctendonanchor definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , inherited8__steelgrade , ): ifcreinforcingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , inherited8__steelgrade , ) #################### # ENTITY ifcconstructionequipmentresource # #################### class ifcconstructionequipmentresource(ifcconstructionresource): '''Entity ifcconstructionequipmentresource definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__resourceidentifier , inherited6__resourcegroup , inherited7__resourceconsumption , inherited8__basequantity , ): ifcconstructionresource.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__resourceidentifier , inherited6__resourcegroup , inherited7__resourceconsumption , inherited8__basequantity , ) #################### # ENTITY ifctexturevertex # #################### class ifctexturevertex(BaseEntityClass): '''Entity ifctexturevertex definition. :param coordinates :type coordinates:LIST(2,2,'REAL', scope = schema_scope) ''' def __init__( self , coordinates, ): self.coordinates = coordinates @apply def coordinates(): def fget( self ): return self._coordinates def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument coordinates is mantatory and can not be set to None') if not check_type(value,LIST(2,2,'REAL', scope = schema_scope)): self._coordinates = LIST(value) else: self._coordinates = value return property(**locals()) #################### # ENTITY ifcpile # #################### class ifcpile(ifcbuildingelement): '''Entity ifcpile definition. :param predefinedtype :type predefinedtype:ifcpiletypeenum :param constructiontype :type constructiontype:ifcpileconstructionenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , predefinedtype,constructiontype, ): ifcbuildingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) self.predefinedtype = predefinedtype self.constructiontype = constructiontype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcpiletypeenum): self._predefinedtype = ifcpiletypeenum(value) else: self._predefinedtype = value return property(**locals()) @apply def constructiontype(): def fget( self ): return self._constructiontype def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpileconstructionenum): self._constructiontype = ifcpileconstructionenum(value) else: self._constructiontype = value else: self._constructiontype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcpiletypeenum.self.userdefined) or ((self.predefinedtype == ifcpiletypeenum.self.userdefined) and EXISTS(self.self.ifcobject.self.objecttype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcrelassociatesappliedvalue # #################### class ifcrelassociatesappliedvalue(ifcrelassociates): '''Entity ifcrelassociatesappliedvalue definition. :param relatingappliedvalue :type relatingappliedvalue:ifcappliedvalue ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , relatingappliedvalue, ): ifcrelassociates.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , ) self.relatingappliedvalue = relatingappliedvalue @apply def relatingappliedvalue(): def fget( self ): return self._relatingappliedvalue def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingappliedvalue is mantatory and can not be set to None') if not check_type(value,ifcappliedvalue): self._relatingappliedvalue = ifcappliedvalue(value) else: self._relatingappliedvalue = value return property(**locals()) #################### # ENTITY ifcrelassociateslibrary # #################### class ifcrelassociateslibrary(ifcrelassociates): '''Entity ifcrelassociateslibrary definition. :param relatinglibrary :type relatinglibrary:ifclibraryselect ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , relatinglibrary, ): ifcrelassociates.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , ) self.relatinglibrary = relatinglibrary @apply def relatinglibrary(): def fget( self ): return self._relatinglibrary def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatinglibrary is mantatory and can not be set to None') if not check_type(value,ifclibraryselect): self._relatinglibrary = ifclibraryselect(value) else: self._relatinglibrary = value return property(**locals()) #################### # ENTITY ifcdimensioncalloutrelationship # #################### class ifcdimensioncalloutrelationship(ifcdraughtingcalloutrelationship): '''Entity ifcdimensioncalloutrelationship definition. ''' def __init__( self , inherited0__name , inherited1__description , inherited2__relatingdraughtingcallout , inherited3__relateddraughtingcallout , ): ifcdraughtingcalloutrelationship.__init__(self , inherited0__name , inherited1__description , inherited2__relatingdraughtingcallout , inherited3__relateddraughtingcallout , ) def wr11(self): eval_wr11_wr = (self.self.ifcdraughtingcalloutrelationship.self.name == ['primary','secondary']) if not eval_wr11_wr: raise AssertionError('Rule wr11 violated') else: return eval_wr11_wr def wr12(self): eval_wr12_wr = (SIZEOF(TYPEOF(self.self.ifcdraughtingcalloutrelationship.self.relatingdraughtingcallout) * ['IFC2X3.IFCANGULARDIMENSION','IFC2X3.IFCDIAMETERDIMENSION','IFC2X3.IFCLINEARDIMENSION','IFC2X3.IFCRADIUSDIMENSION']) == 1) if not eval_wr12_wr: raise AssertionError('Rule wr12 violated') else: return eval_wr12_wr def wr13(self): eval_wr13_wr = ( not ('IFC2X3.IFCDIMENSIONCURVEDIRECTEDCALLOUT' == TYPEOF(self.self.ifcdraughtingcalloutrelationship.self.relateddraughtingcallout))) if not eval_wr13_wr: raise AssertionError('Rule wr13 violated') else: return eval_wr13_wr #################### # ENTITY ifcrectanglehollowprofiledef # #################### class ifcrectanglehollowprofiledef(ifcrectangleprofiledef): '''Entity ifcrectanglehollowprofiledef definition. :param wallthickness :type wallthickness:ifcpositivelengthmeasure :param innerfilletradius :type innerfilletradius:ifcpositivelengthmeasure :param outerfilletradius :type outerfilletradius:ifcpositivelengthmeasure ''' def __init__( self , inherited0__profiletype , inherited1__profilename , inherited2__position , inherited3__xdim , inherited4__ydim , wallthickness,innerfilletradius,outerfilletradius, ): ifcrectangleprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , inherited2__position , inherited3__xdim , inherited4__ydim , ) self.wallthickness = wallthickness self.innerfilletradius = innerfilletradius self.outerfilletradius = outerfilletradius @apply def wallthickness(): def fget( self ): return self._wallthickness def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument wallthickness is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._wallthickness = ifcpositivelengthmeasure(value) else: self._wallthickness = value return property(**locals()) @apply def innerfilletradius(): def fget( self ): return self._innerfilletradius def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._innerfilletradius = ifcpositivelengthmeasure(value) else: self._innerfilletradius = value else: self._innerfilletradius = value return property(**locals()) @apply def outerfilletradius(): def fget( self ): return self._outerfilletradius def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._outerfilletradius = ifcpositivelengthmeasure(value) else: self._outerfilletradius = value else: self._outerfilletradius = value return property(**locals()) def wr31(self): eval_wr31_wr = ((self.wallthickness < (self.self.ifcrectangleprofiledef.self.xdim / 2)) and (self.wallthickness < (self.self.ifcrectangleprofiledef.self.ydim / 2))) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr def wr32(self): eval_wr32_wr = (( not EXISTS(self.outerfilletradius)) or ((self.outerfilletradius <= (self.self.ifcrectangleprofiledef.self.xdim / 2)) and (self.outerfilletradius <= (self.self.ifcrectangleprofiledef.self.ydim / 2)))) if not eval_wr32_wr: raise AssertionError('Rule wr32 violated') else: return eval_wr32_wr def wr33(self): eval_wr33_wr = (( not EXISTS(self.innerfilletradius)) or ((self.innerfilletradius <= ((self.self.ifcrectangleprofiledef.self.xdim / 2) - self.wallthickness)) and (self.innerfilletradius <= ((self.self.ifcrectangleprofiledef.self.ydim / 2) - self.wallthickness)))) if not eval_wr33_wr: raise AssertionError('Rule wr33 violated') else: return eval_wr33_wr #################### # ENTITY ifcproxy # #################### class ifcproxy(ifcproduct): '''Entity ifcproxy definition. :param proxytype :type proxytype:ifcobjecttypeenum :param tag :type tag:ifclabel ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , proxytype,tag, ): ifcproduct.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , ) self.proxytype = proxytype self.tag = tag @apply def proxytype(): def fget( self ): return self._proxytype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument proxytype is mantatory and can not be set to None') if not check_type(value,ifcobjecttypeenum): self._proxytype = ifcobjecttypeenum(value) else: self._proxytype = value return property(**locals()) @apply def tag(): def fget( self ): return self._tag def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._tag = ifclabel(value) else: self._tag = value else: self._tag = value return property(**locals()) def wr1(self): eval_wr1_wr = EXISTS(self.self.ifcroot.self.name) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcpropertyboundedvalue # #################### class ifcpropertyboundedvalue(ifcsimpleproperty): '''Entity ifcpropertyboundedvalue definition. :param upperboundvalue :type upperboundvalue:ifcvalue :param lowerboundvalue :type lowerboundvalue:ifcvalue :param unit :type unit:ifcunit ''' def __init__( self , inherited0__name , inherited1__description , upperboundvalue,lowerboundvalue,unit, ): ifcsimpleproperty.__init__(self , inherited0__name , inherited1__description , ) self.upperboundvalue = upperboundvalue self.lowerboundvalue = lowerboundvalue self.unit = unit @apply def upperboundvalue(): def fget( self ): return self._upperboundvalue def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcvalue): self._upperboundvalue = ifcvalue(value) else: self._upperboundvalue = value else: self._upperboundvalue = value return property(**locals()) @apply def lowerboundvalue(): def fget( self ): return self._lowerboundvalue def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcvalue): self._lowerboundvalue = ifcvalue(value) else: self._lowerboundvalue = value else: self._lowerboundvalue = value return property(**locals()) @apply def unit(): def fget( self ): return self._unit def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcunit): self._unit = ifcunit(value) else: self._unit = value else: self._unit = value return property(**locals()) def wr21(self): eval_wr21_wr = ((( not EXISTS(self.upperboundvalue)) or ( not EXISTS(self.lowerboundvalue))) or (TYPEOF(self.upperboundvalue) == TYPEOF(self.lowerboundvalue))) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr def wr22(self): eval_wr22_wr = (EXISTS(self.upperboundvalue) or EXISTS(self.lowerboundvalue)) if not eval_wr22_wr: raise AssertionError('Rule wr22 violated') else: return eval_wr22_wr #################### # ENTITY ifcpresentationstyleassignment # #################### class ifcpresentationstyleassignment(BaseEntityClass): '''Entity ifcpresentationstyleassignment definition. :param styles :type styles:SET(1,None,'ifcpresentationstyleselect', scope = schema_scope) ''' def __init__( self , styles, ): self.styles = styles @apply def styles(): def fget( self ): return self._styles def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument styles is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcpresentationstyleselect', scope = schema_scope)): self._styles = SET(value) else: self._styles = value return property(**locals()) #################### # ENTITY ifcspaceprogram # #################### class ifcspaceprogram(ifccontrol): '''Entity ifcspaceprogram definition. :param spaceprogramidentifier :type spaceprogramidentifier:ifcidentifier :param maxrequiredarea :type maxrequiredarea:ifcareameasure :param minrequiredarea :type minrequiredarea:ifcareameasure :param requestedlocation :type requestedlocation:ifcspatialstructureelement :param standardrequiredarea :type standardrequiredarea:ifcareameasure :param hasinteractionreqsfrom :type hasinteractionreqsfrom:SET(0,None,'ifcrelinteractionrequirements', scope = schema_scope) :param hasinteractionreqsto :type hasinteractionreqsto:SET(0,None,'ifcrelinteractionrequirements', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , spaceprogramidentifier,maxrequiredarea,minrequiredarea,requestedlocation,standardrequiredarea, ): ifccontrol.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.spaceprogramidentifier = spaceprogramidentifier self.maxrequiredarea = maxrequiredarea self.minrequiredarea = minrequiredarea self.requestedlocation = requestedlocation self.standardrequiredarea = standardrequiredarea @apply def spaceprogramidentifier(): def fget( self ): return self._spaceprogramidentifier def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument spaceprogramidentifier is mantatory and can not be set to None') if not check_type(value,ifcidentifier): self._spaceprogramidentifier = ifcidentifier(value) else: self._spaceprogramidentifier = value return property(**locals()) @apply def maxrequiredarea(): def fget( self ): return self._maxrequiredarea def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcareameasure): self._maxrequiredarea = ifcareameasure(value) else: self._maxrequiredarea = value else: self._maxrequiredarea = value return property(**locals()) @apply def minrequiredarea(): def fget( self ): return self._minrequiredarea def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcareameasure): self._minrequiredarea = ifcareameasure(value) else: self._minrequiredarea = value else: self._minrequiredarea = value return property(**locals()) @apply def requestedlocation(): def fget( self ): return self._requestedlocation def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcspatialstructureelement): self._requestedlocation = ifcspatialstructureelement(value) else: self._requestedlocation = value else: self._requestedlocation = value return property(**locals()) @apply def standardrequiredarea(): def fget( self ): return self._standardrequiredarea def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument standardrequiredarea is mantatory and can not be set to None') if not check_type(value,ifcareameasure): self._standardrequiredarea = ifcareameasure(value) else: self._standardrequiredarea = value return property(**locals()) @apply def hasinteractionreqsfrom(): def fget( self ): return self._hasinteractionreqsfrom def fset( self, value ): # INVERSE argument raise AssertionError('Argument hasinteractionreqsfrom is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def hasinteractionreqsto(): def fget( self ): return self._hasinteractionreqsto def fset( self, value ): # INVERSE argument raise AssertionError('Argument hasinteractionreqsto is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcsite # #################### class ifcsite(ifcspatialstructureelement): '''Entity ifcsite definition. :param reflatitude :type reflatitude:LIST(3,4,'INTEGER', scope = schema_scope) :param reflongitude :type reflongitude:LIST(3,4,'INTEGER', scope = schema_scope) :param refelevation :type refelevation:ifclengthmeasure :param landtitlenumber :type landtitlenumber:ifclabel :param siteaddress :type siteaddress:ifcpostaladdress ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__longname , inherited8__compositiontype , reflatitude,reflongitude,refelevation,landtitlenumber,siteaddress, ): ifcspatialstructureelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__longname , inherited8__compositiontype , ) self.reflatitude = reflatitude self.reflongitude = reflongitude self.refelevation = refelevation self.landtitlenumber = landtitlenumber self.siteaddress = siteaddress @apply def reflatitude(): def fget( self ): return self._reflatitude def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,LIST(3,4,'INTEGER', scope = schema_scope)): self._reflatitude = LIST(value) else: self._reflatitude = value else: self._reflatitude = value return property(**locals()) @apply def reflongitude(): def fget( self ): return self._reflongitude def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,LIST(3,4,'INTEGER', scope = schema_scope)): self._reflongitude = LIST(value) else: self._reflongitude = value else: self._reflongitude = value return property(**locals()) @apply def refelevation(): def fget( self ): return self._refelevation def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._refelevation = ifclengthmeasure(value) else: self._refelevation = value else: self._refelevation = value return property(**locals()) @apply def landtitlenumber(): def fget( self ): return self._landtitlenumber def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._landtitlenumber = ifclabel(value) else: self._landtitlenumber = value else: self._landtitlenumber = value return property(**locals()) @apply def siteaddress(): def fget( self ): return self._siteaddress def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpostaladdress): self._siteaddress = ifcpostaladdress(value) else: self._siteaddress = value else: self._siteaddress = value return property(**locals()) #################### # ENTITY ifcarbitraryopenprofiledef # #################### class ifcarbitraryopenprofiledef(ifcprofiledef): '''Entity ifcarbitraryopenprofiledef definition. :param curve :type curve:ifcboundedcurve ''' def __init__( self , inherited0__profiletype , inherited1__profilename , curve, ): ifcprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , ) self.curve = curve @apply def curve(): def fget( self ): return self._curve def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument curve is mantatory and can not be set to None') if not check_type(value,ifcboundedcurve): self._curve = ifcboundedcurve(value) else: self._curve = value return property(**locals()) def wr11(self): eval_wr11_wr = (('IFC2X3.IFCCENTERLINEPROFILEDEF' == TYPEOF(self)) or (self.self.ifcprofiledef.self.profiletype == ifcprofiletypeenum.self.curve)) if not eval_wr11_wr: raise AssertionError('Rule wr11 violated') else: return eval_wr11_wr def wr12(self): eval_wr12_wr = (self.curve.self.dim == 2) if not eval_wr12_wr: raise AssertionError('Rule wr12 violated') else: return eval_wr12_wr #################### # ENTITY ifcquantitylength # #################### class ifcquantitylength(ifcphysicalsimplequantity): '''Entity ifcquantitylength definition. :param lengthvalue :type lengthvalue:ifclengthmeasure ''' def __init__( self , inherited0__name , inherited1__description , inherited2__unit , lengthvalue, ): ifcphysicalsimplequantity.__init__(self , inherited0__name , inherited1__description , inherited2__unit , ) self.lengthvalue = lengthvalue @apply def lengthvalue(): def fget( self ): return self._lengthvalue def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument lengthvalue is mantatory and can not be set to None') if not check_type(value,ifclengthmeasure): self._lengthvalue = ifclengthmeasure(value) else: self._lengthvalue = value return property(**locals()) def wr21(self): eval_wr21_wr = (( not EXISTS(self.self.ifcphysicalsimplequantity.self.unit)) or (self.self.ifcphysicalsimplequantity.self.unit.self.unittype == ifcunitenum.self.lengthunit)) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr def wr22(self): eval_wr22_wr = (self.lengthvalue >= 0) if not eval_wr22_wr: raise AssertionError('Rule wr22 violated') else: return eval_wr22_wr #################### # ENTITY ifcsubcontractresource # #################### class ifcsubcontractresource(ifcconstructionresource): '''Entity ifcsubcontractresource definition. :param subcontractor :type subcontractor:ifcactorselect :param jobdescription :type jobdescription:ifctext ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__resourceidentifier , inherited6__resourcegroup , inherited7__resourceconsumption , inherited8__basequantity , subcontractor,jobdescription, ): ifcconstructionresource.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__resourceidentifier , inherited6__resourcegroup , inherited7__resourceconsumption , inherited8__basequantity , ) self.subcontractor = subcontractor self.jobdescription = jobdescription @apply def subcontractor(): def fget( self ): return self._subcontractor def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcactorselect): self._subcontractor = ifcactorselect(value) else: self._subcontractor = value else: self._subcontractor = value return property(**locals()) @apply def jobdescription(): def fget( self ): return self._jobdescription def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._jobdescription = ifctext(value) else: self._jobdescription = value else: self._jobdescription = value return property(**locals()) #################### # ENTITY ifcdoor # #################### class ifcdoor(ifcbuildingelement): '''Entity ifcdoor definition. :param overallheight :type overallheight:ifcpositivelengthmeasure :param overallwidth :type overallwidth:ifcpositivelengthmeasure ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , overallheight,overallwidth, ): ifcbuildingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) self.overallheight = overallheight self.overallwidth = overallwidth @apply def overallheight(): def fget( self ): return self._overallheight def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._overallheight = ifcpositivelengthmeasure(value) else: self._overallheight = value else: self._overallheight = value return property(**locals()) @apply def overallwidth(): def fget( self ): return self._overallwidth def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._overallwidth = ifcpositivelengthmeasure(value) else: self._overallwidth = value else: self._overallwidth = value return property(**locals()) #################### # ENTITY ifctimeseries # #################### class ifctimeseries(BaseEntityClass): '''Entity ifctimeseries definition. :param name :type name:ifclabel :param description :type description:ifctext :param starttime :type starttime:ifcdatetimeselect :param endtime :type endtime:ifcdatetimeselect :param timeseriesdatatype :type timeseriesdatatype:ifctimeseriesdatatypeenum :param dataorigin :type dataorigin:ifcdataoriginenum :param userdefineddataorigin :type userdefineddataorigin:ifclabel :param unit :type unit:ifcunit :param documentedby :type documentedby:SET(0,1,'ifctimeseriesreferencerelationship', scope = schema_scope) ''' def __init__( self , name,description,starttime,endtime,timeseriesdatatype,dataorigin,userdefineddataorigin,unit, ): self.name = name self.description = description self.starttime = starttime self.endtime = endtime self.timeseriesdatatype = timeseriesdatatype self.dataorigin = dataorigin self.userdefineddataorigin = userdefineddataorigin self.unit = unit @apply def name(): def fget( self ): return self._name def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument name is mantatory and can not be set to None') if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) @apply def starttime(): def fget( self ): return self._starttime def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument starttime is mantatory and can not be set to None') if not check_type(value,ifcdatetimeselect): self._starttime = ifcdatetimeselect(value) else: self._starttime = value return property(**locals()) @apply def endtime(): def fget( self ): return self._endtime def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument endtime is mantatory and can not be set to None') if not check_type(value,ifcdatetimeselect): self._endtime = ifcdatetimeselect(value) else: self._endtime = value return property(**locals()) @apply def timeseriesdatatype(): def fget( self ): return self._timeseriesdatatype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument timeseriesdatatype is mantatory and can not be set to None') if not check_type(value,ifctimeseriesdatatypeenum): self._timeseriesdatatype = ifctimeseriesdatatypeenum(value) else: self._timeseriesdatatype = value return property(**locals()) @apply def dataorigin(): def fget( self ): return self._dataorigin def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument dataorigin is mantatory and can not be set to None') if not check_type(value,ifcdataoriginenum): self._dataorigin = ifcdataoriginenum(value) else: self._dataorigin = value return property(**locals()) @apply def userdefineddataorigin(): def fget( self ): return self._userdefineddataorigin def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._userdefineddataorigin = ifclabel(value) else: self._userdefineddataorigin = value else: self._userdefineddataorigin = value return property(**locals()) @apply def unit(): def fget( self ): return self._unit def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcunit): self._unit = ifcunit(value) else: self._unit = value else: self._unit = value return property(**locals()) @apply def documentedby(): def fget( self ): return self._documentedby def fset( self, value ): # INVERSE argument raise AssertionError('Argument documentedby is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcregulartimeseries # #################### class ifcregulartimeseries(ifctimeseries): '''Entity ifcregulartimeseries definition. :param timestep :type timestep:ifctimemeasure :param values :type values:LIST(1,None,'ifctimeseriesvalue', scope = schema_scope) ''' def __init__( self , inherited0__name , inherited1__description , inherited2__starttime , inherited3__endtime , inherited4__timeseriesdatatype , inherited5__dataorigin , inherited6__userdefineddataorigin , inherited7__unit , timestep,values, ): ifctimeseries.__init__(self , inherited0__name , inherited1__description , inherited2__starttime , inherited3__endtime , inherited4__timeseriesdatatype , inherited5__dataorigin , inherited6__userdefineddataorigin , inherited7__unit , ) self.timestep = timestep self.values = values @apply def timestep(): def fget( self ): return self._timestep def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument timestep is mantatory and can not be set to None') if not check_type(value,ifctimemeasure): self._timestep = ifctimemeasure(value) else: self._timestep = value return property(**locals()) @apply def values(): def fget( self ): return self._values def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument values is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifctimeseriesvalue', scope = schema_scope)): self._values = LIST(value) else: self._values = value return property(**locals()) #################### # ENTITY ifcdimensionpair # #################### class ifcdimensionpair(ifcdraughtingcalloutrelationship): '''Entity ifcdimensionpair definition. ''' def __init__( self , inherited0__name , inherited1__description , inherited2__relatingdraughtingcallout , inherited3__relateddraughtingcallout , ): ifcdraughtingcalloutrelationship.__init__(self , inherited0__name , inherited1__description , inherited2__relatingdraughtingcallout , inherited3__relateddraughtingcallout , ) def wr11(self): eval_wr11_wr = (self.self.name == ['chained','parallel']) if not eval_wr11_wr: raise AssertionError('Rule wr11 violated') else: return eval_wr11_wr def wr12(self): eval_wr12_wr = (SIZEOF(TYPEOF(self.self.relatingdraughtingcallout) * ['IFC2X3.IFCANGULARDIMENSION','IFC2X3.IFCDIAMETERDIMENSION','IFC2X3.IFCLINEARDIMENSION','IFC2X3.IFCRADIUSDIMENSION']) == 1) if not eval_wr12_wr: raise AssertionError('Rule wr12 violated') else: return eval_wr12_wr def wr13(self): eval_wr13_wr = (SIZEOF(TYPEOF(self.self.relateddraughtingcallout) * ['IFC2X3.IFCANGULARDIMENSION','IFC2X3.IFCDIAMETERDIMENSION','IFC2X3.IFCLINEARDIMENSION','IFC2X3.IFCRADIUSDIMENSION']) == 1) if not eval_wr13_wr: raise AssertionError('Rule wr13 violated') else: return eval_wr13_wr #################### # ENTITY ifcdistributionport # #################### class ifcdistributionport(ifcport): '''Entity ifcdistributionport definition. :param flowdirection :type flowdirection:ifcflowdirectionenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , flowdirection, ): ifcport.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , ) self.flowdirection = flowdirection @apply def flowdirection(): def fget( self ): return self._flowdirection def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcflowdirectionenum): self._flowdirection = ifcflowdirectionenum(value) else: self._flowdirection = value else: self._flowdirection = value return property(**locals()) #################### # ENTITY ifcenergyproperties # #################### class ifcenergyproperties(ifcpropertysetdefinition): '''Entity ifcenergyproperties definition. :param energysequence :type energysequence:ifcenergysequenceenum :param userdefinedenergysequence :type userdefinedenergysequence:ifclabel ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , energysequence,userdefinedenergysequence, ): ifcpropertysetdefinition.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.energysequence = energysequence self.userdefinedenergysequence = userdefinedenergysequence @apply def energysequence(): def fget( self ): return self._energysequence def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcenergysequenceenum): self._energysequence = ifcenergysequenceenum(value) else: self._energysequence = value else: self._energysequence = value return property(**locals()) @apply def userdefinedenergysequence(): def fget( self ): return self._userdefinedenergysequence def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._userdefinedenergysequence = ifclabel(value) else: self._userdefinedenergysequence = value else: self._userdefinedenergysequence = value return property(**locals()) #################### # ENTITY ifcelectricalelement # #################### class ifcelectricalelement(ifcelement): '''Entity ifcelectricalelement definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifclightsourcepositional # #################### class ifclightsourcepositional(ifclightsource): '''Entity ifclightsourcepositional definition. :param position :type position:ifccartesianpoint :param radius :type radius:ifcpositivelengthmeasure :param constantattenuation :type constantattenuation:ifcreal :param distanceattenuation :type distanceattenuation:ifcreal :param quadricattenuation :type quadricattenuation:ifcreal ''' def __init__( self , inherited0__name , inherited1__lightcolour , inherited2__ambientintensity , inherited3__intensity , position,radius,constantattenuation,distanceattenuation,quadricattenuation, ): ifclightsource.__init__(self , inherited0__name , inherited1__lightcolour , inherited2__ambientintensity , inherited3__intensity , ) self.position = position self.radius = radius self.constantattenuation = constantattenuation self.distanceattenuation = distanceattenuation self.quadricattenuation = quadricattenuation @apply def position(): def fget( self ): return self._position def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument position is mantatory and can not be set to None') if not check_type(value,ifccartesianpoint): self._position = ifccartesianpoint(value) else: self._position = value return property(**locals()) @apply def radius(): def fget( self ): return self._radius def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument radius is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._radius = ifcpositivelengthmeasure(value) else: self._radius = value return property(**locals()) @apply def constantattenuation(): def fget( self ): return self._constantattenuation def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument constantattenuation is mantatory and can not be set to None') if not check_type(value,ifcreal): self._constantattenuation = ifcreal(value) else: self._constantattenuation = value return property(**locals()) @apply def distanceattenuation(): def fget( self ): return self._distanceattenuation def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument distanceattenuation is mantatory and can not be set to None') if not check_type(value,ifcreal): self._distanceattenuation = ifcreal(value) else: self._distanceattenuation = value return property(**locals()) @apply def quadricattenuation(): def fget( self ): return self._quadricattenuation def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument quadricattenuation is mantatory and can not be set to None') if not check_type(value,ifcreal): self._quadricattenuation = ifcreal(value) else: self._quadricattenuation = value return property(**locals()) #################### # ENTITY ifclightsourcedirectional # #################### class ifclightsourcedirectional(ifclightsource): '''Entity ifclightsourcedirectional definition. :param orientation :type orientation:ifcdirection ''' def __init__( self , inherited0__name , inherited1__lightcolour , inherited2__ambientintensity , inherited3__intensity , orientation, ): ifclightsource.__init__(self , inherited0__name , inherited1__lightcolour , inherited2__ambientintensity , inherited3__intensity , ) self.orientation = orientation @apply def orientation(): def fget( self ): return self._orientation def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument orientation is mantatory and can not be set to None') if not check_type(value,ifcdirection): self._orientation = ifcdirection(value) else: self._orientation = value return property(**locals()) #################### # ENTITY ifcstructuralreaction # #################### class ifcstructuralreaction(ifcstructuralactivity): '''Entity ifcstructuralreaction definition. :param causes :type causes:SET(0,None,'ifcstructuralaction', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedload , inherited8__globalorlocal , ): ifcstructuralactivity.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedload , inherited8__globalorlocal , ) @apply def causes(): def fget( self ): return self._causes def fset( self, value ): # INVERSE argument raise AssertionError('Argument causes is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcstructuralpointreaction # #################### class ifcstructuralpointreaction(ifcstructuralreaction): '''Entity ifcstructuralpointreaction definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedload , inherited8__globalorlocal , ): ifcstructuralreaction.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedload , inherited8__globalorlocal , ) def wr61(self): eval_wr61_wr = (SIZEOF(['IFC2X3.IFCSTRUCTURALLOADSINGLEFORCE','IFC2X3.IFCSTRUCTURALLOADSINGLEDISPLACEMENT'] * TYPEOF(self.self.ifcstructuralactivity.self.appliedload)) == 1) if not eval_wr61_wr: raise AssertionError('Rule wr61 violated') else: return eval_wr61_wr #################### # ENTITY ifcsoundproperties # #################### class ifcsoundproperties(ifcpropertysetdefinition): '''Entity ifcsoundproperties definition. :param isattenuating :type isattenuating:ifcboolean :param soundscale :type soundscale:ifcsoundscaleenum :param soundvalues :type soundvalues:LIST(1,8,'ifcsoundvalue', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , isattenuating,soundscale,soundvalues, ): ifcpropertysetdefinition.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.isattenuating = isattenuating self.soundscale = soundscale self.soundvalues = soundvalues @apply def isattenuating(): def fget( self ): return self._isattenuating def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument isattenuating is mantatory and can not be set to None') if not check_type(value,ifcboolean): self._isattenuating = ifcboolean(value) else: self._isattenuating = value return property(**locals()) @apply def soundscale(): def fget( self ): return self._soundscale def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcsoundscaleenum): self._soundscale = ifcsoundscaleenum(value) else: self._soundscale = value else: self._soundscale = value return property(**locals()) @apply def soundvalues(): def fget( self ): return self._soundvalues def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument soundvalues is mantatory and can not be set to None') if not check_type(value,LIST(1,8,'ifcsoundvalue', scope = schema_scope)): self._soundvalues = LIST(value) else: self._soundvalues = value return property(**locals()) #################### # ENTITY ifcfastener # #################### class ifcfastener(ifcelementcomponent): '''Entity ifcfastener definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcelementcomponent.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcorientededge # #################### class ifcorientededge(ifcedge): '''Entity ifcorientededge definition. :param edgeelement :type edgeelement:ifcedge :param orientation :type orientation:BOOLEAN :param ifcedge_edgestart :type ifcedge_edgestart:ifcvertex :param ifcedge_edgeend :type ifcedge_edgeend:ifcvertex ''' def __init__( self , inherited0__edgestart , inherited1__edgeend , edgeelement,orientation, ): ifcedge.__init__(self , inherited0__edgestart , inherited1__edgeend , ) self.edgeelement = edgeelement self.orientation = orientation @apply def edgeelement(): def fget( self ): return self._edgeelement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument edgeelement is mantatory and can not be set to None') if not check_type(value,ifcedge): self._edgeelement = ifcedge(value) else: self._edgeelement = value return property(**locals()) @apply def orientation(): def fget( self ): return self._orientation def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument orientation is mantatory and can not be set to None') if not check_type(value,BOOLEAN): self._orientation = BOOLEAN(value) else: self._orientation = value return property(**locals()) @apply def ifcedge_edgestart(): def fget( self ): attribute_eval = ifcbooleanchoose(self.orientation,self.edgeelement.self.edgestart,self.edgeelement.self.edgeend) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument ifcedge_edgestart is DERIVED. It is computed and can not be set to any value') return property(**locals()) @apply def ifcedge_edgeend(): def fget( self ): attribute_eval = ifcbooleanchoose(self.orientation,self.edgeelement.self.edgeend,self.edgeelement.self.edgestart) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument ifcedge_edgeend is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = ( not ('IFC2X3.IFCORIENTEDEDGE' == TYPEOF(self.edgeelement))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcrelassociatesconstraint # #################### class ifcrelassociatesconstraint(ifcrelassociates): '''Entity ifcrelassociatesconstraint definition. :param intent :type intent:ifclabel :param relatingconstraint :type relatingconstraint:ifcconstraint ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , intent,relatingconstraint, ): ifcrelassociates.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , ) self.intent = intent self.relatingconstraint = relatingconstraint @apply def intent(): def fget( self ): return self._intent def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument intent is mantatory and can not be set to None') if not check_type(value,ifclabel): self._intent = ifclabel(value) else: self._intent = value return property(**locals()) @apply def relatingconstraint(): def fget( self ): return self._relatingconstraint def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingconstraint is mantatory and can not be set to None') if not check_type(value,ifcconstraint): self._relatingconstraint = ifcconstraint(value) else: self._relatingconstraint = value return property(**locals()) #################### # ENTITY ifctimeseriesvalue # #################### class ifctimeseriesvalue(BaseEntityClass): '''Entity ifctimeseriesvalue definition. :param listvalues :type listvalues:LIST(1,None,'ifcvalue', scope = schema_scope) ''' def __init__( self , listvalues, ): self.listvalues = listvalues @apply def listvalues(): def fget( self ): return self._listvalues def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument listvalues is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcvalue', scope = schema_scope)): self._listvalues = LIST(value) else: self._listvalues = value return property(**locals()) #################### # ENTITY ifcbuildingelementpart # #################### class ifcbuildingelementpart(ifcbuildingelementcomponent): '''Entity ifcbuildingelementpart definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcbuildingelementcomponent.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifctimeseriesreferencerelationship # #################### class ifctimeseriesreferencerelationship(BaseEntityClass): '''Entity ifctimeseriesreferencerelationship definition. :param referencedtimeseries :type referencedtimeseries:ifctimeseries :param timeseriesreferences :type timeseriesreferences:SET(1,None,'ifcdocumentselect', scope = schema_scope) ''' def __init__( self , referencedtimeseries,timeseriesreferences, ): self.referencedtimeseries = referencedtimeseries self.timeseriesreferences = timeseriesreferences @apply def referencedtimeseries(): def fget( self ): return self._referencedtimeseries def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument referencedtimeseries is mantatory and can not be set to None') if not check_type(value,ifctimeseries): self._referencedtimeseries = ifctimeseries(value) else: self._referencedtimeseries = value return property(**locals()) @apply def timeseriesreferences(): def fget( self ): return self._timeseriesreferences def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument timeseriesreferences is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcdocumentselect', scope = schema_scope)): self._timeseriesreferences = SET(value) else: self._timeseriesreferences = value return property(**locals()) #################### # ENTITY ifcbuildingelementproxy # #################### class ifcbuildingelementproxy(ifcbuildingelement): '''Entity ifcbuildingelementproxy definition. :param compositiontype :type compositiontype:ifcelementcompositionenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , compositiontype, ): ifcbuildingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) self.compositiontype = compositiontype @apply def compositiontype(): def fget( self ): return self._compositiontype def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcelementcompositionenum): self._compositiontype = ifcelementcompositionenum(value) else: self._compositiontype = value else: self._compositiontype = value return property(**locals()) def wr1(self): eval_wr1_wr = EXISTS(self.self.ifcroot.self.name) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcdiscreteaccessorytype # #################### class ifcdiscreteaccessorytype(ifcelementcomponenttype): '''Entity ifcdiscreteaccessorytype definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ): ifcelementcomponenttype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) #################### # ENTITY ifcplate # #################### class ifcplate(ifcbuildingelement): '''Entity ifcplate definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcbuildingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcconnectedfaceset # #################### class ifcconnectedfaceset(ifctopologicalrepresentationitem): '''Entity ifcconnectedfaceset definition. :param cfsfaces :type cfsfaces:SET(1,None,'ifcface', scope = schema_scope) ''' def __init__( self , cfsfaces, ): ifctopologicalrepresentationitem.__init__(self , ) self.cfsfaces = cfsfaces @apply def cfsfaces(): def fget( self ): return self._cfsfaces def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument cfsfaces is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcface', scope = schema_scope)): self._cfsfaces = SET(value) else: self._cfsfaces = value return property(**locals()) #################### # ENTITY ifcclosedshell # #################### class ifcclosedshell(ifcconnectedfaceset): '''Entity ifcclosedshell definition. ''' def __init__( self , inherited0__cfsfaces , ): ifcconnectedfaceset.__init__(self , inherited0__cfsfaces , ) #################### # ENTITY ifcrelassociatesprofileproperties # #################### class ifcrelassociatesprofileproperties(ifcrelassociates): '''Entity ifcrelassociatesprofileproperties definition. :param relatingprofileproperties :type relatingprofileproperties:ifcprofileproperties :param profilesectionlocation :type profilesectionlocation:ifcshapeaspect :param profileorientation :type profileorientation:ifcorientationselect ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , relatingprofileproperties,profilesectionlocation,profileorientation, ): ifcrelassociates.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , ) self.relatingprofileproperties = relatingprofileproperties self.profilesectionlocation = profilesectionlocation self.profileorientation = profileorientation @apply def relatingprofileproperties(): def fget( self ): return self._relatingprofileproperties def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingprofileproperties is mantatory and can not be set to None') if not check_type(value,ifcprofileproperties): self._relatingprofileproperties = ifcprofileproperties(value) else: self._relatingprofileproperties = value return property(**locals()) @apply def profilesectionlocation(): def fget( self ): return self._profilesectionlocation def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcshapeaspect): self._profilesectionlocation = ifcshapeaspect(value) else: self._profilesectionlocation = value else: self._profilesectionlocation = value return property(**locals()) @apply def profileorientation(): def fget( self ): return self._profileorientation def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcorientationselect): self._profileorientation = ifcorientationselect(value) else: self._profileorientation = value else: self._profileorientation = value return property(**locals()) #################### # ENTITY ifcorganizationrelationship # #################### class ifcorganizationrelationship(BaseEntityClass): '''Entity ifcorganizationrelationship definition. :param name :type name:ifclabel :param description :type description:ifctext :param relatingorganization :type relatingorganization:ifcorganization :param relatedorganizations :type relatedorganizations:SET(1,None,'ifcorganization', scope = schema_scope) ''' def __init__( self , name,description,relatingorganization,relatedorganizations, ): self.name = name self.description = description self.relatingorganization = relatingorganization self.relatedorganizations = relatedorganizations @apply def name(): def fget( self ): return self._name def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument name is mantatory and can not be set to None') if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) @apply def relatingorganization(): def fget( self ): return self._relatingorganization def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingorganization is mantatory and can not be set to None') if not check_type(value,ifcorganization): self._relatingorganization = ifcorganization(value) else: self._relatingorganization = value return property(**locals()) @apply def relatedorganizations(): def fget( self ): return self._relatedorganizations def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedorganizations is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcorganization', scope = schema_scope)): self._relatedorganizations = SET(value) else: self._relatedorganizations = value return property(**locals()) #################### # ENTITY ifcsweptdisksolid # #################### class ifcsweptdisksolid(ifcsolidmodel): '''Entity ifcsweptdisksolid definition. :param directrix :type directrix:ifccurve :param radius :type radius:ifcpositivelengthmeasure :param innerradius :type innerradius:ifcpositivelengthmeasure :param startparam :type startparam:ifcparametervalue :param endparam :type endparam:ifcparametervalue ''' def __init__( self , directrix,radius,innerradius,startparam,endparam, ): ifcsolidmodel.__init__(self , ) self.directrix = directrix self.radius = radius self.innerradius = innerradius self.startparam = startparam self.endparam = endparam @apply def directrix(): def fget( self ): return self._directrix def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument directrix is mantatory and can not be set to None') if not check_type(value,ifccurve): self._directrix = ifccurve(value) else: self._directrix = value return property(**locals()) @apply def radius(): def fget( self ): return self._radius def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument radius is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._radius = ifcpositivelengthmeasure(value) else: self._radius = value return property(**locals()) @apply def innerradius(): def fget( self ): return self._innerradius def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._innerradius = ifcpositivelengthmeasure(value) else: self._innerradius = value else: self._innerradius = value return property(**locals()) @apply def startparam(): def fget( self ): return self._startparam def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument startparam is mantatory and can not be set to None') if not check_type(value,ifcparametervalue): self._startparam = ifcparametervalue(value) else: self._startparam = value return property(**locals()) @apply def endparam(): def fget( self ): return self._endparam def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument endparam is mantatory and can not be set to None') if not check_type(value,ifcparametervalue): self._endparam = ifcparametervalue(value) else: self._endparam = value return property(**locals()) def wr1(self): eval_wr1_wr = (self.directrix.self.dim == 3) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (( not EXISTS(self.innerradius)) or (self.radius > self.innerradius)) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr #################### # ENTITY ifccovering # #################### class ifccovering(ifcbuildingelement): '''Entity ifccovering definition. :param predefinedtype :type predefinedtype:ifccoveringtypeenum :param coversspaces :type coversspaces:SET(0,1,'ifcrelcoversspaces', scope = schema_scope) :param covers :type covers:SET(0,1,'ifcrelcoversbldgelements', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , predefinedtype, ): ifcbuildingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccoveringtypeenum): self._predefinedtype = ifccoveringtypeenum(value) else: self._predefinedtype = value else: self._predefinedtype = value return property(**locals()) @apply def coversspaces(): def fget( self ): return self._coversspaces def fset( self, value ): # INVERSE argument raise AssertionError('Argument coversspaces is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def covers(): def fget( self ): return self._covers def fset( self, value ): # INVERSE argument raise AssertionError('Argument covers is INVERSE. It is computed and can not be set to any value') return property(**locals()) def wr61(self): eval_wr61_wr = ((( not EXISTS(self.predefinedtype)) or (self.predefinedtype != ifccoveringtypeenum.self.userdefined)) or ((self.predefinedtype == ifccoveringtypeenum.self.userdefined) and EXISTS(self.self.ifcobject.self.objecttype))) if not eval_wr61_wr: raise AssertionError('Rule wr61 violated') else: return eval_wr61_wr #################### # ENTITY ifcquantitytime # #################### class ifcquantitytime(ifcphysicalsimplequantity): '''Entity ifcquantitytime definition. :param timevalue :type timevalue:ifctimemeasure ''' def __init__( self , inherited0__name , inherited1__description , inherited2__unit , timevalue, ): ifcphysicalsimplequantity.__init__(self , inherited0__name , inherited1__description , inherited2__unit , ) self.timevalue = timevalue @apply def timevalue(): def fget( self ): return self._timevalue def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument timevalue is mantatory and can not be set to None') if not check_type(value,ifctimemeasure): self._timevalue = ifctimemeasure(value) else: self._timevalue = value return property(**locals()) def wr21(self): eval_wr21_wr = (( not EXISTS(self.self.ifcphysicalsimplequantity.self.unit)) or (self.self.ifcphysicalsimplequantity.self.unit.self.unittype == ifcunitenum.self.timeunit)) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr def wr22(self): eval_wr22_wr = (self.timevalue >= 0) if not eval_wr22_wr: raise AssertionError('Rule wr22 violated') else: return eval_wr22_wr #################### # ENTITY ifcdocumentinformationrelationship # #################### class ifcdocumentinformationrelationship(BaseEntityClass): '''Entity ifcdocumentinformationrelationship definition. :param relatingdocument :type relatingdocument:ifcdocumentinformation :param relateddocuments :type relateddocuments:SET(1,None,'ifcdocumentinformation', scope = schema_scope) :param relationshiptype :type relationshiptype:ifclabel ''' def __init__( self , relatingdocument,relateddocuments,relationshiptype, ): self.relatingdocument = relatingdocument self.relateddocuments = relateddocuments self.relationshiptype = relationshiptype @apply def relatingdocument(): def fget( self ): return self._relatingdocument def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingdocument is mantatory and can not be set to None') if not check_type(value,ifcdocumentinformation): self._relatingdocument = ifcdocumentinformation(value) else: self._relatingdocument = value return property(**locals()) @apply def relateddocuments(): def fget( self ): return self._relateddocuments def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relateddocuments is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcdocumentinformation', scope = schema_scope)): self._relateddocuments = SET(value) else: self._relateddocuments = value return property(**locals()) @apply def relationshiptype(): def fget( self ): return self._relationshiptype def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._relationshiptype = ifclabel(value) else: self._relationshiptype = value else: self._relationshiptype = value return property(**locals()) #################### # ENTITY ifcgeometricrepresentationsubcontext # #################### class ifcgeometricrepresentationsubcontext(ifcgeometricrepresentationcontext): '''Entity ifcgeometricrepresentationsubcontext definition. :param parentcontext :type parentcontext:ifcgeometricrepresentationcontext :param targetscale :type targetscale:ifcpositiveratiomeasure :param targetview :type targetview:ifcgeometricprojectionenum :param userdefinedtargetview :type userdefinedtargetview:ifclabel :param ifcgeometricrepresentationcontext_worldcoordinatesystem :type ifcgeometricrepresentationcontext_worldcoordinatesystem:ifcaxis2placement :param ifcgeometricrepresentationcontext_coordinatespacedimension :type ifcgeometricrepresentationcontext_coordinatespacedimension:ifcdimensioncount :param ifcgeometricrepresentationcontext_truenorth :type ifcgeometricrepresentationcontext_truenorth:ifcdirection :param ifcgeometricrepresentationcontext_precision :type ifcgeometricrepresentationcontext_precision:REAL ''' def __init__( self , inherited0__contextidentifier , inherited1__contexttype , inherited2__coordinatespacedimension , inherited3__precision , inherited4__worldcoordinatesystem , inherited5__truenorth , parentcontext,targetscale,targetview,userdefinedtargetview, ): ifcgeometricrepresentationcontext.__init__(self , inherited0__contextidentifier , inherited1__contexttype , inherited2__coordinatespacedimension , inherited3__precision , inherited4__worldcoordinatesystem , inherited5__truenorth , ) self.parentcontext = parentcontext self.targetscale = targetscale self.targetview = targetview self.userdefinedtargetview = userdefinedtargetview @apply def parentcontext(): def fget( self ): return self._parentcontext def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument parentcontext is mantatory and can not be set to None') if not check_type(value,ifcgeometricrepresentationcontext): self._parentcontext = ifcgeometricrepresentationcontext(value) else: self._parentcontext = value return property(**locals()) @apply def targetscale(): def fget( self ): return self._targetscale def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._targetscale = ifcpositiveratiomeasure(value) else: self._targetscale = value else: self._targetscale = value return property(**locals()) @apply def targetview(): def fget( self ): return self._targetview def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument targetview is mantatory and can not be set to None') if not check_type(value,ifcgeometricprojectionenum): self._targetview = ifcgeometricprojectionenum(value) else: self._targetview = value return property(**locals()) @apply def userdefinedtargetview(): def fget( self ): return self._userdefinedtargetview def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._userdefinedtargetview = ifclabel(value) else: self._userdefinedtargetview = value else: self._userdefinedtargetview = value return property(**locals()) @apply def ifcgeometricrepresentationcontext_worldcoordinatesystem(): def fget( self ): attribute_eval = self.parentcontext.self.worldcoordinatesystem return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument ifcgeometricrepresentationcontext_worldcoordinatesystem is DERIVED. It is computed and can not be set to any value') return property(**locals()) @apply def ifcgeometricrepresentationcontext_coordinatespacedimension(): def fget( self ): attribute_eval = self.parentcontext.self.coordinatespacedimension return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument ifcgeometricrepresentationcontext_coordinatespacedimension is DERIVED. It is computed and can not be set to any value') return property(**locals()) @apply def ifcgeometricrepresentationcontext_truenorth(): def fget( self ): attribute_eval = NVL(self.parentcontext.self.truenorth,self.self.worldcoordinatesystem.self.p[2]) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument ifcgeometricrepresentationcontext_truenorth is DERIVED. It is computed and can not be set to any value') return property(**locals()) @apply def ifcgeometricrepresentationcontext_precision(): def fget( self ): attribute_eval = NVL(self.parentcontext.self.precision,1e-005) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument ifcgeometricrepresentationcontext_precision is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr31(self): eval_wr31_wr = ( not ('IFC2X3.IFCGEOMETRICREPRESENTATIONSUBCONTEXT' == TYPEOF(self.parentcontext))) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr def wr32(self): eval_wr32_wr = ((self.targetview != ifcgeometricprojectionenum.self.userdefined) or ((self.targetview == ifcgeometricprojectionenum.self.userdefined) and EXISTS(self.userdefinedtargetview))) if not eval_wr32_wr: raise AssertionError('Rule wr32 violated') else: return eval_wr32_wr #################### # ENTITY ifcdocumentreference # #################### class ifcdocumentreference(ifcexternalreference): '''Entity ifcdocumentreference definition. :param referencetodocument :type referencetodocument:SET(0,1,'ifcdocumentinformation', scope = schema_scope) ''' def __init__( self , inherited0__location , inherited1__itemreference , inherited2__name , ): ifcexternalreference.__init__(self , inherited0__location , inherited1__itemreference , inherited2__name , ) @apply def referencetodocument(): def fget( self ): return self._referencetodocument def fset( self, value ): # INVERSE argument raise AssertionError('Argument referencetodocument is INVERSE. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (EXISTS(self.name) XOR EXISTS(self.referencetodocument[1])) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcexternallydefinedtextfont # #################### class ifcexternallydefinedtextfont(ifcexternalreference): '''Entity ifcexternallydefinedtextfont definition. ''' def __init__( self , inherited0__location , inherited1__itemreference , inherited2__name , ): ifcexternalreference.__init__(self , inherited0__location , inherited1__itemreference , inherited2__name , ) #################### # ENTITY ifcnamedunit # #################### class ifcnamedunit(BaseEntityClass): '''Entity ifcnamedunit definition. :param dimensions :type dimensions:ifcdimensionalexponents :param unittype :type unittype:ifcunitenum ''' def __init__( self , dimensions,unittype, ): self.dimensions = dimensions self.unittype = unittype @apply def dimensions(): def fget( self ): return self._dimensions def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument dimensions is mantatory and can not be set to None') if not check_type(value,ifcdimensionalexponents): self._dimensions = ifcdimensionalexponents(value) else: self._dimensions = value return property(**locals()) @apply def unittype(): def fget( self ): return self._unittype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument unittype is mantatory and can not be set to None') if not check_type(value,ifcunitenum): self._unittype = ifcunitenum(value) else: self._unittype = value return property(**locals()) def wr1(self): eval_wr1_wr = ifccorrectdimensions(self.self.unittype,self.self.dimensions) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcconstraintaggregationrelationship # #################### class ifcconstraintaggregationrelationship(BaseEntityClass): '''Entity ifcconstraintaggregationrelationship definition. :param name :type name:ifclabel :param description :type description:ifctext :param relatingconstraint :type relatingconstraint:ifcconstraint :param relatedconstraints :type relatedconstraints:LIST(1,None,'ifcconstraint', scope = schema_scope) :param logicalaggregator :type logicalaggregator:ifclogicaloperatorenum ''' def __init__( self , name,description,relatingconstraint,relatedconstraints,logicalaggregator, ): self.name = name self.description = description self.relatingconstraint = relatingconstraint self.relatedconstraints = relatedconstraints self.logicalaggregator = logicalaggregator @apply def name(): def fget( self ): return self._name def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value else: self._name = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) @apply def relatingconstraint(): def fget( self ): return self._relatingconstraint def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingconstraint is mantatory and can not be set to None') if not check_type(value,ifcconstraint): self._relatingconstraint = ifcconstraint(value) else: self._relatingconstraint = value return property(**locals()) @apply def relatedconstraints(): def fget( self ): return self._relatedconstraints def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedconstraints is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcconstraint', scope = schema_scope)): self._relatedconstraints = LIST(value) else: self._relatedconstraints = value return property(**locals()) @apply def logicalaggregator(): def fget( self ): return self._logicalaggregator def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument logicalaggregator is mantatory and can not be set to None') if not check_type(value,ifclogicaloperatorenum): self._logicalaggregator = ifclogicaloperatorenum(value) else: self._logicalaggregator = value return property(**locals()) def wr11(self): eval_wr11_wr = (SIZEOF(None) == 0) if not eval_wr11_wr: raise AssertionError('Rule wr11 violated') else: return eval_wr11_wr #################### # ENTITY ifcrelassignstoprojectorder # #################### class ifcrelassignstoprojectorder(ifcrelassignstocontrol): '''Entity ifcrelassignstoprojectorder definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatedobjectstype , inherited6__relatingcontrol , ): ifcrelassignstocontrol.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatedobjectstype , inherited6__relatingcontrol , ) #################### # ENTITY ifcconnectioncurvegeometry # #################### class ifcconnectioncurvegeometry(ifcconnectiongeometry): '''Entity ifcconnectioncurvegeometry definition. :param curveonrelatingelement :type curveonrelatingelement:ifccurveoredgecurve :param curveonrelatedelement :type curveonrelatedelement:ifccurveoredgecurve ''' def __init__( self , curveonrelatingelement,curveonrelatedelement, ): ifcconnectiongeometry.__init__(self , ) self.curveonrelatingelement = curveonrelatingelement self.curveonrelatedelement = curveonrelatedelement @apply def curveonrelatingelement(): def fget( self ): return self._curveonrelatingelement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument curveonrelatingelement is mantatory and can not be set to None') if not check_type(value,ifccurveoredgecurve): self._curveonrelatingelement = ifccurveoredgecurve(value) else: self._curveonrelatingelement = value return property(**locals()) @apply def curveonrelatedelement(): def fget( self ): return self._curveonrelatedelement def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccurveoredgecurve): self._curveonrelatedelement = ifccurveoredgecurve(value) else: self._curveonrelatedelement = value else: self._curveonrelatedelement = value return property(**locals()) #################### # ENTITY ifcdraughtingpredefinedcolour # #################### class ifcdraughtingpredefinedcolour(ifcpredefinedcolour): '''Entity ifcdraughtingpredefinedcolour definition. ''' def __init__( self , inherited0__name , ): ifcpredefinedcolour.__init__(self , inherited0__name , ) def wr31(self): eval_wr31_wr = (self.self.ifcpredefineditem.self.name == ['black','red','green','blue','yellow','magenta','cyan','white','by layer']) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifcrelcoversspaces # #################### class ifcrelcoversspaces(ifcrelconnects): '''Entity ifcrelcoversspaces definition. :param relatedspace :type relatedspace:ifcspace :param relatedcoverings :type relatedcoverings:SET(1,None,'ifccovering', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , relatedspace,relatedcoverings, ): ifcrelconnects.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.relatedspace = relatedspace self.relatedcoverings = relatedcoverings @apply def relatedspace(): def fget( self ): return self._relatedspace def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedspace is mantatory and can not be set to None') if not check_type(value,ifcspace): self._relatedspace = ifcspace(value) else: self._relatedspace = value return property(**locals()) @apply def relatedcoverings(): def fget( self ): return self._relatedcoverings def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedcoverings is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifccovering', scope = schema_scope)): self._relatedcoverings = SET(value) else: self._relatedcoverings = value return property(**locals()) #################### # ENTITY ifcstructureddimensioncallout # #################### class ifcstructureddimensioncallout(ifcdraughtingcallout): '''Entity ifcstructureddimensioncallout definition. ''' def __init__( self , inherited0__contents , ): ifcdraughtingcallout.__init__(self , inherited0__contents , ) def wr31(self): eval_wr31_wr = (SIZEOF(None) == 0) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifclaborresource # #################### class ifclaborresource(ifcconstructionresource): '''Entity ifclaborresource definition. :param skillset :type skillset:ifctext ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__resourceidentifier , inherited6__resourcegroup , inherited7__resourceconsumption , inherited8__basequantity , skillset, ): ifcconstructionresource.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__resourceidentifier , inherited6__resourcegroup , inherited7__resourceconsumption , inherited8__basequantity , ) self.skillset = skillset @apply def skillset(): def fget( self ): return self._skillset def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._skillset = ifctext(value) else: self._skillset = value else: self._skillset = value return property(**locals()) #################### # ENTITY ifcmechanicalfastenertype # #################### class ifcmechanicalfastenertype(ifcfastenertype): '''Entity ifcmechanicalfastenertype definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ): ifcfastenertype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) #################### # ENTITY ifcquantityweight # #################### class ifcquantityweight(ifcphysicalsimplequantity): '''Entity ifcquantityweight definition. :param weightvalue :type weightvalue:ifcmassmeasure ''' def __init__( self , inherited0__name , inherited1__description , inherited2__unit , weightvalue, ): ifcphysicalsimplequantity.__init__(self , inherited0__name , inherited1__description , inherited2__unit , ) self.weightvalue = weightvalue @apply def weightvalue(): def fget( self ): return self._weightvalue def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument weightvalue is mantatory and can not be set to None') if not check_type(value,ifcmassmeasure): self._weightvalue = ifcmassmeasure(value) else: self._weightvalue = value return property(**locals()) def wr21(self): eval_wr21_wr = (( not EXISTS(self.self.ifcphysicalsimplequantity.self.unit)) or (self.self.ifcphysicalsimplequantity.self.unit.self.unittype == ifcunitenum.self.massunit)) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr def wr22(self): eval_wr22_wr = (self.weightvalue >= 0) if not eval_wr22_wr: raise AssertionError('Rule wr22 violated') else: return eval_wr22_wr #################### # ENTITY ifcstructuralloadgroup # #################### class ifcstructuralloadgroup(ifcgroup): '''Entity ifcstructuralloadgroup definition. :param predefinedtype :type predefinedtype:ifcloadgrouptypeenum :param actiontype :type actiontype:ifcactiontypeenum :param actionsource :type actionsource:ifcactionsourcetypeenum :param coefficient :type coefficient:ifcratiomeasure :param purpose :type purpose:ifclabel :param sourceofresultgroup :type sourceofresultgroup:SET(0,1,'ifcstructuralresultgroup', scope = schema_scope) :param loadgroupfor :type loadgroupfor:SET(0,None,'ifcstructuralanalysismodel', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , predefinedtype,actiontype,actionsource,coefficient,purpose, ): ifcgroup.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.predefinedtype = predefinedtype self.actiontype = actiontype self.actionsource = actionsource self.coefficient = coefficient self.purpose = purpose @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcloadgrouptypeenum): self._predefinedtype = ifcloadgrouptypeenum(value) else: self._predefinedtype = value return property(**locals()) @apply def actiontype(): def fget( self ): return self._actiontype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument actiontype is mantatory and can not be set to None') if not check_type(value,ifcactiontypeenum): self._actiontype = ifcactiontypeenum(value) else: self._actiontype = value return property(**locals()) @apply def actionsource(): def fget( self ): return self._actionsource def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument actionsource is mantatory and can not be set to None') if not check_type(value,ifcactionsourcetypeenum): self._actionsource = ifcactionsourcetypeenum(value) else: self._actionsource = value return property(**locals()) @apply def coefficient(): def fget( self ): return self._coefficient def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcratiomeasure): self._coefficient = ifcratiomeasure(value) else: self._coefficient = value else: self._coefficient = value return property(**locals()) @apply def purpose(): def fget( self ): return self._purpose def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._purpose = ifclabel(value) else: self._purpose = value else: self._purpose = value return property(**locals()) @apply def sourceofresultgroup(): def fget( self ): return self._sourceofresultgroup def fset( self, value ): # INVERSE argument raise AssertionError('Argument sourceofresultgroup is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def loadgroupfor(): def fget( self ): return self._loadgroupfor def fset( self, value ): # INVERSE argument raise AssertionError('Argument loadgroupfor is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcwalltype # #################### class ifcwalltype(ifcbuildingelementtype): '''Entity ifcwalltype definition. :param predefinedtype :type predefinedtype:ifcwalltypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcbuildingelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcwalltypeenum): self._predefinedtype = ifcwalltypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcconstructionmaterialresource # #################### class ifcconstructionmaterialresource(ifcconstructionresource): '''Entity ifcconstructionmaterialresource definition. :param suppliers :type suppliers:SET(1,None,'ifcactorselect', scope = schema_scope) :param usageratio :type usageratio:ifcratiomeasure ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__resourceidentifier , inherited6__resourcegroup , inherited7__resourceconsumption , inherited8__basequantity , suppliers,usageratio, ): ifcconstructionresource.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__resourceidentifier , inherited6__resourcegroup , inherited7__resourceconsumption , inherited8__basequantity , ) self.suppliers = suppliers self.usageratio = usageratio @apply def suppliers(): def fget( self ): return self._suppliers def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,SET(1,None,'ifcactorselect', scope = schema_scope)): self._suppliers = SET(value) else: self._suppliers = value else: self._suppliers = value return property(**locals()) @apply def usageratio(): def fget( self ): return self._usageratio def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcratiomeasure): self._usageratio = ifcratiomeasure(value) else: self._usageratio = value else: self._usageratio = value return property(**locals()) def wr1(self): eval_wr1_wr = (SIZEOF(self.self.ifcresource.self.resourceof) <= 1) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (( not EXISTS(self.self.ifcresource.self.resourceof[1])) or (self.self.ifcresource.self.resourceof[1].self.relatedobjectstype == ifcobjecttypeenum.self.product)) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr #################### # ENTITY ifcradiusdimension # #################### class ifcradiusdimension(ifcdimensioncurvedirectedcallout): '''Entity ifcradiusdimension definition. ''' def __init__( self , inherited0__contents , ): ifcdimensioncurvedirectedcallout.__init__(self , inherited0__contents , ) #################### # ENTITY ifcapprovalrelationship # #################### class ifcapprovalrelationship(BaseEntityClass): '''Entity ifcapprovalrelationship definition. :param relatedapproval :type relatedapproval:ifcapproval :param relatingapproval :type relatingapproval:ifcapproval :param description :type description:ifctext :param name :type name:ifclabel ''' def __init__( self , relatedapproval,relatingapproval,description,name, ): self.relatedapproval = relatedapproval self.relatingapproval = relatingapproval self.description = description self.name = name @apply def relatedapproval(): def fget( self ): return self._relatedapproval def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedapproval is mantatory and can not be set to None') if not check_type(value,ifcapproval): self._relatedapproval = ifcapproval(value) else: self._relatedapproval = value return property(**locals()) @apply def relatingapproval(): def fget( self ): return self._relatingapproval def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingapproval is mantatory and can not be set to None') if not check_type(value,ifcapproval): self._relatingapproval = ifcapproval(value) else: self._relatingapproval = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) @apply def name(): def fget( self ): return self._name def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument name is mantatory and can not be set to None') if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value return property(**locals()) #################### # ENTITY ifcboundingbox # #################### class ifcboundingbox(ifcgeometricrepresentationitem): '''Entity ifcboundingbox definition. :param corner :type corner:ifccartesianpoint :param xdim :type xdim:ifcpositivelengthmeasure :param ydim :type ydim:ifcpositivelengthmeasure :param zdim :type zdim:ifcpositivelengthmeasure :param dim :type dim:ifcdimensioncount ''' def __init__( self , corner,xdim,ydim,zdim, ): ifcgeometricrepresentationitem.__init__(self , ) self.corner = corner self.xdim = xdim self.ydim = ydim self.zdim = zdim @apply def corner(): def fget( self ): return self._corner def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument corner is mantatory and can not be set to None') if not check_type(value,ifccartesianpoint): self._corner = ifccartesianpoint(value) else: self._corner = value return property(**locals()) @apply def xdim(): def fget( self ): return self._xdim def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument xdim is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._xdim = ifcpositivelengthmeasure(value) else: self._xdim = value return property(**locals()) @apply def ydim(): def fget( self ): return self._ydim def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument ydim is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._ydim = ifcpositivelengthmeasure(value) else: self._ydim = value return property(**locals()) @apply def zdim(): def fget( self ): return self._zdim def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument zdim is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._zdim = ifcpositivelengthmeasure(value) else: self._zdim = value return property(**locals()) @apply def dim(): def fget( self ): attribute_eval = 3 return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifctextstylefordefinedfont # #################### class ifctextstylefordefinedfont(BaseEntityClass): '''Entity ifctextstylefordefinedfont definition. :param colour :type colour:ifccolour :param backgroundcolour :type backgroundcolour:ifccolour ''' def __init__( self , colour,backgroundcolour, ): self.colour = colour self.backgroundcolour = backgroundcolour @apply def colour(): def fget( self ): return self._colour def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument colour is mantatory and can not be set to None') if not check_type(value,ifccolour): self._colour = ifccolour(value) else: self._colour = value return property(**locals()) @apply def backgroundcolour(): def fget( self ): return self._backgroundcolour def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccolour): self._backgroundcolour = ifccolour(value) else: self._backgroundcolour = value else: self._backgroundcolour = value return property(**locals()) #################### # ENTITY ifcconstructionproductresource # #################### class ifcconstructionproductresource(ifcconstructionresource): '''Entity ifcconstructionproductresource definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__resourceidentifier , inherited6__resourcegroup , inherited7__resourceconsumption , inherited8__basequantity , ): ifcconstructionresource.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__resourceidentifier , inherited6__resourcegroup , inherited7__resourceconsumption , inherited8__basequantity , ) def wr1(self): eval_wr1_wr = (SIZEOF(self.self.ifcresource.self.resourceof) <= 1) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (( not EXISTS(self.self.ifcresource.self.resourceof[1])) or (self.self.ifcresource.self.resourceof[1].self.relatedobjectstype == ifcobjecttypeenum.self.product)) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr #################### # ENTITY ifcmonetaryunit # #################### class ifcmonetaryunit(BaseEntityClass): '''Entity ifcmonetaryunit definition. :param currency :type currency:ifccurrencyenum ''' def __init__( self , currency, ): self.currency = currency @apply def currency(): def fget( self ): return self._currency def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument currency is mantatory and can not be set to None') if not check_type(value,ifccurrencyenum): self._currency = ifccurrencyenum(value) else: self._currency = value return property(**locals()) #################### # ENTITY ifcpropertysinglevalue # #################### class ifcpropertysinglevalue(ifcsimpleproperty): '''Entity ifcpropertysinglevalue definition. :param nominalvalue :type nominalvalue:ifcvalue :param unit :type unit:ifcunit ''' def __init__( self , inherited0__name , inherited1__description , nominalvalue,unit, ): ifcsimpleproperty.__init__(self , inherited0__name , inherited1__description , ) self.nominalvalue = nominalvalue self.unit = unit @apply def nominalvalue(): def fget( self ): return self._nominalvalue def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcvalue): self._nominalvalue = ifcvalue(value) else: self._nominalvalue = value else: self._nominalvalue = value return property(**locals()) @apply def unit(): def fget( self ): return self._unit def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcunit): self._unit = ifcunit(value) else: self._unit = value else: self._unit = value return property(**locals()) #################### # ENTITY ifcrelassignstoprocess # #################### class ifcrelassignstoprocess(ifcrelassigns): '''Entity ifcrelassignstoprocess definition. :param relatingprocess :type relatingprocess:ifcprocess :param quantityinprocess :type quantityinprocess:ifcmeasurewithunit ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatedobjectstype , relatingprocess,quantityinprocess, ): ifcrelassigns.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatedobjectstype , ) self.relatingprocess = relatingprocess self.quantityinprocess = quantityinprocess @apply def relatingprocess(): def fget( self ): return self._relatingprocess def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingprocess is mantatory and can not be set to None') if not check_type(value,ifcprocess): self._relatingprocess = ifcprocess(value) else: self._relatingprocess = value return property(**locals()) @apply def quantityinprocess(): def fget( self ): return self._quantityinprocess def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmeasurewithunit): self._quantityinprocess = ifcmeasurewithunit(value) else: self._quantityinprocess = value else: self._quantityinprocess = value return property(**locals()) def wr1(self): eval_wr1_wr = (SIZEOF(None) == 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcsiunit # #################### class ifcsiunit(ifcnamedunit): '''Entity ifcsiunit definition. :param prefix :type prefix:ifcsiprefix :param name :type name:ifcsiunitname :param ifcnamedunit_dimensions :type ifcnamedunit_dimensions:ifcdimensionalexponents ''' def __init__( self , inherited0__dimensions , inherited1__unittype , prefix,name, ): ifcnamedunit.__init__(self , inherited0__dimensions , inherited1__unittype , ) self.prefix = prefix self.name = name @apply def prefix(): def fget( self ): return self._prefix def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcsiprefix): self._prefix = ifcsiprefix(value) else: self._prefix = value else: self._prefix = value return property(**locals()) @apply def name(): def fget( self ): return self._name def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument name is mantatory and can not be set to None') if not check_type(value,ifcsiunitname): self._name = ifcsiunitname(value) else: self._name = value return property(**locals()) @apply def ifcnamedunit_dimensions(): def fget( self ): attribute_eval = ifcdimensionsforsiunit(self.self.name) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument ifcnamedunit_dimensions is DERIVED. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcspaceheatertype # #################### class ifcspaceheatertype(ifcenergyconversiondevicetype): '''Entity ifcspaceheatertype definition. :param predefinedtype :type predefinedtype:ifcspaceheatertypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcenergyconversiondevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcspaceheatertypeenum): self._predefinedtype = ifcspaceheatertypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcspaceheatertypeenum.self.userdefined) or ((self.predefinedtype == ifcspaceheatertypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcdistributionchamberelementtype # #################### class ifcdistributionchamberelementtype(ifcdistributionflowelementtype): '''Entity ifcdistributionchamberelementtype definition. :param predefinedtype :type predefinedtype:ifcdistributionchamberelementtypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcdistributionflowelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcdistributionchamberelementtypeenum): self._predefinedtype = ifcdistributionchamberelementtypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcstructuralcurvemember # #################### class ifcstructuralcurvemember(ifcstructuralmember): '''Entity ifcstructuralcurvemember definition. :param predefinedtype :type predefinedtype:ifcstructuralcurvetypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , predefinedtype, ): ifcstructuralmember.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcstructuralcurvetypeenum): self._predefinedtype = ifcstructuralcurvetypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcjunctionboxtype # #################### class ifcjunctionboxtype(ifcflowfittingtype): '''Entity ifcjunctionboxtype definition. :param predefinedtype :type predefinedtype:ifcjunctionboxtypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowfittingtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcjunctionboxtypeenum): self._predefinedtype = ifcjunctionboxtypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifccontextdependentunit # #################### class ifccontextdependentunit(ifcnamedunit): '''Entity ifccontextdependentunit definition. :param name :type name:ifclabel ''' def __init__( self , inherited0__dimensions , inherited1__unittype , name, ): ifcnamedunit.__init__(self , inherited0__dimensions , inherited1__unittype , ) self.name = name @apply def name(): def fget( self ): return self._name def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument name is mantatory and can not be set to None') if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value return property(**locals()) #################### # ENTITY ifcsectionproperties # #################### class ifcsectionproperties(BaseEntityClass): '''Entity ifcsectionproperties definition. :param sectiontype :type sectiontype:ifcsectiontypeenum :param startprofile :type startprofile:ifcprofiledef :param endprofile :type endprofile:ifcprofiledef ''' def __init__( self , sectiontype,startprofile,endprofile, ): self.sectiontype = sectiontype self.startprofile = startprofile self.endprofile = endprofile @apply def sectiontype(): def fget( self ): return self._sectiontype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument sectiontype is mantatory and can not be set to None') if not check_type(value,ifcsectiontypeenum): self._sectiontype = ifcsectiontypeenum(value) else: self._sectiontype = value return property(**locals()) @apply def startprofile(): def fget( self ): return self._startprofile def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument startprofile is mantatory and can not be set to None') if not check_type(value,ifcprofiledef): self._startprofile = ifcprofiledef(value) else: self._startprofile = value return property(**locals()) @apply def endprofile(): def fget( self ): return self._endprofile def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcprofiledef): self._endprofile = ifcprofiledef(value) else: self._endprofile = value else: self._endprofile = value return property(**locals()) #################### # ENTITY ifcshaperepresentation # #################### class ifcshaperepresentation(ifcshapemodel): '''Entity ifcshaperepresentation definition. ''' def __init__( self , inherited0__contextofitems , inherited1__representationidentifier , inherited2__representationtype , inherited3__items , ): ifcshapemodel.__init__(self , inherited0__contextofitems , inherited1__representationidentifier , inherited2__representationtype , inherited3__items , ) def wr21(self): eval_wr21_wr = ('IFC2X3.IFCGEOMETRICREPRESENTATIONCONTEXT' == TYPEOF(self.self.ifcrepresentation.self.contextofitems)) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr def wr22(self): eval_wr22_wr = (SIZEOF(None) == 0) if not eval_wr22_wr: raise AssertionError('Rule wr22 violated') else: return eval_wr22_wr def wr23(self): eval_wr23_wr = EXISTS(self.self.ifcrepresentation.self.representationtype) if not eval_wr23_wr: raise AssertionError('Rule wr23 violated') else: return eval_wr23_wr def wr24(self): eval_wr24_wr = ifcshaperepresentationtypes(self.self.ifcrepresentation.self.representationtype,self.self.ifcrepresentation.self.items) if not eval_wr24_wr: raise AssertionError('Rule wr24 violated') else: return eval_wr24_wr #################### # ENTITY ifcfiltertype # #################### class ifcfiltertype(ifcflowtreatmentdevicetype): '''Entity ifcfiltertype definition. :param predefinedtype :type predefinedtype:ifcfiltertypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowtreatmentdevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcfiltertypeenum): self._predefinedtype = ifcfiltertypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcfiltertypeenum.self.userdefined) or ((self.predefinedtype == ifcfiltertypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcspace # #################### class ifcspace(ifcspatialstructureelement): '''Entity ifcspace definition. :param interiororexteriorspace :type interiororexteriorspace:ifcinternalorexternalenum :param elevationwithflooring :type elevationwithflooring:ifclengthmeasure :param hascoverings :type hascoverings:SET(0,None,'ifcrelcoversspaces', scope = schema_scope) :param boundedby :type boundedby:SET(0,None,'ifcrelspaceboundary', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__longname , inherited8__compositiontype , interiororexteriorspace,elevationwithflooring, ): ifcspatialstructureelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__longname , inherited8__compositiontype , ) self.interiororexteriorspace = interiororexteriorspace self.elevationwithflooring = elevationwithflooring @apply def interiororexteriorspace(): def fget( self ): return self._interiororexteriorspace def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument interiororexteriorspace is mantatory and can not be set to None') if not check_type(value,ifcinternalorexternalenum): self._interiororexteriorspace = ifcinternalorexternalenum(value) else: self._interiororexteriorspace = value return property(**locals()) @apply def elevationwithflooring(): def fget( self ): return self._elevationwithflooring def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._elevationwithflooring = ifclengthmeasure(value) else: self._elevationwithflooring = value else: self._elevationwithflooring = value return property(**locals()) @apply def hascoverings(): def fget( self ): return self._hascoverings def fset( self, value ): # INVERSE argument raise AssertionError('Argument hascoverings is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def boundedby(): def fget( self ): return self._boundedby def fset( self, value ): # INVERSE argument raise AssertionError('Argument boundedby is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcflowterminal # #################### class ifcflowterminal(ifcdistributionflowelement): '''Entity ifcflowterminal definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcdistributionflowelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcpolyloop # #################### class ifcpolyloop(ifcloop): '''Entity ifcpolyloop definition. :param polygon :type polygon:LIST(3,None,'ifccartesianpoint', scope = schema_scope) ''' def __init__( self , polygon, ): ifcloop.__init__(self , ) self.polygon = polygon @apply def polygon(): def fget( self ): return self._polygon def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument polygon is mantatory and can not be set to None') if not check_type(value,LIST(3,None,'ifccartesianpoint', scope = schema_scope)): self._polygon = LIST(value) else: self._polygon = value return property(**locals()) def wr21(self): eval_wr21_wr = (SIZEOF(None) == 0) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr #################### # ENTITY ifcrelassociatesmaterial # #################### class ifcrelassociatesmaterial(ifcrelassociates): '''Entity ifcrelassociatesmaterial definition. :param relatingmaterial :type relatingmaterial:ifcmaterialselect ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , relatingmaterial, ): ifcrelassociates.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , ) self.relatingmaterial = relatingmaterial @apply def relatingmaterial(): def fget( self ): return self._relatingmaterial def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingmaterial is mantatory and can not be set to None') if not check_type(value,ifcmaterialselect): self._relatingmaterial = ifcmaterialselect(value) else: self._relatingmaterial = value return property(**locals()) def wr21(self): eval_wr21_wr = (SIZEOF(None) == 0) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr def wr22(self): eval_wr22_wr = (SIZEOF(None) == 0) if not eval_wr22_wr: raise AssertionError('Rule wr22 violated') else: return eval_wr22_wr #################### # ENTITY ifccshapeprofiledef # #################### class ifccshapeprofiledef(ifcparameterizedprofiledef): '''Entity ifccshapeprofiledef definition. :param depth :type depth:ifcpositivelengthmeasure :param width :type width:ifcpositivelengthmeasure :param wallthickness :type wallthickness:ifcpositivelengthmeasure :param girth :type girth:ifcpositivelengthmeasure :param internalfilletradius :type internalfilletradius:ifcpositivelengthmeasure :param centreofgravityinx :type centreofgravityinx:ifcpositivelengthmeasure ''' def __init__( self , inherited0__profiletype , inherited1__profilename , inherited2__position , depth,width,wallthickness,girth,internalfilletradius,centreofgravityinx, ): ifcparameterizedprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , inherited2__position , ) self.depth = depth self.width = width self.wallthickness = wallthickness self.girth = girth self.internalfilletradius = internalfilletradius self.centreofgravityinx = centreofgravityinx @apply def depth(): def fget( self ): return self._depth def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument depth is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._depth = ifcpositivelengthmeasure(value) else: self._depth = value return property(**locals()) @apply def width(): def fget( self ): return self._width def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument width is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._width = ifcpositivelengthmeasure(value) else: self._width = value return property(**locals()) @apply def wallthickness(): def fget( self ): return self._wallthickness def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument wallthickness is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._wallthickness = ifcpositivelengthmeasure(value) else: self._wallthickness = value return property(**locals()) @apply def girth(): def fget( self ): return self._girth def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument girth is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._girth = ifcpositivelengthmeasure(value) else: self._girth = value return property(**locals()) @apply def internalfilletradius(): def fget( self ): return self._internalfilletradius def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._internalfilletradius = ifcpositivelengthmeasure(value) else: self._internalfilletradius = value else: self._internalfilletradius = value return property(**locals()) @apply def centreofgravityinx(): def fget( self ): return self._centreofgravityinx def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._centreofgravityinx = ifcpositivelengthmeasure(value) else: self._centreofgravityinx = value else: self._centreofgravityinx = value return property(**locals()) def wr1(self): eval_wr1_wr = (self.girth < (self.depth / 2)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (( not EXISTS(self.internalfilletradius)) or ((self.internalfilletradius <= (self.width / 2)) and (self.internalfilletradius <= (self.depth / 2)))) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr def wr3(self): eval_wr3_wr = ((self.wallthickness < (self.width / 2)) and (self.wallthickness < (self.depth / 2))) if not eval_wr3_wr: raise AssertionError('Rule wr3 violated') else: return eval_wr3_wr #################### # ENTITY ifcpropertytablevalue # #################### class ifcpropertytablevalue(ifcsimpleproperty): '''Entity ifcpropertytablevalue definition. :param definingvalues :type definingvalues:LIST(1,None,'ifcvalue', scope = schema_scope) :param definedvalues :type definedvalues:LIST(1,None,'ifcvalue', scope = schema_scope) :param expression :type expression:ifctext :param definingunit :type definingunit:ifcunit :param definedunit :type definedunit:ifcunit ''' def __init__( self , inherited0__name , inherited1__description , definingvalues,definedvalues,expression,definingunit,definedunit, ): ifcsimpleproperty.__init__(self , inherited0__name , inherited1__description , ) self.definingvalues = definingvalues self.definedvalues = definedvalues self.expression = expression self.definingunit = definingunit self.definedunit = definedunit @apply def definingvalues(): def fget( self ): return self._definingvalues def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument definingvalues is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcvalue', scope = schema_scope)): self._definingvalues = LIST(value) else: self._definingvalues = value return property(**locals()) @apply def definedvalues(): def fget( self ): return self._definedvalues def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument definedvalues is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcvalue', scope = schema_scope)): self._definedvalues = LIST(value) else: self._definedvalues = value return property(**locals()) @apply def expression(): def fget( self ): return self._expression def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._expression = ifctext(value) else: self._expression = value else: self._expression = value return property(**locals()) @apply def definingunit(): def fget( self ): return self._definingunit def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcunit): self._definingunit = ifcunit(value) else: self._definingunit = value else: self._definingunit = value return property(**locals()) @apply def definedunit(): def fget( self ): return self._definedunit def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcunit): self._definedunit = ifcunit(value) else: self._definedunit = value else: self._definedunit = value return property(**locals()) def wr1(self): eval_wr1_wr = (SIZEOF(self.definingvalues) == SIZEOF(self.definedvalues)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (SIZEOF(None) == 0) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr def wr3(self): eval_wr3_wr = (SIZEOF(None) == 0) if not eval_wr3_wr: raise AssertionError('Rule wr3 violated') else: return eval_wr3_wr #################### # ENTITY ifcstructuralloadplanarforce # #################### class ifcstructuralloadplanarforce(ifcstructuralloadstatic): '''Entity ifcstructuralloadplanarforce definition. :param planarforcex :type planarforcex:ifcplanarforcemeasure :param planarforcey :type planarforcey:ifcplanarforcemeasure :param planarforcez :type planarforcez:ifcplanarforcemeasure ''' def __init__( self , inherited0__name , planarforcex,planarforcey,planarforcez, ): ifcstructuralloadstatic.__init__(self , inherited0__name , ) self.planarforcex = planarforcex self.planarforcey = planarforcey self.planarforcez = planarforcez @apply def planarforcex(): def fget( self ): return self._planarforcex def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcplanarforcemeasure): self._planarforcex = ifcplanarforcemeasure(value) else: self._planarforcex = value else: self._planarforcex = value return property(**locals()) @apply def planarforcey(): def fget( self ): return self._planarforcey def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcplanarforcemeasure): self._planarforcey = ifcplanarforcemeasure(value) else: self._planarforcey = value else: self._planarforcey = value return property(**locals()) @apply def planarforcez(): def fget( self ): return self._planarforcez def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcplanarforcemeasure): self._planarforcez = ifcplanarforcemeasure(value) else: self._planarforcez = value else: self._planarforcez = value return property(**locals()) #################### # ENTITY ifcbooleanclippingresult # #################### class ifcbooleanclippingresult(ifcbooleanresult): '''Entity ifcbooleanclippingresult definition. ''' def __init__( self , inherited0__operator , inherited1__firstoperand , inherited2__secondoperand , ): ifcbooleanresult.__init__(self , inherited0__operator , inherited1__firstoperand , inherited2__secondoperand , ) def wr1(self): eval_wr1_wr = (('IFC2X3.IFCSWEPTAREASOLID' == TYPEOF(self.firstoperand)) or ('IFC2X3.IFCBOOLEANCLIPPINGRESULT' == TYPEOF(self.firstoperand))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = ('IFC2X3.IFCHALFSPACESOLID' == TYPEOF(self.secondoperand)) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr def wr3(self): eval_wr3_wr = (self.operator == difference) if not eval_wr3_wr: raise AssertionError('Rule wr3 violated') else: return eval_wr3_wr #################### # ENTITY ifcbuildingstorey # #################### class ifcbuildingstorey(ifcspatialstructureelement): '''Entity ifcbuildingstorey definition. :param elevation :type elevation:ifclengthmeasure ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__longname , inherited8__compositiontype , elevation, ): ifcspatialstructureelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__longname , inherited8__compositiontype , ) self.elevation = elevation @apply def elevation(): def fget( self ): return self._elevation def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._elevation = ifclengthmeasure(value) else: self._elevation = value else: self._elevation = value return property(**locals()) #################### # ENTITY ifcsectionreinforcementproperties # #################### class ifcsectionreinforcementproperties(BaseEntityClass): '''Entity ifcsectionreinforcementproperties definition. :param longitudinalstartposition :type longitudinalstartposition:ifclengthmeasure :param longitudinalendposition :type longitudinalendposition:ifclengthmeasure :param transverseposition :type transverseposition:ifclengthmeasure :param reinforcementrole :type reinforcementrole:ifcreinforcingbarroleenum :param sectiondefinition :type sectiondefinition:ifcsectionproperties :param crosssectionreinforcementdefinitions :type crosssectionreinforcementdefinitions:SET(1,None,'ifcreinforcementbarproperties', scope = schema_scope) ''' def __init__( self , longitudinalstartposition,longitudinalendposition,transverseposition,reinforcementrole,sectiondefinition,crosssectionreinforcementdefinitions, ): self.longitudinalstartposition = longitudinalstartposition self.longitudinalendposition = longitudinalendposition self.transverseposition = transverseposition self.reinforcementrole = reinforcementrole self.sectiondefinition = sectiondefinition self.crosssectionreinforcementdefinitions = crosssectionreinforcementdefinitions @apply def longitudinalstartposition(): def fget( self ): return self._longitudinalstartposition def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument longitudinalstartposition is mantatory and can not be set to None') if not check_type(value,ifclengthmeasure): self._longitudinalstartposition = ifclengthmeasure(value) else: self._longitudinalstartposition = value return property(**locals()) @apply def longitudinalendposition(): def fget( self ): return self._longitudinalendposition def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument longitudinalendposition is mantatory and can not be set to None') if not check_type(value,ifclengthmeasure): self._longitudinalendposition = ifclengthmeasure(value) else: self._longitudinalendposition = value return property(**locals()) @apply def transverseposition(): def fget( self ): return self._transverseposition def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._transverseposition = ifclengthmeasure(value) else: self._transverseposition = value else: self._transverseposition = value return property(**locals()) @apply def reinforcementrole(): def fget( self ): return self._reinforcementrole def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument reinforcementrole is mantatory and can not be set to None') if not check_type(value,ifcreinforcingbarroleenum): self._reinforcementrole = ifcreinforcingbarroleenum(value) else: self._reinforcementrole = value return property(**locals()) @apply def sectiondefinition(): def fget( self ): return self._sectiondefinition def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument sectiondefinition is mantatory and can not be set to None') if not check_type(value,ifcsectionproperties): self._sectiondefinition = ifcsectionproperties(value) else: self._sectiondefinition = value return property(**locals()) @apply def crosssectionreinforcementdefinitions(): def fget( self ): return self._crosssectionreinforcementdefinitions def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument crosssectionreinforcementdefinitions is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcreinforcementbarproperties', scope = schema_scope)): self._crosssectionreinforcementdefinitions = SET(value) else: self._crosssectionreinforcementdefinitions = value return property(**locals()) #################### # ENTITY ifcrelassignstoresource # #################### class ifcrelassignstoresource(ifcrelassigns): '''Entity ifcrelassignstoresource definition. :param relatingresource :type relatingresource:ifcresource ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatedobjectstype , relatingresource, ): ifcrelassigns.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatedobjectstype , ) self.relatingresource = relatingresource @apply def relatingresource(): def fget( self ): return self._relatingresource def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingresource is mantatory and can not be set to None') if not check_type(value,ifcresource): self._relatingresource = ifcresource(value) else: self._relatingresource = value return property(**locals()) def wr1(self): eval_wr1_wr = (SIZEOF(None) == 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifclineardimension # #################### class ifclineardimension(ifcdimensioncurvedirectedcallout): '''Entity ifclineardimension definition. ''' def __init__( self , inherited0__contents , ): ifcdimensioncurvedirectedcallout.__init__(self , inherited0__contents , ) #################### # ENTITY ifcprocedure # #################### class ifcprocedure(ifcprocess): '''Entity ifcprocedure definition. :param procedureid :type procedureid:ifcidentifier :param proceduretype :type proceduretype:ifcproceduretypeenum :param userdefinedproceduretype :type userdefinedproceduretype:ifclabel ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , procedureid,proceduretype,userdefinedproceduretype, ): ifcprocess.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.procedureid = procedureid self.proceduretype = proceduretype self.userdefinedproceduretype = userdefinedproceduretype @apply def procedureid(): def fget( self ): return self._procedureid def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument procedureid is mantatory and can not be set to None') if not check_type(value,ifcidentifier): self._procedureid = ifcidentifier(value) else: self._procedureid = value return property(**locals()) @apply def proceduretype(): def fget( self ): return self._proceduretype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument proceduretype is mantatory and can not be set to None') if not check_type(value,ifcproceduretypeenum): self._proceduretype = ifcproceduretypeenum(value) else: self._proceduretype = value return property(**locals()) @apply def userdefinedproceduretype(): def fget( self ): return self._userdefinedproceduretype def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._userdefinedproceduretype = ifclabel(value) else: self._userdefinedproceduretype = value else: self._userdefinedproceduretype = value return property(**locals()) def wr1(self): eval_wr1_wr = (SIZEOF(None) == 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (SIZEOF(None) == 0) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr def wr3(self): eval_wr3_wr = EXISTS(self.self.ifcroot.self.name) if not eval_wr3_wr: raise AssertionError('Rule wr3 violated') else: return eval_wr3_wr def wr4(self): eval_wr4_wr = ((self.proceduretype != ifcproceduretypeenum.self.userdefined) or ((self.proceduretype == ifcproceduretypeenum.self.userdefined) and EXISTS(self.self.ifcprocedure.self.userdefinedproceduretype))) if not eval_wr4_wr: raise AssertionError('Rule wr4 violated') else: return eval_wr4_wr #################### # ENTITY ifcactionrequest # #################### class ifcactionrequest(ifccontrol): '''Entity ifcactionrequest definition. :param requestid :type requestid:ifcidentifier ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , requestid, ): ifccontrol.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.requestid = requestid @apply def requestid(): def fget( self ): return self._requestid def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument requestid is mantatory and can not be set to None') if not check_type(value,ifcidentifier): self._requestid = ifcidentifier(value) else: self._requestid = value return property(**locals()) #################### # ENTITY ifcinventory # #################### class ifcinventory(ifcgroup): '''Entity ifcinventory definition. :param inventorytype :type inventorytype:ifcinventorytypeenum :param jurisdiction :type jurisdiction:ifcactorselect :param responsiblepersons :type responsiblepersons:SET(1,None,'ifcperson', scope = schema_scope) :param lastupdatedate :type lastupdatedate:ifccalendardate :param currentvalue :type currentvalue:ifccostvalue :param originalvalue :type originalvalue:ifccostvalue ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inventorytype,jurisdiction,responsiblepersons,lastupdatedate,currentvalue,originalvalue, ): ifcgroup.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.inventorytype = inventorytype self.jurisdiction = jurisdiction self.responsiblepersons = responsiblepersons self.lastupdatedate = lastupdatedate self.currentvalue = currentvalue self.originalvalue = originalvalue @apply def inventorytype(): def fget( self ): return self._inventorytype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument inventorytype is mantatory and can not be set to None') if not check_type(value,ifcinventorytypeenum): self._inventorytype = ifcinventorytypeenum(value) else: self._inventorytype = value return property(**locals()) @apply def jurisdiction(): def fget( self ): return self._jurisdiction def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument jurisdiction is mantatory and can not be set to None') if not check_type(value,ifcactorselect): self._jurisdiction = ifcactorselect(value) else: self._jurisdiction = value return property(**locals()) @apply def responsiblepersons(): def fget( self ): return self._responsiblepersons def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument responsiblepersons is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcperson', scope = schema_scope)): self._responsiblepersons = SET(value) else: self._responsiblepersons = value return property(**locals()) @apply def lastupdatedate(): def fget( self ): return self._lastupdatedate def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument lastupdatedate is mantatory and can not be set to None') if not check_type(value,ifccalendardate): self._lastupdatedate = ifccalendardate(value) else: self._lastupdatedate = value return property(**locals()) @apply def currentvalue(): def fget( self ): return self._currentvalue def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccostvalue): self._currentvalue = ifccostvalue(value) else: self._currentvalue = value else: self._currentvalue = value return property(**locals()) @apply def originalvalue(): def fget( self ): return self._originalvalue def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccostvalue): self._originalvalue = ifccostvalue(value) else: self._originalvalue = value else: self._originalvalue = value return property(**locals()) def wr41(self): eval_wr41_wr = (SIZEOF(None) == 0) if not eval_wr41_wr: raise AssertionError('Rule wr41 violated') else: return eval_wr41_wr #################### # ENTITY ifcclassificationitemrelationship # #################### class ifcclassificationitemrelationship(BaseEntityClass): '''Entity ifcclassificationitemrelationship definition. :param relatingitem :type relatingitem:ifcclassificationitem :param relateditems :type relateditems:SET(1,None,'ifcclassificationitem', scope = schema_scope) ''' def __init__( self , relatingitem,relateditems, ): self.relatingitem = relatingitem self.relateditems = relateditems @apply def relatingitem(): def fget( self ): return self._relatingitem def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingitem is mantatory and can not be set to None') if not check_type(value,ifcclassificationitem): self._relatingitem = ifcclassificationitem(value) else: self._relatingitem = value return property(**locals()) @apply def relateditems(): def fget( self ): return self._relateditems def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relateditems is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcclassificationitem', scope = schema_scope)): self._relateditems = SET(value) else: self._relateditems = value return property(**locals()) #################### # ENTITY ifcpredefinedterminatorsymbol # #################### class ifcpredefinedterminatorsymbol(ifcpredefinedsymbol): '''Entity ifcpredefinedterminatorsymbol definition. ''' def __init__( self , inherited0__name , ): ifcpredefinedsymbol.__init__(self , inherited0__name , ) def wr31(self): eval_wr31_wr = (self.self.ifcpredefineditem.self.name == ['blanked arrow','blanked box','blanked dot','dimension origin','filled arrow','filled box','filled dot','integral symbol','open arrow','slash','unfilled arrow']) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifcrelconnectspathelements # #################### class ifcrelconnectspathelements(ifcrelconnectselements): '''Entity ifcrelconnectspathelements definition. :param relatingpriorities :type relatingpriorities:LIST(0,None,'INTEGER', scope = schema_scope) :param relatedpriorities :type relatedpriorities:LIST(0,None,'INTEGER', scope = schema_scope) :param relatedconnectiontype :type relatedconnectiontype:ifcconnectiontypeenum :param relatingconnectiontype :type relatingconnectiontype:ifcconnectiontypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__connectiongeometry , inherited5__relatingelement , inherited6__relatedelement , relatingpriorities,relatedpriorities,relatedconnectiontype,relatingconnectiontype, ): ifcrelconnectselements.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__connectiongeometry , inherited5__relatingelement , inherited6__relatedelement , ) self.relatingpriorities = relatingpriorities self.relatedpriorities = relatedpriorities self.relatedconnectiontype = relatedconnectiontype self.relatingconnectiontype = relatingconnectiontype @apply def relatingpriorities(): def fget( self ): return self._relatingpriorities def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingpriorities is mantatory and can not be set to None') if not check_type(value,LIST(0,None,'INTEGER', scope = schema_scope)): self._relatingpriorities = LIST(value) else: self._relatingpriorities = value return property(**locals()) @apply def relatedpriorities(): def fget( self ): return self._relatedpriorities def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedpriorities is mantatory and can not be set to None') if not check_type(value,LIST(0,None,'INTEGER', scope = schema_scope)): self._relatedpriorities = LIST(value) else: self._relatedpriorities = value return property(**locals()) @apply def relatedconnectiontype(): def fget( self ): return self._relatedconnectiontype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedconnectiontype is mantatory and can not be set to None') if not check_type(value,ifcconnectiontypeenum): self._relatedconnectiontype = ifcconnectiontypeenum(value) else: self._relatedconnectiontype = value return property(**locals()) @apply def relatingconnectiontype(): def fget( self ): return self._relatingconnectiontype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingconnectiontype is mantatory and can not be set to None') if not check_type(value,ifcconnectiontypeenum): self._relatingconnectiontype = ifcconnectiontypeenum(value) else: self._relatingconnectiontype = value return property(**locals()) #################### # ENTITY ifccurtainwalltype # #################### class ifccurtainwalltype(ifcbuildingelementtype): '''Entity ifccurtainwalltype definition. :param predefinedtype :type predefinedtype:ifccurtainwalltypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcbuildingelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifccurtainwalltypeenum): self._predefinedtype = ifccurtainwalltypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcdraughtingpredefinedcurvefont # #################### class ifcdraughtingpredefinedcurvefont(ifcpredefinedcurvefont): '''Entity ifcdraughtingpredefinedcurvefont definition. ''' def __init__( self , inherited0__name , ): ifcpredefinedcurvefont.__init__(self , inherited0__name , ) def wr31(self): eval_wr31_wr = (self.self.ifcpredefineditem.self.name == ['continuous','chain','chain double dash','dashed','dotted','by layer']) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifcrelcoversbldgelements # #################### class ifcrelcoversbldgelements(ifcrelconnects): '''Entity ifcrelcoversbldgelements definition. :param relatingbuildingelement :type relatingbuildingelement:ifcelement :param relatedcoverings :type relatedcoverings:SET(1,None,'ifccovering', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , relatingbuildingelement,relatedcoverings, ): ifcrelconnects.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.relatingbuildingelement = relatingbuildingelement self.relatedcoverings = relatedcoverings @apply def relatingbuildingelement(): def fget( self ): return self._relatingbuildingelement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingbuildingelement is mantatory and can not be set to None') if not check_type(value,ifcelement): self._relatingbuildingelement = ifcelement(value) else: self._relatingbuildingelement = value return property(**locals()) @apply def relatedcoverings(): def fget( self ): return self._relatedcoverings def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedcoverings is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifccovering', scope = schema_scope)): self._relatedcoverings = SET(value) else: self._relatedcoverings = value return property(**locals()) #################### # ENTITY ifcdoorstyle # #################### class ifcdoorstyle(ifctypeproduct): '''Entity ifcdoorstyle definition. :param operationtype :type operationtype:ifcdoorstyleoperationenum :param constructiontype :type constructiontype:ifcdoorstyleconstructionenum :param parametertakesprecedence :type parametertakesprecedence:BOOLEAN :param sizeable :type sizeable:BOOLEAN ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , operationtype,constructiontype,parametertakesprecedence,sizeable, ): ifctypeproduct.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , ) self.operationtype = operationtype self.constructiontype = constructiontype self.parametertakesprecedence = parametertakesprecedence self.sizeable = sizeable @apply def operationtype(): def fget( self ): return self._operationtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument operationtype is mantatory and can not be set to None') if not check_type(value,ifcdoorstyleoperationenum): self._operationtype = ifcdoorstyleoperationenum(value) else: self._operationtype = value return property(**locals()) @apply def constructiontype(): def fget( self ): return self._constructiontype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument constructiontype is mantatory and can not be set to None') if not check_type(value,ifcdoorstyleconstructionenum): self._constructiontype = ifcdoorstyleconstructionenum(value) else: self._constructiontype = value return property(**locals()) @apply def parametertakesprecedence(): def fget( self ): return self._parametertakesprecedence def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument parametertakesprecedence is mantatory and can not be set to None') if not check_type(value,BOOLEAN): self._parametertakesprecedence = BOOLEAN(value) else: self._parametertakesprecedence = value return property(**locals()) @apply def sizeable(): def fget( self ): return self._sizeable def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument sizeable is mantatory and can not be set to None') if not check_type(value,BOOLEAN): self._sizeable = BOOLEAN(value) else: self._sizeable = value return property(**locals()) #################### # ENTITY ifcellipse # #################### class ifcellipse(ifcconic): '''Entity ifcellipse definition. :param semiaxis1 :type semiaxis1:ifcpositivelengthmeasure :param semiaxis2 :type semiaxis2:ifcpositivelengthmeasure ''' def __init__( self , inherited0__position , semiaxis1,semiaxis2, ): ifcconic.__init__(self , inherited0__position , ) self.semiaxis1 = semiaxis1 self.semiaxis2 = semiaxis2 @apply def semiaxis1(): def fget( self ): return self._semiaxis1 def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument semiaxis1 is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._semiaxis1 = ifcpositivelengthmeasure(value) else: self._semiaxis1 = value return property(**locals()) @apply def semiaxis2(): def fget( self ): return self._semiaxis2 def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument semiaxis2 is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._semiaxis2 = ifcpositivelengthmeasure(value) else: self._semiaxis2 = value return property(**locals()) #################### # ENTITY ifcstairflighttype # #################### class ifcstairflighttype(ifcbuildingelementtype): '''Entity ifcstairflighttype definition. :param predefinedtype :type predefinedtype:ifcstairflighttypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcbuildingelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcstairflighttypeenum): self._predefinedtype = ifcstairflighttypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcstructuralloadtemperature # #################### class ifcstructuralloadtemperature(ifcstructuralloadstatic): '''Entity ifcstructuralloadtemperature definition. :param deltat_constant :type deltat_constant:ifcthermodynamictemperaturemeasure :param deltat_y :type deltat_y:ifcthermodynamictemperaturemeasure :param deltat_z :type deltat_z:ifcthermodynamictemperaturemeasure ''' def __init__( self , inherited0__name , deltat_constant,deltat_y,deltat_z, ): ifcstructuralloadstatic.__init__(self , inherited0__name , ) self.deltat_constant = deltat_constant self.deltat_y = deltat_y self.deltat_z = deltat_z @apply def deltat_constant(): def fget( self ): return self._deltat_constant def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcthermodynamictemperaturemeasure): self._deltat_constant = ifcthermodynamictemperaturemeasure(value) else: self._deltat_constant = value else: self._deltat_constant = value return property(**locals()) @apply def deltat_y(): def fget( self ): return self._deltat_y def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcthermodynamictemperaturemeasure): self._deltat_y = ifcthermodynamictemperaturemeasure(value) else: self._deltat_y = value else: self._deltat_y = value return property(**locals()) @apply def deltat_z(): def fget( self ): return self._deltat_z def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcthermodynamictemperaturemeasure): self._deltat_z = ifcthermodynamictemperaturemeasure(value) else: self._deltat_z = value else: self._deltat_z = value return property(**locals()) #################### # ENTITY ifcapprovalactorrelationship # #################### class ifcapprovalactorrelationship(BaseEntityClass): '''Entity ifcapprovalactorrelationship definition. :param actor :type actor:ifcactorselect :param approval :type approval:ifcapproval :param role :type role:ifcactorrole ''' def __init__( self , actor,approval,role, ): self.actor = actor self.approval = approval self.role = role @apply def actor(): def fget( self ): return self._actor def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument actor is mantatory and can not be set to None') if not check_type(value,ifcactorselect): self._actor = ifcactorselect(value) else: self._actor = value return property(**locals()) @apply def approval(): def fget( self ): return self._approval def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument approval is mantatory and can not be set to None') if not check_type(value,ifcapproval): self._approval = ifcapproval(value) else: self._approval = value return property(**locals()) @apply def role(): def fget( self ): return self._role def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument role is mantatory and can not be set to None') if not check_type(value,ifcactorrole): self._role = ifcactorrole(value) else: self._role = value return property(**locals()) #################### # ENTITY ifclshapeprofiledef # #################### class ifclshapeprofiledef(ifcparameterizedprofiledef): '''Entity ifclshapeprofiledef definition. :param depth :type depth:ifcpositivelengthmeasure :param width :type width:ifcpositivelengthmeasure :param thickness :type thickness:ifcpositivelengthmeasure :param filletradius :type filletradius:ifcpositivelengthmeasure :param edgeradius :type edgeradius:ifcpositivelengthmeasure :param legslope :type legslope:ifcplaneanglemeasure :param centreofgravityinx :type centreofgravityinx:ifcpositivelengthmeasure :param centreofgravityiny :type centreofgravityiny:ifcpositivelengthmeasure ''' def __init__( self , inherited0__profiletype , inherited1__profilename , inherited2__position , depth,width,thickness,filletradius,edgeradius,legslope,centreofgravityinx,centreofgravityiny, ): ifcparameterizedprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , inherited2__position , ) self.depth = depth self.width = width self.thickness = thickness self.filletradius = filletradius self.edgeradius = edgeradius self.legslope = legslope self.centreofgravityinx = centreofgravityinx self.centreofgravityiny = centreofgravityiny @apply def depth(): def fget( self ): return self._depth def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument depth is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._depth = ifcpositivelengthmeasure(value) else: self._depth = value return property(**locals()) @apply def width(): def fget( self ): return self._width def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._width = ifcpositivelengthmeasure(value) else: self._width = value else: self._width = value return property(**locals()) @apply def thickness(): def fget( self ): return self._thickness def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument thickness is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._thickness = ifcpositivelengthmeasure(value) else: self._thickness = value return property(**locals()) @apply def filletradius(): def fget( self ): return self._filletradius def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._filletradius = ifcpositivelengthmeasure(value) else: self._filletradius = value else: self._filletradius = value return property(**locals()) @apply def edgeradius(): def fget( self ): return self._edgeradius def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._edgeradius = ifcpositivelengthmeasure(value) else: self._edgeradius = value else: self._edgeradius = value return property(**locals()) @apply def legslope(): def fget( self ): return self._legslope def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcplaneanglemeasure): self._legslope = ifcplaneanglemeasure(value) else: self._legslope = value else: self._legslope = value return property(**locals()) @apply def centreofgravityinx(): def fget( self ): return self._centreofgravityinx def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._centreofgravityinx = ifcpositivelengthmeasure(value) else: self._centreofgravityinx = value else: self._centreofgravityinx = value return property(**locals()) @apply def centreofgravityiny(): def fget( self ): return self._centreofgravityiny def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._centreofgravityiny = ifcpositivelengthmeasure(value) else: self._centreofgravityiny = value else: self._centreofgravityiny = value return property(**locals()) def wr21(self): eval_wr21_wr = (self.thickness < self.depth) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr def wr22(self): eval_wr22_wr = (( not EXISTS(self.width)) or (self.thickness < self.width)) if not eval_wr22_wr: raise AssertionError('Rule wr22 violated') else: return eval_wr22_wr #################### # ENTITY ifcflowinstrumenttype # #################### class ifcflowinstrumenttype(ifcdistributioncontrolelementtype): '''Entity ifcflowinstrumenttype definition. :param predefinedtype :type predefinedtype:ifcflowinstrumenttypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcdistributioncontrolelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcflowinstrumenttypeenum): self._predefinedtype = ifcflowinstrumenttypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifccircle # #################### class ifccircle(ifcconic): '''Entity ifccircle definition. :param radius :type radius:ifcpositivelengthmeasure ''' def __init__( self , inherited0__position , radius, ): ifcconic.__init__(self , inherited0__position , ) self.radius = radius @apply def radius(): def fget( self ): return self._radius def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument radius is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._radius = ifcpositivelengthmeasure(value) else: self._radius = value return property(**locals()) #################### # ENTITY ifcdistributionchamberelement # #################### class ifcdistributionchamberelement(ifcdistributionflowelement): '''Entity ifcdistributionchamberelement definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcdistributionflowelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcmotorconnectiontype # #################### class ifcmotorconnectiontype(ifcenergyconversiondevicetype): '''Entity ifcmotorconnectiontype definition. :param predefinedtype :type predefinedtype:ifcmotorconnectiontypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcenergyconversiondevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcmotorconnectiontypeenum): self._predefinedtype = ifcmotorconnectiontypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcshellbasedsurfacemodel # #################### class ifcshellbasedsurfacemodel(ifcgeometricrepresentationitem): '''Entity ifcshellbasedsurfacemodel definition. :param sbsmboundary :type sbsmboundary:SET(1,None,'ifcshell', scope = schema_scope) :param dim :type dim:ifcdimensioncount ''' def __init__( self , sbsmboundary, ): ifcgeometricrepresentationitem.__init__(self , ) self.sbsmboundary = sbsmboundary @apply def sbsmboundary(): def fget( self ): return self._sbsmboundary def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument sbsmboundary is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcshell', scope = schema_scope)): self._sbsmboundary = SET(value) else: self._sbsmboundary = value return property(**locals()) @apply def dim(): def fget( self ): attribute_eval = 3 return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcprojectorder # #################### class ifcprojectorder(ifccontrol): '''Entity ifcprojectorder definition. :param id :type id:ifcidentifier :param predefinedtype :type predefinedtype:ifcprojectordertypeenum :param status :type status:ifclabel ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , id,predefinedtype,status, ): ifccontrol.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.id = id self.predefinedtype = predefinedtype self.status = status @apply def id(): def fget( self ): return self._id def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument id is mantatory and can not be set to None') if not check_type(value,ifcidentifier): self._id = ifcidentifier(value) else: self._id = value return property(**locals()) @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcprojectordertypeenum): self._predefinedtype = ifcprojectordertypeenum(value) else: self._predefinedtype = value return property(**locals()) @apply def status(): def fget( self ): return self._status def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._status = ifclabel(value) else: self._status = value else: self._status = value return property(**locals()) #################### # ENTITY ifcrampflighttype # #################### class ifcrampflighttype(ifcbuildingelementtype): '''Entity ifcrampflighttype definition. :param predefinedtype :type predefinedtype:ifcrampflighttypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcbuildingelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcrampflighttypeenum): self._predefinedtype = ifcrampflighttypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcsurfacecurvesweptareasolid # #################### class ifcsurfacecurvesweptareasolid(ifcsweptareasolid): '''Entity ifcsurfacecurvesweptareasolid definition. :param directrix :type directrix:ifccurve :param startparam :type startparam:ifcparametervalue :param endparam :type endparam:ifcparametervalue :param referencesurface :type referencesurface:ifcsurface ''' def __init__( self , inherited0__sweptarea , inherited1__position , directrix,startparam,endparam,referencesurface, ): ifcsweptareasolid.__init__(self , inherited0__sweptarea , inherited1__position , ) self.directrix = directrix self.startparam = startparam self.endparam = endparam self.referencesurface = referencesurface @apply def directrix(): def fget( self ): return self._directrix def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument directrix is mantatory and can not be set to None') if not check_type(value,ifccurve): self._directrix = ifccurve(value) else: self._directrix = value return property(**locals()) @apply def startparam(): def fget( self ): return self._startparam def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument startparam is mantatory and can not be set to None') if not check_type(value,ifcparametervalue): self._startparam = ifcparametervalue(value) else: self._startparam = value return property(**locals()) @apply def endparam(): def fget( self ): return self._endparam def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument endparam is mantatory and can not be set to None') if not check_type(value,ifcparametervalue): self._endparam = ifcparametervalue(value) else: self._endparam = value return property(**locals()) @apply def referencesurface(): def fget( self ): return self._referencesurface def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument referencesurface is mantatory and can not be set to None') if not check_type(value,ifcsurface): self._referencesurface = ifcsurface(value) else: self._referencesurface = value return property(**locals()) #################### # ENTITY ifctextstylewithboxcharacteristics # #################### class ifctextstylewithboxcharacteristics(BaseEntityClass): '''Entity ifctextstylewithboxcharacteristics definition. :param boxheight :type boxheight:ifcpositivelengthmeasure :param boxwidth :type boxwidth:ifcpositivelengthmeasure :param boxslantangle :type boxslantangle:ifcplaneanglemeasure :param boxrotateangle :type boxrotateangle:ifcplaneanglemeasure :param characterspacing :type characterspacing:ifcsizeselect ''' def __init__( self , boxheight,boxwidth,boxslantangle,boxrotateangle,characterspacing, ): self.boxheight = boxheight self.boxwidth = boxwidth self.boxslantangle = boxslantangle self.boxrotateangle = boxrotateangle self.characterspacing = characterspacing @apply def boxheight(): def fget( self ): return self._boxheight def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._boxheight = ifcpositivelengthmeasure(value) else: self._boxheight = value else: self._boxheight = value return property(**locals()) @apply def boxwidth(): def fget( self ): return self._boxwidth def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._boxwidth = ifcpositivelengthmeasure(value) else: self._boxwidth = value else: self._boxwidth = value return property(**locals()) @apply def boxslantangle(): def fget( self ): return self._boxslantangle def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcplaneanglemeasure): self._boxslantangle = ifcplaneanglemeasure(value) else: self._boxslantangle = value else: self._boxslantangle = value return property(**locals()) @apply def boxrotateangle(): def fget( self ): return self._boxrotateangle def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcplaneanglemeasure): self._boxrotateangle = ifcplaneanglemeasure(value) else: self._boxrotateangle = value else: self._boxrotateangle = value return property(**locals()) @apply def characterspacing(): def fget( self ): return self._characterspacing def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcsizeselect): self._characterspacing = ifcsizeselect(value) else: self._characterspacing = value else: self._characterspacing = value return property(**locals()) #################### # ENTITY ifcstructuralpointaction # #################### class ifcstructuralpointaction(ifcstructuralaction): '''Entity ifcstructuralpointaction definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedload , inherited8__globalorlocal , inherited9__destabilizingload , inherited10__causedby , ): ifcstructuralaction.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedload , inherited8__globalorlocal , inherited9__destabilizingload , inherited10__causedby , ) def wr61(self): eval_wr61_wr = (SIZEOF(['IFC2X3.IFCSTRUCTURALLOADSINGLEFORCE','IFC2X3.IFCSTRUCTURALLOADSINGLEDISPLACEMENT'] * TYPEOF(self.self.ifcstructuralactivity.self.appliedload)) == 1) if not eval_wr61_wr: raise AssertionError('Rule wr61 violated') else: return eval_wr61_wr #################### # ENTITY ifcannotationsurface # #################### class ifcannotationsurface(ifcgeometricrepresentationitem): '''Entity ifcannotationsurface definition. :param item :type item:ifcgeometricrepresentationitem :param texturecoordinates :type texturecoordinates:ifctexturecoordinate ''' def __init__( self , item,texturecoordinates, ): ifcgeometricrepresentationitem.__init__(self , ) self.item = item self.texturecoordinates = texturecoordinates @apply def item(): def fget( self ): return self._item def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument item is mantatory and can not be set to None') if not check_type(value,ifcgeometricrepresentationitem): self._item = ifcgeometricrepresentationitem(value) else: self._item = value return property(**locals()) @apply def texturecoordinates(): def fget( self ): return self._texturecoordinates def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctexturecoordinate): self._texturecoordinates = ifctexturecoordinate(value) else: self._texturecoordinates = value else: self._texturecoordinates = value return property(**locals()) def wr01(self): eval_wr01_wr = (SIZEOF(['IFC2X3.IFCSURFACE','IFC2X3.IFCSHELLBASEDSURFACEMODEL','IFC2X3.IFCFACEBASEDSURFACEMODEL','IFC2X3.IFCSOLIDMODEL','IFC2X3.IFCBOOLEANRESULT','IFC2X3.IFCCSGPRIMITIVE3D'] * TYPEOF(self.item)) >= 1) if not eval_wr01_wr: raise AssertionError('Rule wr01 violated') else: return eval_wr01_wr #################### # ENTITY ifcpropertyreferencevalue # #################### class ifcpropertyreferencevalue(ifcsimpleproperty): '''Entity ifcpropertyreferencevalue definition. :param usagename :type usagename:ifclabel :param propertyreference :type propertyreference:ifcobjectreferenceselect ''' def __init__( self , inherited0__name , inherited1__description , usagename,propertyreference, ): ifcsimpleproperty.__init__(self , inherited0__name , inherited1__description , ) self.usagename = usagename self.propertyreference = propertyreference @apply def usagename(): def fget( self ): return self._usagename def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._usagename = ifclabel(value) else: self._usagename = value else: self._usagename = value return property(**locals()) @apply def propertyreference(): def fget( self ): return self._propertyreference def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument propertyreference is mantatory and can not be set to None') if not check_type(value,ifcobjectreferenceselect): self._propertyreference = ifcobjectreferenceselect(value) else: self._propertyreference = value return property(**locals()) #################### # ENTITY ifcrelassignstoactor # #################### class ifcrelassignstoactor(ifcrelassigns): '''Entity ifcrelassignstoactor definition. :param relatingactor :type relatingactor:ifcactor :param actingrole :type actingrole:ifcactorrole ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatedobjectstype , relatingactor,actingrole, ): ifcrelassigns.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatedobjectstype , ) self.relatingactor = relatingactor self.actingrole = actingrole @apply def relatingactor(): def fget( self ): return self._relatingactor def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingactor is mantatory and can not be set to None') if not check_type(value,ifcactor): self._relatingactor = ifcactor(value) else: self._relatingactor = value return property(**locals()) @apply def actingrole(): def fget( self ): return self._actingrole def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcactorrole): self._actingrole = ifcactorrole(value) else: self._actingrole = value else: self._actingrole = value return property(**locals()) def wr1(self): eval_wr1_wr = (SIZEOF(None) == 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcreloccupiesspaces # #################### class ifcreloccupiesspaces(ifcrelassignstoactor): '''Entity ifcreloccupiesspaces definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatedobjectstype , inherited6__relatingactor , inherited7__actingrole , ): ifcrelassignstoactor.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , inherited5__relatedobjectstype , inherited6__relatingactor , inherited7__actingrole , ) #################### # ENTITY ifcpointonsurface # #################### class ifcpointonsurface(ifcpoint): '''Entity ifcpointonsurface definition. :param basissurface :type basissurface:ifcsurface :param pointparameteru :type pointparameteru:ifcparametervalue :param pointparameterv :type pointparameterv:ifcparametervalue :param dim :type dim:ifcdimensioncount ''' def __init__( self , basissurface,pointparameteru,pointparameterv, ): ifcpoint.__init__(self , ) self.basissurface = basissurface self.pointparameteru = pointparameteru self.pointparameterv = pointparameterv @apply def basissurface(): def fget( self ): return self._basissurface def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument basissurface is mantatory and can not be set to None') if not check_type(value,ifcsurface): self._basissurface = ifcsurface(value) else: self._basissurface = value return property(**locals()) @apply def pointparameteru(): def fget( self ): return self._pointparameteru def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument pointparameteru is mantatory and can not be set to None') if not check_type(value,ifcparametervalue): self._pointparameteru = ifcparametervalue(value) else: self._pointparameteru = value return property(**locals()) @apply def pointparameterv(): def fget( self ): return self._pointparameterv def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument pointparameterv is mantatory and can not be set to None') if not check_type(value,ifcparametervalue): self._pointparameterv = ifcparametervalue(value) else: self._pointparameterv = value return property(**locals()) @apply def dim(): def fget( self ): attribute_eval = self.basissurface.self.dim return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcboilertype # #################### class ifcboilertype(ifcenergyconversiondevicetype): '''Entity ifcboilertype definition. :param predefinedtype :type predefinedtype:ifcboilertypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcenergyconversiondevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcboilertypeenum): self._predefinedtype = ifcboilertypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcboilertypeenum.self.userdefined) or ((self.predefinedtype == ifcboilertypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcactor # #################### class ifcactor(ifcobject): '''Entity ifcactor definition. :param theactor :type theactor:ifcactorselect :param isactingupon :type isactingupon:SET(0,None,'ifcrelassignstoactor', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , theactor, ): ifcobject.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.theactor = theactor @apply def theactor(): def fget( self ): return self._theactor def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument theactor is mantatory and can not be set to None') if not check_type(value,ifcactorselect): self._theactor = ifcactorselect(value) else: self._theactor = value return property(**locals()) @apply def isactingupon(): def fget( self ): return self._isactingupon def fset( self, value ): # INVERSE argument raise AssertionError('Argument isactingupon is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcoccupant # #################### class ifcoccupant(ifcactor): '''Entity ifcoccupant definition. :param predefinedtype :type predefinedtype:ifcoccupanttypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__theactor , predefinedtype, ): ifcactor.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__theactor , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcoccupanttypeenum): self._predefinedtype = ifcoccupanttypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr31(self): eval_wr31_wr = (( not (self.predefinedtype == ifcoccupanttypeenum.self.userdefined)) or EXISTS(self.self.ifcobject.self.objecttype)) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifcrelcontainedinspatialstructure # #################### class ifcrelcontainedinspatialstructure(ifcrelconnects): '''Entity ifcrelcontainedinspatialstructure definition. :param relatedelements :type relatedelements:SET(1,None,'ifcproduct', scope = schema_scope) :param relatingstructure :type relatingstructure:ifcspatialstructureelement ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , relatedelements,relatingstructure, ): ifcrelconnects.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.relatedelements = relatedelements self.relatingstructure = relatingstructure @apply def relatedelements(): def fget( self ): return self._relatedelements def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedelements is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcproduct', scope = schema_scope)): self._relatedelements = SET(value) else: self._relatedelements = value return property(**locals()) @apply def relatingstructure(): def fget( self ): return self._relatingstructure def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingstructure is mantatory and can not be set to None') if not check_type(value,ifcspatialstructureelement): self._relatingstructure = ifcspatialstructureelement(value) else: self._relatingstructure = value return property(**locals()) def wr31(self): eval_wr31_wr = (SIZEOF(None) == 0) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifcstructuralpointconnection # #################### class ifcstructuralpointconnection(ifcstructuralconnection): '''Entity ifcstructuralpointconnection definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedcondition , ): ifcstructuralconnection.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__appliedcondition , ) #################### # ENTITY ifcflowsegment # #################### class ifcflowsegment(ifcdistributionflowelement): '''Entity ifcflowsegment definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcdistributionflowelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcoffsetcurve3d # #################### class ifcoffsetcurve3d(ifccurve): '''Entity ifcoffsetcurve3d definition. :param basiscurve :type basiscurve:ifccurve :param distance :type distance:ifclengthmeasure :param selfintersect :type selfintersect:LOGICAL :param refdirection :type refdirection:ifcdirection ''' def __init__( self , basiscurve,distance,selfintersect,refdirection, ): ifccurve.__init__(self , ) self.basiscurve = basiscurve self.distance = distance self.selfintersect = selfintersect self.refdirection = refdirection @apply def basiscurve(): def fget( self ): return self._basiscurve def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument basiscurve is mantatory and can not be set to None') if not check_type(value,ifccurve): self._basiscurve = ifccurve(value) else: self._basiscurve = value return property(**locals()) @apply def distance(): def fget( self ): return self._distance def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument distance is mantatory and can not be set to None') if not check_type(value,ifclengthmeasure): self._distance = ifclengthmeasure(value) else: self._distance = value return property(**locals()) @apply def selfintersect(): def fget( self ): return self._selfintersect def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument selfintersect is mantatory and can not be set to None') if not check_type(value,LOGICAL): self._selfintersect = LOGICAL(value) else: self._selfintersect = value return property(**locals()) @apply def refdirection(): def fget( self ): return self._refdirection def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument refdirection is mantatory and can not be set to None') if not check_type(value,ifcdirection): self._refdirection = ifcdirection(value) else: self._refdirection = value return property(**locals()) def wr1(self): eval_wr1_wr = (self.basiscurve.self.dim == 3) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcvibrationisolatortype # #################### class ifcvibrationisolatortype(ifcdiscreteaccessorytype): '''Entity ifcvibrationisolatortype definition. :param predefinedtype :type predefinedtype:ifcvibrationisolatortypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcdiscreteaccessorytype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcvibrationisolatortypeenum): self._predefinedtype = ifcvibrationisolatortypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcvibrationisolatortypeenum.self.userdefined) or ((self.predefinedtype == ifcvibrationisolatortypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcconversionbasedunit # #################### class ifcconversionbasedunit(ifcnamedunit): '''Entity ifcconversionbasedunit definition. :param name :type name:ifclabel :param conversionfactor :type conversionfactor:ifcmeasurewithunit ''' def __init__( self , inherited0__dimensions , inherited1__unittype , name,conversionfactor, ): ifcnamedunit.__init__(self , inherited0__dimensions , inherited1__unittype , ) self.name = name self.conversionfactor = conversionfactor @apply def name(): def fget( self ): return self._name def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument name is mantatory and can not be set to None') if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value return property(**locals()) @apply def conversionfactor(): def fget( self ): return self._conversionfactor def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument conversionfactor is mantatory and can not be set to None') if not check_type(value,ifcmeasurewithunit): self._conversionfactor = ifcmeasurewithunit(value) else: self._conversionfactor = value return property(**locals()) #################### # ENTITY ifctransformertype # #################### class ifctransformertype(ifcenergyconversiondevicetype): '''Entity ifctransformertype definition. :param predefinedtype :type predefinedtype:ifctransformertypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcenergyconversiondevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifctransformertypeenum): self._predefinedtype = ifctransformertypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcapplication # #################### class ifcapplication(BaseEntityClass): '''Entity ifcapplication definition. :param applicationdeveloper :type applicationdeveloper:ifcorganization :param version :type version:ifclabel :param applicationfullname :type applicationfullname:ifclabel :param applicationidentifier :type applicationidentifier:ifcidentifier ''' def __init__( self , applicationdeveloper,version,applicationfullname,applicationidentifier, ): self.applicationdeveloper = applicationdeveloper self.version = version self.applicationfullname = applicationfullname self.applicationidentifier = applicationidentifier @apply def applicationdeveloper(): def fget( self ): return self._applicationdeveloper def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument applicationdeveloper is mantatory and can not be set to None') if not check_type(value,ifcorganization): self._applicationdeveloper = ifcorganization(value) else: self._applicationdeveloper = value return property(**locals()) @apply def version(): def fget( self ): return self._version def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument version is mantatory and can not be set to None') if not check_type(value,ifclabel): self._version = ifclabel(value) else: self._version = value return property(**locals()) @apply def applicationfullname(): def fget( self ): return self._applicationfullname def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument applicationfullname is mantatory and can not be set to None') if not check_type(value,ifclabel): self._applicationfullname = ifclabel(value) else: self._applicationfullname = value return property(**locals()) @apply def applicationidentifier(): def fget( self ): return self._applicationidentifier def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument applicationidentifier is mantatory and can not be set to None') if not check_type(value,ifcidentifier): self._applicationidentifier = ifcidentifier(value) else: self._applicationidentifier = value return property(**locals()) #################### # ENTITY ifcannotationfillareaoccurrence # #################### class ifcannotationfillareaoccurrence(ifcannotationoccurrence): '''Entity ifcannotationfillareaoccurrence definition. :param fillstyletarget :type fillstyletarget:ifcpoint :param globalorlocal :type globalorlocal:ifcglobalorlocalenum ''' def __init__( self , inherited0__item , inherited1__styles , inherited2__name , fillstyletarget,globalorlocal, ): ifcannotationoccurrence.__init__(self , inherited0__item , inherited1__styles , inherited2__name , ) self.fillstyletarget = fillstyletarget self.globalorlocal = globalorlocal @apply def fillstyletarget(): def fget( self ): return self._fillstyletarget def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpoint): self._fillstyletarget = ifcpoint(value) else: self._fillstyletarget = value else: self._fillstyletarget = value return property(**locals()) @apply def globalorlocal(): def fget( self ): return self._globalorlocal def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcglobalorlocalenum): self._globalorlocal = ifcglobalorlocalenum(value) else: self._globalorlocal = value else: self._globalorlocal = value return property(**locals()) def wr31(self): eval_wr31_wr = (( not EXISTS(self.self.ifcstyleditem.self.item)) or ('IFC2X3.IFCANNOTATIONFILLAREA' == TYPEOF(self.self.ifcstyleditem.self.item))) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifccoveringtype # #################### class ifccoveringtype(ifcbuildingelementtype): '''Entity ifccoveringtype definition. :param predefinedtype :type predefinedtype:ifccoveringtypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcbuildingelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifccoveringtypeenum): self._predefinedtype = ifccoveringtypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcproductdefinitionshape # #################### class ifcproductdefinitionshape(ifcproductrepresentation): '''Entity ifcproductdefinitionshape definition. :param shapeofproduct :type shapeofproduct:SET(1,1,'ifcproduct', scope = schema_scope) :param hasshapeaspects :type hasshapeaspects:SET(0,None,'ifcshapeaspect', scope = schema_scope) ''' def __init__( self , inherited0__name , inherited1__description , inherited2__representations , ): ifcproductrepresentation.__init__(self , inherited0__name , inherited1__description , inherited2__representations , ) @apply def shapeofproduct(): def fget( self ): return self._shapeofproduct def fset( self, value ): # INVERSE argument raise AssertionError('Argument shapeofproduct is INVERSE. It is computed and can not be set to any value') return property(**locals()) @apply def hasshapeaspects(): def fget( self ): return self._hasshapeaspects def fset( self, value ): # INVERSE argument raise AssertionError('Argument hasshapeaspects is INVERSE. It is computed and can not be set to any value') return property(**locals()) def wr11(self): eval_wr11_wr = (SIZEOF(None) == 0) if not eval_wr11_wr: raise AssertionError('Rule wr11 violated') else: return eval_wr11_wr #################### # ENTITY ifcangulardimension # #################### class ifcangulardimension(ifcdimensioncurvedirectedcallout): '''Entity ifcangulardimension definition. ''' def __init__( self , inherited0__contents , ): ifcdimensioncurvedirectedcallout.__init__(self , inherited0__contents , ) #################### # ENTITY ifccirclehollowprofiledef # #################### class ifccirclehollowprofiledef(ifccircleprofiledef): '''Entity ifccirclehollowprofiledef definition. :param wallthickness :type wallthickness:ifcpositivelengthmeasure ''' def __init__( self , inherited0__profiletype , inherited1__profilename , inherited2__position , inherited3__radius , wallthickness, ): ifccircleprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , inherited2__position , inherited3__radius , ) self.wallthickness = wallthickness @apply def wallthickness(): def fget( self ): return self._wallthickness def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument wallthickness is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._wallthickness = ifcpositivelengthmeasure(value) else: self._wallthickness = value return property(**locals()) def wr1(self): eval_wr1_wr = (self.wallthickness < self.self.ifccircleprofiledef.self.radius) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifccenterlineprofiledef # #################### class ifccenterlineprofiledef(ifcarbitraryopenprofiledef): '''Entity ifccenterlineprofiledef definition. :param thickness :type thickness:ifcpositivelengthmeasure ''' def __init__( self , inherited0__profiletype , inherited1__profilename , inherited2__curve , thickness, ): ifcarbitraryopenprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , inherited2__curve , ) self.thickness = thickness @apply def thickness(): def fget( self ): return self._thickness def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument thickness is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._thickness = ifcpositivelengthmeasure(value) else: self._thickness = value return property(**locals()) #################### # ENTITY ifcfaceouterbound # #################### class ifcfaceouterbound(ifcfacebound): '''Entity ifcfaceouterbound definition. ''' def __init__( self , inherited0__bound , inherited1__orientation , ): ifcfacebound.__init__(self , inherited0__bound , inherited1__orientation , ) #################### # ENTITY ifcvector # #################### class ifcvector(ifcgeometricrepresentationitem): '''Entity ifcvector definition. :param orientation :type orientation:ifcdirection :param magnitude :type magnitude:ifclengthmeasure :param dim :type dim:ifcdimensioncount ''' def __init__( self , orientation,magnitude, ): ifcgeometricrepresentationitem.__init__(self , ) self.orientation = orientation self.magnitude = magnitude @apply def orientation(): def fget( self ): return self._orientation def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument orientation is mantatory and can not be set to None') if not check_type(value,ifcdirection): self._orientation = ifcdirection(value) else: self._orientation = value return property(**locals()) @apply def magnitude(): def fget( self ): return self._magnitude def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument magnitude is mantatory and can not be set to None') if not check_type(value,ifclengthmeasure): self._magnitude = ifclengthmeasure(value) else: self._magnitude = value return property(**locals()) @apply def dim(): def fget( self ): attribute_eval = self.orientation.self.dim return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (self.magnitude >= 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifccurtainwall # #################### class ifccurtainwall(ifcbuildingelement): '''Entity ifccurtainwall definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcbuildingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcexternallydefinedhatchstyle # #################### class ifcexternallydefinedhatchstyle(ifcexternalreference): '''Entity ifcexternallydefinedhatchstyle definition. ''' def __init__( self , inherited0__location , inherited1__itemreference , inherited2__name , ): ifcexternalreference.__init__(self , inherited0__location , inherited1__itemreference , inherited2__name , ) #################### # ENTITY ifcmeasurewithunit # #################### class ifcmeasurewithunit(BaseEntityClass): '''Entity ifcmeasurewithunit definition. :param valuecomponent :type valuecomponent:ifcvalue :param unitcomponent :type unitcomponent:ifcunit ''' def __init__( self , valuecomponent,unitcomponent, ): self.valuecomponent = valuecomponent self.unitcomponent = unitcomponent @apply def valuecomponent(): def fget( self ): return self._valuecomponent def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument valuecomponent is mantatory and can not be set to None') if not check_type(value,ifcvalue): self._valuecomponent = ifcvalue(value) else: self._valuecomponent = value return property(**locals()) @apply def unitcomponent(): def fget( self ): return self._unitcomponent def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument unitcomponent is mantatory and can not be set to None') if not check_type(value,ifcunit): self._unitcomponent = ifcunit(value) else: self._unitcomponent = value return property(**locals()) #################### # ENTITY ifcrectangularpyramid # #################### class ifcrectangularpyramid(ifccsgprimitive3d): '''Entity ifcrectangularpyramid definition. :param xlength :type xlength:ifcpositivelengthmeasure :param ylength :type ylength:ifcpositivelengthmeasure :param height :type height:ifcpositivelengthmeasure ''' def __init__( self , inherited0__position , xlength,ylength,height, ): ifccsgprimitive3d.__init__(self , inherited0__position , ) self.xlength = xlength self.ylength = ylength self.height = height @apply def xlength(): def fget( self ): return self._xlength def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument xlength is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._xlength = ifcpositivelengthmeasure(value) else: self._xlength = value return property(**locals()) @apply def ylength(): def fget( self ): return self._ylength def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument ylength is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._ylength = ifcpositivelengthmeasure(value) else: self._ylength = value return property(**locals()) @apply def height(): def fget( self ): return self._height def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument height is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._height = ifcpositivelengthmeasure(value) else: self._height = value return property(**locals()) #################### # ENTITY ifcsurfacestyle # #################### class ifcsurfacestyle(ifcpresentationstyle): '''Entity ifcsurfacestyle definition. :param side :type side:ifcsurfaceside :param styles :type styles:SET(1,5,'ifcsurfacestyleelementselect', scope = schema_scope) ''' def __init__( self , inherited0__name , side,styles, ): ifcpresentationstyle.__init__(self , inherited0__name , ) self.side = side self.styles = styles @apply def side(): def fget( self ): return self._side def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument side is mantatory and can not be set to None') if not check_type(value,ifcsurfaceside): self._side = ifcsurfaceside(value) else: self._side = value return property(**locals()) @apply def styles(): def fget( self ): return self._styles def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument styles is mantatory and can not be set to None') if not check_type(value,SET(1,5,'ifcsurfacestyleelementselect', scope = schema_scope)): self._styles = SET(value) else: self._styles = value return property(**locals()) def wr11(self): eval_wr11_wr = (SIZEOF(None) <= 1) if not eval_wr11_wr: raise AssertionError('Rule wr11 violated') else: return eval_wr11_wr def wr12(self): eval_wr12_wr = (SIZEOF(None) <= 1) if not eval_wr12_wr: raise AssertionError('Rule wr12 violated') else: return eval_wr12_wr def wr13(self): eval_wr13_wr = (SIZEOF(None) <= 1) if not eval_wr13_wr: raise AssertionError('Rule wr13 violated') else: return eval_wr13_wr def wr14(self): eval_wr14_wr = (SIZEOF(None) <= 1) if not eval_wr14_wr: raise AssertionError('Rule wr14 violated') else: return eval_wr14_wr def wr15(self): eval_wr15_wr = (SIZEOF(None) <= 1) if not eval_wr15_wr: raise AssertionError('Rule wr15 violated') else: return eval_wr15_wr #################### # ENTITY ifcelectricmotortype # #################### class ifcelectricmotortype(ifcenergyconversiondevicetype): '''Entity ifcelectricmotortype definition. :param predefinedtype :type predefinedtype:ifcelectricmotortypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcenergyconversiondevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcelectricmotortypeenum): self._predefinedtype = ifcelectricmotortypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcelectricalbaseproperties # #################### class ifcelectricalbaseproperties(ifcenergyproperties): '''Entity ifcelectricalbaseproperties definition. :param electriccurrenttype :type electriccurrenttype:ifcelectriccurrentenum :param inputvoltage :type inputvoltage:ifcelectricvoltagemeasure :param inputfrequency :type inputfrequency:ifcfrequencymeasure :param fullloadcurrent :type fullloadcurrent:ifcelectriccurrentmeasure :param minimumcircuitcurrent :type minimumcircuitcurrent:ifcelectriccurrentmeasure :param maximumpowerinput :type maximumpowerinput:ifcpowermeasure :param ratedpowerinput :type ratedpowerinput:ifcpowermeasure :param inputphase :type inputphase:INTEGER ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__energysequence , inherited5__userdefinedenergysequence , electriccurrenttype,inputvoltage,inputfrequency,fullloadcurrent,minimumcircuitcurrent,maximumpowerinput,ratedpowerinput,inputphase, ): ifcenergyproperties.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__energysequence , inherited5__userdefinedenergysequence , ) self.electriccurrenttype = electriccurrenttype self.inputvoltage = inputvoltage self.inputfrequency = inputfrequency self.fullloadcurrent = fullloadcurrent self.minimumcircuitcurrent = minimumcircuitcurrent self.maximumpowerinput = maximumpowerinput self.ratedpowerinput = ratedpowerinput self.inputphase = inputphase @apply def electriccurrenttype(): def fget( self ): return self._electriccurrenttype def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcelectriccurrentenum): self._electriccurrenttype = ifcelectriccurrentenum(value) else: self._electriccurrenttype = value else: self._electriccurrenttype = value return property(**locals()) @apply def inputvoltage(): def fget( self ): return self._inputvoltage def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument inputvoltage is mantatory and can not be set to None') if not check_type(value,ifcelectricvoltagemeasure): self._inputvoltage = ifcelectricvoltagemeasure(value) else: self._inputvoltage = value return property(**locals()) @apply def inputfrequency(): def fget( self ): return self._inputfrequency def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument inputfrequency is mantatory and can not be set to None') if not check_type(value,ifcfrequencymeasure): self._inputfrequency = ifcfrequencymeasure(value) else: self._inputfrequency = value return property(**locals()) @apply def fullloadcurrent(): def fget( self ): return self._fullloadcurrent def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcelectriccurrentmeasure): self._fullloadcurrent = ifcelectriccurrentmeasure(value) else: self._fullloadcurrent = value else: self._fullloadcurrent = value return property(**locals()) @apply def minimumcircuitcurrent(): def fget( self ): return self._minimumcircuitcurrent def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcelectriccurrentmeasure): self._minimumcircuitcurrent = ifcelectriccurrentmeasure(value) else: self._minimumcircuitcurrent = value else: self._minimumcircuitcurrent = value return property(**locals()) @apply def maximumpowerinput(): def fget( self ): return self._maximumpowerinput def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpowermeasure): self._maximumpowerinput = ifcpowermeasure(value) else: self._maximumpowerinput = value else: self._maximumpowerinput = value return property(**locals()) @apply def ratedpowerinput(): def fget( self ): return self._ratedpowerinput def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpowermeasure): self._ratedpowerinput = ifcpowermeasure(value) else: self._ratedpowerinput = value else: self._ratedpowerinput = value return property(**locals()) @apply def inputphase(): def fget( self ): return self._inputphase def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument inputphase is mantatory and can not be set to None') if not check_type(value,INTEGER): self._inputphase = INTEGER(value) else: self._inputphase = value return property(**locals()) #################### # ENTITY ifcirregulartimeseriesvalue # #################### class ifcirregulartimeseriesvalue(BaseEntityClass): '''Entity ifcirregulartimeseriesvalue definition. :param timestamp :type timestamp:ifcdatetimeselect :param listvalues :type listvalues:LIST(1,None,'ifcvalue', scope = schema_scope) ''' def __init__( self , timestamp,listvalues, ): self.timestamp = timestamp self.listvalues = listvalues @apply def timestamp(): def fget( self ): return self._timestamp def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument timestamp is mantatory and can not be set to None') if not check_type(value,ifcdatetimeselect): self._timestamp = ifcdatetimeselect(value) else: self._timestamp = value return property(**locals()) @apply def listvalues(): def fget( self ): return self._listvalues def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument listvalues is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcvalue', scope = schema_scope)): self._listvalues = LIST(value) else: self._listvalues = value return property(**locals()) #################### # ENTITY ifcpresentationlayerassignment # #################### class ifcpresentationlayerassignment(BaseEntityClass): '''Entity ifcpresentationlayerassignment definition. :param name :type name:ifclabel :param description :type description:ifctext :param assigneditems :type assigneditems:SET(1,None,'ifclayereditem', scope = schema_scope) :param identifier :type identifier:ifcidentifier ''' def __init__( self , name,description,assigneditems,identifier, ): self.name = name self.description = description self.assigneditems = assigneditems self.identifier = identifier @apply def name(): def fget( self ): return self._name def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument name is mantatory and can not be set to None') if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) @apply def assigneditems(): def fget( self ): return self._assigneditems def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument assigneditems is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifclayereditem', scope = schema_scope)): self._assigneditems = SET(value) else: self._assigneditems = value return property(**locals()) @apply def identifier(): def fget( self ): return self._identifier def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcidentifier): self._identifier = ifcidentifier(value) else: self._identifier = value else: self._identifier = value return property(**locals()) #################### # ENTITY ifcprojectionelement # #################### class ifcprojectionelement(ifcfeatureelementaddition): '''Entity ifcprojectionelement definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcfeatureelementaddition.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) #################### # ENTITY ifcrelassociatesapproval # #################### class ifcrelassociatesapproval(ifcrelassociates): '''Entity ifcrelassociatesapproval definition. :param relatingapproval :type relatingapproval:ifcapproval ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , relatingapproval, ): ifcrelassociates.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , ) self.relatingapproval = relatingapproval @apply def relatingapproval(): def fget( self ): return self._relatingapproval def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingapproval is mantatory and can not be set to None') if not check_type(value,ifcapproval): self._relatingapproval = ifcapproval(value) else: self._relatingapproval = value return property(**locals()) #################### # ENTITY ifccurvestyle # #################### class ifccurvestyle(ifcpresentationstyle): '''Entity ifccurvestyle definition. :param curvefont :type curvefont:ifccurvefontorscaledcurvefontselect :param curvewidth :type curvewidth:ifcsizeselect :param curvecolour :type curvecolour:ifccolour ''' def __init__( self , inherited0__name , curvefont,curvewidth,curvecolour, ): ifcpresentationstyle.__init__(self , inherited0__name , ) self.curvefont = curvefont self.curvewidth = curvewidth self.curvecolour = curvecolour @apply def curvefont(): def fget( self ): return self._curvefont def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccurvefontorscaledcurvefontselect): self._curvefont = ifccurvefontorscaledcurvefontselect(value) else: self._curvefont = value else: self._curvefont = value return property(**locals()) @apply def curvewidth(): def fget( self ): return self._curvewidth def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcsizeselect): self._curvewidth = ifcsizeselect(value) else: self._curvewidth = value else: self._curvewidth = value return property(**locals()) @apply def curvecolour(): def fget( self ): return self._curvecolour def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccolour): self._curvecolour = ifccolour(value) else: self._curvecolour = value else: self._curvecolour = value return property(**locals()) def wr11(self): eval_wr11_wr = ((( not EXISTS(self.curvewidth)) or ('IFC2X3.IFCPOSITIVELENGTHMEASURE' == TYPEOF(self.curvewidth))) or (('IFC2X3.IFCDESCRIPTIVEMEASURE' == TYPEOF(self.curvewidth)) and (self.curvewidth == 'by layer'))) if not eval_wr11_wr: raise AssertionError('Rule wr11 violated') else: return eval_wr11_wr #################### # ENTITY ifcdirection # #################### class ifcdirection(ifcgeometricrepresentationitem): '''Entity ifcdirection definition. :param directionratios :type directionratios:LIST(2,3,'REAL', scope = schema_scope) :param dim :type dim:ifcdimensioncount ''' def __init__( self , directionratios, ): ifcgeometricrepresentationitem.__init__(self , ) self.directionratios = directionratios @apply def directionratios(): def fget( self ): return self._directionratios def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument directionratios is mantatory and can not be set to None') if not check_type(value,LIST(2,3,'REAL', scope = schema_scope)): self._directionratios = LIST(value) else: self._directionratios = value return property(**locals()) @apply def dim(): def fget( self ): attribute_eval = HIINDEX(self.directionratios) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument dim is DERIVED. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcfillareastyletiles # #################### class ifcfillareastyletiles(ifcgeometricrepresentationitem): '''Entity ifcfillareastyletiles definition. :param tilingpattern :type tilingpattern:ifconedirectionrepeatfactor :param tiles :type tiles:SET(1,None,'ifcfillareastyletileshapeselect', scope = schema_scope) :param tilingscale :type tilingscale:ifcpositiveratiomeasure ''' def __init__( self , tilingpattern,tiles,tilingscale, ): ifcgeometricrepresentationitem.__init__(self , ) self.tilingpattern = tilingpattern self.tiles = tiles self.tilingscale = tilingscale @apply def tilingpattern(): def fget( self ): return self._tilingpattern def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument tilingpattern is mantatory and can not be set to None') if not check_type(value,ifconedirectionrepeatfactor): self._tilingpattern = ifconedirectionrepeatfactor(value) else: self._tilingpattern = value return property(**locals()) @apply def tiles(): def fget( self ): return self._tiles def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument tiles is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcfillareastyletileshapeselect', scope = schema_scope)): self._tiles = SET(value) else: self._tiles = value return property(**locals()) @apply def tilingscale(): def fget( self ): return self._tilingscale def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument tilingscale is mantatory and can not be set to None') if not check_type(value,ifcpositiveratiomeasure): self._tilingscale = ifcpositiveratiomeasure(value) else: self._tilingscale = value return property(**locals()) #################### # ENTITY ifcbeamtype # #################### class ifcbeamtype(ifcbuildingelementtype): '''Entity ifcbeamtype definition. :param predefinedtype :type predefinedtype:ifcbeamtypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcbuildingelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcbeamtypeenum): self._predefinedtype = ifcbeamtypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifclightsourcegoniometric # #################### class ifclightsourcegoniometric(ifclightsource): '''Entity ifclightsourcegoniometric definition. :param position :type position:ifcaxis2placement3d :param colourappearance :type colourappearance:ifccolourrgb :param colourtemperature :type colourtemperature:ifcthermodynamictemperaturemeasure :param luminousflux :type luminousflux:ifcluminousfluxmeasure :param lightemissionsource :type lightemissionsource:ifclightemissionsourceenum :param lightdistributiondatasource :type lightdistributiondatasource:ifclightdistributiondatasourceselect ''' def __init__( self , inherited0__name , inherited1__lightcolour , inherited2__ambientintensity , inherited3__intensity , position,colourappearance,colourtemperature,luminousflux,lightemissionsource,lightdistributiondatasource, ): ifclightsource.__init__(self , inherited0__name , inherited1__lightcolour , inherited2__ambientintensity , inherited3__intensity , ) self.position = position self.colourappearance = colourappearance self.colourtemperature = colourtemperature self.luminousflux = luminousflux self.lightemissionsource = lightemissionsource self.lightdistributiondatasource = lightdistributiondatasource @apply def position(): def fget( self ): return self._position def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument position is mantatory and can not be set to None') if not check_type(value,ifcaxis2placement3d): self._position = ifcaxis2placement3d(value) else: self._position = value return property(**locals()) @apply def colourappearance(): def fget( self ): return self._colourappearance def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccolourrgb): self._colourappearance = ifccolourrgb(value) else: self._colourappearance = value else: self._colourappearance = value return property(**locals()) @apply def colourtemperature(): def fget( self ): return self._colourtemperature def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument colourtemperature is mantatory and can not be set to None') if not check_type(value,ifcthermodynamictemperaturemeasure): self._colourtemperature = ifcthermodynamictemperaturemeasure(value) else: self._colourtemperature = value return property(**locals()) @apply def luminousflux(): def fget( self ): return self._luminousflux def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument luminousflux is mantatory and can not be set to None') if not check_type(value,ifcluminousfluxmeasure): self._luminousflux = ifcluminousfluxmeasure(value) else: self._luminousflux = value return property(**locals()) @apply def lightemissionsource(): def fget( self ): return self._lightemissionsource def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument lightemissionsource is mantatory and can not be set to None') if not check_type(value,ifclightemissionsourceenum): self._lightemissionsource = ifclightemissionsourceenum(value) else: self._lightemissionsource = value return property(**locals()) @apply def lightdistributiondatasource(): def fget( self ): return self._lightdistributiondatasource def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument lightdistributiondatasource is mantatory and can not be set to None') if not check_type(value,ifclightdistributiondatasourceselect): self._lightdistributiondatasource = ifclightdistributiondatasourceselect(value) else: self._lightdistributiondatasource = value return property(**locals()) #################### # ENTITY ifcsensortype # #################### class ifcsensortype(ifcdistributioncontrolelementtype): '''Entity ifcsensortype definition. :param predefinedtype :type predefinedtype:ifcsensortypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcdistributioncontrolelementtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcsensortypeenum): self._predefinedtype = ifcsensortypeenum(value) else: self._predefinedtype = value return property(**locals()) #################### # ENTITY ifcstructuralsteelprofileproperties # #################### class ifcstructuralsteelprofileproperties(ifcstructuralprofileproperties): '''Entity ifcstructuralsteelprofileproperties definition. :param shearareaz :type shearareaz:ifcareameasure :param shearareay :type shearareay:ifcareameasure :param plasticshapefactory :type plasticshapefactory:ifcpositiveratiomeasure :param plasticshapefactorz :type plasticshapefactorz:ifcpositiveratiomeasure ''' def __init__( self , inherited0__profilename , inherited1__profiledefinition , inherited2__physicalweight , inherited3__perimeter , inherited4__minimumplatethickness , inherited5__maximumplatethickness , inherited6__crosssectionarea , inherited7__torsionalconstantx , inherited8__momentofinertiayz , inherited9__momentofinertiay , inherited10__momentofinertiaz , inherited11__warpingconstant , inherited12__shearcentrez , inherited13__shearcentrey , inherited14__sheardeformationareaz , inherited15__sheardeformationareay , inherited16__maximumsectionmodulusy , inherited17__minimumsectionmodulusy , inherited18__maximumsectionmodulusz , inherited19__minimumsectionmodulusz , inherited20__torsionalsectionmodulus , inherited21__centreofgravityinx , inherited22__centreofgravityiny , shearareaz,shearareay,plasticshapefactory,plasticshapefactorz, ): ifcstructuralprofileproperties.__init__(self , inherited0__profilename , inherited1__profiledefinition , inherited2__physicalweight , inherited3__perimeter , inherited4__minimumplatethickness , inherited5__maximumplatethickness , inherited6__crosssectionarea , inherited7__torsionalconstantx , inherited8__momentofinertiayz , inherited9__momentofinertiay , inherited10__momentofinertiaz , inherited11__warpingconstant , inherited12__shearcentrez , inherited13__shearcentrey , inherited14__sheardeformationareaz , inherited15__sheardeformationareay , inherited16__maximumsectionmodulusy , inherited17__minimumsectionmodulusy , inherited18__maximumsectionmodulusz , inherited19__minimumsectionmodulusz , inherited20__torsionalsectionmodulus , inherited21__centreofgravityinx , inherited22__centreofgravityiny , ) self.shearareaz = shearareaz self.shearareay = shearareay self.plasticshapefactory = plasticshapefactory self.plasticshapefactorz = plasticshapefactorz @apply def shearareaz(): def fget( self ): return self._shearareaz def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcareameasure): self._shearareaz = ifcareameasure(value) else: self._shearareaz = value else: self._shearareaz = value return property(**locals()) @apply def shearareay(): def fget( self ): return self._shearareay def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcareameasure): self._shearareay = ifcareameasure(value) else: self._shearareay = value else: self._shearareay = value return property(**locals()) @apply def plasticshapefactory(): def fget( self ): return self._plasticshapefactory def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._plasticshapefactory = ifcpositiveratiomeasure(value) else: self._plasticshapefactory = value else: self._plasticshapefactory = value return property(**locals()) @apply def plasticshapefactorz(): def fget( self ): return self._plasticshapefactorz def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._plasticshapefactorz = ifcpositiveratiomeasure(value) else: self._plasticshapefactorz = value else: self._plasticshapefactorz = value return property(**locals()) def wr31(self): eval_wr31_wr = (( not EXISTS(self.shearareay)) or (self.shearareay >= 0)) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr def wr32(self): eval_wr32_wr = (( not EXISTS(self.shearareaz)) or (self.shearareaz >= 0)) if not eval_wr32_wr: raise AssertionError('Rule wr32 violated') else: return eval_wr32_wr #################### # ENTITY ifcconnectionportgeometry # #################### class ifcconnectionportgeometry(ifcconnectiongeometry): '''Entity ifcconnectionportgeometry definition. :param locationatrelatingelement :type locationatrelatingelement:ifcaxis2placement :param locationatrelatedelement :type locationatrelatedelement:ifcaxis2placement :param profileofport :type profileofport:ifcprofiledef ''' def __init__( self , locationatrelatingelement,locationatrelatedelement,profileofport, ): ifcconnectiongeometry.__init__(self , ) self.locationatrelatingelement = locationatrelatingelement self.locationatrelatedelement = locationatrelatedelement self.profileofport = profileofport @apply def locationatrelatingelement(): def fget( self ): return self._locationatrelatingelement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument locationatrelatingelement is mantatory and can not be set to None') if not check_type(value,ifcaxis2placement): self._locationatrelatingelement = ifcaxis2placement(value) else: self._locationatrelatingelement = value return property(**locals()) @apply def locationatrelatedelement(): def fget( self ): return self._locationatrelatedelement def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcaxis2placement): self._locationatrelatedelement = ifcaxis2placement(value) else: self._locationatrelatedelement = value else: self._locationatrelatedelement = value return property(**locals()) @apply def profileofport(): def fget( self ): return self._profileofport def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument profileofport is mantatory and can not be set to None') if not check_type(value,ifcprofiledef): self._profileofport = ifcprofiledef(value) else: self._profileofport = value return property(**locals()) #################### # ENTITY ifcwaterproperties # #################### class ifcwaterproperties(ifcmaterialproperties): '''Entity ifcwaterproperties definition. :param ispotable :type ispotable:BOOLEAN :param hardness :type hardness:ifcionconcentrationmeasure :param alkalinityconcentration :type alkalinityconcentration:ifcionconcentrationmeasure :param acidityconcentration :type acidityconcentration:ifcionconcentrationmeasure :param impuritiescontent :type impuritiescontent:ifcnormalisedratiomeasure :param phlevel :type phlevel:ifcphmeasure :param dissolvedsolidscontent :type dissolvedsolidscontent:ifcnormalisedratiomeasure ''' def __init__( self , inherited0__material , ispotable,hardness,alkalinityconcentration,acidityconcentration,impuritiescontent,phlevel,dissolvedsolidscontent, ): ifcmaterialproperties.__init__(self , inherited0__material , ) self.ispotable = ispotable self.hardness = hardness self.alkalinityconcentration = alkalinityconcentration self.acidityconcentration = acidityconcentration self.impuritiescontent = impuritiescontent self.phlevel = phlevel self.dissolvedsolidscontent = dissolvedsolidscontent @apply def ispotable(): def fget( self ): return self._ispotable def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,BOOLEAN): self._ispotable = BOOLEAN(value) else: self._ispotable = value else: self._ispotable = value return property(**locals()) @apply def hardness(): def fget( self ): return self._hardness def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcionconcentrationmeasure): self._hardness = ifcionconcentrationmeasure(value) else: self._hardness = value else: self._hardness = value return property(**locals()) @apply def alkalinityconcentration(): def fget( self ): return self._alkalinityconcentration def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcionconcentrationmeasure): self._alkalinityconcentration = ifcionconcentrationmeasure(value) else: self._alkalinityconcentration = value else: self._alkalinityconcentration = value return property(**locals()) @apply def acidityconcentration(): def fget( self ): return self._acidityconcentration def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcionconcentrationmeasure): self._acidityconcentration = ifcionconcentrationmeasure(value) else: self._acidityconcentration = value else: self._acidityconcentration = value return property(**locals()) @apply def impuritiescontent(): def fget( self ): return self._impuritiescontent def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcnormalisedratiomeasure): self._impuritiescontent = ifcnormalisedratiomeasure(value) else: self._impuritiescontent = value else: self._impuritiescontent = value return property(**locals()) @apply def phlevel(): def fget( self ): return self._phlevel def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcphmeasure): self._phlevel = ifcphmeasure(value) else: self._phlevel = value else: self._phlevel = value return property(**locals()) @apply def dissolvedsolidscontent(): def fget( self ): return self._dissolvedsolidscontent def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcnormalisedratiomeasure): self._dissolvedsolidscontent = ifcnormalisedratiomeasure(value) else: self._dissolvedsolidscontent = value else: self._dissolvedsolidscontent = value return property(**locals()) #################### # ENTITY ifcfuelproperties # #################### class ifcfuelproperties(ifcmaterialproperties): '''Entity ifcfuelproperties definition. :param combustiontemperature :type combustiontemperature:ifcthermodynamictemperaturemeasure :param carboncontent :type carboncontent:ifcpositiveratiomeasure :param lowerheatingvalue :type lowerheatingvalue:ifcheatingvaluemeasure :param higherheatingvalue :type higherheatingvalue:ifcheatingvaluemeasure ''' def __init__( self , inherited0__material , combustiontemperature,carboncontent,lowerheatingvalue,higherheatingvalue, ): ifcmaterialproperties.__init__(self , inherited0__material , ) self.combustiontemperature = combustiontemperature self.carboncontent = carboncontent self.lowerheatingvalue = lowerheatingvalue self.higherheatingvalue = higherheatingvalue @apply def combustiontemperature(): def fget( self ): return self._combustiontemperature def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcthermodynamictemperaturemeasure): self._combustiontemperature = ifcthermodynamictemperaturemeasure(value) else: self._combustiontemperature = value else: self._combustiontemperature = value return property(**locals()) @apply def carboncontent(): def fget( self ): return self._carboncontent def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._carboncontent = ifcpositiveratiomeasure(value) else: self._carboncontent = value else: self._carboncontent = value return property(**locals()) @apply def lowerheatingvalue(): def fget( self ): return self._lowerheatingvalue def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcheatingvaluemeasure): self._lowerheatingvalue = ifcheatingvaluemeasure(value) else: self._lowerheatingvalue = value else: self._lowerheatingvalue = value return property(**locals()) @apply def higherheatingvalue(): def fget( self ): return self._higherheatingvalue def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcheatingvaluemeasure): self._higherheatingvalue = ifcheatingvaluemeasure(value) else: self._higherheatingvalue = value else: self._higherheatingvalue = value return property(**locals()) #################### # ENTITY ifclocaltime # #################### class ifclocaltime(BaseEntityClass): '''Entity ifclocaltime definition. :param hourcomponent :type hourcomponent:ifchourinday :param minutecomponent :type minutecomponent:ifcminuteinhour :param secondcomponent :type secondcomponent:ifcsecondinminute :param zone :type zone:ifccoordinateduniversaltimeoffset :param daylightsavingoffset :type daylightsavingoffset:ifcdaylightsavinghour ''' def __init__( self , hourcomponent,minutecomponent,secondcomponent,zone,daylightsavingoffset, ): self.hourcomponent = hourcomponent self.minutecomponent = minutecomponent self.secondcomponent = secondcomponent self.zone = zone self.daylightsavingoffset = daylightsavingoffset @apply def hourcomponent(): def fget( self ): return self._hourcomponent def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument hourcomponent is mantatory and can not be set to None') if not check_type(value,ifchourinday): self._hourcomponent = ifchourinday(value) else: self._hourcomponent = value return property(**locals()) @apply def minutecomponent(): def fget( self ): return self._minutecomponent def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcminuteinhour): self._minutecomponent = ifcminuteinhour(value) else: self._minutecomponent = value else: self._minutecomponent = value return property(**locals()) @apply def secondcomponent(): def fget( self ): return self._secondcomponent def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcsecondinminute): self._secondcomponent = ifcsecondinminute(value) else: self._secondcomponent = value else: self._secondcomponent = value return property(**locals()) @apply def zone(): def fget( self ): return self._zone def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccoordinateduniversaltimeoffset): self._zone = ifccoordinateduniversaltimeoffset(value) else: self._zone = value else: self._zone = value return property(**locals()) @apply def daylightsavingoffset(): def fget( self ): return self._daylightsavingoffset def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdaylightsavinghour): self._daylightsavingoffset = ifcdaylightsavinghour(value) else: self._daylightsavingoffset = value else: self._daylightsavingoffset = value return property(**locals()) def wr21(self): eval_wr21_wr = ifcvalidtime(self) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr #################### # ENTITY ifcslippageconnectioncondition # #################### class ifcslippageconnectioncondition(ifcstructuralconnectioncondition): '''Entity ifcslippageconnectioncondition definition. :param slippagex :type slippagex:ifclengthmeasure :param slippagey :type slippagey:ifclengthmeasure :param slippagez :type slippagez:ifclengthmeasure ''' def __init__( self , inherited0__name , slippagex,slippagey,slippagez, ): ifcstructuralconnectioncondition.__init__(self , inherited0__name , ) self.slippagex = slippagex self.slippagey = slippagey self.slippagez = slippagez @apply def slippagex(): def fget( self ): return self._slippagex def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._slippagex = ifclengthmeasure(value) else: self._slippagex = value else: self._slippagex = value return property(**locals()) @apply def slippagey(): def fget( self ): return self._slippagey def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._slippagey = ifclengthmeasure(value) else: self._slippagey = value else: self._slippagey = value return property(**locals()) @apply def slippagez(): def fget( self ): return self._slippagez def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._slippagez = ifclengthmeasure(value) else: self._slippagez = value else: self._slippagez = value return property(**locals()) #################### # ENTITY ifcstructuralresultgroup # #################### class ifcstructuralresultgroup(ifcgroup): '''Entity ifcstructuralresultgroup definition. :param theorytype :type theorytype:ifcanalysistheorytypeenum :param resultforloadgroup :type resultforloadgroup:ifcstructuralloadgroup :param islinear :type islinear:BOOLEAN :param resultgroupfor :type resultgroupfor:SET(0,1,'ifcstructuralanalysismodel', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , theorytype,resultforloadgroup,islinear, ): ifcgroup.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.theorytype = theorytype self.resultforloadgroup = resultforloadgroup self.islinear = islinear @apply def theorytype(): def fget( self ): return self._theorytype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument theorytype is mantatory and can not be set to None') if not check_type(value,ifcanalysistheorytypeenum): self._theorytype = ifcanalysistheorytypeenum(value) else: self._theorytype = value return property(**locals()) @apply def resultforloadgroup(): def fget( self ): return self._resultforloadgroup def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcstructuralloadgroup): self._resultforloadgroup = ifcstructuralloadgroup(value) else: self._resultforloadgroup = value else: self._resultforloadgroup = value return property(**locals()) @apply def islinear(): def fget( self ): return self._islinear def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument islinear is mantatory and can not be set to None') if not check_type(value,BOOLEAN): self._islinear = BOOLEAN(value) else: self._islinear = value return property(**locals()) @apply def resultgroupfor(): def fget( self ): return self._resultgroupfor def fset( self, value ): # INVERSE argument raise AssertionError('Argument resultgroupfor is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifctopologyrepresentation # #################### class ifctopologyrepresentation(ifcshapemodel): '''Entity ifctopologyrepresentation definition. ''' def __init__( self , inherited0__contextofitems , inherited1__representationidentifier , inherited2__representationtype , inherited3__items , ): ifcshapemodel.__init__(self , inherited0__contextofitems , inherited1__representationidentifier , inherited2__representationtype , inherited3__items , ) def wr21(self): eval_wr21_wr = (SIZEOF(None) == 0) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr def wr22(self): eval_wr22_wr = EXISTS(self.self.ifcrepresentation.self.representationtype) if not eval_wr22_wr: raise AssertionError('Rule wr22 violated') else: return eval_wr22_wr def wr23(self): eval_wr23_wr = ifctopologyrepresentationtypes(self.self.ifcrepresentation.self.representationtype,self.self.ifcrepresentation.self.items) if not eval_wr23_wr: raise AssertionError('Rule wr23 violated') else: return eval_wr23_wr #################### # ENTITY ifcblock # #################### class ifcblock(ifccsgprimitive3d): '''Entity ifcblock definition. :param xlength :type xlength:ifcpositivelengthmeasure :param ylength :type ylength:ifcpositivelengthmeasure :param zlength :type zlength:ifcpositivelengthmeasure ''' def __init__( self , inherited0__position , xlength,ylength,zlength, ): ifccsgprimitive3d.__init__(self , inherited0__position , ) self.xlength = xlength self.ylength = ylength self.zlength = zlength @apply def xlength(): def fget( self ): return self._xlength def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument xlength is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._xlength = ifcpositivelengthmeasure(value) else: self._xlength = value return property(**locals()) @apply def ylength(): def fget( self ): return self._ylength def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument ylength is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._ylength = ifcpositivelengthmeasure(value) else: self._ylength = value return property(**locals()) @apply def zlength(): def fget( self ): return self._zlength def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument zlength is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._zlength = ifcpositivelengthmeasure(value) else: self._zlength = value return property(**locals()) #################### # ENTITY ifcconnectionpointgeometry # #################### class ifcconnectionpointgeometry(ifcconnectiongeometry): '''Entity ifcconnectionpointgeometry definition. :param pointonrelatingelement :type pointonrelatingelement:ifcpointorvertexpoint :param pointonrelatedelement :type pointonrelatedelement:ifcpointorvertexpoint ''' def __init__( self , pointonrelatingelement,pointonrelatedelement, ): ifcconnectiongeometry.__init__(self , ) self.pointonrelatingelement = pointonrelatingelement self.pointonrelatedelement = pointonrelatedelement @apply def pointonrelatingelement(): def fget( self ): return self._pointonrelatingelement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument pointonrelatingelement is mantatory and can not be set to None') if not check_type(value,ifcpointorvertexpoint): self._pointonrelatingelement = ifcpointorvertexpoint(value) else: self._pointonrelatingelement = value return property(**locals()) @apply def pointonrelatedelement(): def fget( self ): return self._pointonrelatedelement def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpointorvertexpoint): self._pointonrelatedelement = ifcpointorvertexpoint(value) else: self._pointonrelatedelement = value else: self._pointonrelatedelement = value return property(**locals()) #################### # ENTITY ifcconnectionpointeccentricity # #################### class ifcconnectionpointeccentricity(ifcconnectionpointgeometry): '''Entity ifcconnectionpointeccentricity definition. :param eccentricityinx :type eccentricityinx:ifclengthmeasure :param eccentricityiny :type eccentricityiny:ifclengthmeasure :param eccentricityinz :type eccentricityinz:ifclengthmeasure ''' def __init__( self , inherited0__pointonrelatingelement , inherited1__pointonrelatedelement , eccentricityinx,eccentricityiny,eccentricityinz, ): ifcconnectionpointgeometry.__init__(self , inherited0__pointonrelatingelement , inherited1__pointonrelatedelement , ) self.eccentricityinx = eccentricityinx self.eccentricityiny = eccentricityiny self.eccentricityinz = eccentricityinz @apply def eccentricityinx(): def fget( self ): return self._eccentricityinx def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._eccentricityinx = ifclengthmeasure(value) else: self._eccentricityinx = value else: self._eccentricityinx = value return property(**locals()) @apply def eccentricityiny(): def fget( self ): return self._eccentricityiny def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._eccentricityiny = ifclengthmeasure(value) else: self._eccentricityiny = value else: self._eccentricityiny = value return property(**locals()) @apply def eccentricityinz(): def fget( self ): return self._eccentricityinz def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclengthmeasure): self._eccentricityinz = ifclengthmeasure(value) else: self._eccentricityinz = value else: self._eccentricityinz = value return property(**locals()) #################### # ENTITY ifcedgeloop # #################### class ifcedgeloop(ifcloop): '''Entity ifcedgeloop definition. :param edgelist :type edgelist:LIST(1,None,'ifcorientededge', scope = schema_scope) :param ne :type ne:INTEGER ''' def __init__( self , edgelist, ): ifcloop.__init__(self , ) self.edgelist = edgelist @apply def edgelist(): def fget( self ): return self._edgelist def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument edgelist is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcorientededge', scope = schema_scope)): self._edgelist = LIST(value) else: self._edgelist = value return property(**locals()) @apply def ne(): def fget( self ): attribute_eval = SIZEOF(self.edgelist) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument ne is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (self.edgelist[1].self.edgestart == self.edgelist[self.ne].self.edgeend) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = ifcloopheadtotail(self) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr #################### # ENTITY ifcrelservicesbuildings # #################### class ifcrelservicesbuildings(ifcrelconnects): '''Entity ifcrelservicesbuildings definition. :param relatingsystem :type relatingsystem:ifcsystem :param relatedbuildings :type relatedbuildings:SET(1,None,'ifcspatialstructureelement', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , relatingsystem,relatedbuildings, ): ifcrelconnects.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.relatingsystem = relatingsystem self.relatedbuildings = relatedbuildings @apply def relatingsystem(): def fget( self ): return self._relatingsystem def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingsystem is mantatory and can not be set to None') if not check_type(value,ifcsystem): self._relatingsystem = ifcsystem(value) else: self._relatingsystem = value return property(**locals()) @apply def relatedbuildings(): def fget( self ): return self._relatedbuildings def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedbuildings is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcspatialstructureelement', scope = schema_scope)): self._relatedbuildings = SET(value) else: self._relatedbuildings = value return property(**locals()) #################### # ENTITY ifctexturecoordinategenerator # #################### class ifctexturecoordinategenerator(ifctexturecoordinate): '''Entity ifctexturecoordinategenerator definition. :param mode :type mode:ifclabel :param parameter :type parameter:LIST(1,None,'ifcsimplevalue', scope = schema_scope) ''' def __init__( self , mode,parameter, ): ifctexturecoordinate.__init__(self , ) self.mode = mode self.parameter = parameter @apply def mode(): def fget( self ): return self._mode def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument mode is mantatory and can not be set to None') if not check_type(value,ifclabel): self._mode = ifclabel(value) else: self._mode = value return property(**locals()) @apply def parameter(): def fget( self ): return self._parameter def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument parameter is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcsimplevalue', scope = schema_scope)): self._parameter = LIST(value) else: self._parameter = value return property(**locals()) #################### # ENTITY ifccablecarrierfittingtype # #################### class ifccablecarrierfittingtype(ifcflowfittingtype): '''Entity ifccablecarrierfittingtype definition. :param predefinedtype :type predefinedtype:ifccablecarrierfittingtypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowfittingtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifccablecarrierfittingtypeenum): self._predefinedtype = ifccablecarrierfittingtypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifccablecarrierfittingtypeenum.self.userdefined) or ((self.predefinedtype == ifccablecarrierfittingtypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcappliedvaluerelationship # #################### class ifcappliedvaluerelationship(BaseEntityClass): '''Entity ifcappliedvaluerelationship definition. :param componentoftotal :type componentoftotal:ifcappliedvalue :param components :type components:SET(1,None,'ifcappliedvalue', scope = schema_scope) :param arithmeticoperator :type arithmeticoperator:ifcarithmeticoperatorenum :param name :type name:ifclabel :param description :type description:ifctext ''' def __init__( self , componentoftotal,components,arithmeticoperator,name,description, ): self.componentoftotal = componentoftotal self.components = components self.arithmeticoperator = arithmeticoperator self.name = name self.description = description @apply def componentoftotal(): def fget( self ): return self._componentoftotal def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument componentoftotal is mantatory and can not be set to None') if not check_type(value,ifcappliedvalue): self._componentoftotal = ifcappliedvalue(value) else: self._componentoftotal = value return property(**locals()) @apply def components(): def fget( self ): return self._components def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument components is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcappliedvalue', scope = schema_scope)): self._components = SET(value) else: self._components = value return property(**locals()) @apply def arithmeticoperator(): def fget( self ): return self._arithmeticoperator def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument arithmeticoperator is mantatory and can not be set to None') if not check_type(value,ifcarithmeticoperatorenum): self._arithmeticoperator = ifcarithmeticoperatorenum(value) else: self._arithmeticoperator = value return property(**locals()) @apply def name(): def fget( self ): return self._name def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value else: self._name = value return property(**locals()) @apply def description(): def fget( self ): return self._description def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctext): self._description = ifctext(value) else: self._description = value else: self._description = value return property(**locals()) #################### # ENTITY ifcclassificationnotationfacet # #################### class ifcclassificationnotationfacet(BaseEntityClass): '''Entity ifcclassificationnotationfacet definition. :param notationvalue :type notationvalue:ifclabel ''' def __init__( self , notationvalue, ): self.notationvalue = notationvalue @apply def notationvalue(): def fget( self ): return self._notationvalue def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument notationvalue is mantatory and can not be set to None') if not check_type(value,ifclabel): self._notationvalue = ifclabel(value) else: self._notationvalue = value return property(**locals()) #################### # ENTITY ifcdimensioncurveterminator # #################### class ifcdimensioncurveterminator(ifcterminatorsymbol): '''Entity ifcdimensioncurveterminator definition. :param role :type role:ifcdimensionextentusage ''' def __init__( self , inherited0__item , inherited1__styles , inherited2__name , inherited3__annotatedcurve , role, ): ifcterminatorsymbol.__init__(self , inherited0__item , inherited1__styles , inherited2__name , inherited3__annotatedcurve , ) self.role = role @apply def role(): def fget( self ): return self._role def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument role is mantatory and can not be set to None') if not check_type(value,ifcdimensionextentusage): self._role = ifcdimensionextentusage(value) else: self._role = value return property(**locals()) def wr61(self): eval_wr61_wr = ('IFC2X3.IFCDIMENSIONCURVE' == TYPEOF(self.self.ifcterminatorsymbol.self.annotatedcurve)) if not eval_wr61_wr: raise AssertionError('Rule wr61 violated') else: return eval_wr61_wr #################### # ENTITY ifcductfittingtype # #################### class ifcductfittingtype(ifcflowfittingtype): '''Entity ifcductfittingtype definition. :param predefinedtype :type predefinedtype:ifcductfittingtypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowfittingtype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcductfittingtypeenum): self._predefinedtype = ifcductfittingtypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr2(self): eval_wr2_wr = ((self.predefinedtype != ifcductfittingtypeenum.self.userdefined) or ((self.predefinedtype == ifcductfittingtypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr #################### # ENTITY ifclocalplacement # #################### class ifclocalplacement(ifcobjectplacement): '''Entity ifclocalplacement definition. :param placementrelto :type placementrelto:ifcobjectplacement :param relativeplacement :type relativeplacement:ifcaxis2placement ''' def __init__( self , placementrelto,relativeplacement, ): ifcobjectplacement.__init__(self , ) self.placementrelto = placementrelto self.relativeplacement = relativeplacement @apply def placementrelto(): def fget( self ): return self._placementrelto def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcobjectplacement): self._placementrelto = ifcobjectplacement(value) else: self._placementrelto = value else: self._placementrelto = value return property(**locals()) @apply def relativeplacement(): def fget( self ): return self._relativeplacement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relativeplacement is mantatory and can not be set to None') if not check_type(value,ifcaxis2placement): self._relativeplacement = ifcaxis2placement(value) else: self._relativeplacement = value return property(**locals()) def wr21(self): eval_wr21_wr = ifccorrectlocalplacement(self.relativeplacement,self.placementrelto) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr #################### # ENTITY ifcpropertyset # #################### class ifcpropertyset(ifcpropertysetdefinition): '''Entity ifcpropertyset definition. :param hasproperties :type hasproperties:SET(1,None,'ifcproperty', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , hasproperties, ): ifcpropertysetdefinition.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.hasproperties = hasproperties @apply def hasproperties(): def fget( self ): return self._hasproperties def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument hasproperties is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcproperty', scope = schema_scope)): self._hasproperties = SET(value) else: self._hasproperties = value return property(**locals()) def wr31(self): eval_wr31_wr = EXISTS(self.self.ifcroot.self.name) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr def wr32(self): eval_wr32_wr = ifcuniquepropertyname(self.hasproperties) if not eval_wr32_wr: raise AssertionError('Rule wr32 violated') else: return eval_wr32_wr #################### # ENTITY ifcstructuralcurvemembervarying # #################### class ifcstructuralcurvemembervarying(ifcstructuralcurvemember): '''Entity ifcstructuralcurvemembervarying definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__predefinedtype , ): ifcstructuralcurvemember.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__predefinedtype , ) #################### # ENTITY ifcunitaryequipmenttype # #################### class ifcunitaryequipmenttype(ifcenergyconversiondevicetype): '''Entity ifcunitaryequipmenttype definition. :param predefinedtype :type predefinedtype:ifcunitaryequipmenttypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcenergyconversiondevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcunitaryequipmenttypeenum): self._predefinedtype = ifcunitaryequipmenttypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcunitaryequipmenttypeenum.self.userdefined) or ((self.predefinedtype == ifcunitaryequipmenttypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifczone # #################### class ifczone(ifcgroup): '''Entity ifczone definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ): ifcgroup.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) def wr1(self): eval_wr1_wr = (SIZEOF(None) == 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcrelprojectselement # #################### class ifcrelprojectselement(ifcrelconnects): '''Entity ifcrelprojectselement definition. :param relatingelement :type relatingelement:ifcelement :param relatedfeatureelement :type relatedfeatureelement:ifcfeatureelementaddition ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , relatingelement,relatedfeatureelement, ): ifcrelconnects.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , ) self.relatingelement = relatingelement self.relatedfeatureelement = relatedfeatureelement @apply def relatingelement(): def fget( self ): return self._relatingelement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingelement is mantatory and can not be set to None') if not check_type(value,ifcelement): self._relatingelement = ifcelement(value) else: self._relatingelement = value return property(**locals()) @apply def relatedfeatureelement(): def fget( self ): return self._relatedfeatureelement def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatedfeatureelement is mantatory and can not be set to None') if not check_type(value,ifcfeatureelementaddition): self._relatedfeatureelement = ifcfeatureelementaddition(value) else: self._relatedfeatureelement = value return property(**locals()) #################### # ENTITY ifctanktype # #################### class ifctanktype(ifcflowstoragedevicetype): '''Entity ifctanktype definition. :param predefinedtype :type predefinedtype:ifctanktypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowstoragedevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifctanktypeenum): self._predefinedtype = ifctanktypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifctanktypeenum.self.userdefined) or ((self.predefinedtype == ifctanktypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcdocumentelectronicformat # #################### class ifcdocumentelectronicformat(BaseEntityClass): '''Entity ifcdocumentelectronicformat definition. :param fileextension :type fileextension:ifclabel :param mimecontenttype :type mimecontenttype:ifclabel :param mimesubtype :type mimesubtype:ifclabel ''' def __init__( self , fileextension,mimecontenttype,mimesubtype, ): self.fileextension = fileextension self.mimecontenttype = mimecontenttype self.mimesubtype = mimesubtype @apply def fileextension(): def fget( self ): return self._fileextension def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._fileextension = ifclabel(value) else: self._fileextension = value else: self._fileextension = value return property(**locals()) @apply def mimecontenttype(): def fget( self ): return self._mimecontenttype def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._mimecontenttype = ifclabel(value) else: self._mimecontenttype = value else: self._mimecontenttype = value return property(**locals()) @apply def mimesubtype(): def fget( self ): return self._mimesubtype def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._mimesubtype = ifclabel(value) else: self._mimesubtype = value else: self._mimesubtype = value return property(**locals()) def wr1(self): eval_wr1_wr = (EXISTS(self.fileextension) or EXISTS(self.mimecontenttype)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcwindowstyle # #################### class ifcwindowstyle(ifctypeproduct): '''Entity ifcwindowstyle definition. :param constructiontype :type constructiontype:ifcwindowstyleconstructionenum :param operationtype :type operationtype:ifcwindowstyleoperationenum :param parametertakesprecedence :type parametertakesprecedence:BOOLEAN :param sizeable :type sizeable:BOOLEAN ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , constructiontype,operationtype,parametertakesprecedence,sizeable, ): ifctypeproduct.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , ) self.constructiontype = constructiontype self.operationtype = operationtype self.parametertakesprecedence = parametertakesprecedence self.sizeable = sizeable @apply def constructiontype(): def fget( self ): return self._constructiontype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument constructiontype is mantatory and can not be set to None') if not check_type(value,ifcwindowstyleconstructionenum): self._constructiontype = ifcwindowstyleconstructionenum(value) else: self._constructiontype = value return property(**locals()) @apply def operationtype(): def fget( self ): return self._operationtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument operationtype is mantatory and can not be set to None') if not check_type(value,ifcwindowstyleoperationenum): self._operationtype = ifcwindowstyleoperationenum(value) else: self._operationtype = value return property(**locals()) @apply def parametertakesprecedence(): def fget( self ): return self._parametertakesprecedence def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument parametertakesprecedence is mantatory and can not be set to None') if not check_type(value,BOOLEAN): self._parametertakesprecedence = BOOLEAN(value) else: self._parametertakesprecedence = value return property(**locals()) @apply def sizeable(): def fget( self ): return self._sizeable def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument sizeable is mantatory and can not be set to None') if not check_type(value,BOOLEAN): self._sizeable = BOOLEAN(value) else: self._sizeable = value return property(**locals()) #################### # ENTITY ifcworkschedule # #################### class ifcworkschedule(ifcworkcontrol): '''Entity ifcworkschedule definition. ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__identifier , inherited6__creationdate , inherited7__creators , inherited8__purpose , inherited9__duration , inherited10__totalfloat , inherited11__starttime , inherited12__finishtime , inherited13__workcontroltype , inherited14__userdefinedcontroltype , ): ifcworkcontrol.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__identifier , inherited6__creationdate , inherited7__creators , inherited8__purpose , inherited9__duration , inherited10__totalfloat , inherited11__starttime , inherited12__finishtime , inherited13__workcontroltype , inherited14__userdefinedcontroltype , ) #################### # ENTITY ifcboundaryfacecondition # #################### class ifcboundaryfacecondition(ifcboundarycondition): '''Entity ifcboundaryfacecondition definition. :param linearstiffnessbyareax :type linearstiffnessbyareax:ifcmodulusofsubgradereactionmeasure :param linearstiffnessbyareay :type linearstiffnessbyareay:ifcmodulusofsubgradereactionmeasure :param linearstiffnessbyareaz :type linearstiffnessbyareaz:ifcmodulusofsubgradereactionmeasure ''' def __init__( self , inherited0__name , linearstiffnessbyareax,linearstiffnessbyareay,linearstiffnessbyareaz, ): ifcboundarycondition.__init__(self , inherited0__name , ) self.linearstiffnessbyareax = linearstiffnessbyareax self.linearstiffnessbyareay = linearstiffnessbyareay self.linearstiffnessbyareaz = linearstiffnessbyareaz @apply def linearstiffnessbyareax(): def fget( self ): return self._linearstiffnessbyareax def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmodulusofsubgradereactionmeasure): self._linearstiffnessbyareax = ifcmodulusofsubgradereactionmeasure(value) else: self._linearstiffnessbyareax = value else: self._linearstiffnessbyareax = value return property(**locals()) @apply def linearstiffnessbyareay(): def fget( self ): return self._linearstiffnessbyareay def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmodulusofsubgradereactionmeasure): self._linearstiffnessbyareay = ifcmodulusofsubgradereactionmeasure(value) else: self._linearstiffnessbyareay = value else: self._linearstiffnessbyareay = value return property(**locals()) @apply def linearstiffnessbyareaz(): def fget( self ): return self._linearstiffnessbyareaz def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmodulusofsubgradereactionmeasure): self._linearstiffnessbyareaz = ifcmodulusofsubgradereactionmeasure(value) else: self._linearstiffnessbyareaz = value else: self._linearstiffnessbyareaz = value return property(**locals()) #################### # ENTITY ifccompositeprofiledef # #################### class ifccompositeprofiledef(ifcprofiledef): '''Entity ifccompositeprofiledef definition. :param profiles :type profiles:SET(2,None,'ifcprofiledef', scope = schema_scope) :param label :type label:ifclabel ''' def __init__( self , inherited0__profiletype , inherited1__profilename , profiles,label, ): ifcprofiledef.__init__(self , inherited0__profiletype , inherited1__profilename , ) self.profiles = profiles self.label = label @apply def profiles(): def fget( self ): return self._profiles def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument profiles is mantatory and can not be set to None') if not check_type(value,SET(2,None,'ifcprofiledef', scope = schema_scope)): self._profiles = SET(value) else: self._profiles = value return property(**locals()) @apply def label(): def fget( self ): return self._label def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._label = ifclabel(value) else: self._label = value else: self._label = value return property(**locals()) def wr1(self): eval_wr1_wr = (SIZEOF(None) == 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (SIZEOF(None) == 0) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr #################### # ENTITY ifcasset # #################### class ifcasset(ifcgroup): '''Entity ifcasset definition. :param assetid :type assetid:ifcidentifier :param originalvalue :type originalvalue:ifccostvalue :param currentvalue :type currentvalue:ifccostvalue :param totalreplacementcost :type totalreplacementcost:ifccostvalue :param owner :type owner:ifcactorselect :param user :type user:ifcactorselect :param responsibleperson :type responsibleperson:ifcperson :param incorporationdate :type incorporationdate:ifccalendardate :param depreciatedvalue :type depreciatedvalue:ifccostvalue ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , assetid,originalvalue,currentvalue,totalreplacementcost,owner,user,responsibleperson,incorporationdate,depreciatedvalue, ): ifcgroup.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.assetid = assetid self.originalvalue = originalvalue self.currentvalue = currentvalue self.totalreplacementcost = totalreplacementcost self.owner = owner self.user = user self.responsibleperson = responsibleperson self.incorporationdate = incorporationdate self.depreciatedvalue = depreciatedvalue @apply def assetid(): def fget( self ): return self._assetid def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument assetid is mantatory and can not be set to None') if not check_type(value,ifcidentifier): self._assetid = ifcidentifier(value) else: self._assetid = value return property(**locals()) @apply def originalvalue(): def fget( self ): return self._originalvalue def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument originalvalue is mantatory and can not be set to None') if not check_type(value,ifccostvalue): self._originalvalue = ifccostvalue(value) else: self._originalvalue = value return property(**locals()) @apply def currentvalue(): def fget( self ): return self._currentvalue def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument currentvalue is mantatory and can not be set to None') if not check_type(value,ifccostvalue): self._currentvalue = ifccostvalue(value) else: self._currentvalue = value return property(**locals()) @apply def totalreplacementcost(): def fget( self ): return self._totalreplacementcost def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument totalreplacementcost is mantatory and can not be set to None') if not check_type(value,ifccostvalue): self._totalreplacementcost = ifccostvalue(value) else: self._totalreplacementcost = value return property(**locals()) @apply def owner(): def fget( self ): return self._owner def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument owner is mantatory and can not be set to None') if not check_type(value,ifcactorselect): self._owner = ifcactorselect(value) else: self._owner = value return property(**locals()) @apply def user(): def fget( self ): return self._user def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument user is mantatory and can not be set to None') if not check_type(value,ifcactorselect): self._user = ifcactorselect(value) else: self._user = value return property(**locals()) @apply def responsibleperson(): def fget( self ): return self._responsibleperson def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument responsibleperson is mantatory and can not be set to None') if not check_type(value,ifcperson): self._responsibleperson = ifcperson(value) else: self._responsibleperson = value return property(**locals()) @apply def incorporationdate(): def fget( self ): return self._incorporationdate def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument incorporationdate is mantatory and can not be set to None') if not check_type(value,ifccalendardate): self._incorporationdate = ifccalendardate(value) else: self._incorporationdate = value return property(**locals()) @apply def depreciatedvalue(): def fget( self ): return self._depreciatedvalue def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument depreciatedvalue is mantatory and can not be set to None') if not check_type(value,ifccostvalue): self._depreciatedvalue = ifccostvalue(value) else: self._depreciatedvalue = value return property(**locals()) def wr1(self): eval_wr1_wr = (SIZEOF(None) == 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcirregulartimeseries # #################### class ifcirregulartimeseries(ifctimeseries): '''Entity ifcirregulartimeseries definition. :param values :type values:LIST(1,None,'ifcirregulartimeseriesvalue', scope = schema_scope) ''' def __init__( self , inherited0__name , inherited1__description , inherited2__starttime , inherited3__endtime , inherited4__timeseriesdatatype , inherited5__dataorigin , inherited6__userdefineddataorigin , inherited7__unit , values, ): ifctimeseries.__init__(self , inherited0__name , inherited1__description , inherited2__starttime , inherited3__endtime , inherited4__timeseriesdatatype , inherited5__dataorigin , inherited6__userdefineddataorigin , inherited7__unit , ) self.values = values @apply def values(): def fget( self ): return self._values def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument values is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcirregulartimeseriesvalue', scope = schema_scope)): self._values = LIST(value) else: self._values = value return property(**locals()) #################### # ENTITY ifcblobtexture # #################### class ifcblobtexture(ifcsurfacetexture): '''Entity ifcblobtexture definition. :param rasterformat :type rasterformat:ifcidentifier :param rastercode :type rastercode:BOOLEAN ''' def __init__( self , inherited0__repeats , inherited1__repeatt , inherited2__texturetype , inherited3__texturetransform , rasterformat,rastercode, ): ifcsurfacetexture.__init__(self , inherited0__repeats , inherited1__repeatt , inherited2__texturetype , inherited3__texturetransform , ) self.rasterformat = rasterformat self.rastercode = rastercode @apply def rasterformat(): def fget( self ): return self._rasterformat def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument rasterformat is mantatory and can not be set to None') if not check_type(value,ifcidentifier): self._rasterformat = ifcidentifier(value) else: self._rasterformat = value return property(**locals()) @apply def rastercode(): def fget( self ): return self._rastercode def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument rastercode is mantatory and can not be set to None') if not check_type(value,BOOLEAN): self._rastercode = BOOLEAN(value) else: self._rastercode = value return property(**locals()) def wr11(self): eval_wr11_wr = (self.self.rasterformat == ['BMP','JPG','GIF','PNG']) if not eval_wr11_wr: raise AssertionError('Rule wr11 violated') else: return eval_wr11_wr #################### # ENTITY ifclightintensitydistribution # #################### class ifclightintensitydistribution(BaseEntityClass): '''Entity ifclightintensitydistribution definition. :param lightdistributioncurve :type lightdistributioncurve:ifclightdistributioncurveenum :param distributiondata :type distributiondata:LIST(1,None,'ifclightdistributiondata', scope = schema_scope) ''' def __init__( self , lightdistributioncurve,distributiondata, ): self.lightdistributioncurve = lightdistributioncurve self.distributiondata = distributiondata @apply def lightdistributioncurve(): def fget( self ): return self._lightdistributioncurve def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument lightdistributioncurve is mantatory and can not be set to None') if not check_type(value,ifclightdistributioncurveenum): self._lightdistributioncurve = ifclightdistributioncurveenum(value) else: self._lightdistributioncurve = value return property(**locals()) @apply def distributiondata(): def fget( self ): return self._distributiondata def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument distributiondata is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifclightdistributiondata', scope = schema_scope)): self._distributiondata = LIST(value) else: self._distributiondata = value return property(**locals()) #################### # ENTITY ifcorderaction # #################### class ifcorderaction(ifctask): '''Entity ifcorderaction definition. :param actionid :type actionid:ifcidentifier ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__taskid , inherited6__status , inherited7__workmethod , inherited8__ismilestone , inherited9__priority , actionid, ): ifctask.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__taskid , inherited6__status , inherited7__workmethod , inherited8__ismilestone , inherited9__priority , ) self.actionid = actionid @apply def actionid(): def fget( self ): return self._actionid def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument actionid is mantatory and can not be set to None') if not check_type(value,ifcidentifier): self._actionid = ifcidentifier(value) else: self._actionid = value return property(**locals()) #################### # ENTITY ifcgrid # #################### class ifcgrid(ifcproduct): '''Entity ifcgrid definition. :param uaxes :type uaxes:LIST(1,None,'ifcgridaxis', scope = schema_scope) :param vaxes :type vaxes:LIST(1,None,'ifcgridaxis', scope = schema_scope) :param waxes :type waxes:LIST(1,None,'ifcgridaxis', scope = schema_scope) :param containedinstructure :type containedinstructure:SET(0,1,'ifcrelcontainedinspatialstructure', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , uaxes,vaxes,waxes, ): ifcproduct.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , ) self.uaxes = uaxes self.vaxes = vaxes self.waxes = waxes @apply def uaxes(): def fget( self ): return self._uaxes def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument uaxes is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcgridaxis', scope = schema_scope)): self._uaxes = LIST(value) else: self._uaxes = value return property(**locals()) @apply def vaxes(): def fget( self ): return self._vaxes def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument vaxes is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifcgridaxis', scope = schema_scope)): self._vaxes = LIST(value) else: self._vaxes = value return property(**locals()) @apply def waxes(): def fget( self ): return self._waxes def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,LIST(1,None,'ifcgridaxis', scope = schema_scope)): self._waxes = LIST(value) else: self._waxes = value else: self._waxes = value return property(**locals()) @apply def containedinstructure(): def fget( self ): return self._containedinstructure def fset( self, value ): # INVERSE argument raise AssertionError('Argument containedinstructure is INVERSE. It is computed and can not be set to any value') return property(**locals()) def wr41(self): eval_wr41_wr = EXISTS(self.self.ifcproduct.self.objectplacement) if not eval_wr41_wr: raise AssertionError('Rule wr41 violated') else: return eval_wr41_wr #################### # ENTITY ifcmechanicalfastener # #################### class ifcmechanicalfastener(ifcfastener): '''Entity ifcmechanicalfastener definition. :param nominaldiameter :type nominaldiameter:ifcpositivelengthmeasure :param nominallength :type nominallength:ifcpositivelengthmeasure ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , nominaldiameter,nominallength, ): ifcfastener.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) self.nominaldiameter = nominaldiameter self.nominallength = nominallength @apply def nominaldiameter(): def fget( self ): return self._nominaldiameter def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._nominaldiameter = ifcpositivelengthmeasure(value) else: self._nominaldiameter = value else: self._nominaldiameter = value return property(**locals()) @apply def nominallength(): def fget( self ): return self._nominallength def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._nominallength = ifcpositivelengthmeasure(value) else: self._nominallength = value else: self._nominallength = value return property(**locals()) #################### # ENTITY ifcphysicalcomplexquantity # #################### class ifcphysicalcomplexquantity(ifcphysicalquantity): '''Entity ifcphysicalcomplexquantity definition. :param hasquantities :type hasquantities:SET(1,None,'ifcphysicalquantity', scope = schema_scope) :param discrimination :type discrimination:ifclabel :param quality :type quality:ifclabel :param usage :type usage:ifclabel ''' def __init__( self , inherited0__name , inherited1__description , hasquantities,discrimination,quality,usage, ): ifcphysicalquantity.__init__(self , inherited0__name , inherited1__description , ) self.hasquantities = hasquantities self.discrimination = discrimination self.quality = quality self.usage = usage @apply def hasquantities(): def fget( self ): return self._hasquantities def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument hasquantities is mantatory and can not be set to None') if not check_type(value,SET(1,None,'ifcphysicalquantity', scope = schema_scope)): self._hasquantities = SET(value) else: self._hasquantities = value return property(**locals()) @apply def discrimination(): def fget( self ): return self._discrimination def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument discrimination is mantatory and can not be set to None') if not check_type(value,ifclabel): self._discrimination = ifclabel(value) else: self._discrimination = value return property(**locals()) @apply def quality(): def fget( self ): return self._quality def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._quality = ifclabel(value) else: self._quality = value else: self._quality = value return property(**locals()) @apply def usage(): def fget( self ): return self._usage def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._usage = ifclabel(value) else: self._usage = value else: self._usage = value return property(**locals()) def wr21(self): eval_wr21_wr = (SIZEOF(None) == 0) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr #################### # ENTITY ifcpresentationlayerwithstyle # #################### class ifcpresentationlayerwithstyle(ifcpresentationlayerassignment): '''Entity ifcpresentationlayerwithstyle definition. :param layeron :type layeron:LOGICAL :param layerfrozen :type layerfrozen:LOGICAL :param layerblocked :type layerblocked:LOGICAL :param layerstyles :type layerstyles:SET(0,None,'ifcpresentationstyleselect', scope = schema_scope) ''' def __init__( self , inherited0__name , inherited1__description , inherited2__assigneditems , inherited3__identifier , layeron,layerfrozen,layerblocked,layerstyles, ): ifcpresentationlayerassignment.__init__(self , inherited0__name , inherited1__description , inherited2__assigneditems , inherited3__identifier , ) self.layeron = layeron self.layerfrozen = layerfrozen self.layerblocked = layerblocked self.layerstyles = layerstyles @apply def layeron(): def fget( self ): return self._layeron def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument layeron is mantatory and can not be set to None') if not check_type(value,LOGICAL): self._layeron = LOGICAL(value) else: self._layeron = value return property(**locals()) @apply def layerfrozen(): def fget( self ): return self._layerfrozen def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument layerfrozen is mantatory and can not be set to None') if not check_type(value,LOGICAL): self._layerfrozen = LOGICAL(value) else: self._layerfrozen = value return property(**locals()) @apply def layerblocked(): def fget( self ): return self._layerblocked def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument layerblocked is mantatory and can not be set to None') if not check_type(value,LOGICAL): self._layerblocked = LOGICAL(value) else: self._layerblocked = value return property(**locals()) @apply def layerstyles(): def fget( self ): return self._layerstyles def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument layerstyles is mantatory and can not be set to None') if not check_type(value,SET(0,None,'ifcpresentationstyleselect', scope = schema_scope)): self._layerstyles = SET(value) else: self._layerstyles = value return property(**locals()) #################### # ENTITY ifccompressortype # #################### class ifccompressortype(ifcflowmovingdevicetype): '''Entity ifccompressortype definition. :param predefinedtype :type predefinedtype:ifccompressortypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowmovingdevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifccompressortypeenum): self._predefinedtype = ifccompressortypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifccompressortypeenum.self.userdefined) or ((self.predefinedtype == ifccompressortypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifclightdistributiondata # #################### class ifclightdistributiondata(BaseEntityClass): '''Entity ifclightdistributiondata definition. :param mainplaneangle :type mainplaneangle:ifcplaneanglemeasure :param secondaryplaneangle :type secondaryplaneangle:LIST(1,None,'REAL', scope = schema_scope) :param luminousintensity :type luminousintensity:LIST(1,None,'REAL', scope = schema_scope) ''' def __init__( self , mainplaneangle,secondaryplaneangle,luminousintensity, ): self.mainplaneangle = mainplaneangle self.secondaryplaneangle = secondaryplaneangle self.luminousintensity = luminousintensity @apply def mainplaneangle(): def fget( self ): return self._mainplaneangle def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument mainplaneangle is mantatory and can not be set to None') if not check_type(value,ifcplaneanglemeasure): self._mainplaneangle = ifcplaneanglemeasure(value) else: self._mainplaneangle = value return property(**locals()) @apply def secondaryplaneangle(): def fget( self ): return self._secondaryplaneangle def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument secondaryplaneangle is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'REAL', scope = schema_scope)): self._secondaryplaneangle = LIST(value) else: self._secondaryplaneangle = value return property(**locals()) @apply def luminousintensity(): def fget( self ): return self._luminousintensity def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument luminousintensity is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'REAL', scope = schema_scope)): self._luminousintensity = LIST(value) else: self._luminousintensity = value return property(**locals()) #################### # ENTITY ifcpipesegmenttype # #################### class ifcpipesegmenttype(ifcflowsegmenttype): '''Entity ifcpipesegmenttype definition. :param predefinedtype :type predefinedtype:ifcpipesegmenttypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowsegmenttype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcpipesegmenttypeenum): self._predefinedtype = ifcpipesegmenttypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcpipesegmenttypeenum.self.userdefined) or ((self.predefinedtype == ifcpipesegmenttypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcquantityvolume # #################### class ifcquantityvolume(ifcphysicalsimplequantity): '''Entity ifcquantityvolume definition. :param volumevalue :type volumevalue:ifcvolumemeasure ''' def __init__( self , inherited0__name , inherited1__description , inherited2__unit , volumevalue, ): ifcphysicalsimplequantity.__init__(self , inherited0__name , inherited1__description , inherited2__unit , ) self.volumevalue = volumevalue @apply def volumevalue(): def fget( self ): return self._volumevalue def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument volumevalue is mantatory and can not be set to None') if not check_type(value,ifcvolumemeasure): self._volumevalue = ifcvolumemeasure(value) else: self._volumevalue = value return property(**locals()) def wr21(self): eval_wr21_wr = (( not EXISTS(self.self.ifcphysicalsimplequantity.self.unit)) or (self.self.ifcphysicalsimplequantity.self.unit.self.unittype == ifcunitenum.self.volumeunit)) if not eval_wr21_wr: raise AssertionError('Rule wr21 violated') else: return eval_wr21_wr def wr22(self): eval_wr22_wr = (self.volumevalue >= 0) if not eval_wr22_wr: raise AssertionError('Rule wr22 violated') else: return eval_wr22_wr #################### # ENTITY ifcaxis2placement2d # #################### class ifcaxis2placement2d(ifcplacement): '''Entity ifcaxis2placement2d definition. :param refdirection :type refdirection:ifcdirection :param p :type p:LIST(2,2,'ifcdirection', scope = schema_scope) ''' def __init__( self , inherited0__location , refdirection, ): ifcplacement.__init__(self , inherited0__location , ) self.refdirection = refdirection @apply def refdirection(): def fget( self ): return self._refdirection def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdirection): self._refdirection = ifcdirection(value) else: self._refdirection = value else: self._refdirection = value return property(**locals()) @apply def p(): def fget( self ): attribute_eval = ifcbuild2axes(self.refdirection) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument p is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (( not EXISTS(self.refdirection)) or (self.refdirection.self.dim == 2)) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (self.self.ifcplacement.self.location.self.dim == 2) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr #################### # ENTITY ifcchamferedgefeature # #################### class ifcchamferedgefeature(ifcedgefeature): '''Entity ifcchamferedgefeature definition. :param width :type width:ifcpositivelengthmeasure :param height :type height:ifcpositivelengthmeasure ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , inherited8__featurelength , width,height, ): ifcedgefeature.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , inherited8__featurelength , ) self.width = width self.height = height @apply def width(): def fget( self ): return self._width def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._width = ifcpositivelengthmeasure(value) else: self._width = value else: self._width = value return property(**locals()) @apply def height(): def fget( self ): return self._height def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._height = ifcpositivelengthmeasure(value) else: self._height = value else: self._height = value return property(**locals()) #################### # ENTITY ifcmateriallayer # #################### class ifcmateriallayer(BaseEntityClass): '''Entity ifcmateriallayer definition. :param material :type material:ifcmaterial :param layerthickness :type layerthickness:ifcpositivelengthmeasure :param isventilated :type isventilated:ifclogical :param tomateriallayerset :type tomateriallayerset:ifcmateriallayerset ''' def __init__( self , material,layerthickness,isventilated, ): self.material = material self.layerthickness = layerthickness self.isventilated = isventilated @apply def material(): def fget( self ): return self._material def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcmaterial): self._material = ifcmaterial(value) else: self._material = value else: self._material = value return property(**locals()) @apply def layerthickness(): def fget( self ): return self._layerthickness def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument layerthickness is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._layerthickness = ifcpositivelengthmeasure(value) else: self._layerthickness = value return property(**locals()) @apply def isventilated(): def fget( self ): return self._isventilated def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclogical): self._isventilated = ifclogical(value) else: self._isventilated = value else: self._isventilated = value return property(**locals()) @apply def tomateriallayerset(): def fget( self ): return self._tomateriallayerset def fset( self, value ): # INVERSE argument raise AssertionError('Argument tomateriallayerset is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifcrightcircularcone # #################### class ifcrightcircularcone(ifccsgprimitive3d): '''Entity ifcrightcircularcone definition. :param height :type height:ifcpositivelengthmeasure :param bottomradius :type bottomradius:ifcpositivelengthmeasure ''' def __init__( self , inherited0__position , height,bottomradius, ): ifccsgprimitive3d.__init__(self , inherited0__position , ) self.height = height self.bottomradius = bottomradius @apply def height(): def fget( self ): return self._height def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument height is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._height = ifcpositivelengthmeasure(value) else: self._height = value return property(**locals()) @apply def bottomradius(): def fget( self ): return self._bottomradius def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument bottomradius is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._bottomradius = ifcpositivelengthmeasure(value) else: self._bottomradius = value return property(**locals()) #################### # ENTITY ifcstructuralloadlinearforce # #################### class ifcstructuralloadlinearforce(ifcstructuralloadstatic): '''Entity ifcstructuralloadlinearforce definition. :param linearforcex :type linearforcex:ifclinearforcemeasure :param linearforcey :type linearforcey:ifclinearforcemeasure :param linearforcez :type linearforcez:ifclinearforcemeasure :param linearmomentx :type linearmomentx:ifclinearmomentmeasure :param linearmomenty :type linearmomenty:ifclinearmomentmeasure :param linearmomentz :type linearmomentz:ifclinearmomentmeasure ''' def __init__( self , inherited0__name , linearforcex,linearforcey,linearforcez,linearmomentx,linearmomenty,linearmomentz, ): ifcstructuralloadstatic.__init__(self , inherited0__name , ) self.linearforcex = linearforcex self.linearforcey = linearforcey self.linearforcez = linearforcez self.linearmomentx = linearmomentx self.linearmomenty = linearmomenty self.linearmomentz = linearmomentz @apply def linearforcex(): def fget( self ): return self._linearforcex def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclinearforcemeasure): self._linearforcex = ifclinearforcemeasure(value) else: self._linearforcex = value else: self._linearforcex = value return property(**locals()) @apply def linearforcey(): def fget( self ): return self._linearforcey def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclinearforcemeasure): self._linearforcey = ifclinearforcemeasure(value) else: self._linearforcey = value else: self._linearforcey = value return property(**locals()) @apply def linearforcez(): def fget( self ): return self._linearforcez def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclinearforcemeasure): self._linearforcez = ifclinearforcemeasure(value) else: self._linearforcez = value else: self._linearforcez = value return property(**locals()) @apply def linearmomentx(): def fget( self ): return self._linearmomentx def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclinearmomentmeasure): self._linearmomentx = ifclinearmomentmeasure(value) else: self._linearmomentx = value else: self._linearmomentx = value return property(**locals()) @apply def linearmomenty(): def fget( self ): return self._linearmomenty def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclinearmomentmeasure): self._linearmomenty = ifclinearmomentmeasure(value) else: self._linearmomenty = value else: self._linearmomenty = value return property(**locals()) @apply def linearmomentz(): def fget( self ): return self._linearmomentz def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclinearmomentmeasure): self._linearmomentz = ifclinearmomentmeasure(value) else: self._linearmomentz = value else: self._linearmomentz = value return property(**locals()) #################### # ENTITY ifcopenshell # #################### class ifcopenshell(ifcconnectedfaceset): '''Entity ifcopenshell definition. ''' def __init__( self , inherited0__cfsfaces , ): ifcconnectedfaceset.__init__(self , inherited0__cfsfaces , ) #################### # ENTITY ifcwindow # #################### class ifcwindow(ifcbuildingelement): '''Entity ifcwindow definition. :param overallheight :type overallheight:ifcpositivelengthmeasure :param overallwidth :type overallwidth:ifcpositivelengthmeasure ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , overallheight,overallwidth, ): ifcbuildingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) self.overallheight = overallheight self.overallwidth = overallwidth @apply def overallheight(): def fget( self ): return self._overallheight def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._overallheight = ifcpositivelengthmeasure(value) else: self._overallheight = value else: self._overallheight = value return property(**locals()) @apply def overallwidth(): def fget( self ): return self._overallwidth def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositivelengthmeasure): self._overallwidth = ifcpositivelengthmeasure(value) else: self._overallwidth = value else: self._overallwidth = value return property(**locals()) #################### # ENTITY ifclibraryinformation # #################### class ifclibraryinformation(BaseEntityClass): '''Entity ifclibraryinformation definition. :param name :type name:ifclabel :param version :type version:ifclabel :param publisher :type publisher:ifcorganization :param versiondate :type versiondate:ifccalendardate :param libraryreference :type libraryreference:SET(1,None,'ifclibraryreference', scope = schema_scope) ''' def __init__( self , name,version,publisher,versiondate,libraryreference, ): self.name = name self.version = version self.publisher = publisher self.versiondate = versiondate self.libraryreference = libraryreference @apply def name(): def fget( self ): return self._name def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument name is mantatory and can not be set to None') if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value return property(**locals()) @apply def version(): def fget( self ): return self._version def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._version = ifclabel(value) else: self._version = value else: self._version = value return property(**locals()) @apply def publisher(): def fget( self ): return self._publisher def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcorganization): self._publisher = ifcorganization(value) else: self._publisher = value else: self._publisher = value return property(**locals()) @apply def versiondate(): def fget( self ): return self._versiondate def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifccalendardate): self._versiondate = ifccalendardate(value) else: self._versiondate = value else: self._versiondate = value return property(**locals()) @apply def libraryreference(): def fget( self ): return self._libraryreference def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,SET(1,None,'ifclibraryreference', scope = schema_scope)): self._libraryreference = SET(value) else: self._libraryreference = value else: self._libraryreference = value return property(**locals()) #################### # ENTITY ifclightsourcespot # #################### class ifclightsourcespot(ifclightsourcepositional): '''Entity ifclightsourcespot definition. :param orientation :type orientation:ifcdirection :param concentrationexponent :type concentrationexponent:ifcreal :param spreadangle :type spreadangle:ifcpositiveplaneanglemeasure :param beamwidthangle :type beamwidthangle:ifcpositiveplaneanglemeasure ''' def __init__( self , inherited0__name , inherited1__lightcolour , inherited2__ambientintensity , inherited3__intensity , inherited4__position , inherited5__radius , inherited6__constantattenuation , inherited7__distanceattenuation , inherited8__quadricattenuation , orientation,concentrationexponent,spreadangle,beamwidthangle, ): ifclightsourcepositional.__init__(self , inherited0__name , inherited1__lightcolour , inherited2__ambientintensity , inherited3__intensity , inherited4__position , inherited5__radius , inherited6__constantattenuation , inherited7__distanceattenuation , inherited8__quadricattenuation , ) self.orientation = orientation self.concentrationexponent = concentrationexponent self.spreadangle = spreadangle self.beamwidthangle = beamwidthangle @apply def orientation(): def fget( self ): return self._orientation def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument orientation is mantatory and can not be set to None') if not check_type(value,ifcdirection): self._orientation = ifcdirection(value) else: self._orientation = value return property(**locals()) @apply def concentrationexponent(): def fget( self ): return self._concentrationexponent def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcreal): self._concentrationexponent = ifcreal(value) else: self._concentrationexponent = value else: self._concentrationexponent = value return property(**locals()) @apply def spreadangle(): def fget( self ): return self._spreadangle def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument spreadangle is mantatory and can not be set to None') if not check_type(value,ifcpositiveplaneanglemeasure): self._spreadangle = ifcpositiveplaneanglemeasure(value) else: self._spreadangle = value return property(**locals()) @apply def beamwidthangle(): def fget( self ): return self._beamwidthangle def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument beamwidthangle is mantatory and can not be set to None') if not check_type(value,ifcpositiveplaneanglemeasure): self._beamwidthangle = ifcpositiveplaneanglemeasure(value) else: self._beamwidthangle = value return property(**locals()) #################### # ENTITY ifcstructuralsurfacemembervarying # #################### class ifcstructuralsurfacemembervarying(ifcstructuralsurfacemember): '''Entity ifcstructuralsurfacemembervarying definition. :param subsequentthickness :type subsequentthickness:LIST(2,None,'REAL', scope = schema_scope) :param varyingthicknesslocation :type varyingthicknesslocation:ifcshapeaspect :param varyingthickness :type varyingthickness:LIST(3,None,'REAL', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__predefinedtype , inherited8__thickness , subsequentthickness,varyingthicknesslocation, ): ifcstructuralsurfacemember.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__predefinedtype , inherited8__thickness , ) self.subsequentthickness = subsequentthickness self.varyingthicknesslocation = varyingthicknesslocation @apply def subsequentthickness(): def fget( self ): return self._subsequentthickness def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument subsequentthickness is mantatory and can not be set to None') if not check_type(value,LIST(2,None,'REAL', scope = schema_scope)): self._subsequentthickness = LIST(value) else: self._subsequentthickness = value return property(**locals()) @apply def varyingthicknesslocation(): def fget( self ): return self._varyingthicknesslocation def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument varyingthicknesslocation is mantatory and can not be set to None') if not check_type(value,ifcshapeaspect): self._varyingthicknesslocation = ifcshapeaspect(value) else: self._varyingthicknesslocation = value return property(**locals()) @apply def varyingthickness(): def fget( self ): attribute_eval = ifcaddtobeginoflist(self.self.ifcstructuralsurfacemember.self.thickness,self.subsequentthickness) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument varyingthickness is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr61(self): eval_wr61_wr = EXISTS(self.self.ifcstructuralsurfacemember.self.thickness) if not eval_wr61_wr: raise AssertionError('Rule wr61 violated') else: return eval_wr61_wr def wr62(self): eval_wr62_wr = (SIZEOF(None) == 0) if not eval_wr62_wr: raise AssertionError('Rule wr62 violated') else: return eval_wr62_wr def wr63(self): eval_wr63_wr = (SIZEOF(None) == 0) if not eval_wr63_wr: raise AssertionError('Rule wr63 violated') else: return eval_wr63_wr #################### # ENTITY ifcrelassociatesdocument # #################### class ifcrelassociatesdocument(ifcrelassociates): '''Entity ifcrelassociatesdocument definition. :param relatingdocument :type relatingdocument:ifcdocumentselect ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , relatingdocument, ): ifcrelassociates.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__relatedobjects , ) self.relatingdocument = relatingdocument @apply def relatingdocument(): def fget( self ): return self._relatingdocument def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument relatingdocument is mantatory and can not be set to None') if not check_type(value,ifcdocumentselect): self._relatingdocument = ifcdocumentselect(value) else: self._relatingdocument = value return property(**locals()) #################### # ENTITY ifctimeseriesschedule # #################### class ifctimeseriesschedule(ifccontrol): '''Entity ifctimeseriesschedule definition. :param applicabledates :type applicabledates:LIST(1,None,'ifcdatetimeselect', scope = schema_scope) :param timeseriesscheduletype :type timeseriesscheduletype:ifctimeseriesscheduletypeenum :param timeseries :type timeseries:ifctimeseries ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , applicabledates,timeseriesscheduletype,timeseries, ): ifccontrol.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.applicabledates = applicabledates self.timeseriesscheduletype = timeseriesscheduletype self.timeseries = timeseries @apply def applicabledates(): def fget( self ): return self._applicabledates def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,LIST(1,None,'ifcdatetimeselect', scope = schema_scope)): self._applicabledates = LIST(value) else: self._applicabledates = value else: self._applicabledates = value return property(**locals()) @apply def timeseriesscheduletype(): def fget( self ): return self._timeseriesscheduletype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument timeseriesscheduletype is mantatory and can not be set to None') if not check_type(value,ifctimeseriesscheduletypeenum): self._timeseriesscheduletype = ifctimeseriesscheduletypeenum(value) else: self._timeseriesscheduletype = value return property(**locals()) @apply def timeseries(): def fget( self ): return self._timeseries def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument timeseries is mantatory and can not be set to None') if not check_type(value,ifctimeseries): self._timeseries = ifctimeseries(value) else: self._timeseries = value return property(**locals()) def wr41(self): eval_wr41_wr = (( not (self.timeseriesscheduletype == ifctimeseriesscheduletypeenum.self.userdefined)) or EXISTS(self.self.ifcobject.self.objecttype)) if not eval_wr41_wr: raise AssertionError('Rule wr41 violated') else: return eval_wr41_wr #################### # ENTITY ifcconditioncriterion # #################### class ifcconditioncriterion(ifccontrol): '''Entity ifcconditioncriterion definition. :param criterion :type criterion:ifcconditioncriterionselect :param criteriondatetime :type criteriondatetime:ifcdatetimeselect ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , criterion,criteriondatetime, ): ifccontrol.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.criterion = criterion self.criteriondatetime = criteriondatetime @apply def criterion(): def fget( self ): return self._criterion def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument criterion is mantatory and can not be set to None') if not check_type(value,ifcconditioncriterionselect): self._criterion = ifcconditioncriterionselect(value) else: self._criterion = value return property(**locals()) @apply def criteriondatetime(): def fget( self ): return self._criteriondatetime def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument criteriondatetime is mantatory and can not be set to None') if not check_type(value,ifcdatetimeselect): self._criteriondatetime = ifcdatetimeselect(value) else: self._criteriondatetime = value return property(**locals()) def wr1(self): eval_wr1_wr = EXISTS(self.self.ifcroot.self.name) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcelectricdistributionpoint # #################### class ifcelectricdistributionpoint(ifcflowcontroller): '''Entity ifcelectricdistributionpoint definition. :param distributionpointfunction :type distributionpointfunction:ifcelectricdistributionpointfunctionenum :param userdefinedfunction :type userdefinedfunction:ifclabel ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , distributionpointfunction,userdefinedfunction, ): ifcflowcontroller.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) self.distributionpointfunction = distributionpointfunction self.userdefinedfunction = userdefinedfunction @apply def distributionpointfunction(): def fget( self ): return self._distributionpointfunction def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument distributionpointfunction is mantatory and can not be set to None') if not check_type(value,ifcelectricdistributionpointfunctionenum): self._distributionpointfunction = ifcelectricdistributionpointfunctionenum(value) else: self._distributionpointfunction = value return property(**locals()) @apply def userdefinedfunction(): def fget( self ): return self._userdefinedfunction def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._userdefinedfunction = ifclabel(value) else: self._userdefinedfunction = value else: self._userdefinedfunction = value return property(**locals()) def wr31(self): eval_wr31_wr = ((self.distributionpointfunction != ifcelectricdistributionpointfunctionenum.self.userdefined) or ((self.distributionpointfunction == ifcelectricdistributionpointfunctionenum.self.userdefined) and EXISTS(self.self.ifcelectricdistributionpoint.self.userdefinedfunction))) if not eval_wr31_wr: raise AssertionError('Rule wr31 violated') else: return eval_wr31_wr #################### # ENTITY ifcpumptype # #################### class ifcpumptype(ifcflowmovingdevicetype): '''Entity ifcpumptype definition. :param predefinedtype :type predefinedtype:ifcpumptypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , predefinedtype, ): ifcflowmovingdevicetype.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__applicableoccurrence , inherited5__haspropertysets , inherited6__representationmaps , inherited7__tag , inherited8__elementtype , ) self.predefinedtype = predefinedtype @apply def predefinedtype(): def fget( self ): return self._predefinedtype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument predefinedtype is mantatory and can not be set to None') if not check_type(value,ifcpumptypeenum): self._predefinedtype = ifcpumptypeenum(value) else: self._predefinedtype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((self.predefinedtype != ifcpumptypeenum.self.userdefined) or ((self.predefinedtype == ifcpumptypeenum.self.userdefined) and EXISTS(self.self.ifcelementtype.self.elementtype))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcsphere # #################### class ifcsphere(ifccsgprimitive3d): '''Entity ifcsphere definition. :param radius :type radius:ifcpositivelengthmeasure ''' def __init__( self , inherited0__position , radius, ): ifccsgprimitive3d.__init__(self , inherited0__position , ) self.radius = radius @apply def radius(): def fget( self ): return self._radius def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument radius is mantatory and can not be set to None') if not check_type(value,ifcpositivelengthmeasure): self._radius = ifcpositivelengthmeasure(value) else: self._radius = value return property(**locals()) #################### # ENTITY ifccurvestylefont # #################### class ifccurvestylefont(BaseEntityClass): '''Entity ifccurvestylefont definition. :param name :type name:ifclabel :param patternlist :type patternlist:LIST(1,None,'ifccurvestylefontpattern', scope = schema_scope) ''' def __init__( self , name,patternlist, ): self.name = name self.patternlist = patternlist @apply def name(): def fget( self ): return self._name def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifclabel): self._name = ifclabel(value) else: self._name = value else: self._name = value return property(**locals()) @apply def patternlist(): def fget( self ): return self._patternlist def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument patternlist is mantatory and can not be set to None') if not check_type(value,LIST(1,None,'ifccurvestylefontpattern', scope = schema_scope)): self._patternlist = LIST(value) else: self._patternlist = value return property(**locals()) #################### # ENTITY ifcexternallydefinedsymbol # #################### class ifcexternallydefinedsymbol(ifcexternalreference): '''Entity ifcexternallydefinedsymbol definition. ''' def __init__( self , inherited0__location , inherited1__itemreference , inherited2__name , ): ifcexternalreference.__init__(self , inherited0__location , inherited1__itemreference , inherited2__name , ) #################### # ENTITY ifcramp # #################### class ifcramp(ifcbuildingelement): '''Entity ifcramp definition. :param shapetype :type shapetype:ifcramptypeenum ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , shapetype, ): ifcbuildingelement.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) self.shapetype = shapetype @apply def shapetype(): def fget( self ): return self._shapetype def fset( self, value ): # Mandatory argument if value==None: raise AssertionError('Argument shapetype is mantatory and can not be set to None') if not check_type(value,ifcramptypeenum): self._shapetype = ifcramptypeenum(value) else: self._shapetype = value return property(**locals()) def wr1(self): eval_wr1_wr = ((HIINDEX(self.self.ifcobjectdefinition.self.isdecomposedby) == 0) or ((HIINDEX(self.self.ifcobjectdefinition.self.isdecomposedby) == 1) and ( not EXISTS(self.self.ifcproduct.self.representation)))) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr #################### # ENTITY ifcopeningelement # #################### class ifcopeningelement(ifcfeatureelementsubtraction): '''Entity ifcopeningelement definition. :param hasfillings :type hasfillings:SET(0,None,'ifcrelfillselement', scope = schema_scope) ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ): ifcfeatureelementsubtraction.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , inherited5__objectplacement , inherited6__representation , inherited7__tag , ) @apply def hasfillings(): def fget( self ): return self._hasfillings def fset( self, value ): # INVERSE argument raise AssertionError('Argument hasfillings is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # ENTITY ifccartesiantransformationoperator3dnonuniform # #################### class ifccartesiantransformationoperator3dnonuniform(ifccartesiantransformationoperator3d): '''Entity ifccartesiantransformationoperator3dnonuniform definition. :param scale2 :type scale2:REAL :param scale3 :type scale3:REAL :param scl2 :type scl2:REAL :param scl3 :type scl3:REAL ''' def __init__( self , inherited0__axis1 , inherited1__axis2 , inherited2__localorigin , inherited3__scale , inherited4__axis3 , scale2,scale3, ): ifccartesiantransformationoperator3d.__init__(self , inherited0__axis1 , inherited1__axis2 , inherited2__localorigin , inherited3__scale , inherited4__axis3 , ) self.scale2 = scale2 self.scale3 = scale3 @apply def scale2(): def fget( self ): return self._scale2 def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,REAL): self._scale2 = REAL(value) else: self._scale2 = value else: self._scale2 = value return property(**locals()) @apply def scale3(): def fget( self ): return self._scale3 def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,REAL): self._scale3 = REAL(value) else: self._scale3 = value else: self._scale3 = value return property(**locals()) @apply def scl2(): def fget( self ): attribute_eval = NVL(self.scale2,self.self.ifccartesiantransformationoperator.self.scl) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument scl2 is DERIVED. It is computed and can not be set to any value') return property(**locals()) @apply def scl3(): def fget( self ): attribute_eval = NVL(self.scale3,self.self.ifccartesiantransformationoperator.self.scl) return attribute_eval def fset( self, value ): # DERIVED argument raise AssertionError('Argument scl3 is DERIVED. It is computed and can not be set to any value') return property(**locals()) def wr1(self): eval_wr1_wr = (self.scl2 > 0) if not eval_wr1_wr: raise AssertionError('Rule wr1 violated') else: return eval_wr1_wr def wr2(self): eval_wr2_wr = (self.scl3 > 0) if not eval_wr2_wr: raise AssertionError('Rule wr2 violated') else: return eval_wr2_wr #################### # ENTITY ifcscheduletimecontrol # #################### class ifcscheduletimecontrol(ifccontrol): '''Entity ifcscheduletimecontrol definition. :param actualstart :type actualstart:ifcdatetimeselect :param earlystart :type earlystart:ifcdatetimeselect :param latestart :type latestart:ifcdatetimeselect :param schedulestart :type schedulestart:ifcdatetimeselect :param actualfinish :type actualfinish:ifcdatetimeselect :param earlyfinish :type earlyfinish:ifcdatetimeselect :param latefinish :type latefinish:ifcdatetimeselect :param schedulefinish :type schedulefinish:ifcdatetimeselect :param scheduleduration :type scheduleduration:ifctimemeasure :param actualduration :type actualduration:ifctimemeasure :param remainingtime :type remainingtime:ifctimemeasure :param freefloat :type freefloat:ifctimemeasure :param totalfloat :type totalfloat:ifctimemeasure :param iscritical :type iscritical:BOOLEAN :param statustime :type statustime:ifcdatetimeselect :param startfloat :type startfloat:ifctimemeasure :param finishfloat :type finishfloat:ifctimemeasure :param completion :type completion:ifcpositiveratiomeasure :param scheduletimecontrolassigned :type scheduletimecontrolassigned:ifcrelassignstasks ''' def __init__( self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , actualstart,earlystart,latestart,schedulestart,actualfinish,earlyfinish,latefinish,schedulefinish,scheduleduration,actualduration,remainingtime,freefloat,totalfloat,iscritical,statustime,startfloat,finishfloat,completion, ): ifccontrol.__init__(self , inherited0__globalid , inherited1__ownerhistory , inherited2__name , inherited3__description , inherited4__objecttype , ) self.actualstart = actualstart self.earlystart = earlystart self.latestart = latestart self.schedulestart = schedulestart self.actualfinish = actualfinish self.earlyfinish = earlyfinish self.latefinish = latefinish self.schedulefinish = schedulefinish self.scheduleduration = scheduleduration self.actualduration = actualduration self.remainingtime = remainingtime self.freefloat = freefloat self.totalfloat = totalfloat self.iscritical = iscritical self.statustime = statustime self.startfloat = startfloat self.finishfloat = finishfloat self.completion = completion @apply def actualstart(): def fget( self ): return self._actualstart def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdatetimeselect): self._actualstart = ifcdatetimeselect(value) else: self._actualstart = value else: self._actualstart = value return property(**locals()) @apply def earlystart(): def fget( self ): return self._earlystart def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdatetimeselect): self._earlystart = ifcdatetimeselect(value) else: self._earlystart = value else: self._earlystart = value return property(**locals()) @apply def latestart(): def fget( self ): return self._latestart def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdatetimeselect): self._latestart = ifcdatetimeselect(value) else: self._latestart = value else: self._latestart = value return property(**locals()) @apply def schedulestart(): def fget( self ): return self._schedulestart def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdatetimeselect): self._schedulestart = ifcdatetimeselect(value) else: self._schedulestart = value else: self._schedulestart = value return property(**locals()) @apply def actualfinish(): def fget( self ): return self._actualfinish def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdatetimeselect): self._actualfinish = ifcdatetimeselect(value) else: self._actualfinish = value else: self._actualfinish = value return property(**locals()) @apply def earlyfinish(): def fget( self ): return self._earlyfinish def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdatetimeselect): self._earlyfinish = ifcdatetimeselect(value) else: self._earlyfinish = value else: self._earlyfinish = value return property(**locals()) @apply def latefinish(): def fget( self ): return self._latefinish def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdatetimeselect): self._latefinish = ifcdatetimeselect(value) else: self._latefinish = value else: self._latefinish = value return property(**locals()) @apply def schedulefinish(): def fget( self ): return self._schedulefinish def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdatetimeselect): self._schedulefinish = ifcdatetimeselect(value) else: self._schedulefinish = value else: self._schedulefinish = value return property(**locals()) @apply def scheduleduration(): def fget( self ): return self._scheduleduration def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctimemeasure): self._scheduleduration = ifctimemeasure(value) else: self._scheduleduration = value else: self._scheduleduration = value return property(**locals()) @apply def actualduration(): def fget( self ): return self._actualduration def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctimemeasure): self._actualduration = ifctimemeasure(value) else: self._actualduration = value else: self._actualduration = value return property(**locals()) @apply def remainingtime(): def fget( self ): return self._remainingtime def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctimemeasure): self._remainingtime = ifctimemeasure(value) else: self._remainingtime = value else: self._remainingtime = value return property(**locals()) @apply def freefloat(): def fget( self ): return self._freefloat def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctimemeasure): self._freefloat = ifctimemeasure(value) else: self._freefloat = value else: self._freefloat = value return property(**locals()) @apply def totalfloat(): def fget( self ): return self._totalfloat def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctimemeasure): self._totalfloat = ifctimemeasure(value) else: self._totalfloat = value else: self._totalfloat = value return property(**locals()) @apply def iscritical(): def fget( self ): return self._iscritical def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,BOOLEAN): self._iscritical = BOOLEAN(value) else: self._iscritical = value else: self._iscritical = value return property(**locals()) @apply def statustime(): def fget( self ): return self._statustime def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcdatetimeselect): self._statustime = ifcdatetimeselect(value) else: self._statustime = value else: self._statustime = value return property(**locals()) @apply def startfloat(): def fget( self ): return self._startfloat def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctimemeasure): self._startfloat = ifctimemeasure(value) else: self._startfloat = value else: self._startfloat = value return property(**locals()) @apply def finishfloat(): def fget( self ): return self._finishfloat def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifctimemeasure): self._finishfloat = ifctimemeasure(value) else: self._finishfloat = value else: self._finishfloat = value return property(**locals()) @apply def completion(): def fget( self ): return self._completion def fset( self, value ): if value != None: # OPTIONAL attribute if not check_type(value,ifcpositiveratiomeasure): self._completion = ifcpositiveratiomeasure(value) else: self._completion = value else: self._completion = value return property(**locals()) @apply def scheduletimecontrolassigned(): def fget( self ): return self._scheduletimecontrolassigned def fset( self, value ): # INVERSE argument raise AssertionError('Argument scheduletimecontrolassigned is INVERSE. It is computed and can not be set to any value') return property(**locals()) #################### # FUNCTION ifcnormalise # #################### def ifcnormalise(arg,): ''' :param arg :type arg:ifcvectorordirection ''' if ( not EXISTS(arg)): return None else: ndim = arg.dim if ('IFC2X3.IFCVECTOR' == TYPEOF(arg)): # begin/end block v.directionratios = arg.ifcvector.orientation.directionratios vec.magnitude = arg.ifcvector.magnitude vec.orientation = v if (arg.magnitude == 0): return None else: vec.magnitude = 1 else: v.directionratios = arg.directionratios mag = 0 for i in range(1,ndim,1): mag = mag + (v.directionratios[i] * v.directionratios[i]) if (mag > 0): mag = SQRT(mag) for i in range(1,ndim,1): v.directionratios[i] = v.directionratios[i] / mag if ('IFC2X3.IFCVECTOR' == TYPEOF(arg)): vec.orientation = v result = vec else: result = v else: return None return result #################### # FUNCTION ifcsamevalue # #################### def ifcsamevalue(value1,value2,epsilon,): ''' :param value1 :type value1:REAL :param value2 :type value2:REAL :param epsilon :type epsilon:REAL ''' valideps = NVL(epsilon,defaulteps) return ((value1 + valideps) > value2) and (value1 < (value2 + valideps)) #################### # FUNCTION ifcsamevalidprecision # #################### def ifcsamevalidprecision(epsilon1,epsilon2,): ''' :param epsilon1 :type epsilon1:REAL :param epsilon2 :type epsilon2:REAL ''' valideps1 = NVL(epsilon1,defaulteps) valideps2 = NVL(epsilon2,defaulteps) return (((0 < valideps1) and (valideps1 <= (derivationofeps * valideps2))) and (valideps2 <= (derivationofeps * valideps1))) and (valideps2 < uppereps) #################### # FUNCTION ifcbuildaxes # #################### def ifcbuildaxes(axis,refdirection,): ''' :param axis :type axis:ifcdirection :param refdirection :type refdirection:ifcdirection ''' d1 = NVL(ifcnormalise(axis),(ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcdirection([0,0,1])) d2 = ifcfirstprojaxis(d1,refdirection) return [d2,ifcnormalise(ifccrossproduct(d1,d2)).ifcvector.orientation,d1] #################### # FUNCTION ifcvectorsum # #################### def ifcvectorsum(arg1,arg2,): ''' :param arg1 :type arg1:ifcvectorordirection :param arg2 :type arg2:ifcvectorordirection ''' if ((( not EXISTS(arg1)) or ( not EXISTS(arg2))) or (arg1.dim != arg2.dim)): return None else: # begin/end block if ('IFC2X3.IFCVECTOR' == TYPEOF(arg1)): mag1 = arg1.ifcvector.magnitude vec1 = arg1.ifcvector.orientation else: mag1 = 1 vec1 = arg1 if ('IFC2X3.IFCVECTOR' == TYPEOF(arg2)): mag2 = arg2.ifcvector.magnitude vec2 = arg2.ifcvector.orientation else: mag2 = 1 vec2 = arg2 vec1 = ifcnormalise(vec1) vec2 = ifcnormalise(vec2) ndim = SIZEOF(vec1.directionratios) mag = 0 res = (ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcdirection([0,ndim]) for i in range(1,ndim,1): res.directionratios[i] = (mag1 * vec1.directionratios[i]) + (mag2 * vec2.directionratios[i]) mag = mag + (res.directionratios[i] * res.directionratios[i]) if (mag > 0): result = (ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcvector(res,SQRT(mag)) else: result = (ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcvector(vec1,0) return result #################### # FUNCTION ifcvectordifference # #################### def ifcvectordifference(arg1,arg2,): ''' :param arg1 :type arg1:ifcvectorordirection :param arg2 :type arg2:ifcvectorordirection ''' if ((( not EXISTS(arg1)) or ( not EXISTS(arg2))) or (arg1.dim != arg2.dim)): return None else: # begin/end block if ('IFC2X3.IFCVECTOR' == TYPEOF(arg1)): mag1 = arg1.ifcvector.magnitude vec1 = arg1.ifcvector.orientation else: mag1 = 1 vec1 = arg1 if ('IFC2X3.IFCVECTOR' == TYPEOF(arg2)): mag2 = arg2.ifcvector.magnitude vec2 = arg2.ifcvector.orientation else: mag2 = 1 vec2 = arg2 vec1 = ifcnormalise(vec1) vec2 = ifcnormalise(vec2) ndim = SIZEOF(vec1.directionratios) mag = 0 res = (ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcdirection([0,ndim]) for i in range(1,ndim,1): res.directionratios[i] = (mag1 * vec1.directionratios[i]) - (mag2 * vec2.directionratios[i]) mag = mag + (res.directionratios[i] * res.directionratios[i]) if (mag > 0): result = (ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcvector(res,SQRT(mag)) else: result = (ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcvector(vec1,0) return result #################### # FUNCTION ifccorrectlocalplacement # #################### def ifccorrectlocalplacement(axisplacement,relplacement,): ''' :param axisplacement :type axisplacement:ifcaxis2placement :param relplacement :type relplacement:ifcobjectplacement ''' if (EXISTS(relplacement)): if ('IFC2X3.IFCGRIDPLACEMENT' == TYPEOF(relplacement)): return None if ('IFC2X3.IFCLOCALPLACEMENT' == TYPEOF(relplacement)): if ('IFC2X3.IFCAXIS2PLACEMENT2D' == TYPEOF(axisplacement)): return TRUE if ('IFC2X3.IFCAXIS2PLACEMENT3D' == TYPEOF(axisplacement)): if (relplacement.relativeplacement.dim == 3): return TRUE else: return FALSE else: return TRUE return None #################### # FUNCTION ifccorrectfillareastyle # #################### def ifccorrectfillareastyle(styles,): ''' :param styles :type styles:(null) ''' external = SIZEOF(None) hatching = SIZEOF(None) tiles = SIZEOF(None) colour = SIZEOF(None) if (external > 1): return FALSE if ((external == 1) and (((hatching > 0) or (tiles > 0)) or (colour > 0))): return FALSE if (colour > 1): return FALSE if ((hatching > 0) and (tiles > 0)): return FALSE return TRUE #################### # FUNCTION ifcuniquepropertyname # #################### def ifcuniquepropertyname(properties,): ''' :param properties :type properties:(null) ''' for i in range(1,HIINDEX(properties),1): names = names + properties[i].name return SIZEOF(names) == SIZEOF(properties) #################### # FUNCTION ifccurvedim # #################### def ifccurvedim(curve,): ''' :param curve :type curve:ifccurve ''' if ('IFC2X3.IFCLINE' == TYPEOF(curve)): return curve.ifcline.pnt.dim if ('IFC2X3.IFCCONIC' == TYPEOF(curve)): return curve.ifcconic.position.dim if ('IFC2X3.IFCPOLYLINE' == TYPEOF(curve)): return curve.ifcpolyline.points[1].dim if ('IFC2X3.IFCTRIMMEDCURVE' == TYPEOF(curve)): return ifccurvedim(curve.ifctrimmedcurve.basiscurve) if ('IFC2X3.IFCCOMPOSITECURVE' == TYPEOF(curve)): return curve.ifccompositecurve.segments[1].dim if ('IFC2X3.IFCBSPLINECURVE' == TYPEOF(curve)): return curve.ifcbsplinecurve.controlpointslist[1].dim if ('IFC2X3.IFCOFFSETCURVE2D' == TYPEOF(curve)): return 2 if ('IFC2X3.IFCOFFSETCURVE3D' == TYPEOF(curve)): return 3 return None #################### # FUNCTION ifcsamedirection # #################### def ifcsamedirection(dir1,dir2,epsilon,): ''' :param dir1 :type dir1:ifcdirection :param dir2 :type dir2:ifcdirection :param epsilon :type epsilon:REAL ''' if (SIZEOF(dir1.directionratios) > 2): dir1z = dir1.directionratios[3] if (SIZEOF(dir2.directionratios) > 2): dir2z = dir2.directionratios[3] return (ifcsamevalue(dir1x,dir2x,epsilon) and ifcsamevalue(dir1y,dir2y,epsilon)) and ifcsamevalue(dir1z,dir2z,epsilon) #################### # FUNCTION ifclisttoarray # #################### def ifclisttoarray(lis,low,u,): ''' :param lis :type lis:(null) :param low :type low:INTEGER :param u :type u:INTEGER ''' n = SIZEOF(lis) if (n != ((u - low) + 1)): return None else: res = [lis[1],n] for i in range(2,n,1): res[(low + i) - 1] = lis[i] return res #################### # FUNCTION ifcvalidtime # #################### def ifcvalidtime(time,): ''' :param time :type time:ifclocaltime ''' if (EXISTS(time.secondcomponent)): return EXISTS(time.minutecomponent) else: return TRUE #################### # FUNCTION ifctopologyrepresentationtypes # #################### def ifctopologyrepresentationtypes(reptype,items,): ''' :param reptype :type reptype:STRING :param items :type items:(null) ''' case_selector = reptype if case_selector == 'Vertex': # begin/end block count = SIZEOF(None) elif case_selector == 'Edge': # begin/end block count = SIZEOF(None) elif case_selector == 'Path': # begin/end block count = SIZEOF(None) elif case_selector == 'Face': # begin/end block count = SIZEOF(None) elif case_selector == 'Shell': # begin/end block count = SIZEOF(None) elif case_selector == 'Undefined': return TRUE else: return None return count == SIZEOF(items) #################### # FUNCTION ifccorrectunitassignment # #################### def ifccorrectunitassignment(units,): ''' :param units :type units:(null) ''' namedunitnumber = SIZEOF(None) derivedunitnumber = SIZEOF(None) monetaryunitnumber = SIZEOF(None) for i in range(1,SIZEOF(units),1): if (('IFC2X3.IFCNAMEDUNIT' == TYPEOF(units[i])) and ( not (units[i].ifcnamedunit.unittype == ifcunitenum.userdefined))): namedunitnames = namedunitnames + units[i].ifcnamedunit.unittype if (('IFC2X3.IFCDERIVEDUNIT' == TYPEOF(units[i])) and ( not (units[i].ifcderivedunit.unittype == ifcderivedunitenum.userdefined))): derivedunitnames = derivedunitnames + units[i].ifcderivedunit.unittype return ((SIZEOF(namedunitnames) == namedunitnumber) and (SIZEOF(derivedunitnames) == derivedunitnumber)) and (monetaryunitnumber <= 1) #################### # FUNCTION ifcdotproduct # #################### def ifcdotproduct(arg1,arg2,): ''' :param arg1 :type arg1:ifcdirection :param arg2 :type arg2:ifcdirection ''' if (( not EXISTS(arg1)) or ( not EXISTS(arg2))): scalar = None else: if (arg1.dim != arg2.dim): scalar = None else: # begin/end block vec1 = ifcnormalise(arg1) vec2 = ifcnormalise(arg2) ndim = arg1.dim scalar = 0 for i in range(1,ndim,1): scalar = scalar + (vec1.directionratios[i] * vec2.directionratios[i]) return scalar #################### # FUNCTION ifcaddtobeginoflist # #################### def ifcaddtobeginoflist(ascalar,alist,): ''' :param ascalar :type ascalar:(null) :param alist :type alist:(null) ''' if ( not EXISTS(ascalar)): result = alist else: result = result + ascalar if (HIINDEX(alist) >= 1): for i in range(1,HIINDEX(alist),1): result[i + 1] = alist[i] return result #################### # FUNCTION ifcfirstprojaxis # #################### def ifcfirstprojaxis(zaxis,arg,): ''' :param zaxis :type zaxis:ifcdirection :param arg :type arg:ifcdirection ''' if ( not EXISTS(zaxis)): return None else: z = ifcnormalise(zaxis) if ( not EXISTS(arg)): if (z.directionratios != [1,0,0]): v = (ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcdirection([1,0,0]) else: v = (ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcdirection([0,1,0]) else: if (arg.dim != 3): return None if (ifccrossproduct(arg,z).magnitude == 0): return None else: v = ifcnormalise(arg) xvec = ifcscalartimesvector(ifcdotproduct(v,z),z) xaxis = ifcvectordifference(v,xvec).orientation xaxis = ifcnormalise(xaxis) return xaxis #################### # FUNCTION ifcshaperepresentationtypes # #################### def ifcshaperepresentationtypes(reptype,items,): ''' :param reptype :type reptype:STRING :param items :type items:(null) ''' case_selector = reptype if case_selector == 'Curve2D': # begin/end block count = SIZEOF(None) elif case_selector == 'Annotation2D': # begin/end block count = SIZEOF(None) elif case_selector == 'GeometricSet': # begin/end block count = SIZEOF(None) elif case_selector == 'GeometricCurveSet': # begin/end block count = SIZEOF(None) for i in range(1,HIINDEX(items),1): if ('IFC2X3.IFCGEOMETRICSET' == TYPEOF(items[i])): if (SIZEOF(None) > 0): count = count - 1 elif case_selector == 'SurfaceModel': # begin/end block count = SIZEOF(None) elif case_selector == 'SolidModel': # begin/end block count = SIZEOF(None) elif case_selector == 'SweptSolid': # begin/end block count = SIZEOF(None) elif case_selector == 'CSG': # begin/end block count = SIZEOF(None) elif case_selector == 'Clipping': # begin/end block count = SIZEOF(None) elif case_selector == 'AdvancedSweptSolid': # begin/end block count = SIZEOF(None) elif case_selector == 'Brep': # begin/end block count = SIZEOF(None) elif case_selector == 'BoundingBox': # begin/end block count = SIZEOF(None) if (SIZEOF(items) > 1): count = 0 elif case_selector == 'SectionedSpine': # begin/end block count = SIZEOF(None) elif case_selector == 'MappedRepresentation': # begin/end block count = SIZEOF(None) else: return None return count == SIZEOF(items) #################### # FUNCTION ifcpathheadtotail # #################### def ifcpathheadtotail(apath,): ''' :param apath :type apath:ifcpath ''' n = SIZEOF(apath.edgelist) for i in range(2,n,1): p = p and (apath.edgelist[i - 1].edgeend == apath.edgelist[i].edgestart) return p #################### # FUNCTION ifcsecondprojaxis # #################### def ifcsecondprojaxis(zaxis,xaxis,arg,): ''' :param zaxis :type zaxis:ifcdirection :param xaxis :type xaxis:ifcdirection :param arg :type arg:ifcdirection ''' if ( not EXISTS(arg)): v = (ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcdirection([0,1,0]) else: v = arg temp = ifcscalartimesvector(ifcdotproduct(v,zaxis),zaxis) yaxis = ifcvectordifference(v,temp) temp = ifcscalartimesvector(ifcdotproduct(v,xaxis),xaxis) yaxis = ifcvectordifference(yaxis,temp) yaxis = ifcnormalise(yaxis) return yaxis.orientation #################### # FUNCTION ifcderivedimensionalexponents # #################### def ifcderivedimensionalexponents(unitelements,): ''' :param unitelements :type unitelements:(null) ''' for i in range(LOINDEX(unitelements),HIINDEX(unitelements),1): result.lengthexponent = result.lengthexponent + (unitelements[i].exponent * unitelements[i].unit.dimensions.lengthexponent) result.massexponent = result.massexponent + (unitelements[i].exponent * unitelements[i].unit.dimensions.massexponent) result.timeexponent = result.timeexponent + (unitelements[i].exponent * unitelements[i].unit.dimensions.timeexponent) result.electriccurrentexponent = result.electriccurrentexponent + (unitelements[i].exponent * unitelements[i].unit.dimensions.electriccurrentexponent) result.thermodynamictemperatureexponent = result.thermodynamictemperatureexponent + (unitelements[i].exponent * unitelements[i].unit.dimensions.thermodynamictemperatureexponent) result.amountofsubstanceexponent = result.amountofsubstanceexponent + (unitelements[i].exponent * unitelements[i].unit.dimensions.amountofsubstanceexponent) result.luminousintensityexponent = result.luminousintensityexponent + (unitelements[i].exponent * unitelements[i].unit.dimensions.luminousintensityexponent) return result #################### # FUNCTION ifcbooleanchoose # #################### def ifcbooleanchoose(b,choice1,choice2,): ''' :param b :type b:BOOLEAN :param choice1 :type choice1:(null) :param choice2 :type choice2:(null) ''' if (b): return choice1 else: return choice2 #################### # FUNCTION ifcscalartimesvector # #################### def ifcscalartimesvector(scalar,vec,): ''' :param scalar :type scalar:REAL :param vec :type vec:ifcvectorordirection ''' if (( not EXISTS(scalar)) or ( not EXISTS(vec))): return None else: if ('IFC2X3.IFCVECTOR' == TYPEOF(vec)): v = vec.ifcvector.orientation mag = scalar * vec.ifcvector.magnitude else: v = vec mag = scalar if (mag < 0): for i in range(1,SIZEOF(v.directionratios),1): v.directionratios[i] = -v.directionratios[i] mag = -mag result = (ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcvector(ifcnormalise(v),mag) return result #################### # FUNCTION ifcleapyear # #################### def ifcleapyear(year,): ''' :param year :type year:INTEGER ''' if ((((year % 4) == 0) and ((year % 100) != 0)) or ((year % 400) == 0)): return TRUE else: return FALSE #################### # FUNCTION ifcbaseaxis # #################### def ifcbaseaxis(dim,axis1,axis2,axis3,): ''' :param dim :type dim:INTEGER :param axis1 :type axis1:ifcdirection :param axis2 :type axis2:ifcdirection :param axis3 :type axis3:ifcdirection ''' if (dim == 3): d1 = NVL(ifcnormalise(axis3),(ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcdirection([0,0,1])) d2 = ifcfirstprojaxis(d1,axis1) u = [d2,ifcsecondprojaxis(d1,d2,axis2),d1] else: if (EXISTS(axis1)): d1 = ifcnormalise(axis1) u = [d1,ifcorthogonalcomplement(d1)] if (EXISTS(axis2)): factor = ifcdotproduct(axis2,u[2]) if (factor < 0): u[2].directionratios[1] = -u[2].directionratios[1] u[2].directionratios[2] = -u[2].directionratios[2] else: if (EXISTS(axis2)): d1 = ifcnormalise(axis2) u = [ifcorthogonalcomplement(d1),d1] u[1].directionratios[1] = -u[1].directionratios[1] u[1].directionratios[2] = -u[1].directionratios[2] else: u = [(ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcdirection([1,0]),(ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcdirection([0,1])] return u #################### # FUNCTION ifcorthogonalcomplement # #################### def ifcorthogonalcomplement(vec,): ''' :param vec :type vec:ifcdirection ''' if (( not EXISTS(vec)) or (vec.dim != 2)): return None else: result = (ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcdirection([-vec.directionratios[2],vec.directionratios[1]]) return result #################### # FUNCTION ifcloopheadtotail # #################### def ifcloopheadtotail(aloop,): ''' :param aloop :type aloop:ifcedgeloop ''' n = SIZEOF(aloop.edgelist) for i in range(2,n,1): p = p and (aloop.edgelist[i - 1].edgeend == aloop.edgelist[i].edgestart) return p #################### # FUNCTION ifccorrectdimensions # #################### def ifccorrectdimensions(m,dim,): ''' :param m :type m:ifcunitenum :param dim :type dim:ifcdimensionalexponents ''' case_selector = m if case_selector == lengthunit: if (dim == ifcdimensionalexponents(1,0,0,0,0,0,0)): return TRUE else: return FALSE elif case_selector == massunit: if (dim == ifcdimensionalexponents(0,1,0,0,0,0,0)): return TRUE else: return FALSE elif case_selector == timeunit: if (dim == ifcdimensionalexponents(0,0,1,0,0,0,0)): return TRUE else: return FALSE elif case_selector == electriccurrentunit: if (dim == ifcdimensionalexponents(0,0,0,1,0,0,0)): return TRUE else: return FALSE elif case_selector == thermodynamictemperatureunit: if (dim == ifcdimensionalexponents(0,0,0,0,1,0,0)): return TRUE else: return FALSE elif case_selector == amountofsubstanceunit: if (dim == ifcdimensionalexponents(0,0,0,0,0,1,0)): return TRUE else: return FALSE elif case_selector == luminousintensityunit: if (dim == ifcdimensionalexponents(0,0,0,0,0,0,1)): return TRUE else: return FALSE elif case_selector == planeangleunit: if (dim == ifcdimensionalexponents(0,0,0,0,0,0,0)): return TRUE else: return FALSE elif case_selector == solidangleunit: if (dim == ifcdimensionalexponents(0,0,0,0,0,0,0)): return TRUE else: return FALSE elif case_selector == areaunit: if (dim == ifcdimensionalexponents(2,0,0,0,0,0,0)): return TRUE else: return FALSE elif case_selector == volumeunit: if (dim == ifcdimensionalexponents(3,0,0,0,0,0,0)): return TRUE else: return FALSE elif case_selector == absorbeddoseunit: if (dim == ifcdimensionalexponents(2,0,-2,0,0,0,0)): return TRUE else: return FALSE elif case_selector == radioactivityunit: if (dim == ifcdimensionalexponents(0,0,-1,0,0,0,0)): return TRUE else: return FALSE elif case_selector == electriccapacitanceunit: if (dim == ifcdimensionalexponents(-2,1,4,1,0,0,0)): return TRUE else: return FALSE elif case_selector == doseequivalentunit: if (dim == ifcdimensionalexponents(2,0,-2,0,0,0,0)): return TRUE else: return FALSE elif case_selector == electricchargeunit: if (dim == ifcdimensionalexponents(0,0,1,1,0,0,0)): return TRUE else: return FALSE elif case_selector == electricconductanceunit: if (dim == ifcdimensionalexponents(-2,-1,3,2,0,0,0)): return TRUE else: return FALSE elif case_selector == electricvoltageunit: if (dim == ifcdimensionalexponents(2,1,-3,-1,0,0,0)): return TRUE else: return FALSE elif case_selector == electricresistanceunit: if (dim == ifcdimensionalexponents(2,1,-3,-2,0,0,0)): return TRUE else: return FALSE elif case_selector == energyunit: if (dim == ifcdimensionalexponents(2,1,-2,0,0,0,0)): return TRUE else: return FALSE elif case_selector == forceunit: if (dim == ifcdimensionalexponents(1,1,-2,0,0,0,0)): return TRUE else: return FALSE elif case_selector == frequencyunit: if (dim == ifcdimensionalexponents(0,0,-1,0,0,0,0)): return TRUE else: return FALSE elif case_selector == inductanceunit: if (dim == ifcdimensionalexponents(2,1,-2,-2,0,0,0)): return TRUE else: return FALSE elif case_selector == illuminanceunit: if (dim == ifcdimensionalexponents(-2,0,0,0,0,0,1)): return TRUE else: return FALSE elif case_selector == luminousfluxunit: if (dim == ifcdimensionalexponents(0,0,0,0,0,0,1)): return TRUE else: return FALSE elif case_selector == magneticfluxunit: if (dim == ifcdimensionalexponents(2,1,-2,-1,0,0,0)): return TRUE else: return FALSE elif case_selector == magneticfluxdensityunit: if (dim == ifcdimensionalexponents(0,1,-2,-1,0,0,0)): return TRUE else: return FALSE elif case_selector == powerunit: if (dim == ifcdimensionalexponents(2,1,-3,0,0,0,0)): return TRUE else: return FALSE elif case_selector == pressureunit: if (dim == ifcdimensionalexponents(-1,1,-2,0,0,0,0)): return TRUE else: return FALSE else: return UNKNOWN #################### # FUNCTION ifcdimensionsforsiunit # #################### def ifcdimensionsforsiunit(n,): ''' :param n :type n:ifcsiunitname ''' case_selector = n if case_selector == metre: return ifcdimensionalexponents(1,0,0,0,0,0,0) elif case_selector == square_metre: return ifcdimensionalexponents(2,0,0,0,0,0,0) elif case_selector == cubic_metre: return ifcdimensionalexponents(3,0,0,0,0,0,0) elif case_selector == gram: return ifcdimensionalexponents(0,1,0,0,0,0,0) elif case_selector == second: return ifcdimensionalexponents(0,0,1,0,0,0,0) elif case_selector == ampere: return ifcdimensionalexponents(0,0,0,1,0,0,0) elif case_selector == kelvin: return ifcdimensionalexponents(0,0,0,0,1,0,0) elif case_selector == mole: return ifcdimensionalexponents(0,0,0,0,0,1,0) elif case_selector == candela: return ifcdimensionalexponents(0,0,0,0,0,0,1) elif case_selector == radian: return ifcdimensionalexponents(0,0,0,0,0,0,0) elif case_selector == steradian: return ifcdimensionalexponents(0,0,0,0,0,0,0) elif case_selector == hertz: return ifcdimensionalexponents(0,0,-1,0,0,0,0) elif case_selector == newton: return ifcdimensionalexponents(1,1,-2,0,0,0,0) elif case_selector == pascal: return ifcdimensionalexponents(-1,1,-2,0,0,0,0) elif case_selector == joule: return ifcdimensionalexponents(2,1,-2,0,0,0,0) elif case_selector == watt: return ifcdimensionalexponents(2,1,-3,0,0,0,0) elif case_selector == coulomb: return ifcdimensionalexponents(0,0,1,1,0,0,0) elif case_selector == volt: return ifcdimensionalexponents(2,1,-3,-1,0,0,0) elif case_selector == farad: return ifcdimensionalexponents(-2,-1,4,1,0,0,0) elif case_selector == ohm: return ifcdimensionalexponents(2,1,-3,-2,0,0,0) elif case_selector == siemens: return ifcdimensionalexponents(-2,-1,3,2,0,0,0) elif case_selector == weber: return ifcdimensionalexponents(2,1,-2,-1,0,0,0) elif case_selector == tesla: return ifcdimensionalexponents(0,1,-2,-1,0,0,0) elif case_selector == henry: return ifcdimensionalexponents(2,1,-2,-2,0,0,0) elif case_selector == degree_celsius: return ifcdimensionalexponents(0,0,0,0,1,0,0) elif case_selector == lumen: return ifcdimensionalexponents(0,0,0,0,0,0,1) elif case_selector == lux: return ifcdimensionalexponents(-2,0,0,0,0,0,1) elif case_selector == becquerel: return ifcdimensionalexponents(0,0,-1,0,0,0,0) elif case_selector == gray: return ifcdimensionalexponents(2,0,-2,0,0,0,0) elif case_selector == sievert: return ifcdimensionalexponents(2,0,-2,0,0,0,0) else: return ifcdimensionalexponents(0,0,0,0,0,0,0) #################### # FUNCTION ifcmlstotalthickness # #################### def ifcmlstotalthickness(layerset,): ''' :param layerset :type layerset:ifcmateriallayerset ''' if (SIZEOF(layerset.materiallayers) > 1): for i in range(2,HIINDEX(layerset.materiallayers),1): max = max + layerset.materiallayers[i].layerthickness return max #################### # FUNCTION ifccorrectobjectassignment # #################### def ifccorrectobjectassignment(constraint,objects,): ''' :param constraint :type constraint:ifcobjecttypeenum :param objects :type objects:(null) ''' if ( not EXISTS(constraint)): return TRUE case_selector = constraint if case_selector == ifcobjecttypeenum.notdefined: return TRUE elif case_selector == ifcobjecttypeenum.product: # begin/end block count = SIZEOF(None) return count == 0 elif case_selector == ifcobjecttypeenum.process: # begin/end block count = SIZEOF(None) return count == 0 elif case_selector == ifcobjecttypeenum.control: # begin/end block count = SIZEOF(None) return count == 0 elif case_selector == ifcobjecttypeenum.resource: # begin/end block count = SIZEOF(None) return count == 0 elif case_selector == ifcobjecttypeenum.actor: # begin/end block count = SIZEOF(None) return count == 0 elif case_selector == ifcobjecttypeenum.group: # begin/end block count = SIZEOF(None) return count == 0 elif case_selector == ifcobjecttypeenum.project: # begin/end block count = SIZEOF(None) return count == 0 else: return None #################### # FUNCTION ifcvalidcalendardate # #################### def ifcvalidcalendardate(date,): ''' :param date :type date:ifccalendardate ''' if ( not ((1 <= date.daycomponent) and (date.daycomponent <= 31))): return FALSE case_selector = date.monthcomponent if case_selector == 4: return (1 <= date.daycomponent) and (date.daycomponent <= 30) elif case_selector == 6: return (1 <= date.daycomponent) and (date.daycomponent <= 30) elif case_selector == 9: return (1 <= date.daycomponent) and (date.daycomponent <= 30) elif case_selector == 11: return (1 <= date.daycomponent) and (date.daycomponent <= 30) elif case_selector == 2: # begin/end block if (ifcleapyear(date.yearcomponent)): return (1 <= date.daycomponent) and (date.daycomponent <= 29) else: return (1 <= date.daycomponent) and (date.daycomponent <= 28) else: return TRUE #################### # FUNCTION ifccurveweightspositive # #################### def ifccurveweightspositive(b,): ''' :param b :type b:ifcrationalbeziercurve ''' for i in range(0,b.upperindexoncontrolpoints,1): if (b.weights[i] <= 0): result = FALSE return result return result #################### # FUNCTION ifcsameaxis2placement # #################### def ifcsameaxis2placement(ap1,ap2,epsilon,): ''' :param ap1 :type ap1:ifcaxis2placement :param ap2 :type ap2:ifcaxis2placement :param epsilon :type epsilon:REAL ''' return (ifcsamedirection(ap1.p[1],ap2.p[1],epsilon) and ifcsamedirection(ap1.p[2],ap2.p[2],epsilon)) and ifcsamecartesianpoint(ap1.location,ap1.location,epsilon) #################### # FUNCTION ifcbuild2axes # #################### def ifcbuild2axes(refdirection,): ''' :param refdirection :type refdirection:ifcdirection ''' return [d,ifcorthogonalcomplement(d)] #################### # FUNCTION ifccrossproduct # #################### def ifccrossproduct(arg1,arg2,): ''' :param arg1 :type arg1:ifcdirection :param arg2 :type arg2:ifcdirection ''' if ((( not EXISTS(arg1)) or (arg1.dim == 2)) or (( not EXISTS(arg2)) or (arg2.dim == 2))): return None else: # begin/end block v1 = ifcnormalise(arg1).directionratios v2 = ifcnormalise(arg2).directionratios res = (ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcdirection([(v1[2] * v2[3]) - (v1[3] * v2[2]),(v1[3] * v2[1]) - (v1[1] * v2[3]),(v1[1] * v2[2]) - (v1[2] * v2[1])]) mag = 0 for i in range(1,3,1): mag = mag + (res.directionratios[i] * res.directionratios[i]) if (mag > 0): result = (ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcvector(res,SQRT(mag)) else: result = (ifcrepresentationitem() == ifcgeometricrepresentationitem()) == ifcvector(arg1,0) return result #################### # FUNCTION ifcsamecartesianpoint # #################### def ifcsamecartesianpoint(cp1,cp2,epsilon,): ''' :param cp1 :type cp1:ifccartesianpoint :param cp2 :type cp2:ifccartesianpoint :param epsilon :type epsilon:REAL ''' if (SIZEOF(cp1.coordinates) > 2): cp1z = cp1.coordinates[3] if (SIZEOF(cp2.coordinates) > 2): cp2z = cp2.coordinates[3] return (ifcsamevalue(cp1x,cp2x,epsilon) and ifcsamevalue(cp1y,cp2y,epsilon)) and ifcsamevalue(cp1z,cp2z,epsilon) #################### # RULE ifcsingleprojectinstance # #################### ifcsingleprojectinstance = Rule() #################### # RULE ifcrepresentationcontextsamewcs # #################### ifcrepresentationcontextsamewcs = Rule()
downloaders
VeohCom
# -*- coding: utf-8 -*- import json from ..base.simple_downloader import SimpleDownloader class VeohCom(SimpleDownloader): __name__ = "VeohCom" __type__ = "downloader" __version__ = "0.30" __status__ = "testing" __pattern__ = r"https?://(?:www\.)?veoh\.com/(?:tv/)?(?:watch|videos)/(?P<ID>v\w+)" __config__ = [ ("enabled", "bool", "Activated", True), ("use_premium", "bool", "Use premium account if available", True), ("fallback", "bool", "Fallback to free download if premium fails", True), ("chk_filesize", "bool", "Check file size", True), ("max_wait", "int", "Reconnect if waiting time is greater than minutes", 10), ] __description__ = """Veoh.com downloader plugin""" __license__ = "GPLv3" __authors__ = [ ("Walter Purcaro", "vuolter@gmail.com"), ("GammaC0de", "nitzo2001[AT]yahoo[DOT]com"), ] NAME_PATTERN = r'<meta name="title" content="(?P<N>.*?)"' OFFLINE_PATTERN = r">Sorry, we couldn\'t find the video you were looking for" URL_REPLACEMENTS = [(__pattern__ + ".*", r"https://www.veoh.com/watch/\g<ID>")] COOKIES = [("veoh.com", "lassieLocale", "en")] def setup(self): self.resume_download = True self.multi_dl = True self.chunk_limit = -1 def handle_free(self, pyfile): video_id = self.info["pattern"]["ID"] video_data = json.loads( self.load(rf"https://www.veoh.com/watch/getVideo/{video_id}") ) pyfile.name = video_data["video"]["title"] + ".mp4" self.link = video_data["video"]["src"]["HQ"]
extractor
nosvideo
# coding: utf-8 from __future__ import unicode_literals import re from ..utils import ( ExtractorError, sanitized_Request, urlencode_postdata, xpath_text, xpath_with_ns, ) from .common import InfoExtractor _x = lambda p: xpath_with_ns(p, {"xspf": "http://xspf.org/ns/0/"}) class NosVideoIE(InfoExtractor): _VALID_URL = ( r"https?://(?:www\.)?nosvideo\.com/" + r"(?:embed/|\?v=)(?P<id>[A-Za-z0-9]{12})/?" ) _PLAYLIST_URL = "http://nosvideo.com/xml/{xml_id:s}.xml" _FILE_DELETED_REGEX = r"<b>File Not Found</b>" _TEST = { "url": "http://nosvideo.com/?v=mu8fle7g7rpq", "md5": "6124ed47130d8be3eacae635b071e6b6", "info_dict": { "id": "mu8fle7g7rpq", "ext": "mp4", "title": "big_buck_bunny_480p_surround-fix.avi.mp4", "thumbnail": r"re:^https?://.*\.jpg$", }, } def _real_extract(self, url): video_id = self._match_id(url) fields = { "id": video_id, "op": "download1", "method_free": "Continue to Video", } req = sanitized_Request(url, urlencode_postdata(fields)) req.add_header("Content-type", "application/x-www-form-urlencoded") webpage = self._download_webpage(req, video_id, "Downloading download page") if re.search(self._FILE_DELETED_REGEX, webpage) is not None: raise ExtractorError("Video %s does not exist" % video_id, expected=True) xml_id = self._search_regex(r"php\|([^\|]+)\|", webpage, "XML ID") playlist_url = self._PLAYLIST_URL.format(xml_id=xml_id) playlist = self._download_xml(playlist_url, video_id) track = playlist.find(_x(".//xspf:track")) if track is None: raise ExtractorError( "XML playlist is missing the 'track' element", expected=True ) title = xpath_text(track, _x("./xspf:title"), "title") url = xpath_text(track, _x("./xspf:file"), "URL", fatal=True) thumbnail = xpath_text(track, _x("./xspf:image"), "thumbnail") if title is not None: title = title.strip() formats = [ { "format_id": "sd", "url": url, } ] return { "id": video_id, "title": title, "thumbnail": thumbnail, "formats": formats, }
extractor
ministrygrid
from __future__ import unicode_literals from ..utils import ExtractorError, smuggle_url from .common import InfoExtractor class MinistryGridIE(InfoExtractor): _VALID_URL = ( r"https?://(?:www\.)?ministrygrid\.com/([^/?#]*/)*(?P<id>[^/#?]+)/?(?:$|[?#])" ) _TEST = { "url": "http://www.ministrygrid.com/training-viewer/-/training/t4g-2014-conference/the-gospel-by-numbers-4/the-gospel-by-numbers", "md5": "844be0d2a1340422759c2a9101bab017", "info_dict": { "id": "3453494717001", "ext": "mp4", "title": "The Gospel by Numbers", "thumbnail": r"re:^https?://.*\.jpg", "upload_date": "20140410", "description": "Coming soon from T4G 2014!", "uploader_id": "2034960640001", "timestamp": 1397145591, }, "params": { # m3u8 download "skip_download": True, }, "add_ie": ["TDSLifeway"], } def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) portlets = self._parse_json( self._search_regex( r"Liferay\.Portlet\.list=(\[.+?\])", webpage, "portlet list" ), video_id, ) pl_id = self._search_regex( r'getPlid:function\(\){return"(\d+)"}', webpage, "p_l_id" ) for i, portlet in enumerate(portlets): portlet_url = ( "http://www.ministrygrid.com/c/portal/render_portlet?p_l_id=%s&p_p_id=%s" % (pl_id, portlet) ) portlet_code = self._download_webpage( portlet_url, video_id, note="Looking in portlet %s (%d/%d)" % (portlet, i + 1, len(portlets)), fatal=False, ) video_iframe_url = self._search_regex( r'<iframe.*?src="([^"]+)"', portlet_code, "video iframe", default=None ) if video_iframe_url: return self.url_result( smuggle_url(video_iframe_url, {"force_videoid": video_id}), video_id=video_id, ) raise ExtractorError("Could not find video iframe in any portlets")
output
http
import socket from contextlib import suppress from http.server import BaseHTTPRequestHandler from io import BytesIO from typing import Optional from streamlink_cli.output.abc import Output class HTTPRequest(BaseHTTPRequestHandler): # noinspection PyMissingConstructor def __init__(self, request_text): self.rfile = BytesIO(request_text) self.raw_requestline = self.rfile.readline() self.error_code = self.error_message = None self.parse_request() def send_error(self, code, message=None, explain=None): self.error_code = code self.error_message = message class HTTPOutput(Output): socket: socket.socket def __init__(self, host: Optional[str] = "127.0.0.1", port: int = 0) -> None: super().__init__() self.host = host self.port = port self.conn: Optional[socket.socket] = None @property def addresses(self): if self.host: return [self.host] addrs = {"127.0.0.1"} with suppress(socket.gaierror): for info in socket.getaddrinfo(socket.gethostname(), self.port, socket.AF_INET): addrs.add(info[4][0]) return sorted(addrs) @property def urls(self): for addr in self.addresses: yield f"http://{addr}:{self.port}/" @property def url(self): return next(self.urls, None) def start_server(self): self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) self.socket.bind((self.host or "", self.port)) self.socket.listen(1) self.host, self.port = self.socket.getsockname() if self.host == "0.0.0.0": self.host = None def accept_connection(self, timeout=30) -> None: self.socket.settimeout(timeout) try: conn, addr = self.socket.accept() conn.settimeout(None) self.conn = conn except socket.timeout as err: self.conn = None raise OSError("Socket accept timed out") from err def _open(self): conn = self.conn if not conn: raise OSError("No client connection") try: req_data = conn.recv(1024) except OSError as err: raise OSError("Failed to read data from socket") from err req = HTTPRequest(req_data) if req.command not in ("GET", "HEAD"): conn.send(b"HTTP/1.1 501 Not Implemented\r\n") conn.close() raise OSError(f"Invalid request method: {req.command}") try: conn.send(b"HTTP/1.1 200 OK\r\n") conn.send(b"Server: Streamlink\r\n") conn.send(b"Content-Type: video/unknown\r\n") conn.send(b"\r\n") except OSError as err: raise OSError("Failed to write data to socket") from err # We don't want to send any data on HEAD requests. if req.command == "HEAD": conn.close() raise OSError self.request = req def _write(self, data): self.conn.sendall(data) def _close(self): if self.conn: with suppress(OSError): self.conn.close() self.conn = None def shutdown(self) -> None: self.close() with suppress(OSError): self.socket.shutdown(socket.SHUT_RDWR) with suppress(OSError): self.socket.close()
equations
heat_writer
# *************************************************************************** # * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> * # * Copyright (c) 2020 Bernd Hahnebach <bernd@bimstatik.org> * # * Copyright (c) 2022 Uwe Stöhr <uwestoehr@lyx.org> * # * * # * This file is part of the FreeCAD CAx development system. * # * * # * This program is free software; you can redistribute it and/or modify * # * it under the terms of the GNU Lesser General Public License (LGPL) * # * as published by the Free Software Foundation; either version 2 of * # * the License, or (at your option) any later version. * # * for detail see the LICENCE text file. * # * * # * This program is distributed in the hope that it will be useful, * # * but WITHOUT ANY WARRANTY; without even the implied warranty of * # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * # * GNU Library General Public License for more details. * # * * # * You should have received a copy of the GNU Library General Public * # * License along with this program; if not, write to the Free Software * # * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * # * USA * # * * # *************************************************************************** __title__ = "FreeCAD FEM Heat Elmer writer" __author__ = "Markus Hovorka, Bernd Hahnebach, Uwe Stöhr" __url__ = "https://www.freecad.org" ## \addtogroup FEM # @{ from femmesh import meshtools from femtools import membertools from .. import sifio from .. import writer as general_writer from . import heat class Heatwriter: def __init__(self, writer, solver): self.write = writer self.solver = solver def getHeatSolver(self, equation): # check if we need to update the equation self._updateHeatSolver(equation) # output the equation parameters s = self.write.createNonlinearSolver(equation) s["Equation"] = equation.Name s["Procedure"] = sifio.FileAttr("HeatSolve/HeatSolver") s["Bubbles"] = equation.Bubbles s["Exec Solver"] = "Always" s["Optimize Bandwidth"] = True s["Stabilize"] = equation.Stabilize s["Variable"] = self.write.getUniqueVarName("Temperature") return s def handleHeatConstants(self): self.write.constant( "Stefan Boltzmann", self.write.convert(self.write.constsdef["StefanBoltzmann"], "M/(O^4*T^3)"), ) def handleHeatEquation(self, bodies, equation): for b in bodies: if equation.Convection != "None": self.write.equation(b, "Convection", equation.Convection) if equation.PhaseChangeModel != "None": self.write.equation(b, "Phase Change Model", equation.PhaseChangeModel) def _updateHeatSolver(self, equation): # updates older Heat equations if not hasattr(equation, "Convection"): equation.addProperty( "App::PropertyEnumeration", "Convection", "Equation", "Type of convection to be used", ) equation.Convection = heat.CONVECTION_TYPE equation.Convection = "None" if not hasattr(equation, "PhaseChangeModel"): equation.addProperty( "App::PropertyEnumeration", "PhaseChangeModel", "Equation", "Model for phase change", ) equation.PhaseChangeModel = heat.PHASE_CHANGE_MODEL equation.PhaseChangeModel = "None" def handleHeatBndConditions(self): i = -1 for obj in self.write.getMember("Fem::ConstraintTemperature"): i = i + 1 femobjects = membertools.get_several_member( self.write.analysis, "Fem::ConstraintTemperature" ) femobjects[i]["Nodes"] = meshtools.get_femnodes_by_femobj_with_references( self.write.getSingleMember("Fem::FemMeshObject").FemMesh, femobjects[i] ) NumberOfNodes = len(femobjects[i]["Nodes"]) if obj.References: for name in obj.References[0][1]: if obj.ConstraintType == "Temperature": temperature = float(obj.Temperature.getValueAs("K")) self.write.boundary(name, "Temperature", temperature) elif obj.ConstraintType == "CFlux": flux = float(obj.CFlux.getValueAs("W")) # CFLUX is the flux per mesh node flux = flux / NumberOfNodes self.write.boundary(name, "Temperature Load", flux) self.write.handled(obj) for obj in self.write.getMember("Fem::ConstraintHeatflux"): if obj.References: for name in obj.References[0][1]: if obj.ConstraintType == "Convection": film = self.write.getFromUi( obj.FilmCoef, "W/(m^2*K)", "M/(T^3*O)" ) temp = self.write.getFromUi(obj.AmbientTemp, "K", "O") self.write.boundary(name, "Heat Transfer Coefficient", film) self.write.boundary(name, "External Temperature", temp) elif obj.ConstraintType == "DFlux": flux = self.write.getFromUi(obj.DFlux, "W/m^2", "M*T^-3") self.write.boundary(name, "Heat Flux BC", True) self.write.boundary(name, "Heat Flux", flux) self.write.handled(obj) def handleHeatInitial(self, bodies): tempObj = self.write.getSingleMember("Fem::ConstraintInitialTemperature") if tempObj is not None: refTemp = float(tempObj.initialTemperature.getValueAs("K")) for name in bodies: self.write.initial(name, "Temperature", refTemp) self.write.handled(tempObj) def _outputHeatBodyForce(self, obj, name): heatSource = self.write.getFromUi(obj.HeatSource, "W/kg", "L^2*T^-3") if heatSource == 0.0: # a zero heat would break Elmer (division by zero) raise general_writer.WriteError("The body heat source must not be zero!") self.write.bodyForce(name, "Heat Source", heatSource) def handleHeatBodyForces(self, bodies): bodyHeats = self.write.getMember("Fem::ConstraintBodyHeatSource") for obj in bodyHeats: if obj.References: for name in obj.References[0][1]: self._outputHeatBodyForce(obj, name) self.write.handled(obj) else: # if there is only one body heat without a reference # add it to all bodies if len(bodyHeats) == 1: for name in bodies: self._outputHeatBodyForce(obj, name) else: raise general_writer.WriteError( "Several body heat constraints found without reference to a body.\n" "Please set a body for each body heat constraint." ) self.write.handled(obj) def handleHeatMaterial(self, bodies): tempObj = self.write.getSingleMember("Fem::ConstraintInitialTemperature") if tempObj is not None: refTemp = float(tempObj.initialTemperature.getValueAs("K")) for name in bodies: self.write.material(name, "Reference Temperature", refTemp) for obj in self.write.getMember("App::MaterialObject"): m = obj.Material refs = obj.References[0][1] if obj.References else self.write.getAllBodies() for name in (n for n in refs if n in bodies): if "Density" not in m: raise general_writer.WriteError( "Used material does not specify the necessary 'Density'." ) self.write.material(name, "Name", m["Name"]) self.write.material(name, "Density", self.write.getDensity(m)) if "ThermalConductivity" not in m: raise general_writer.WriteError( "Used material does not specify the necessary 'Thermal Conductivity'." ) self.write.material( name, "Heat Conductivity", self.write.convert(m["ThermalConductivity"], "M*L/(T^3*O)"), ) if "SpecificHeat" not in m: raise general_writer.WriteError( "Used material does not specify the necessary 'Specific Heat'." ) self.write.material( name, "Heat Capacity", self.write.convert(m["SpecificHeat"], "L^2/(T^2*O)"), ) ## @}
classes
project
""" @file @brief This file is for legacy support of OpenShot 1.x project files @author Jonathan Thomas <jonathan@openshot.org> @section LICENSE Copyright (c) 2008-2018 OpenShot Studios, LLC (http://www.openshotstudios.com). This file is part of OpenShot Video Editor (http://www.openshot.org), an open-source project dedicated to delivering high quality video editing and animation solutions to the world. OpenShot Video Editor is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenShot Video Editor is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>. """ import os from classes.legacy.openshot.classes import files class project: """This is the main project class that contains all the details of a project, such as name, folder, timeline information, sequences, media files, etc...""" # ---------------------------------------------------------------------- def __init__(self, init_threads=True): """Constructor""" # debug message/function control self.DEBUG = True # define common directories containing resources # get the base directory of the openshot installation for all future relative references # Note: don't rely on __file__ to be an absolute path. E.g., in the debugger (pdb) it will be # a relative path, so use os.path.abspath() self.BASE_DIR = os.path.dirname( os.path.dirname(os.path.dirname(os.path.abspath(__file__))) ) self.UI_DIR = os.path.join(self.BASE_DIR, "openshot", "windows", "ui") self.IMAGE_DIR = os.path.join(self.BASE_DIR, "openshot", "images") self.LOCALE_DIR = os.path.join(self.BASE_DIR, "openshot", "locale") self.PROFILES_DIR = os.path.join(self.BASE_DIR, "openshot", "profiles") self.TRANSITIONS_DIR = os.path.join(self.BASE_DIR, "openshot", "transitions") self.BLENDER_DIR = os.path.join(self.BASE_DIR, "openshot", "blender") self.EXPORT_PRESETS_DIR = os.path.join( self.BASE_DIR, "openshot", "export_presets" ) self.EFFECTS_DIR = os.path.join(self.BASE_DIR, "openshot", "effects") # location for per-session, per-user, files to be written/read to self.DESKTOP = os.path.join(os.path.expanduser("~"), "Desktop") self.USER_DIR = os.path.join(os.path.expanduser("~"), ".openshot") self.THEMES_DIR = os.path.join(self.BASE_DIR, "openshot", "themes") self.USER_PROFILES_DIR = os.path.join(self.USER_DIR, "user_profiles") self.USER_TRANSITIONS_DIR = os.path.join(self.USER_DIR, "user_transitions") # init the variables for the project self.name = "Default Project" self.folder = self.USER_DIR self.project_type = None self.canvas = None self.is_modified = False self.refresh_xml = True self.mlt_profile = None # reference to the main GTK form self.form = None # init the file / folder list (used to populate the tree) self.project_folder = files.OpenShotFolder(self) # ini the sequences collection self.sequences = [] # init the tab collection self.tabs = []
cli
plugin_info
# encoding: utf-8 from __future__ import annotations from typing import Any, Callable import ckan.plugins as p import click @click.command(name="plugin-info", short_help="Provide info on installed plugins.") def plugin_info(): """print info about current plugins from the .ini file""" import ckan.plugins as p interfaces = {} plugins = {} for name in dir(p): item = getattr(p, name) try: if issubclass(item, p.Interface): interfaces[item] = {"class": item} except TypeError: pass for interface in interfaces: for plugin in p.PluginImplementations(interface): name = plugin.name if name not in plugins: plugins[name] = { "doc": plugin.__doc__, "class": plugin, "implements": [], } plugins[name]["implements"].append(interface.__name__) for plugin in plugins: p = plugins[plugin] click.echo(plugin + ":") click.echo("-" * (len(plugin) + 1)) if p["doc"]: click.echo(p["doc"]) click.echo("Implements:") for i in p["implements"]: extra = None if i == "ITemplateHelpers": extra = _template_helpers(p["class"]) if i == "IActions": extra = _actions(p["class"]) click.echo(" {i}".format(i=i)) if extra: click.echo(extra) click.echo() def _template_helpers(plugin_class: p.ITemplateHelpers): """Return readable helper function info.""" helpers = plugin_class.get_helpers() return _function_info(helpers) def _actions(plugin_class: p.IActions): """Return readable action function info.""" actions = plugin_class.get_actions() return _function_info(actions) def _function_info(functions: dict[str, Callable[..., Any]]): """Take a dict of functions and output readable info""" import inspect output = [] for function_name in functions: fn = functions[function_name] args_info = inspect.getargspec(fn) params = args_info.args num_params = len(params) if args_info.varargs: params.append("*" + args_info.varargs) if args_info.keywords: params.append("**" + args_info.keywords) if args_info.defaults: offset = num_params - len(args_info.defaults) for i, v in enumerate(args_info.defaults): params[i + offset] = params[i + offset] + "=" + repr(v) # is this a classmethod if so remove the first parameter if inspect.ismethod(fn) and inspect.isclass(fn.__self__): params = params[1:] params = ", ".join(params) output.append( " {function_name}({params})".format( function_name=function_name, params=params ) ) # doc string if fn.__doc__: bits = fn.__doc__.split("\n") for bit in bits: output.append(" {bit}".format(bit=bit)) return ("\n").join(output)
UML
umlfmt
"""Formatting of UML elements like attributes, operations, stereotypes, etc.""" import re from typing import Tuple from gaphor.core.format import format from gaphor.i18n import gettext from gaphor.UML import uml as UML # Do not render if the name still contains a visibility element no_render_pat = re.compile(r"^\s*[+#-]", re.MULTILINE | re.DOTALL) vis_map = {"public": "+", "protected": "#", "package": "~", "private": "-"} @format.register(UML.Property) def format_property( el, visibility=False, is_derived=False, type=False, multiplicity=False, default=False, tags=False, note=False, ): """Create an OCL representation of the attribute, Returns the attribute as a string. If one or more of the parameters (visibility, is_derived, type, multiplicity, default and/or tags) is set, only that field is rendered. Note that the name of the attribute is always rendered, so a parseable string is returned. Note that, when some of those parameters are set, parsing the string will not give you the same result. """ name = el.name if name and no_render_pat.match(name): return name # Render all fields if they all are set to False if not (visibility or is_derived or type or multiplicity or default): visibility = is_derived = type = multiplicity = default = True s: list[str] = [] if name: if visibility: s.extend((vis_map[el.visibility], " ")) if is_derived and el.isDerived: s.append("/") s.append(name) if type: if el.typeValue: s.append(f": {el.typeValue}") elif el.type and el.type.name: s.append(f": {el.type.name}") if multiplicity: s.append(format_multiplicity(el)) if default and el.defaultValue: s.append(f" = {el.defaultValue}") if tags and ( slots := [format(slot) for slot in el.appliedStereotype[:].slot if slot] ): s.append(" { %s }" % ", ".join(slots)) if note and el.note: s.append(f" # {el.note}") return "".join(s) def format_association_end(el) -> Tuple[str, str]: """Format association end.""" name = "" if el.name: n = [vis_map[el.visibility], " "] if el.isDerived: n.append("/") n.append(el.name) name = "".join(n) m = [format_multiplicity(el, bare=True)] if slots := [format(slot) for slot in el.appliedStereotype[:].slot if slot]: m.append(" { %s }" % ",\n".join(slots)) mult = "".join(m) return name, mult @format.register(UML.Operation) def format_operation( el, pattern=None, visibility=False, type=False, multiplicity=False, default=False, tags=False, direction=False, note=False, ): """Create an OCL representation of the operation, Returns the operation as a string.""" name = el.name if not name: return "" if no_render_pat.match(name): return name # Render all fields if they all are set to False if not (visibility or type or multiplicity or default or tags or direction): visibility = type = multiplicity = default = tags = direction = True s = [] if visibility: s.append(f"{vis_map[el.visibility]} ") s.extend( ( name, "(", ", ".join( format( p, direction=direction, type=type, multiplicity=multiplicity, default=default, ) for p in el.ownedParameter if p.direction != "return" ), ")", ) ) if rr := next((p for p in el.ownedParameter if p.direction == "return"), None): s.append(format(rr, type=type, multiplicity=multiplicity, default=default)) if note and el.note: s.append(f" # {el.note}") return "".join(s) @format.register(UML.Parameter) def format_parameter( el, direction=False, type=False, multiplicity=False, default=False ): if not (direction or type or multiplicity or default): direction = type = multiplicity = default = True s = [] name = el.name if name and direction: s.append(f"{el.direction} ") s.append(name or "") if type and el.typeValue: s.append(f": {el.typeValue}") if multiplicity: s.append(format_multiplicity(el)) if default and el.defaultValue: s.append(f" = {el.defaultValue}") return "".join(s) @format.register(UML.Slot) def format_slot(el): return f'{el.definingFeature.name} = "{el.value}"' @format.register(UML.NamedElement) def format_namedelement(el, **kwargs): return el.name or "" @format.register(UML.Pin) def format_pin(el, **kwargs): if not el: return "" s = [el.name or ""] if el.type and el.type.name: s.append(f": {el.type.name}") if el.upperValue or el.lowerValue: s.append(format_multiplicity(el)) return "".join(s) @format.register(UML.MultiplicityElement) def format_multiplicity(el, bare=False): m = "" if el.upperValue: m = f"{el.lowerValue}..{el.upperValue}" if el.lowerValue else f"{el.upperValue}" return f"[{m}]" if m and not bare else m @format.register(UML.Relationship) def format_relationship(el): return el.__class__.__name__ @format.register(UML.Generalization) def format_generalization(el): return gettext("general: {name}").format(name=el.general and el.general.name or "") @format.register(UML.Dependency) def format_dependency(el): return gettext("supplier: {name}").format( name=el.supplier and el.supplier.name or "" ) @format.register(UML.Extend) def format_extend(el): return gettext("extend: {name}").format( name=el.extendedCase and el.extendedCase.name or "" ) @format.register(UML.Include) def format_include(el): return gettext("include: {name}").format( name=el.addition and el.addition.name or "" ) @format.register(UML.CallBehaviorAction) def format_call_behavior_action_name(el): """Name conforms to UML2.5.1 16.3.4.1 naming description""" return el.behavior.name if el.behavior and not el.name else el.name or ""
managers
folder
# This file is part of Supysonic. # Supysonic is a Python implementation of the Subsonic server API. # # Copyright (C) 2013-2023 Alban 'spl0k' Féron # # Distributed under terms of the GNU AGPLv3 license. import os.path from ..daemon.client import DaemonClient from ..daemon.exceptions import DaemonUnavailableError from ..db import Album, Artist, Folder class FolderManager: @staticmethod def get(id): try: id = int(id) except ValueError: raise ValueError("Invalid folder id") return Folder[id] @staticmethod def add(name, path): try: Folder.get(name=name, root=True) raise ValueError(f"Folder '{name}' exists") except Folder.DoesNotExist: pass path = os.path.abspath(os.path.expanduser(path)) if not os.path.isdir(path): raise ValueError("The path doesn't exits or isn't a directory") try: Folder.get(path=path) raise ValueError("This path is already registered") except Folder.DoesNotExist: pass if any( path.startswith(p) for (p,) in Folder.select(Folder.path).where(Folder.root).tuples() ): raise ValueError("This path is already registered") if Folder.select().where(Folder.path.startswith(path)).exists(): raise ValueError("This path contains a folder that is already registered") folder = Folder.create(root=True, name=name, path=path) try: DaemonClient().add_watched_folder(path) except DaemonUnavailableError: pass return folder @staticmethod def delete(id): folder = FolderManager.get(id) if not folder.root: raise Folder.DoesNotExist(id) try: DaemonClient().remove_watched_folder(folder.path) except DaemonUnavailableError: pass folder.delete_hierarchy() Album.prune() Artist.prune() @staticmethod def delete_by_name(name): folder = Folder.get(name=name, root=True) FolderManager.delete(folder.id)
QT
PantallaResistance
from Code.QT import ( Colocacion, Columnas, Controles, FormLayout, Grid, Iconos, QTUtil2, QTVarios, ) class WResistance(QTVarios.WDialogo): def __init__(self, owner, resistance): self.resistance = resistance # Dialogo --------------------------------------------------------------- icono = Iconos.Resistencia() titulo = _("Resistance Test") tipo = resistance.tipo if tipo: titulo += "-" + _("Blindfold chess") if tipo == "p1": titulo += "-" + _("Hide only our pieces") elif tipo == "p2": titulo += "-" + _("Hide only opponent pieces") extparam = "boxing" QTVarios.WDialogo.__init__(self, owner, titulo, icono, extparam) # self.setStyleSheet("QWidget { background: #AFC3D7 }") # Tool bar --------------------------------------------------------------- liAcciones = [ (_("Close"), Iconos.MainMenu(), self.terminar), None, (_("Remove data"), Iconos.Borrar(), self.borrar), None, (_("Config"), Iconos.Configurar(), self.configurar), ] tb = Controles.TBrutina(self, liAcciones, background="#AFC3D7") # Texto explicativo ---------------------------------------------------- self.lb = Controles.LB(self) self.ponTextoAyuda() self.lb.ponFondoN("#F5F0CF") # Lista oColumnas = Columnas.ListaColumnas() oColumnas.nueva("ENGINE", _("Engine"), 198) oColumnas.nueva("BLANCAS", _("White"), 200, siCentrado=True) oColumnas.nueva("NEGRAS", _("Black"), 200, siCentrado=True) self.grid = grid = Grid.Grid( self, oColumnas, siSelecFilas=True, background=None ) self.grid.coloresAlternados() self.registrarGrid(grid) # Layout lyB = Colocacion.V().controlc(self.lb).control(self.grid).margen(3) layout = Colocacion.V().control(tb).otro(lyB).margen(0) self.setLayout(layout) self.recuperarVideo(siTam=True, anchoDefecto=677, altoDefecto=562) self.grid.gotop() self.grid.setFocus() self.resultado = None def ponTextoAyuda(self): txt = self.resistance.rotuloActual() self.lb.ponTexto( '<center><b>%s<br><font color="red">%s</red></b></center>' % (txt, _("Double click in any cell to begin to play")) ) def gridNumDatos(self, grid): return self.resistance.numEngines() def gridDato(self, grid, fila, oColumna): clave = oColumna.clave if clave == "ENGINE": return self.resistance.dameEtiEngine(fila) else: return self.resistance.dameEtiRecord(clave, fila) def gridDobleClick(self, grid, fila, columna): clave = columna.clave if clave != "ENGINE": self.play(clave) def play(self, clave): self.guardarVideo() self.resultado = self.grid.recno(), clave self.accept() def borrar(self): numEngine = self.grid.recno() if QTUtil2.pregunta( self, _X(_("Remove data from %1 ?"), self.resistance.dameEtiEngine(numEngine)), ): self.resistance.borraRegistros(numEngine) def terminar(self): self.guardarVideo() self.accept() def configurar(self): segundos, puntos, maxerror = self.resistance.actual() separador = FormLayout.separador liGen = [separador] config = FormLayout.Spinbox(_("Time in seconds"), 1, 99999, 80) liGen.append((config, segundos)) liGen.append(separador) config = FormLayout.Spinbox(_("Max lost points in total"), 10, 99999, 80) liGen.append((config, puntos)) liGen.append(separador) config = FormLayout.Spinbox( _("Max lost points in a single move") + ":\n" + _("0 = not consider this limit"), 0, 1000, 80, ) liGen.append((config, maxerror)) resultado = FormLayout.fedit( liGen, title=_("Config"), parent=self, icon=Iconos.Configurar() ) if resultado: accion, liResp = resultado segundos, puntos, maxerror = liResp self.resistance.cambiaConfiguracion(segundos, puntos, maxerror) self.ponTextoAyuda() self.grid.refresh() return liResp[0] def pantallaResistance(window, resistance): w = WResistance(window, resistance) if w.exec_(): return w.resultado else: return None
utils
label_map_util_test
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """Tests for object_detection.utils.label_map_util.""" import os import tensorflow as tf from app.object_detection.protos import string_int_label_map_pb2 from app.object_detection.utils import label_map_util from google.protobuf import text_format class LabelMapUtilTest(tf.test.TestCase): def _generate_label_map(self, num_classes): label_map_proto = string_int_label_map_pb2.StringIntLabelMap() for i in range(1, num_classes + 1): item = label_map_proto.item.add() item.id = i item.name = "label_" + str(i) item.display_name = str(i) return label_map_proto def test_get_label_map_dict(self): label_map_string = """ item { id:2 name:'cat' } item { id:1 name:'dog' } """ label_map_path = os.path.join(self.get_temp_dir(), "label_map.pbtxt") with tf.gfile.Open(label_map_path, "wb") as f: f.write(label_map_string) label_map_dict = label_map_util.get_label_map_dict(label_map_path) self.assertEqual(label_map_dict["dog"], 1) self.assertEqual(label_map_dict["cat"], 2) def test_get_label_map_dict_display(self): label_map_string = """ item { id:2 display_name:'cat' } item { id:1 display_name:'dog' } """ label_map_path = os.path.join(self.get_temp_dir(), "label_map.pbtxt") with tf.gfile.Open(label_map_path, "wb") as f: f.write(label_map_string) label_map_dict = label_map_util.get_label_map_dict( label_map_path, use_display_name=True ) self.assertEqual(label_map_dict["dog"], 1) self.assertEqual(label_map_dict["cat"], 2) def test_load_bad_label_map(self): label_map_string = """ item { id:0 name:'class that should not be indexed at zero' } item { id:2 name:'cat' } item { id:1 name:'dog' } """ label_map_path = os.path.join(self.get_temp_dir(), "label_map.pbtxt") with tf.gfile.Open(label_map_path, "wb") as f: f.write(label_map_string) with self.assertRaises(ValueError): label_map_util.load_labelmap(label_map_path) def test_keep_categories_with_unique_id(self): label_map_proto = string_int_label_map_pb2.StringIntLabelMap() label_map_string = """ item { id:2 name:'cat' } item { id:1 name:'child' } item { id:1 name:'person' } item { id:1 name:'n00007846' } """ text_format.Merge(label_map_string, label_map_proto) categories = label_map_util.convert_label_map_to_categories( label_map_proto, max_num_classes=3 ) self.assertListEqual( [{"id": 2, "name": "cat"}, {"id": 1, "name": "child"}], categories ) def test_convert_label_map_to_categories_no_label_map(self): categories = label_map_util.convert_label_map_to_categories( None, max_num_classes=3 ) expected_categories_list = [ {"name": "category_1", "id": 1}, {"name": "category_2", "id": 2}, {"name": "category_3", "id": 3}, ] self.assertListEqual(expected_categories_list, categories) def test_convert_label_map_to_coco_categories(self): label_map_proto = self._generate_label_map(num_classes=4) categories = label_map_util.convert_label_map_to_categories( label_map_proto, max_num_classes=3 ) expected_categories_list = [ {"name": "1", "id": 1}, {"name": "2", "id": 2}, {"name": "3", "id": 3}, ] self.assertListEqual(expected_categories_list, categories) def test_convert_label_map_to_coco_categories_with_few_classes(self): label_map_proto = self._generate_label_map(num_classes=4) cat_no_offset = label_map_util.convert_label_map_to_categories( label_map_proto, max_num_classes=2 ) expected_categories_list = [{"name": "1", "id": 1}, {"name": "2", "id": 2}] self.assertListEqual(expected_categories_list, cat_no_offset) def test_create_category_index(self): categories = [{"name": "1", "id": 1}, {"name": "2", "id": 2}] category_index = label_map_util.create_category_index(categories) self.assertDictEqual( {1: {"name": "1", "id": 1}, 2: {"name": "2", "id": 2}}, category_index ) def test_create_category_index_from_labelmap(self): label_map_string = """ item { id:2 name:'cat' } item { id:1 name:'dog' } """ label_map_path = os.path.join(self.get_temp_dir(), "label_map.pbtxt") with tf.gfile.Open(label_map_path, "wb") as f: f.write(label_map_string) category_index = label_map_util.create_category_index_from_labelmap( label_map_path ) self.assertDictEqual( {1: {"name": "dog", "id": 1}, 2: {"name": "cat", "id": 2}}, category_index ) if __name__ == "__main__": tf.test.main()
slack
tasks
import logging import random from typing import Optional from apps.alerts.tasks.compare_escalations import compare_escalations from apps.slack.alert_group_slack_service import AlertGroupSlackService from apps.slack.client import SlackClient from apps.slack.constants import ( CACHE_UPDATE_INCIDENT_SLACK_MESSAGE_LIFETIME, SLACK_BOT_ID, ) from apps.slack.errors import ( SlackAPIInvalidAuthError, SlackAPIPlanUpgradeRequiredError, SlackAPIRatelimitError, SlackAPITokenError, SlackAPIUsergroupNotFoundError, ) from apps.slack.scenarios.scenario_step import ScenarioStep from apps.slack.utils import ( get_cache_key_update_incident_slack_message, get_populate_slack_channel_task_id_key, post_message_to_channel, ) from celery import uuid as celery_uuid from celery.utils.log import get_task_logger from common.custom_celery_tasks import shared_dedicated_queue_retry_task from common.utils import batch_queryset from django.conf import settings from django.core.cache import cache from django.utils import timezone logger = get_task_logger(__name__) logger.setLevel(logging.DEBUG) @shared_dedicated_queue_retry_task(autoretry_for=(Exception,), retry_backoff=True) def update_incident_slack_message(slack_team_identity_pk, alert_group_pk): cache_key = get_cache_key_update_incident_slack_message(alert_group_pk) cached_task_id = cache.get(cache_key) current_task_id = update_incident_slack_message.request.id if cached_task_id is None: update_task_id = update_incident_slack_message.apply_async( (slack_team_identity_pk, alert_group_pk), countdown=10, ) cache.set( cache_key, update_task_id, timeout=CACHE_UPDATE_INCIDENT_SLACK_MESSAGE_LIFETIME, ) return ( f"update_incident_slack_message rescheduled because of current task_id ({current_task_id})" f" for alert_group {alert_group_pk} doesn't exist in cache" ) if not current_task_id == cached_task_id: return ( f"update_incident_slack_message skipped, because of current task_id ({current_task_id})" f" doesn't equal to cached task_id ({cached_task_id}) for alert_group {alert_group_pk}" ) from apps.alerts.models import AlertGroup from apps.slack.models import SlackTeamIdentity slack_team_identity = SlackTeamIdentity.objects.get(pk=slack_team_identity_pk) alert_group = AlertGroup.objects.get(pk=alert_group_pk) if ( alert_group.skip_escalation_in_slack or alert_group.channel.is_rate_limited_in_slack ): return "Skip message update in Slack due to rate limit" if alert_group.slack_message is None: return "Skip message update in Slack due to absence of slack message" AlertGroupSlackService(slack_team_identity).update_alert_group_slack_message( alert_group ) @shared_dedicated_queue_retry_task(autoretry_for=(Exception,), retry_backoff=True) def check_slack_message_exists_before_post_message_to_thread( alert_group_pk, text, escalation_policy_pk=None, escalation_policy_step=None, step_specific_info=None, ): """ Check if slack message for current alert group exists before before posting a message to a thread in slack. If it does not exist - restart task every 10 seconds for 24 hours. """ from apps.alerts.models import AlertGroup, AlertGroupLogRecord, EscalationPolicy alert_group = AlertGroup.objects.get(pk=alert_group_pk) slack_team_identity = alert_group.channel.organization.slack_team_identity # get escalation policy object if it exists to save it in log record escalation_policy = EscalationPolicy.objects.filter(pk=escalation_policy_pk).first() # we cannot post message to thread if team does not have slack team identity if not slack_team_identity: AlertGroupLogRecord( type=AlertGroupLogRecord.TYPE_ESCALATION_FAILED, alert_group=alert_group, escalation_policy=escalation_policy, escalation_error_code=AlertGroupLogRecord.ERROR_ESCALATION_NOTIFY_IN_SLACK, escalation_policy_step=escalation_policy_step, step_specific_info=step_specific_info, ).save() logger.debug( f"Failed to post message to thread in Slack for alert_group {alert_group_pk} because " f"slack team identity doesn't exist" ) return retry_timeout_hours = 24 if alert_group.slack_message: AlertGroupSlackService( slack_team_identity ).publish_message_to_alert_group_thread(alert_group, text=text) # check how much time has passed since alert group was created # to prevent eternal loop of restarting check_slack_message_before_post_message_to_thread elif timezone.now() < alert_group.started_at + timezone.timedelta( hours=retry_timeout_hours ): logger.debug( f"check_slack_message_exists_before_post_message_to_thread for alert_group {alert_group.pk} failed " f"because slack message does not exist. Restarting check_slack_message_before_post_message_to_thread." ) restart_delay_seconds = 10 check_slack_message_exists_before_post_message_to_thread.apply_async( ( alert_group_pk, text, escalation_policy_pk, escalation_policy_step, step_specific_info, ), countdown=restart_delay_seconds, ) else: logger.debug( f"check_slack_message_exists_before_post_message_to_thread for alert_group {alert_group.pk} failed " f"because slack message after {retry_timeout_hours} hours still does not exist" ) # create log if it was triggered by escalation step if escalation_policy_step: AlertGroupLogRecord( type=AlertGroupLogRecord.TYPE_ESCALATION_FAILED, alert_group=alert_group, escalation_policy=escalation_policy, escalation_error_code=AlertGroupLogRecord.ERROR_ESCALATION_NOTIFY_IN_SLACK, escalation_policy_step=escalation_policy_step, step_specific_info=step_specific_info, ).save() @shared_dedicated_queue_retry_task( autoretry_for=(Exception,), retry_backoff=True, max_retries=1 ) def send_message_to_thread_if_bot_not_in_channel( alert_group_pk, slack_team_identity_pk, channel_id ): """ Send message to alert group's thread if bot is not in current channel """ from apps.alerts.models import AlertGroup from apps.slack.models import SlackTeamIdentity slack_team_identity = SlackTeamIdentity.objects.get(pk=slack_team_identity_pk) alert_group = AlertGroup.objects.get(pk=alert_group_pk) sc = SlackClient(slack_team_identity) bot_user_id = slack_team_identity.bot_user_id members = slack_team_identity.get_conversation_members(sc, channel_id) if bot_user_id not in members: text = ( f"Please invite <@{bot_user_id}> to this channel to make all features " f"available :wink:" ) AlertGroupSlackService( slack_team_identity, sc ).publish_message_to_alert_group_thread(alert_group, text=text) @shared_dedicated_queue_retry_task( autoretry_for=(Exception,), retry_backoff=True, max_retries=0 ) def unpopulate_slack_user_identities(organization_pk, force=False, ts=None): from apps.user_management.models import Organization, User organization = Organization.objects.get(pk=organization_pk) # Reset slack_user_identity for organization users (make sure to include deleted users in the queryset) User.objects.filter_with_deleted(organization=organization).update( slack_user_identity=None ) if force: organization.slack_team_identity = None organization.general_log_channel_id = None organization.save( update_fields=["slack_team_identity", "general_log_channel_id"] ) @shared_dedicated_queue_retry_task( autoretry_for=(Exception,), retry_backoff=True, max_retries=0 ) def populate_slack_user_identities(organization_pk): from apps.slack.models import SlackUserIdentity from apps.user_management.models import Organization organization = Organization.objects.get(pk=organization_pk) unpopulate_slack_user_identities(organization_pk) slack_team_identity = organization.slack_team_identity slack_user_identity_installed = slack_team_identity.installed_by slack_user_identities_to_update = [] for member in slack_team_identity.members: profile = member.get("profile") email = profile.get("email", None) # Don't collect bots, invited users and users from other workspaces if ( member.get("id", None) == SLACK_BOT_ID or member.get("is_bot", False) or not email or member.get("is_invited_user", False) or member.get("is_restricted") or member.get("is_ultra_restricted") ): continue # For user which installs bot if member.get("id", None) == slack_user_identity_installed.slack_id: slack_user_identity = slack_user_identity_installed else: try: slack_user_identity, _ = slack_team_identity.slack_user_identities.get( slack_id=member["id"], ) except SlackUserIdentity.DoesNotExist: continue slack_user_identity.cached_slack_login = member.get("name", None) slack_user_identity.cached_name = member.get("real_name") or profile.get( "real_name", None ) slack_user_identity.cached_slack_email = profile.get("email", "") slack_user_identity.profile_real_name = profile.get("real_name", None) slack_user_identity.profile_real_name_normalized = profile.get( "real_name_normalized", None ) slack_user_identity.profile_display_name = profile.get("display_name", None) slack_user_identity.profile_display_name_normalized = profile.get( "display_name_normalized", None ) slack_user_identity.cached_avatar = profile.get("image_512", None) slack_user_identity.cached_timezone = member.get("tz", None) slack_user_identity.deleted = member.get("deleted", None) slack_user_identity.is_admin = member.get("is_admin", None) slack_user_identity.is_owner = member.get("is_owner", None) slack_user_identity.is_primary_owner = member.get("is_primary_owner", None) slack_user_identity.is_restricted = member.get("is_restricted", None) slack_user_identity.is_ultra_restricted = member.get( "is_ultra_restricted", None ) slack_user_identity.cached_is_bot = member.get( "is_bot", None ) # This fields already existed slack_user_identity.is_app_user = member.get("is_app_user", None) slack_user_identities_to_update.append(slack_user_identity) fields_to_update = [ "cached_slack_login", "cached_name", "cached_slack_email", "profile_real_name", "profile_real_name_normalized", "profile_display_name", "profile_display_name_normalized", "cached_avatar", "cached_timezone", "deleted", "is_admin", "is_owner", "is_primary_owner", "is_restricted", "is_ultra_restricted", "cached_is_bot", "is_app_user", ] SlackUserIdentity.objects.bulk_update( slack_user_identities_to_update, fields_to_update, batch_size=5000 ) @shared_dedicated_queue_retry_task( autoretry_for=(Exception,), retry_backoff=True, max_retries=1 if settings.DEBUG else None, ) def post_or_update_log_report_message_task( alert_group_pk, slack_team_identity_pk, update=False ): logger.debug( f"Start post_or_update_log_report_message_task for alert_group {alert_group_pk}" ) from apps.alerts.models import AlertGroup from apps.slack.models import SlackTeamIdentity UpdateLogReportMessageStep = ScenarioStep.get_step( "distribute_alerts", "UpdateLogReportMessageStep" ) slack_team_identity = SlackTeamIdentity.objects.get(pk=slack_team_identity_pk) alert_group = AlertGroup.objects.get(pk=alert_group_pk) step = UpdateLogReportMessageStep( slack_team_identity, alert_group.channel.organization ) if ( alert_group.skip_escalation_in_slack or alert_group.channel.is_rate_limited_in_slack ): return if update: # flag to prevent multiple posting log message to slack step.update_log_message(alert_group) else: step.post_log_message(alert_group) logger.debug( f"Finish post_or_update_log_report_message_task for alert_group {alert_group_pk}" ) @shared_dedicated_queue_retry_task( autoretry_for=(Exception,), retry_backoff=True, max_retries=1 if settings.DEBUG else None, ) def post_slack_rate_limit_message(integration_id): from apps.alerts.models import AlertReceiveChannel try: integration = AlertReceiveChannel.objects.get(pk=integration_id) except AlertReceiveChannel.DoesNotExist: logger.warning(f"AlertReceiveChannel {integration_id} doesn't exist") return if not compare_escalations( post_slack_rate_limit_message.request.id, integration.rate_limit_message_task_id ): logger.info( f"post_slack_rate_limit_message. integration {integration_id}. ID mismatch. " f"Active: {integration.rate_limit_message_task_id}" ) return default_route = integration.channel_filters.get(is_default=True) slack_channel = default_route.slack_channel_id_or_general_log_id if slack_channel: text = ( f"Delivering and updating alert groups of integration {integration.verbal_name} in Slack is " f"temporarily stopped due to rate limit. You could find new alert groups at " f"<{integration.new_incidents_web_link}|web page " '"Alert Groups">' ) post_message_to_channel(integration.organization, slack_channel, text) @shared_dedicated_queue_retry_task( autoretry_for=(Exception,), retry_backoff=True, max_retries=1 if settings.DEBUG else None, ) def populate_slack_usergroups(): from apps.slack.models import SlackTeamIdentity slack_team_identities = SlackTeamIdentity.objects.filter( detected_token_revoked__isnull=True ) delay = 0 counter = 0 for qs in batch_queryset(slack_team_identities, 5000): for slack_team_identity in qs: counter += 1 # increase delay to prevent slack ratelimit if counter % 8 == 0: delay += 60 populate_slack_usergroups_for_team.apply_async( (slack_team_identity.pk,), countdown=delay ) @shared_dedicated_queue_retry_task( autoretry_for=(Exception,), retry_backoff=True, max_retries=1 if settings.DEBUG else None, ) def populate_slack_usergroups_for_team(slack_team_identity_id): from apps.slack.models import SlackTeamIdentity, SlackUserGroup slack_team_identity = SlackTeamIdentity.objects.get(pk=slack_team_identity_id) sc = SlackClient(slack_team_identity) try: usergroups = sc.usergroups_list()["usergroups"] except SlackAPIRatelimitError as e: populate_slack_usergroups_for_team.apply_async( (slack_team_identity_id,), countdown=e.retry_after ) return except ( SlackAPITokenError, SlackAPIInvalidAuthError, SlackAPIPlanUpgradeRequiredError, ): return today = timezone.now().date() populated_user_groups_ids = slack_team_identity.usergroups.filter( last_populated=today ).values_list("slack_id", flat=True) for usergroup in usergroups: # skip groups that were recently populated if usergroup["id"] in populated_user_groups_ids: continue try: members = sc.usergroups_users_list(usergroup=usergroup["id"])["users"] except SlackAPIRatelimitError as e: populate_slack_usergroups_for_team.apply_async( (slack_team_identity_id,), countdown=e.retry_after ) return except (SlackAPIUsergroupNotFoundError, SlackAPIInvalidAuthError): return SlackUserGroup.objects.update_or_create( slack_id=usergroup["id"], slack_team_identity=slack_team_identity, defaults={ "name": usergroup["name"], "handle": usergroup["handle"], "members": members, "is_active": usergroup["date_delete"] == 0, "last_populated": today, }, ) @shared_dedicated_queue_retry_task() def start_update_slack_user_group_for_schedules(): from apps.slack.models import SlackUserGroup user_group_pks = ( SlackUserGroup.objects.filter( oncall_schedules__isnull=False, # has oncall schedules connected oncall_schedules__organization__deleted_at__isnull=True, # organization is not deleted ) .distinct() .values_list("pk", flat=True) ) for user_group_pk in user_group_pks: update_slack_user_group_for_schedules.delay(user_group_pk=user_group_pk) @shared_dedicated_queue_retry_task( autoretry_for=(Exception,), retry_backoff=True, max_retries=3 ) def update_slack_user_group_for_schedules(user_group_pk): from apps.slack.models import SlackUserGroup try: user_group = SlackUserGroup.objects.get(pk=user_group_pk) except SlackUserGroup.DoesNotExist: logger.warning(f"Slack user group {user_group_pk} does not exist") return user_group.update_oncall_members() @shared_dedicated_queue_retry_task( autoretry_for=(Exception,), retry_backoff=True, max_retries=1 if settings.DEBUG else None, ) def populate_slack_channels(): from apps.slack.models import SlackTeamIdentity slack_team_identities = SlackTeamIdentity.objects.filter( detected_token_revoked__isnull=True ) delay = 0 counter = 0 for qs in batch_queryset(slack_team_identities, 5000): for slack_team_identity in qs: counter += 1 # increase delay to prevent slack ratelimit if counter % 8 == 0: delay += 60 start_populate_slack_channels_for_team(slack_team_identity.pk, delay) def start_populate_slack_channels_for_team( slack_team_identity_id: int, delay: int, cursor: Optional[str] = None ) -> None: # save active task id in cache to make only one populate task active per team task_id = celery_uuid() cache_key = get_populate_slack_channel_task_id_key(slack_team_identity_id) cache.set(cache_key, task_id) populate_slack_channels_for_team.apply_async( (slack_team_identity_id, cursor), countdown=delay, task_id=task_id ) @shared_dedicated_queue_retry_task( autoretry_for=(Exception,), retry_backoff=True, max_retries=1 if settings.DEBUG else None, ) def populate_slack_channels_for_team( slack_team_identity_id: int, cursor: Optional[str] = None ) -> None: """ Make paginated request to get slack channels. On ratelimit - update info for got channels, save collected channels ids in cache and restart the task with the last successful pagination cursor to avoid any data loss during delay time. """ from apps.slack.models import SlackChannel, SlackTeamIdentity slack_team_identity = SlackTeamIdentity.objects.get(pk=slack_team_identity_id) sc = SlackClient(slack_team_identity) active_task_id_key = get_populate_slack_channel_task_id_key(slack_team_identity_id) active_task_id = cache.get(active_task_id_key) current_task_id = populate_slack_channels_for_team.request.id if active_task_id and active_task_id != current_task_id: logger.info( f"Stop populate_slack_channels_for_team for SlackTeamIdentity pk: {slack_team_identity_id} due to " f"incorrect active task id" ) return collected_channels_key = f"SLACK_CHANNELS_TEAM_{slack_team_identity_id}" collected_channels = cache.get(collected_channels_key, set()) if cursor and not collected_channels: # means the task was restarted after rate limit exception but collected channels were lost logger.warning( f"Restart slack channel sync for SlackTeamIdentity pk: {slack_team_identity_id} due to empty " f"'collected_channels' after rate limit" ) delay = 60 return start_populate_slack_channels_for_team(slack_team_identity_id, delay) try: response, cursor, rate_limited = sc.paginated_api_call_with_ratelimit( "conversations_list", paginated_key="channels", types="public_channel,private_channel", limit=1000, cursor=cursor, ) except (SlackAPITokenError, SlackAPIInvalidAuthError): return else: today = timezone.now().date() slack_channels = {channel["id"]: channel for channel in response["channels"]} collected_channels.update(slack_channels.keys()) existing_channels = slack_team_identity.cached_channels.all() existing_channel_ids = set(existing_channels.values_list("slack_id", flat=True)) # create missing channels channels_to_create = tuple( SlackChannel( slack_team_identity=slack_team_identity, slack_id=channel["id"], name=channel["name"], is_archived=channel["is_archived"], is_shared=channel["is_shared"], last_populated=today, ) for channel in slack_channels.values() if channel["id"] not in existing_channel_ids ) SlackChannel.objects.bulk_create(channels_to_create, batch_size=5000) # update existing channels channels_to_update = existing_channels.filter( slack_id__in=slack_channels.keys() ).exclude(last_populated=today) for channel in channels_to_update: slack_channel = slack_channels[channel.slack_id] channel.name = slack_channel["name"] channel.is_archived = slack_channel["is_archived"] channel.is_shared = slack_channel["is_shared"] channel.last_populated = today SlackChannel.objects.bulk_update( channels_to_update, fields=("name", "is_archived", "is_shared", "last_populated"), batch_size=5000, ) if rate_limited: # save collected channels ids to cache and restart the task with the current pagination cursor cache.set(collected_channels_key, collected_channels, timeout=3600) delay = random.randint(1, 3) * 60 logger.warning( f"'conversations.list' slack api error: rate_limited. SlackTeamIdentity pk: {slack_team_identity_id}. " f"Delay populate_slack_channels_for_team task for {delay//60} min." ) start_populate_slack_channels_for_team( slack_team_identity_id, delay, cursor ) else: # delete excess channels assert collected_channels channel_ids_to_delete = existing_channel_ids - collected_channels slack_team_identity.cached_channels.filter( slack_id__in=channel_ids_to_delete ).delete() cache.delete(collected_channels_key) @shared_dedicated_queue_retry_task( autoretry_for=(Exception,), retry_backoff=True, max_retries=0 ) def clean_slack_integration_leftovers(organization_id, *args, **kwargs): """ This task removes binding to slack (e.g ChannelFilter's slack channel) for a given organization. It is used when user changes slack integration. """ from apps.alerts.models import ChannelFilter from apps.schedules.models import OnCallSchedule logger.info(f"Cleaning up for organization {organization_id}") ChannelFilter.objects.filter( alert_receive_channel__organization_id=organization_id ).update(slack_channel_id=None) OnCallSchedule.objects.filter(organization_id=organization_id).update( channel=None, user_group=None ) @shared_dedicated_queue_retry_task( autoretry_for=(Exception,), retry_backoff=True, max_retries=10 ) def clean_slack_channel_leftovers(slack_team_identity_id, slack_channel_id): """ This task removes binding to slack channel after channel arcived or deleted in slack. """ from apps.alerts.models import ChannelFilter from apps.slack.models import SlackTeamIdentity from apps.user_management.models import Organization try: sti = SlackTeamIdentity.objects.get(id=slack_team_identity_id) except SlackTeamIdentity.DoesNotExist: logger.info( f"Failed to clean_slack_channel_leftovers slack_channel_id={slack_channel_id} slack_team_identity_id={slack_team_identity_id} : Invalid slack_team_identity_id" ) return orgs_to_clean_general_log_channel_id = [] for org in sti.organizations.all(): if org.general_log_channel_id == slack_channel_id: logger.info( f"Set general_log_channel_id to None for org_id={org.id} slack_channel_id={slack_channel_id} since slack_channel is arcived or deleted" ) org.general_log_channel_id = None orgs_to_clean_general_log_channel_id.append(org) ChannelFilter.objects.filter( alert_receive_channel__organization=org, slack_channel_id=slack_channel_id ).update(slack_channel_id=None) Organization.objects.bulk_update( orgs_to_clean_general_log_channel_id, ["general_log_channel_id"], batch_size=5000, )
tasks
refresh_ical_files
from apps.alerts.tasks import notify_ical_schedule_shift from apps.schedules.ical_utils import is_icals_equal from apps.schedules.tasks import ( notify_about_empty_shifts_in_schedule, notify_about_gaps_in_schedule, ) from apps.slack.tasks import start_update_slack_user_group_for_schedules from celery.utils.log import get_task_logger from common.custom_celery_tasks import shared_dedicated_queue_retry_task task_logger = get_task_logger(__name__) @shared_dedicated_queue_retry_task() def start_refresh_ical_files(): from apps.schedules.models import OnCallSchedule task_logger.info("Start refresh ical files") schedules = OnCallSchedule.objects.filter(organization__deleted_at__isnull=True) for schedule in schedules: refresh_ical_file.apply_async((schedule.pk,)) # Update Slack user groups with a delay to make sure all the schedules are refreshed start_update_slack_user_group_for_schedules.apply_async(countdown=30) @shared_dedicated_queue_retry_task() def start_refresh_ical_final_schedules(): from apps.schedules.models import OnCallSchedule task_logger.info("Start refresh ical final schedules") schedules = OnCallSchedule.objects.filter(organization__deleted_at__isnull=True) for schedule in schedules: refresh_ical_final_schedule.apply_async((schedule.pk,)) @shared_dedicated_queue_retry_task() def refresh_ical_file(schedule_pk): from apps.schedules.models import OnCallSchedule task_logger.info(f"Refresh ical files for schedule {schedule_pk}") try: schedule = OnCallSchedule.objects.get(pk=schedule_pk) except OnCallSchedule.DoesNotExist: task_logger.info(f"Tried to refresh non-existing schedule {schedule_pk}") return schedule.refresh_ical_file() if schedule.channel is not None: notify_ical_schedule_shift.apply_async((schedule.pk,)) run_task_primary = False if schedule.cached_ical_file_primary: # ie. primary schedule is not empty (None -> no ical, "" -> empty cached value) if not schedule.prev_ical_file_primary: # prev value is empty run_task_primary = True task_logger.info( f"run_task_primary {schedule_pk} {run_task_primary} prev_ical_file_primary is None" ) else: # prev value is not empty, we need to compare run_task_primary = not is_icals_equal( schedule.cached_ical_file_primary, schedule.prev_ical_file_primary, ) task_logger.info( f"run_task_primary {schedule_pk} {run_task_primary} icals not equal" ) run_task_overrides = False if schedule.cached_ical_file_overrides: # ie. overrides schedule is not empty (None -> no ical, "" -> empty cached value) if not schedule.prev_ical_file_overrides: # prev value is empty run_task_overrides = True task_logger.info( f"run_task_overrides {schedule_pk} {run_task_primary} prev_ical_file_overrides is None" ) else: # prev value is not empty, we need to compare run_task_overrides = not is_icals_equal( schedule.cached_ical_file_overrides, schedule.prev_ical_file_overrides, ) task_logger.info( f"run_task_overrides {schedule_pk} {run_task_primary} icals not equal" ) run_task = run_task_primary or run_task_overrides if run_task: notify_about_empty_shifts_in_schedule.apply_async((schedule_pk,)) notify_about_gaps_in_schedule.apply_async((schedule_pk,)) @shared_dedicated_queue_retry_task() def refresh_ical_final_schedule(schedule_pk): from apps.schedules.models import OnCallSchedule task_logger.info(f"Refresh ical final schedule {schedule_pk}") try: schedule = OnCallSchedule.objects.get(pk=schedule_pk) except OnCallSchedule.DoesNotExist: task_logger.info( f"Tried to refresh final schedule for non-existing schedule {schedule_pk}" ) return schedule.refresh_ical_final_schedule()
neubot
raw_srvr
# neubot/raw_srvr.py # # Copyright (c) 2012 Simone Basso <bassosimone@gmail.com>, # NEXA Center for Internet & Society at Politecnico di Torino # # This file is part of Neubot <http://www.neubot.org/>. # # Neubot is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Neubot is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Neubot. If not, see <http://www.gnu.org/licenses/>. # """ Server-side `test` phase of the raw test, minus access control, which is implemented in raw_srvr_glue.py. """ # Python3-ready: yes import getopt import logging import os import struct import sys if __name__ == "__main__": sys.path.insert(0, ".") from neubot import six, utils, utils_net, utils_version, web100 from neubot.brigade import Brigade from neubot.defer import Deferred from neubot.handler import Handler from neubot.poller import POLLER from neubot.raw_defs import ( AUTH_LEN, EMPTY_MESSAGE, FAKEAUTH, PIECE_CODE, PING_CODE, PINGBACK, RAWTEST, RAWTEST_CODE, ) from neubot.stream import Stream LEN_MESSAGE = 32768 MAXRECV = 262144 class ServerContext(Brigade): """Server context""" def __init__(self): Brigade.__init__(self) self.ticks = 0.0 self.count = 0 self.message = six.b("") self.auth = six.b("") self.state = {} self.snap_ticks = 0.0 self.snap_count = 0 self.snap_utime = 0.0 self.snap_stime = 0.0 self.web100_dirname = six.u("") class RawServer(Handler): """Raw test server""" def handle_accept(self, listener, sock, sslconfig, sslcert): logging.info("raw_srvr: new connection at %s", listener) Stream( sock, self._connection_ready, self._connection_lost, sslconfig, sslcert, ServerContext(), ) def handle_accept_error(self, listener): logging.warning("raw_srvr: accept failed") def _connection_ready(self, stream): """Invoked when the connection is ready""" logging.info("raw_srvr: sending auth to client... in progress") context = stream.opaque spec = "%s %s" % ( utils_net.format_epnt_web100(stream.myname), utils_net.format_epnt_web100(stream.peername), ) context.web100_dirname = web100.web100_find_dirname(web100.WEB100_HEADER, spec) logging.debug("> FAKEAUTH") stream.send(FAKEAUTH, self._fakeauth_sent) def _fakeauth_sent(self, stream): """The FAKEAUTH was sent to client""" logging.info("raw_srvr: sending auth to client... complete") logging.info("raw_srvr: receiving auth from client... in progress") stream.recv(AUTH_LEN, self._waiting_auth) def _waiting_auth(self, stream, data): """Invoked when we're waiting for client auth""" context = stream.opaque context.bufferise(data) tmp = context.pullup(AUTH_LEN) if not tmp: stream.recv(AUTH_LEN, self._waiting_auth) return logging.debug("< AUTH") self.filter_auth(stream, tmp) context.auth = tmp context.state["myname"] = stream.myname[0] context.state["peername"] = stream.peername[0] context.state["platform"] = sys.platform context.state["version"] = utils_version.NUMERIC_VERSION logging.info("raw_srvr: receiving auth from client... complete") logging.info("raw_srvr: waiting for RAWTEST message... in progress") stream.recv(len(RAWTEST), self._waiting_rawtest) def filter_auth(self, stream, tmp): """Filter client auth""" def _waiting_rawtest(self, stream, data): """Waiting for RAWTEST message from client""" context = stream.opaque context.bufferise(data) tmp = context.pullup(len(RAWTEST)) if not tmp: stream.recv(len(RAWTEST), self._waiting_rawtest) return if tmp[4:5] == PING_CODE: logging.debug("< PING") stream.send(PINGBACK, self._sent_pingback) logging.debug("> PINGBACK") return if tmp[4:5] != RAWTEST_CODE: raise RuntimeError("raw_srvr: received invalid message") logging.debug("< RAWTEST") logging.info("raw_srvr: waiting for RAWTEST message... complete") logging.info("raw_srvr: raw test... in progress") context.count = context.snap_count = stream.bytes_out context.ticks = context.snap_ticks = utils.ticks() context.snap_utime, context.snap_stime = os.times()[:2] message = PIECE_CODE + context.auth * int(LEN_MESSAGE / AUTH_LEN) context.message = struct.pack("!I", len(message)) + message stream.send(context.message, self._piece_sent) # logging.debug('> PIECE') POLLER.sched(1, self._periodic, stream) stream.recv(1, self._waiting_eof) @staticmethod def _waiting_eof(stream, data): """If this is invoked the protocol was violated""" raise RuntimeError("raw_srvr: protocol violation") def _sent_pingback(self, stream): """Sent the PINGBACK message""" stream.recv(len(RAWTEST), self._waiting_rawtest) def _piece_sent(self, stream): """Invoked when a message has been sent""" context = stream.opaque ticks = utils.ticks() if ticks - context.ticks < 10: stream.send(context.message, self._piece_sent) # logging.debug('> PIECE') return logging.info("raw_srvr: raw test... complete") ticks = utils.ticks() timediff = ticks - context.ticks bytesdiff = stream.bytes_out - context.count context.state["timestamp"] = utils.timestamp() context.state["goodput"] = { "ticks": ticks, "bytesdiff": bytesdiff, "timediff": timediff, } if timediff > 1e-06: speed = utils.speed_formatter(bytesdiff / timediff) logging.info("raw_srvr: goodput: %s", speed) self._periodic_internal(stream) stream.send(EMPTY_MESSAGE, self._empty_message_sent) logging.debug("> {empty-message}") def _periodic(self, args): """Periodically snap goodput""" stream = args[0] if stream.opaque: deferred = Deferred() deferred.add_callback(self._periodic_internal) deferred.add_errback(lambda err: self._periodic_error(stream, err)) deferred.callback(stream) POLLER.sched(1, self._periodic, stream) @staticmethod def _periodic_error(stream, err): """Invoked when _periodic_internal() fails""" logging.warning("raw_clnt: _periodic_internal() failed: %s", err) stream.close() @staticmethod def _periodic_internal(stream): """Periodically snap goodput (internal function)""" context = stream.opaque utime, stime = os.times()[:2] utimediff = utime - context.snap_utime stimediff = stime - context.snap_stime ticks = utils.ticks() timediff = ticks - context.snap_ticks bytesdiff = stream.bytes_out - context.snap_count context.state.setdefault("goodput_snap", []).append( { "ticks": ticks, "bytesdiff": bytesdiff, "timediff": timediff, "utimediff": utimediff, "stimediff": stimediff, } ) logging.debug("raw_srvr: utime, stime = %f, %f", utime, stime) if timediff > 1e-06: speed = utils.speed_formatter(bytesdiff / timediff) logging.debug("raw_srvr: goodput_snap: %s", speed) web100_snap = web100.web100_snap(web100.WEB100_HEADER, context.web100_dirname) web100_snap["ticks"] = ticks context.state.setdefault("web100_snap", []).append(web100_snap) context.snap_count = stream.bytes_out context.snap_ticks = ticks context.snap_utime = utime context.snap_stime = stime @staticmethod def _empty_message_sent(stream): """Sent the empty message to signal end of test""" # Tell the poller to reclaim this stream in some seconds stream.created = utils.ticks() stream.watchdog = 5 def _connection_lost(self, stream): """Invoked when the connection is lost""" def main(args): """Main function""" try: options, arguments = getopt.getopt(args[1:], "6A:p:Sv") except getopt.error: sys.exit("usage: neubot mod_raw [-6Sv] [-A address] [-p port]") if arguments: sys.exit("usage: neubot mod_raw [-6Sv] [-A address] [-p port]") prefer_ipv6 = 0 address = "127.0.0.1" port = 12345 sslconfig = False sslcert = "" verbose = 0 for name, value in options: if name == "-6": prefer_ipv6 = 1 elif name == "-A": address = value elif name == "-p": port = int(value) elif name == "-S": sslconfig = True sslcert = "cert.pem" elif name == "-v": verbose += 1 level = logging.INFO if verbose > 0: level = logging.DEBUG logging.getLogger().setLevel(level) handler = RawServer() handler.listen((address, port), prefer_ipv6, sslconfig, sslcert) POLLER.loop() if __name__ == "__main__": main(sys.argv)
api
filters
# -*- coding: utf-8 -*- from core import models from django_filters import rest_framework as filters class CharInFilter(filters.BaseInFilter, filters.CharFilter): pass class ChildFieldFilter(filters.FilterSet): class Meta: abstract = True fields = ["child"] class TagsFieldFilter(filters.FilterSet): tags = CharInFilter( field_name="tags__name", label="tag", help_text="A list of tag names, comma separated", ) class Meta: abstract = True class TimeFieldFilter(ChildFieldFilter): date = filters.IsoDateTimeFilter(field_name="time", label="DateTime") date_max = filters.IsoDateTimeFilter( field_name="time", label="Max. DateTime", lookup_expr="lte" ) date_min = filters.IsoDateTimeFilter( field_name="time", label="Min. DateTime", lookup_expr="gte" ) class Meta: abstract = True fields = sorted(ChildFieldFilter.Meta.fields + ["date", "date_max", "date_min"]) class StartEndFieldFilter(ChildFieldFilter): end = filters.IsoDateTimeFilter(field_name="end", label="End DateTime") end_max = filters.IsoDateTimeFilter( field_name="end", label="Max. End DateTime", lookup_expr="lte" ) end_min = filters.IsoDateTimeFilter( field_name="end", label="Min. End DateTime", lookup_expr="gte" ) start = filters.IsoDateTimeFilter(field_name="start", label="Start DateTime") start_max = filters.IsoDateTimeFilter( field_name="start", lookup_expr="lte", label="Max. End DateTime" ) start_min = filters.IsoDateTimeFilter( field_name="start", lookup_expr="gte", label="Min. Start DateTime" ) class Meta: abstract = True fields = sorted( ChildFieldFilter.Meta.fields + ["end", "end_max", "end_min", "start", "start_max", "start_min"] ) class DiaperChangeFilter(TimeFieldFilter, TagsFieldFilter): class Meta(TimeFieldFilter.Meta): model = models.DiaperChange fields = sorted( TimeFieldFilter.Meta.fields + ["wet", "solid", "color", "amount"] ) class FeedingFilter(StartEndFieldFilter, TagsFieldFilter): class Meta(StartEndFieldFilter.Meta): model = models.Feeding fields = sorted(StartEndFieldFilter.Meta.fields + ["type", "method"]) class NoteFilter(TimeFieldFilter, TagsFieldFilter): class Meta(TimeFieldFilter.Meta): model = models.Note class PumpingFilter(StartEndFieldFilter): class Meta(StartEndFieldFilter.Meta): model = models.Pumping class SleepFilter(StartEndFieldFilter, TagsFieldFilter): class Meta(StartEndFieldFilter.Meta): model = models.Sleep class TemperatureFilter(TimeFieldFilter, TagsFieldFilter): class Meta(TimeFieldFilter.Meta): model = models.Temperature class TimerFilter(StartEndFieldFilter): class Meta(StartEndFieldFilter.Meta): model = models.Timer fields = sorted(StartEndFieldFilter.Meta.fields + ["name", "user"]) class TummyTimeFilter(StartEndFieldFilter, TagsFieldFilter): class Meta(StartEndFieldFilter.Meta): model = models.TummyTime
beetsplug
loadext
# This file is part of beets. # Copyright 2019, Jack Wilsdon <jack.wilsdon@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. """Load SQLite extensions. """ import sqlite3 from beets.dbcore import Database from beets.plugins import BeetsPlugin class LoadExtPlugin(BeetsPlugin): def __init__(self): super().__init__() if not Database.supports_extensions: self._log.warn( "loadext is enabled but the current SQLite " "installation does not support extensions" ) return self.register_listener("library_opened", self.library_opened) def library_opened(self, lib): for v in self.config: ext = v.as_filename() self._log.debug("loading extension {}", ext) try: lib.load_extension(ext) except sqlite3.OperationalError as e: self._log.error("failed to load extension {}: {}", ext, e)
blueprints
api_blueprint
# -*- coding: utf-8 -*- import traceback from ast import literal_eval from itertools import chain from logging import getLogger from urllib.parse import unquote import flask from flask.json import jsonify from pyload import APPID from ..helpers import clear_session, set_session bp = flask.Blueprint("api", __name__) log = getLogger(APPID) # accepting positional arguments, as well as kwargs via post and get # @bottle.route( @bp.route("/api/<func>", methods=["GET", "POST"], endpoint="rpc") @bp.route("/api/<func>/<args>", methods=["GET", "POST"], endpoint="rpc") # @apiver_check def rpc(func, args=""): api = flask.current_app.config["PYLOAD_API"] if flask.request.authorization: user = flask.request.authorization.get("username", "") password = flask.request.authorization.get("password", "") else: user = flask.request.form.get("u", "") password = flask.request.form.get("p", "") if user: user_info = api.check_auth(user, password) s = set_session(user_info) else: s = flask.session if ( "role" not in s or "perms" not in s or not api.is_authorized(func, {"role": s["role"], "permission": s["perms"]}) ): return jsonify({"error": "Unauthorized"}), 401 args = args.split(",") if len(args) == 1 and not args[0]: args = [] kwargs = {} for x, y in chain(flask.request.args.items(), flask.request.form.items()): if x not in ("u", "p"): kwargs[x] = unquote(y) try: response = call_api(func, *args, **kwargs) except Exception as exc: response = jsonify(error=str(exc), traceback=traceback.format_exc()), 500 return response def call_api(func, *args, **kwargs): api = flask.current_app.config["PYLOAD_API"] if func.startswith("_"): flask.flash(f"Invalid API call '{func}'") return jsonify({"error": "Forbidden"}), 403 result = getattr(api, func)( *[literal_eval(x) for x in args], **{x: literal_eval(y) for x, y in kwargs.items()}, ) return jsonify(result) @bp.route("/api/login", methods=["POST"], endpoint="login") # @apiver_check def login(): user = flask.request.form["username"] password = flask.request.form["password"] api = flask.current_app.config["PYLOAD_API"] user_info = api.check_auth(user, password) if not user_info: log.error(f"Login failed for user '{user}'") return jsonify(False) s = set_session(user_info) log.info(f"User '{user}' successfully logged in") flask.flash("Logged in successfully") return jsonify(s) @bp.route("/api/logout", endpoint="logout") # @apiver_check def logout(): s = flask.session user = s.get("name") clear_session(s) if user: log.info(f"User '{user}' logged out") return jsonify(True)
transforms
filenames
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai __license__ = "GPL v3" __copyright__ = "2010, Kovid Goyal <kovid@kovidgoyal.net>" __docformat__ = "restructuredtext en" import posixpath from calibre.ebooks.oeb.base import rewrite_links, urlnormalize from lxml import etree from urlparse import urldefrag, urlparse class RenameFiles(object): # {{{ """ Rename files and adjust all links pointing to them. Note that the spine and manifest are not touched by this transform. """ def __init__(self, rename_map, renamed_items_map=None): self.rename_map = rename_map self.renamed_items_map = renamed_items_map def __call__(self, oeb, opts): import cssutils self.log = oeb.logger self.opts = opts self.oeb = oeb for item in oeb.manifest.items: self.current_item = item if etree.iselement(item.data): rewrite_links(self.current_item.data, self.url_replacer) elif hasattr(item.data, "cssText"): cssutils.replaceUrls(item.data, self.url_replacer) if self.oeb.guide: for ref in self.oeb.guide.values(): href = urlnormalize(ref.href) href, frag = urldefrag(href) replacement = self.rename_map.get(href, None) if replacement is not None: nhref = replacement if frag: nhref += "#" + frag ref.href = nhref if self.oeb.toc: self.fix_toc_entry(self.oeb.toc) def fix_toc_entry(self, toc): if toc.href: href = urlnormalize(toc.href) href, frag = urldefrag(href) replacement = self.rename_map.get(href, None) if replacement is not None: nhref = replacement if frag: nhref = "#".join((nhref, frag)) toc.href = nhref for x in toc: self.fix_toc_entry(x) def url_replacer(self, orig_url): url = urlnormalize(orig_url) parts = urlparse(url) if parts.scheme: # Only rewrite local URLs return orig_url path, frag = urldefrag(url) if self.renamed_items_map: orig_item = self.renamed_items_map.get( self.current_item.href, self.current_item ) else: orig_item = self.current_item href = orig_item.abshref(path) replacement = self.current_item.relhref(self.rename_map.get(href, href)) if frag: replacement += "#" + frag return replacement # }}} class UniqueFilenames(object): # {{{ "Ensure that every item in the manifest has a unique filename" def __call__(self, oeb, opts): self.log = oeb.logger self.opts = opts self.oeb = oeb self.seen_filenames = set([]) self.rename_map = {} for item in list(oeb.manifest.items): fname = posixpath.basename(item.href) if fname in self.seen_filenames: suffix = self.unique_suffix(fname) data = item.data base, ext = posixpath.splitext(item.href) nhref = base + suffix + ext nhref = oeb.manifest.generate(href=nhref)[1] spine_pos = item.spine_position oeb.manifest.remove(item) nitem = oeb.manifest.add( item.id, nhref, item.media_type, data=data, fallback=item.fallback ) self.seen_filenames.add(posixpath.basename(nhref)) self.rename_map[item.href] = nhref if spine_pos is not None: oeb.spine.insert(spine_pos, nitem, item.linear) else: self.seen_filenames.add(fname) if self.rename_map: self.log( "Found non-unique filenames, renaming to support broken" " EPUB readers like FBReader, Aldiko and Stanza..." ) from pprint import pformat self.log.debug(pformat(self.rename_map)) renamer = RenameFiles(self.rename_map) renamer(oeb, opts) def unique_suffix(self, fname): base, ext = posixpath.splitext(fname) c = 0 while True: c += 1 suffix = "_u%d" % c candidate = base + suffix + ext if candidate not in self.seen_filenames: return suffix # }}} class FlatFilenames(object): # {{{ "Ensure that every item in the manifest has a unique filename without subdirectories." def __call__(self, oeb, opts): self.log = oeb.logger self.opts = opts self.oeb = oeb self.rename_map = {} self.renamed_items_map = {} for item in list(oeb.manifest.items): # Flatten URL by removing directories. # Example: a/b/c/index.html -> a_b_c_index.html nhref = item.href.replace("/", "_") if item.href == nhref: # URL hasn't changed, skip item. continue data = item.data isp = item.spine_position nhref = oeb.manifest.generate(href=nhref)[1] if isp is not None: oeb.spine.remove(item) oeb.manifest.remove(item) nitem = oeb.manifest.add( item.id, nhref, item.media_type, data=data, fallback=item.fallback ) self.rename_map[item.href] = nhref self.renamed_items_map[nhref] = item if isp is not None: oeb.spine.insert(isp, nitem, item.linear) if self.rename_map: self.log( "Found non-flat filenames, renaming to support broken" " EPUB readers like FBReader..." ) from pprint import pformat self.log.debug(pformat(self.rename_map)) self.log.debug(pformat(self.renamed_items_map)) renamer = RenameFiles(self.rename_map, self.renamed_items_map) renamer(oeb, opts) # }}}
macos
release
#!/usr/bin/env python3 import argparse import json import os import platform import shutil import subprocess def parse_args(): parser = argparse.ArgumentParser() parser.add_argument( "--pkg", action="store_true", default=False, dest="pkg", help="Build a PKG installer instead of a DMG", ) return parser.parse_args() ARGS = parse_args() HOME = os.path.expanduser("~") ARCH = platform.machine() with open("meta.json") as f: j = json.load(f) MAJOR_VERSION = j["version"]["major"] MINOR_VERSION = j["version"]["minor"] CWD = os.path.abspath( os.path.join( os.path.dirname(__file__), "..", ), ) os.chdir(CWD) if ARCH == "x86_64": subprocess.check_call( [ "make", "macos", ] ) elif ARCH == "arm64": subprocess.check_call( [ "make", "macos_arm", ] ) else: assert False, f"Unknown arch. {ARCH}" BUNDLE = "Stargate DAW.app" BUNDLE_PATH = os.path.join("dist", BUNDLE) if os.path.isdir(BUNDLE_PATH): shutil.rmtree(BUNDLE_PATH) retcode = subprocess.check_call( [ "pyinstaller", "--noconfirm", "pyinstaller-mac-onedir.spec", ] ) assert retcode == 0, retcode os.chdir("dist") ARCH_NAMES = { "x86_64": "intel", "arm64": "m1", } def build_dmg(): DMG = f"StargateDAW-{MINOR_VERSION}-macos-{ARCH_NAMES[ARCH]}-{ARCH}.dmg" if os.path.exists(DMG): os.remove(DMG) subprocess.check_call( [ "create-dmg", "--volname", "Stargate DAW", "--icon", BUNDLE, "50", "120", "--hide-extension", BUNDLE, "--app-drop-link", "300", "120", "--format", "UDBZ", DMG, BUNDLE, ] ) def build_pkg(): PKG = f"StargateDAW-{MINOR_VERSION}-macos-{ARCH_NAMES[ARCH]}-{ARCH}.pkg" subprocess.check_call( [ "pkgbuild", "--root", BUNDLE, "--identifier", "com.github.stargatedaw.stargate", "--scripts", "../macos/Scripts", "--install-location", f"/Applications/{BUNDLE}", "Distribution.pkg", ] ) # Distribution.xml generated with: # productbuild --synthesize --package Distribution.pkg Distribution.xml subprocess.check_call( [ "productbuild", "--distribution", "../macos/Distribution.xml", "--resources", "Resources", "--package-path", ".", PKG, ] ) if ARGS.pkg: build_pkg() else: build_dmg()
negotiate
server
# neubot/negotiate/server.py # # Copyright (c) 2011 Simone Basso <bassosimone@gmail.com>, # NEXA Center for Internet & Society at Politecnico di Torino # # This file is part of Neubot <http://www.neubot.org/>. # # Neubot is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Neubot is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Neubot. If not, see <http://www.gnu.org/licenses/>. # """ Negotiate server """ import collections import logging import random from neubot.compat import json from neubot.config import CONFIG from neubot.http.message import Message from neubot.http.server import ServerHTTP class NegotiateServerModule(object): """Each test should implement this interface""" # The minimal collect echoes the request body def collect(self, stream, request_body): """Invoked at the end of the test, to collect data""" return request_body # Only speedtest reimplements this method def collect_legacy(self, stream, request_body, request): """Legacy interface to collect that also receives the request object: speedtest needs to inspect the Authorization header when the connecting client is pretty old""" return self.collect(stream, request_body) # The minimal unchoke returns the stream unique identifier only def unchoke(self, stream, request_body): """Invoked when a stream is authorized to take the test""" return {"authorization": str(hash(stream))} class NegotiateServer(ServerHTTP): """Common code layer for /negotiate and /collect""" def __init__(self, poller): """Initialize the negotiator""" ServerHTTP.__init__(self, poller) self.queue = collections.deque() self.modules = {} self.known = set() def register_module(self, name, module): """Register a module""" self.modules[name] = module # # Protect the server from requests with huge request bodies # and filter-out unhandled URIs. # The HTTP layer should close() the stream when we return # False here. # def got_request_headers(self, stream, request): """Decide whether we can accept this HTTP request""" isgood = ( request["transfer-encoding"] == "" and request.content_length() <= 1048576 and ( request.uri.startswith("/negotiate/") or request.uri.startswith("/collect/") ) ) return isgood def process_request(self, stream, request): """Process a /collect or /negotiate HTTP request""" # # Here we are liberal and we process a GET request plus body # as it was a POST or PUT request, however we warn because the # body has no meaning when you send a GET request. # if request.method != "POST" and request.method != "PUT": logging.warning("%s: GET plus body is surprising", request.uri) # # We always pass upstream the collect request. If it is # not authorized the module does not have the identifier in # its global table and will raise a KeyError. # Here we always keepalive=False so the HTTP layer closes # the connection and we are notified that the queue should # be changed. # if request.uri.startswith("/collect/"): module = request.uri.replace("/collect/", "") module = self.modules[module] request_body = json.load(request.body) response_body = module.collect_legacy(stream, request_body, request) response_body = json.dumps(response_body) response = Message() response.compose( code="200", reason="Ok", body=response_body, keepalive=False, mimetype="application/json", ) stream.send_response(request, response) # # The first time we see a stream, we decide whether to # accept or drop it, depending on the length of the # queue. The decision whether to accept or not depends # on the current queue length and follows the Random # Early Discard algorithm. When we accept it, we also # register a function to be called when the stream is # closed so that we can update the queue. And we # immediately send a response. # When it's not the first time we see a stream, we just # take note that we owe it a response. But we won't # respond until its queue position changes. # elif request.uri.startswith("/negotiate/"): if not stream in self.known: position = len(self.queue) min_thresh = CONFIG["negotiate.min_thresh"] max_thresh = CONFIG["negotiate.max_thresh"] if random.random() < float(position - min_thresh) / ( max_thresh - min_thresh ): stream.close() return self.queue.append(stream) self.known.add(stream) stream.atclose(self._update_queue) self._do_negotiate((stream, request, position)) else: stream.opaque = request # For robustness else: raise RuntimeError("Unexpected URI") def _do_negotiate(self, baton): """Respond to a /negotiate request""" stream, request, position = baton module = request.uri.replace("/negotiate/", "") module = self.modules[module] request_body = json.load(request.body) parallelism = CONFIG["negotiate.parallelism"] unchoked = int(position < parallelism) response_body = { "queue_pos": position, "real_address": stream.peername[0], "unchoked": unchoked, } if unchoked: extra = module.unchoke(stream, request_body) if not "authorization" in extra: raise RuntimeError("Negotiate API violation") extra.update(response_body) response_body = extra else: response_body["authorization"] = "" response = Message() response.compose( code="200", reason="Ok", body=json.dumps(response_body), keepalive=True, mimetype="application/json", ) stream.send_response(request, response) # # In theory this function should walk the queue and remove the # lost stream. But, actually, it seems better/faster to create # and fill a new queue. # In the new queue we will add streams before @lost_stream and # streams after @lost_stream that (i) have no pending comet # request or (ii) have a pending comet request and successfully # manage to send it. # Note: in case of error sending the pending comet request, # unregister atclose hook to prevent recursion. # TODO Libero Camillo suggests to use an ordered dictionary to # implement the queue. I like the idea and I will look into # that after the pending Neubot release. # def _update_queue(self, lost_stream, ignored): """Invoked when a connection is lost""" queue, found = collections.deque(), False position = 0 for stream in self.queue: if not found: if lost_stream != stream: position += 1 queue.append(stream) else: found = True self.known.remove(stream) elif not stream.opaque: position += 1 queue.append(stream) else: request, stream.opaque = stream.opaque, None try: self._do_negotiate((stream, request, position)) position += 1 queue.append(stream) except (KeyboardInterrupt, SystemExit): raise except: logging.error("Exception", exc_info=1) stream.unregister_atclose(self._update_queue) self.known.remove(stream) stream.close() self.queue = queue # No poller, so it cannot be used directly NEGOTIATE_SERVER = NegotiateServer(None)
misc
quitter
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # SPDX-License-Identifier: GPL-3.0-or-later """Helpers related to quitting qutebrowser cleanly.""" import argparse import atexit import functools import json import os import os.path import shutil import subprocess import sys import tokenize import warnings from typing import Iterable, Mapping, MutableSequence, Sequence, cast from qutebrowser.qt.core import QObject, QTimer, pyqtSignal try: import hunter except ImportError: hunter = None import qutebrowser from qutebrowser.api import cmdutils from qutebrowser.completion.models import miscmodels from qutebrowser.mainwindow import prompt from qutebrowser.misc import ipc, objects, sessions from qutebrowser.utils import log, qtlog instance = cast("Quitter", None) class Quitter(QObject): """Utility class to quit/restart the QApplication. Attributes: quit_status: The current quitting status. is_shutting_down: Whether we're currently shutting down. _args: The argparse namespace. """ shutting_down = pyqtSignal() # Emitted immediately before shut down def __init__(self, *, args: argparse.Namespace, parent: QObject = None) -> None: super().__init__(parent) self.quit_status = { "crash": True, "tabs": False, "main": False, } self.is_shutting_down = False self._args = args def on_last_window_closed(self) -> None: """Slot which gets invoked when the last window was closed.""" self.shutdown(last_window=True) def _compile_modules(self) -> None: """Compile all modules to catch SyntaxErrors.""" if os.path.basename(sys.argv[0]) == "qutebrowser": # Launched via launcher script return elif hasattr(sys, "frozen"): return else: path = os.path.abspath(os.path.dirname(qutebrowser.__file__)) if not os.path.isdir(path): # Probably running from a python egg. return for dirpath, _dirnames, filenames in os.walk(path): for fn in filenames: if os.path.splitext(fn)[1] == ".py" and os.path.isfile(fn): with tokenize.open(os.path.join(dirpath, fn)) as f: compile(f.read(), fn, "exec") def _get_restart_args( self, pages: Iterable[str] = (), session: str = None, override_args: Mapping[str, str] = None, ) -> Sequence[str]: """Get args to relaunch qutebrowser. Args: pages: The pages to re-open. session: The session to load, or None. override_args: Argument overrides as a dict. Return: The commandline as a list of strings. """ if os.path.basename(sys.argv[0]) == "qutebrowser": # Launched via launcher script args = [sys.argv[0]] elif hasattr(sys, "frozen"): args = [sys.executable] else: args = [sys.executable, "-m", "qutebrowser"] # Add all open pages so they get reopened. page_args: MutableSequence[str] = [] for win in pages: page_args.extend(win) page_args.append("") # Serialize the argparse namespace into json and pass that to the new # process via --json-args. # We do this as there's no way to "unparse" the namespace while # ignoring some arguments. argdict = vars(self._args) argdict["session"] = None argdict["url"] = [] argdict["command"] = page_args[:-1] argdict["json_args"] = None # Ensure the given session (or none at all) gets opened. if session is None: argdict["session"] = None argdict["override_restore"] = True else: argdict["session"] = session argdict["override_restore"] = False # Ensure :restart works with --temp-basedir if self._args.temp_basedir: argdict["temp_basedir"] = False argdict["temp_basedir_restarted"] = True if override_args is not None: argdict.update(override_args) # Dump the data data = json.dumps(argdict) args += ["--json-args", data] log.destroy.debug("args: {}".format(args)) return args def restart( self, pages: Sequence[str] = (), session: str = None, override_args: Mapping[str, str] = None, ) -> bool: """Inner logic to restart qutebrowser. The "better" way to restart is to pass a session (_restart usually) as that'll save the complete state. However we don't do that (and pass a list of pages instead) when we restart because of an exception, as that's a lot simpler and we don't want to risk anything going wrong. Args: pages: A list of URLs to open. session: The session to load, or None. override_args: Argument overrides as a dict. Return: True if the restart succeeded, False otherwise. """ self._compile_modules() log.destroy.debug("sys.executable: {}".format(sys.executable)) log.destroy.debug("sys.path: {}".format(sys.path)) log.destroy.debug("sys.argv: {}".format(sys.argv)) log.destroy.debug("frozen: {}".format(hasattr(sys, "frozen"))) # Save the session if one is given. if session is not None: sessions.session_manager.save(session, with_private=True) # Make sure we're not accepting a connection from the new process # before we fully exited. assert ipc.server is not None ipc.server.shutdown() # Open a new process and immediately shutdown the existing one try: args = self._get_restart_args(pages, session, override_args) proc = subprocess.Popen(args) # pylint: disable=consider-using-with except OSError: log.destroy.exception("Failed to restart") return False else: log.destroy.debug(f"New process PID: {proc.pid}") # Avoid ResourceWarning about still running subprocess when quitting. warnings.filterwarnings( "ignore", category=ResourceWarning, message=f"subprocess {proc.pid} is still running", ) return True def shutdown( self, status: int = 0, session: sessions.ArgType = None, last_window: bool = False, is_restart: bool = False, ) -> None: """Quit qutebrowser. Args: status: The status code to exit with. session: A session name if saving should be forced. last_window: If the shutdown was triggered due to the last window closing. is_restart: If we're planning to restart. """ if self.is_shutting_down: return self.is_shutting_down = True log.destroy.debug( "Shutting down with status {}, session {}...".format(status, session) ) sessions.shutdown(session, last_window=last_window) if prompt.prompt_queue is not None: prompt.prompt_queue.shutdown() # If shutdown was called while we were asking a question, we're in # a still sub-eventloop (which gets quit now) and not in the main # one. # But there's also other situations where it's problematic to shut down # immediately (e.g. when we're just starting up). # This means we need to defer the real shutdown to when we're back # in the real main event loop, or we'll get a segfault. log.destroy.debug("Deferring shutdown stage 2") QTimer.singleShot( 0, functools.partial(self._shutdown_2, status, is_restart=is_restart) ) def _shutdown_2(self, status: int, is_restart: bool) -> None: """Second stage of shutdown.""" log.destroy.debug("Stage 2 of shutting down...") # Tell everything to shut itself down self.shutting_down.emit() # Delete temp basedir if ( self._args.temp_basedir or self._args.temp_basedir_restarted ) and not is_restart: atexit.register(shutil.rmtree, self._args.basedir, ignore_errors=True) # Now we can hopefully quit without segfaults log.destroy.debug("Deferring QApplication::exit...") # We use a singleshot timer to exit here to minimize the likelihood of # segfaults. QTimer.singleShot(0, functools.partial(self._shutdown_3, status)) def _shutdown_3(self, status: int) -> None: """Finally shut down the QApplication.""" log.destroy.debug("Now calling QApplication::exit.") if "debug-exit" in objects.debug_flags: if hunter is None: print( "Not logging late shutdown because hunter could not be " "imported!", file=sys.stderr, ) else: print("Now logging late shutdown.", file=sys.stderr) hunter.trace() objects.qapp.exit(status) @cmdutils.register(name="quit") @cmdutils.argument("session", completion=miscmodels.session) def quit_(save: bool = False, session: sessions.ArgType = None) -> None: """Quit qutebrowser. Args: save: When given, save the open windows even if auto_save.session is turned off. session: The name of the session to save. """ if session is not None and not save: raise cmdutils.CommandError("Session name given without --save!") if save and session is None: session = sessions.default instance.shutdown(session=session) @cmdutils.register() def restart() -> None: """Restart qutebrowser while keeping existing tabs open.""" try: ok = instance.restart(session="_restart") except sessions.SessionError as e: log.destroy.exception("Failed to save session!") raise cmdutils.CommandError("Failed to save session: {}!".format(e)) except SyntaxError as e: log.destroy.exception("Got SyntaxError") raise cmdutils.CommandError( "SyntaxError in {}:{}: {}".format(e.filename, e.lineno, e) ) if ok: instance.shutdown(is_restart=True) def init(args: argparse.Namespace) -> None: """Initialize the global Quitter instance.""" global instance instance = Quitter(args=args, parent=objects.qapp) instance.shutting_down.connect(qtlog.shutdown_log) objects.qapp.lastWindowClosed.connect(instance.on_last_window_closed)
futures
_base
# Copyright 2009 Brian Quinlan. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. import collections import itertools import logging import threading import time import types __author__ = 'Brian Quinlan (brian@sweetapp.com)' FIRST_COMPLETED = 'FIRST_COMPLETED' FIRST_EXCEPTION = 'FIRST_EXCEPTION' ALL_COMPLETED = 'ALL_COMPLETED' _AS_COMPLETED = '_AS_COMPLETED' # Possible future states (for internal use by the futures package). PENDING = 'PENDING' RUNNING = 'RUNNING' # The future was cancelled by the user... CANCELLED = 'CANCELLED' # ...and _Waiter.add_cancelled() was called by a worker. CANCELLED_AND_NOTIFIED = 'CANCELLED_AND_NOTIFIED' FINISHED = 'FINISHED' _FUTURE_STATES = [ PENDING, RUNNING, CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED ] _STATE_TO_DESCRIPTION_MAP = { PENDING: "pending", RUNNING: "running", CANCELLED: "cancelled", CANCELLED_AND_NOTIFIED: "cancelled", FINISHED: "finished" } # Logger for internal use by the futures package. LOGGER = logging.getLogger("concurrent.futures") class Error(Exception): """Base class for all future-related exceptions.""" pass class CancelledError(Error): """The Future was cancelled.""" pass class TimeoutError(Error): """The operation exceeded the given deadline.""" pass class _Waiter(object): """Provides the event that wait() and as_completed() block on.""" def __init__(self): self.event = threading.Event() self.finished_futures = [] def add_result(self, future): self.finished_futures.append(future) def add_exception(self, future): self.finished_futures.append(future) def add_cancelled(self, future): self.finished_futures.append(future) class _AsCompletedWaiter(_Waiter): """Used by as_completed().""" def __init__(self): super(_AsCompletedWaiter, self).__init__() self.lock = threading.Lock() def add_result(self, future): with self.lock: super(_AsCompletedWaiter, self).add_result(future) self.event.set() def add_exception(self, future): with self.lock: super(_AsCompletedWaiter, self).add_exception(future) self.event.set() def add_cancelled(self, future): with self.lock: super(_AsCompletedWaiter, self).add_cancelled(future) self.event.set() class _FirstCompletedWaiter(_Waiter): """Used by wait(return_when=FIRST_COMPLETED).""" def add_result(self, future): super(_FirstCompletedWaiter, self).add_result(future) self.event.set() def add_exception(self, future): super(_FirstCompletedWaiter, self).add_exception(future) self.event.set() def add_cancelled(self, future): super(_FirstCompletedWaiter, self).add_cancelled(future) self.event.set() class _AllCompletedWaiter(_Waiter): """Used by wait(return_when=FIRST_EXCEPTION and ALL_COMPLETED).""" def __init__(self, num_pending_calls, stop_on_exception): self.num_pending_calls = num_pending_calls self.stop_on_exception = stop_on_exception self.lock = threading.Lock() super(_AllCompletedWaiter, self).__init__() def _decrement_pending_calls(self): with self.lock: self.num_pending_calls -= 1 if not self.num_pending_calls: self.event.set() def add_result(self, future): super(_AllCompletedWaiter, self).add_result(future) self._decrement_pending_calls() def add_exception(self, future): super(_AllCompletedWaiter, self).add_exception(future) if self.stop_on_exception: self.event.set() else: self._decrement_pending_calls() def add_cancelled(self, future): super(_AllCompletedWaiter, self).add_cancelled(future) self._decrement_pending_calls() class _AcquireFutures(object): """A context manager that does an ordered acquire of Future conditions.""" def __init__(self, futures): self.futures = sorted(futures, key=id) def __enter__(self): for future in self.futures: future._condition.acquire() def __exit__(self, *args): for future in self.futures: future._condition.release() def _create_and_install_waiters(fs, return_when): if return_when == _AS_COMPLETED: waiter = _AsCompletedWaiter() elif return_when == FIRST_COMPLETED: waiter = _FirstCompletedWaiter() else: pending_count = sum( f._state not in [CANCELLED_AND_NOTIFIED, FINISHED] for f in fs) if return_when == FIRST_EXCEPTION: waiter = _AllCompletedWaiter(pending_count, stop_on_exception=True) elif return_when == ALL_COMPLETED: waiter = _AllCompletedWaiter(pending_count, stop_on_exception=False) else: raise ValueError("Invalid return condition: %r" % return_when) for f in fs: f._waiters.append(waiter) return waiter def as_completed(fs, timeout=None): """An iterator over the given futures that yields each as it completes. Args: fs: The sequence of Futures (possibly created by different Executors) to iterate over. timeout: The maximum number of seconds to wait. If None, then there is no limit on the wait time. Returns: An iterator that yields the given Futures as they complete (finished or cancelled). If any given Futures are duplicated, they will be returned once. Raises: TimeoutError: If the entire result iterator could not be generated before the given timeout. """ if timeout is not None: end_time = timeout + time.time() fs = set(fs) with _AcquireFutures(fs): finished = set( f for f in fs if f._state in [CANCELLED_AND_NOTIFIED, FINISHED]) pending = fs - finished waiter = _create_and_install_waiters(fs, _AS_COMPLETED) try: for future in finished: yield future while pending: if timeout is None: wait_timeout = None else: wait_timeout = end_time - time.time() if wait_timeout < 0: raise TimeoutError( '%d (of %d) futures unfinished' % ( len(pending), len(fs))) waiter.event.wait(wait_timeout) with waiter.lock: finished = waiter.finished_futures waiter.finished_futures = [] waiter.event.clear() for future in finished: yield future pending.remove(future) finally: for f in fs: with f._condition: f._waiters.remove(waiter) DoneAndNotDoneFutures = collections.namedtuple( 'DoneAndNotDoneFutures', 'done not_done') def wait(fs, timeout=None, return_when=ALL_COMPLETED): """Wait for the futures in the given sequence to complete. Args: fs: The sequence of Futures (possibly created by different Executors) to wait upon. timeout: The maximum number of seconds to wait. If None, then there is no limit on the wait time. return_when: Indicates when this function should return. The options are: FIRST_COMPLETED - Return when any future finishes or is cancelled. FIRST_EXCEPTION - Return when any future finishes by raising an exception. If no future raises an exception then it is equivalent to ALL_COMPLETED. ALL_COMPLETED - Return when all futures finish or are cancelled. Returns: A named 2-tuple of sets. The first set, named 'done', contains the futures that completed (is finished or cancelled) before the wait completed. The second set, named 'not_done', contains uncompleted futures. """ with _AcquireFutures(fs): done = set(f for f in fs if f._state in [CANCELLED_AND_NOTIFIED, FINISHED]) not_done = set(fs) - done if (return_when == FIRST_COMPLETED) and done: return DoneAndNotDoneFutures(done, not_done) elif (return_when == FIRST_EXCEPTION) and done: if any(f for f in done if not f.cancelled() and f.exception() is not None): return DoneAndNotDoneFutures(done, not_done) if len(done) == len(fs): return DoneAndNotDoneFutures(done, not_done) waiter = _create_and_install_waiters(fs, return_when) waiter.event.wait(timeout) for f in fs: with f._condition: f._waiters.remove(waiter) done.update(waiter.finished_futures) return DoneAndNotDoneFutures(done, set(fs) - done) class Future(object): """Represents the result of an asynchronous computation.""" def __init__(self): """Initializes the future. Should not be called by clients.""" self._condition = threading.Condition() self._state = PENDING self._result = None self._exception = None self._traceback = None self._waiters = [] self._done_callbacks = [] def _invoke_callbacks(self): for callback in self._done_callbacks: try: callback(self) except Exception: LOGGER.exception('exception calling callback for %r', self) except BaseException: # Explicitly let all other new-style exceptions through so # that we can catch all old-style exceptions with a simple # "except:" clause below. # # All old-style exception objects are instances of # types.InstanceType, but "except types.InstanceType:" does # not catch old-style exceptions for some reason. Thus, the # only way to catch all old-style exceptions without catching # any new-style exceptions is to filter out the new-style # exceptions, which all derive from BaseException. raise except: # Because of the BaseException clause above, this handler only # executes for old-style exception objects. LOGGER.exception('exception calling callback for %r', self) def __repr__(self): with self._condition: if self._state == FINISHED: if self._exception: return '<Future at %s state=%s raised %s>' % ( hex(id(self)), _STATE_TO_DESCRIPTION_MAP[self._state], self._exception.__class__.__name__) else: return '<Future at %s state=%s returned %s>' % ( hex(id(self)), _STATE_TO_DESCRIPTION_MAP[self._state], self._result.__class__.__name__) return '<Future at %s state=%s>' % ( hex(id(self)), _STATE_TO_DESCRIPTION_MAP[self._state]) def cancel(self): """Cancel the future if possible. Returns True if the future was cancelled, False otherwise. A future cannot be cancelled if it is running or has already completed. """ with self._condition: if self._state in [RUNNING, FINISHED]: return False if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: return True self._state = CANCELLED self._condition.notify_all() self._invoke_callbacks() return True def cancelled(self): """Return True if the future has cancelled.""" with self._condition: return self._state in [CANCELLED, CANCELLED_AND_NOTIFIED] def running(self): """Return True if the future is currently executing.""" with self._condition: return self._state == RUNNING def done(self): """Return True of the future was cancelled or finished executing.""" with self._condition: return self._state in [CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED] def __get_result(self): if self._exception: if isinstance(self._exception, types.InstanceType): # The exception is an instance of an old-style class, which # means type(self._exception) returns types.ClassType instead # of the exception's actual class type. exception_type = self._exception.__class__ else: exception_type = type(self._exception) raise exception_type, self._exception, self._traceback else: return self._result def add_done_callback(self, fn): """Attaches a callable that will be called when the future finishes. Args: fn: A callable that will be called with this future as its only argument when the future completes or is cancelled. The callable will always be called by a thread in the same process in which it was added. If the future has already completed or been cancelled then the callable will be called immediately. These callables are called in the order that they were added. """ with self._condition: if self._state not in [CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED]: self._done_callbacks.append(fn) return fn(self) def result(self, timeout=None): """Return the result of the call that the future represents. Args: timeout: The number of seconds to wait for the result if the future isn't done. If None, then there is no limit on the wait time. Returns: The result of the call that the future represents. Raises: CancelledError: If the future was cancelled. TimeoutError: If the future didn't finish executing before the given timeout. Exception: If the call raised then that exception will be raised. """ with self._condition: if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: raise CancelledError() elif self._state == FINISHED: return self.__get_result() self._condition.wait(timeout) if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: raise CancelledError() elif self._state == FINISHED: return self.__get_result() else: raise TimeoutError() def exception_info(self, timeout=None): """Return a tuple of (exception, traceback) raised by the call that the future represents. Args: timeout: The number of seconds to wait for the exception if the future isn't done. If None, then there is no limit on the wait time. Returns: The exception raised by the call that the future represents or None if the call completed without raising. Raises: CancelledError: If the future was cancelled. TimeoutError: If the future didn't finish executing before the given timeout. """ with self._condition: if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: raise CancelledError() elif self._state == FINISHED: return self._exception, self._traceback self._condition.wait(timeout) if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: raise CancelledError() elif self._state == FINISHED: return self._exception, self._traceback else: raise TimeoutError() def exception(self, timeout=None): """Return the exception raised by the call that the future represents. Args: timeout: The number of seconds to wait for the exception if the future isn't done. If None, then there is no limit on the wait time. Returns: The exception raised by the call that the future represents or None if the call completed without raising. Raises: CancelledError: If the future was cancelled. TimeoutError: If the future didn't finish executing before the given timeout. """ return self.exception_info(timeout)[0] # The following methods should only be used by Executors and in tests. def set_running_or_notify_cancel(self): """Mark the future as running or process any cancel notifications. Should only be used by Executor implementations and unit tests. If the future has been cancelled (cancel() was called and returned True) then any threads waiting on the future completing (though calls to as_completed() or wait()) are notified and False is returned. If the future was not cancelled then it is put in the running state (future calls to running() will return True) and True is returned. This method should be called by Executor implementations before executing the work associated with this future. If this method returns False then the work should not be executed. Returns: False if the Future was cancelled, True otherwise. Raises: RuntimeError: if this method was already called or if set_result() or set_exception() was called. """ with self._condition: if self._state == CANCELLED: self._state = CANCELLED_AND_NOTIFIED for waiter in self._waiters: waiter.add_cancelled(self) # self._condition.notify_all() is not necessary because # self.cancel() triggers a notification. return False elif self._state == PENDING: self._state = RUNNING return True else: LOGGER.critical('Future %s in unexpected state: %s', id(self), self._state) raise RuntimeError('Future in unexpected state') def set_result(self, result): """Sets the return value of work associated with the future. Should only be used by Executor implementations and unit tests. """ with self._condition: self._result = result self._state = FINISHED for waiter in self._waiters: waiter.add_result(self) self._condition.notify_all() self._invoke_callbacks() def set_exception_info(self, exception, traceback): """Sets the result of the future as being the given exception and traceback. Should only be used by Executor implementations and unit tests. """ with self._condition: self._exception = exception self._traceback = traceback self._state = FINISHED for waiter in self._waiters: waiter.add_exception(self) self._condition.notify_all() self._invoke_callbacks() def set_exception(self, exception): """Sets the result of the future as being the given exception. Should only be used by Executor implementations and unit tests. """ self.set_exception_info(exception, None) class Executor(object): """This is an abstract base class for concrete asynchronous executors.""" def submit(self, fn, *args, **kwargs): """Submits a callable to be executed with the given arguments. Schedules the callable to be executed as fn(*args, **kwargs) and returns a Future instance representing the execution of the callable. Returns: A Future representing the given call. """ raise NotImplementedError() def map(self, fn, *iterables, **kwargs): """Returns a iterator equivalent to map(fn, iter). Args: fn: A callable that will take as many arguments as there are passed iterables. timeout: The maximum number of seconds to wait. If None, then there is no limit on the wait time. Returns: An iterator equivalent to: map(func, *iterables) but the calls may be evaluated out-of-order. Raises: TimeoutError: If the entire result iterator could not be generated before the given timeout. Exception: If fn(*args) raises for any values. """ timeout = kwargs.get('timeout') if timeout is not None: end_time = timeout + time.time() fs = [self.submit(fn, *args) for args in itertools.izip(*iterables)] # Yield must be hidden in closure so that the futures are submitted # before the first iterator value is required. def result_iterator(): try: for future in fs: if timeout is None: yield future.result() else: yield future.result(end_time - time.time()) finally: for future in fs: future.cancel() return result_iterator() def shutdown(self, wait=True): """Clean-up the resources associated with the Executor. It is safe to call this method several times. Otherwise, no other methods can be called after this one. Args: wait: If True then shutdown will not return until all running futures have finished executing and the resources used by the executor have been reclaimed. """ pass def __enter__(self): return self def __exit__(self, exc_type, exc_val, exc_tb): self.shutdown(wait=True) return False
lib
emailer
# The contents of this file are subject to the Common Public Attribution # License Version 1.0. (the "License"); you may not use this file except in # compliance with the License. You may obtain a copy of the License at # http://code.reddit.com/LICENSE. The License is based on the Mozilla Public # License Version 1.1, but Sections 14 and 15 have been added to cover use of # software over a computer network and provide for limited attribution for the # Original Developer. In addition, Exhibit A has been modified to be consistent # with Exhibit B. # # Software distributed under the License is distributed on an "AS IS" basis, # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for # the specific language governing rights and limitations under the License. # # The Original Code is reddit. # # The Original Developer is the Initial Developer. The Initial Developer of # the Original Code is reddit Inc. # # All portions of the code written by reddit are Copyright (c) 2006-2015 reddit # Inc. All Rights Reserved. ############################################################################### import datetime import smtplib import sys import traceback from email import encoders from email.errors import HeaderParseError from email.MIMEBase import MIMEBase from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText import simplejson as json from pylons import app_globals as g from pylons import tmpl_context as c from r2.config import feature from r2.lib import hooks from r2.lib.ratelimit import SimpleRateLimit from r2.lib.utils import timeago from r2.models import Account, Award, Comment, DefaultSR, Email from r2.models.token import EmailVerificationToken, PasswordResetToken trylater_hooks = hooks.HookRegistrar() def _system_email(email, plaintext_body, kind, reply_to="", thing=None, from_address=g.feedback_email, html_body="", list_unsubscribe_header="", user=None, suppress_username=False): """ For sending email from the system to a user (reply address will be feedback and the name will be reddit.com) """ if suppress_username: user = None elif user is None and c.user_is_loggedin: user = c.user Email.handler.add_to_queue(user, email, g.domain, from_address, kind, body=plaintext_body, reply_to=reply_to, thing=thing, ) def _ads_email(body, from_name, kind): """ For sending email to ads """ Email.handler.add_to_queue(None, g.ads_email, from_name, g.ads_email, kind, body=body) def _fraud_email(body, kind): """ For sending email to the fraud mailbox """ Email.handler.add_to_queue(None, g.fraud_email, g.domain, g.fraud_email, kind, body=body) def _community_email(body, kind): """ For sending email to the community mailbox """ Email.handler.add_to_queue(c.user, g.community_email, g.domain, g.community_email, kind, body=body) def verify_email(user, dest=None): """ For verifying an email address """ from r2.lib.pages import VerifyEmail user.email_verified = False user._commit() Award.take_away("verified_email", user) token = EmailVerificationToken._new(user) base = g.https_endpoint or g.origin emaillink = base + '/verification/' + token._id if dest: emaillink += '?dest=%s' % dest g.log.debug("Generated email verification link: " + emaillink) _system_email(user.email, VerifyEmail(user=user, emaillink = emaillink).render(style='email'), Email.Kind.VERIFY_EMAIL) def password_email(user): """ For resetting a user's password. """ from r2.lib.pages import PasswordReset user_reset_ratelimit = SimpleRateLimit( name="email_reset_count_%s" % user._id36, seconds=int(datetime.timedelta(hours=12).total_seconds()), limit=3, ) if not user_reset_ratelimit.record_and_check(): return False global_reset_ratelimit = SimpleRateLimit( name="email_reset_count_global", seconds=int(datetime.timedelta(hours=1).total_seconds()), limit=1000, ) if not global_reset_ratelimit.record_and_check(): raise ValueError("password reset ratelimit exceeded") token = PasswordResetToken._new(user) base = g.https_endpoint or g.origin passlink = base + '/resetpassword/' + token._id g.log.info("Generated password reset link: " + passlink) _system_email(user.email, PasswordReset(user=user, passlink=passlink).render(style='email'), Email.Kind.RESET_PASSWORD, user=user, ) return True @trylater_hooks.on('trylater.message_notification_email') def message_notification_email(data): """Queues a system email for a new message notification.""" from r2.lib.pages import MessageNotificationEmail MAX_EMAILS_PER_DAY = 1000 MESSAGE_THROTTLE_KEY = 'message_notification_emails' # If our counter's expired, initialize it again. g.cache.add(MESSAGE_THROTTLE_KEY, 0, time=24*60*60) for datum in data.itervalues(): datum = json.loads(datum) user = Account._byID36(datum['to'], data=True) comment = Comment._by_fullname(datum['comment'], data=True) # In case a user has enabled the preference while it was enabled for # them, but we've since turned it off. We need to explicitly state the # user because we're not in the context of an HTTP request from them. if not feature.is_enabled('orangereds_as_emails', user=user): continue if g.cache.get(MESSAGE_THROTTLE_KEY) > MAX_EMAILS_PER_DAY: raise Exception( 'Message notification emails: safety limit exceeded!') mac = generate_notification_email_unsubscribe_token( datum['to'], user_email=user.email, user_password_hash=user.password) base = g.https_endpoint or g.origin unsubscribe_link = base + '/mail/unsubscribe/%s/%s' % (datum['to'], mac) templateData = { 'sender_username': datum.get('from', ''), 'comment': comment, 'permalink': datum['permalink'], 'unsubscribe_link': unsubscribe_link, } _system_email(user.email, MessageNotificationEmail(**templateData).render(style='email'), Email.Kind.MESSAGE_NOTIFICATION, from_address=g.notification_email) g.stats.simple_event('email.message_notification.queued') g.cache.incr(MESSAGE_THROTTLE_KEY) def generate_notification_email_unsubscribe_token(user_id36, user_email=None, user_password_hash=None): """Generate a token used for one-click unsubscribe links for notification emails. user_id36: A base36-encoded user id. user_email: The user's email. Looked up if not provided. user_password_hash: The hash of the user's password. Looked up if not provided. """ import hashlib import hmac if (not user_email) or (not user_password_hash): user = Account._byID36(user_id36, data=True) if not user_email: user_email = user.email if not user_password_hash: user_password_hash = user.password return hmac.new( g.secrets['email_notifications'], user_id36 + user_email + user_password_hash, hashlib.sha256).hexdigest() def password_change_email(user): """Queues a system email for a password change notification.""" from r2.lib.pages import PasswordChangeEmail return _system_email(user.email, PasswordChangeEmail(user=user).render(style='email'), Email.Kind.PASSWORD_CHANGE, user=user, ) def email_change_email(user): """Queues a system email for a email change notification.""" from r2.lib.pages import EmailChangeEmail return _system_email(user.email, EmailChangeEmail(user=user).render(style='email'), Email.Kind.EMAIL_CHANGE) def community_email(body, kind): return _community_email(body, kind) def ads_email(body, from_name=g.domain): """Queues an email to the Sales team.""" return _ads_email(body, from_name, Email.Kind.ADS_ALERT) def share(link, emails, from_name = "", reply_to = "", body = ""): """Queues a 'share link' email.""" now = datetime.datetime.now(g.tz) ival = now - timeago(g.new_link_share_delay) date = max(now,link._date + ival) Email.handler.add_to_queue(c.user, emails, from_name, g.share_reply, Email.Kind.SHARE, date = date, body = body, reply_to = reply_to, thing = link) def send_queued_mail(test = False): """sends mail from the mail queue to smtplib for delivery. Also, on successes, empties the mail queue and adds all emails to the sent_mail list.""" from r2.lib.pages import Mail_Opt, Share now = datetime.datetime.now(g.tz) if not c.site: c.site = DefaultSR() clear = False if not test: session = smtplib.SMTP(g.smtp_server) def sendmail(email): try: mimetext = email.to_MIMEText() if mimetext is None: print ("Got None mimetext for email from %r and to %r" % (email.fr_addr, email.to_addr)) if test: print mimetext.as_string() else: session.sendmail(email.fr_addr, email.to_addr, mimetext.as_string()) email.set_sent(rejected = False) # exception happens only for local recipient that doesn't exist except (smtplib.SMTPRecipientsRefused, smtplib.SMTPSenderRefused, UnicodeDecodeError, AttributeError, HeaderParseError): # handle error and print, but don't stall the rest of the queue print "Handled error sending mail (traceback to follow)" traceback.print_exc(file = sys.stdout) email.set_sent(rejected = True) try: for email in Email.get_unsent(now): clear = True should_queue = email.should_queue() # check only on sharing that the mail is invalid if email.kind == Email.Kind.SHARE: if should_queue: email.body = Share(username = email.from_name(), msg_hash = email.msg_hash, link = email.thing, body =email.body).render(style = "email") else: email.set_sent(rejected = True) continue elif email.kind == Email.Kind.OPTOUT: email.body = Mail_Opt(msg_hash = email.msg_hash, leave = True).render(style = "email") elif email.kind == Email.Kind.OPTIN: email.body = Mail_Opt(msg_hash = email.msg_hash, leave = False).render(style = "email") # handle unknown types here elif not email.body: print ("Rejecting email with an empty body from %r and to %r" % (email.fr_addr, email.to_addr)) email.set_sent(rejected = True) continue sendmail(email) finally: if not test: session.quit() # clear is true if anything was found and processed above if clear: Email.handler.clear_queue(now) def opt_out(msg_hash): """Queues an opt-out email (i.e., a confirmation that the email address has been opted out of receiving any future mail)""" email, added = Email.handler.opt_out(msg_hash) if email and added: _system_email(email, "", Email.Kind.OPTOUT) return email, added def opt_in(msg_hash): """Queues an opt-in email (i.e., that the email has been removed from our opt out list)""" email, removed = Email.handler.opt_in(msg_hash) if email and removed: _system_email(email, "", Email.Kind.OPTIN) return email, removed def _promo_email(thing, kind, body = "", **kw): from r2.lib.pages import Promo_Email a = Account._byID(thing.author_id, True) if not a.email: return body = Promo_Email(link = thing, kind = kind, body = body, **kw).render(style = "email") return _system_email(a.email, body, kind, thing = thing, reply_to = g.selfserve_support_email, suppress_username=True) def new_promo(thing): return _promo_email(thing, Email.Kind.NEW_PROMO) def promo_total_budget(thing, total_budget_dollars, start_date): return _promo_email(thing, Email.Kind.BID_PROMO, total_budget_dollars = total_budget_dollars, start_date = start_date) def accept_promo(thing): return _promo_email(thing, Email.Kind.ACCEPT_PROMO) def reject_promo(thing, reason = ""): return _promo_email(thing, Email.Kind.REJECT_PROMO, reason) def edited_live_promo(thing): return _promo_email(thing, Email.Kind.EDITED_LIVE_PROMO) def queue_promo(thing, total_budget_dollars, trans_id): return _promo_email(thing, Email.Kind.QUEUED_PROMO, total_budget_dollars=total_budget_dollars, trans_id = trans_id) def live_promo(thing): return _promo_email(thing, Email.Kind.LIVE_PROMO) def finished_promo(thing): return _promo_email(thing, Email.Kind.FINISHED_PROMO) def refunded_promo(thing): return _promo_email(thing, Email.Kind.REFUNDED_PROMO) def void_payment(thing, campaign, total_budget_dollars, reason): return _promo_email(thing, Email.Kind.VOID_PAYMENT, campaign=campaign, total_budget_dollars=total_budget_dollars, reason=reason) def fraud_alert(body): return _fraud_email(body, Email.Kind.FRAUD_ALERT) def suspicious_payment(user, link): from r2.lib.pages import SuspiciousPaymentEmail body = SuspiciousPaymentEmail(user, link).render(style="email") kind = Email.Kind.SUSPICIOUS_PAYMENT return _fraud_email(body, kind) def send_html_email(to_addr, from_addr, subject, html, subtype="html", attachments=None): from r2.lib.filters import _force_utf8 if not attachments: attachments = [] msg = MIMEMultipart() msg.attach(MIMEText(_force_utf8(html), subtype)) msg["Subject"] = subject msg["From"] = from_addr msg["To"] = to_addr for attachment in attachments: part = MIMEBase('application', "octet-stream") part.set_payload(attachment['contents']) encoders.encode_base64(part) part.add_header('Content-Disposition', 'attachment', filename=attachment['name']) msg.attach(part) session = smtplib.SMTP(g.smtp_server) session.sendmail(from_addr, to_addr, msg.as_string()) session.quit() trylater_hooks.register_all()
pages
trafficpages
# The contents of this file are subject to the Common Public Attribution # License Version 1.0. (the "License"); you may not use this file except in # compliance with the License. You may obtain a copy of the License at # http://code.reddit.com/LICENSE. The License is based on the Mozilla Public # License Version 1.1, but Sections 14 and 15 have been added to cover use of # software over a computer network and provide for limited attribution for the # Original Developer. In addition, Exhibit A has been modified to be consistent # with Exhibit B. # # Software distributed under the License is distributed on an "AS IS" basis, # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for # the specific language governing rights and limitations under the License. # # The Original Code is reddit. # # The Original Developer is the Initial Developer. The Initial Developer of # the Original Code is reddit Inc. # # All portions of the code written by reddit are Copyright (c) 2006-2015 reddit # Inc. All Rights Reserved. ############################################################################### """View models for the traffic statistic pages on reddit.""" import collections import datetime import urllib import babel.core import pytz from babel.dates import format_datetime from babel.numbers import format_currency from pylons import app_globals as g from pylons import request from pylons import tmpl_context as c from pylons.i18n import _ from r2.lib import promote from r2.lib.db.sorts import epoch_seconds from r2.lib.menus import NamedButton, NavButton, NavMenu, PageNameNav, menu from r2.lib.pages.pages import Reddit, TabbedPane, TimeSeriesChart from r2.lib.promote import cost_per_click, cost_per_mille from r2.lib.template_helpers import format_number from r2.lib.utils import Storage, timedelta_by_name, to_date from r2.lib.wrapped import Templated from r2.models import Link, PromoCampaign, Thing, traffic from r2.models.subreddit import Subreddit, _DefaultSR COLORS = Storage( UPVOTE_ORANGE="#ff5700", DOWNVOTE_BLUE="#9494ff", MISCELLANEOUS="#006600" ) class TrafficPage(Reddit): """Base page template for pages rendering traffic graphs.""" extension_handling = False extra_page_classes = ["traffic"] def __init__(self, content): Reddit.__init__(self, title=_("traffic stats"), content=content) def build_toolbars(self): main_buttons = [ NavButton(menu.sitewide, "/"), NamedButton("languages"), NamedButton("adverts"), ] toolbar = [ PageNameNav("nomenu", title=self.title), NavMenu(main_buttons, base_path="/traffic", type="tabmenu"), ] return toolbar class SitewideTrafficPage(TrafficPage): """Base page for sitewide traffic overview.""" extra_page_classes = TrafficPage.extra_page_classes + ["traffic-sitewide"] def __init__(self): TrafficPage.__init__(self, SitewideTraffic()) class LanguageTrafficPage(TrafficPage): """Base page for interface language traffic summaries or details.""" def __init__(self, langcode): if langcode: content = LanguageTraffic(langcode) else: content = LanguageTrafficSummary() TrafficPage.__init__(self, content) class AdvertTrafficPage(TrafficPage): """Base page for advert traffic summaries or details.""" def __init__(self, code): if code: content = AdvertTraffic(code) else: content = AdvertTrafficSummary() TrafficPage.__init__(self, content) class RedditTraffic(Templated): """A generalized content pane for traffic reporting.""" make_period_link = None def __init__(self, place): self.place = place self.traffic_last_modified = traffic.get_traffic_last_modified() self.traffic_lag = datetime.datetime.utcnow() - self.traffic_last_modified self.make_tables() Templated.__init__(self) def make_tables(self): """Create tables to put in the main table area of the page. See the stub implementations below for ways to hook into this process without completely overriding this method. """ self.tables = [] for interval in ("month", "day", "hour"): columns = [ dict( color=COLORS.UPVOTE_ORANGE, title=_("uniques by %s" % interval), shortname=_("uniques"), ), dict( color=COLORS.DOWNVOTE_BLUE, title=_("pageviews by %s" % interval), shortname=_("pageviews"), ), ] data = self.get_data_for_interval(interval, columns) title = _("traffic by %s" % interval) graph = TimeSeriesChart( "traffic-" + interval, title, interval, columns, data, self.traffic_last_modified, classes=["traffic-table"], make_period_link=self.make_period_link, ) self.tables.append(graph) try: self.dow_summary = self.get_dow_summary() except NotImplementedError: self.dow_summary = None else: uniques_total = collections.Counter() pageviews_total = collections.Counter() days_total = collections.Counter() # don't include the latest (likely incomplete) day for date, (uniques, pageviews) in self.dow_summary[1:]: dow = date.weekday() uniques_total[dow] += uniques pageviews_total[dow] += pageviews days_total[dow] += 1 # make a summary of the averages for each day of the week self.dow_summary = [] for dow in xrange(7): day_count = days_total[dow] if day_count: avg_uniques = uniques_total[dow] / day_count avg_pageviews = pageviews_total[dow] / day_count self.dow_summary.append((dow, (avg_uniques, avg_pageviews))) else: self.dow_summary.append((dow, (0, 0))) # calculate the averages for *any* day of the week mean_uniques = sum(r[1][0] for r in self.dow_summary) / 7.0 mean_pageviews = sum(r[1][1] for r in self.dow_summary) / 7.0 self.dow_means = (round(mean_uniques), round(mean_pageviews)) def get_dow_summary(self): """Return day-interval data to be aggregated by day of week. If implemented, a summary table will be shown on the traffic page with the average per day of week over the data interval given. """ raise NotImplementedError() def get_data_for_interval(self, interval, columns): """Return data for the main overview at the interval given. This data will be shown as a set of graphs at the top of the page and a table for monthly and daily data (hourly is present but hidden by default.) """ raise NotImplementedError() def make_subreddit_traffic_report(subreddits=None, num=None): """Return a report of subreddit traffic in the last full month. If given a list of subreddits, those subreddits will be put in the report otherwise the top subreddits by pageviews will be automatically chosen. """ if subreddits: subreddit_summary = traffic.PageviewsBySubreddit.last_month(subreddits) else: subreddit_summary = traffic.PageviewsBySubreddit.top_last_month(num) report = [] for srname, data in subreddit_summary: if srname == _DefaultSR.name: name = _("[frontpage]") url = None elif srname in Subreddit._specials: name = "[%s]" % srname url = None else: name = "/r/%s" % srname url = name + "/about/traffic" report.append(((name, url), data)) return report class SitewideTraffic(RedditTraffic): """An overview of all traffic to the site.""" def __init__(self): self.subreddit_summary = make_subreddit_traffic_report(num=250) RedditTraffic.__init__(self, g.domain) def get_dow_summary(self): return traffic.SitewidePageviews.history("day") def get_data_for_interval(self, interval, columns): return traffic.SitewidePageviews.history(interval) class LanguageTrafficSummary(Templated): """An overview of traffic by interface language on the site.""" def __init__(self): # convert language codes to real names language_summary = traffic.PageviewsByLanguage.top_last_month() locale = c.locale self.language_summary = [] for language_code, data in language_summary: name = LanguageTraffic.get_language_name(language_code, locale) self.language_summary.append(((language_code, name), data)) Templated.__init__(self) class AdvertTrafficSummary(RedditTraffic): """An overview of traffic for all adverts on the site.""" def __init__(self): RedditTraffic.__init__(self, _("adverts")) def make_tables(self): # overall promoted link traffic impressions = traffic.AdImpressionsByCodename.historical_totals("day") clicks = traffic.ClickthroughsByCodename.historical_totals("day") data = traffic.zip_timeseries(impressions, clicks) columns = [ dict( color=COLORS.UPVOTE_ORANGE, title=_("total impressions by day"), shortname=_("impressions"), ), dict( color=COLORS.DOWNVOTE_BLUE, title=_("total clicks by day"), shortname=_("clicks"), ), ] self.totals = TimeSeriesChart( "traffic-ad-totals", _("ad totals"), "day", columns, data, self.traffic_last_modified, classes=["traffic-table"], ) # get summary of top ads advert_summary = traffic.AdImpressionsByCodename.top_last_month() things = AdvertTrafficSummary.get_things(ad for ad, data in advert_summary) self.advert_summary = [] for id, data in advert_summary: name = AdvertTrafficSummary.get_ad_name(id, things=things) url = AdvertTrafficSummary.get_ad_url(id, things=things) self.advert_summary.append(((name, url), data)) @staticmethod def split_codename(codename): """Codenames can be "fullname_campaign". Rend the parts asunder.""" split_code = codename.split("_") fullname = "_".join(split_code[:2]) campaign = "_".join(split_code[2:]) return fullname, campaign @staticmethod def get_things(codes): """Fetch relevant things for a list of ad codenames in batch.""" fullnames = [ AdvertTrafficSummary.split_codename(code)[0] for code in codes if code.startswith(Thing._type_prefix) ] return Thing._by_fullname(fullnames, data=True, return_dict=True) @staticmethod def get_sr_name(name): """Return the display name for a subreddit.""" if name == g.default_sr: return _("frontpage") else: return "/r/" + name @staticmethod def get_ad_name(code, things=None): """Return a human-readable name for an ad given its codename. Optionally, a dictionary of things can be passed in so lookups can be done in batch upstream. """ if not things: things = AdvertTrafficSummary.get_things([code]) thing = things.get(code) campaign = None # if it's not at first a thing, see if it's a thing with campaign # appended to it. if not thing: fullname, campaign = AdvertTrafficSummary.split_codename(code) thing = things.get(fullname) if not thing: if code.startswith("dart_"): srname = code.split("_", 1)[1] srname = AdvertTrafficSummary.get_sr_name(srname) return "DART: " + srname else: return code elif isinstance(thing, Link): return "Link: " + thing.title elif isinstance(thing, Subreddit): srname = AdvertTrafficSummary.get_sr_name(thing.name) name = "300x100: " + srname if campaign: name += " (%s)" % campaign return name @staticmethod def get_ad_url(code, things): """Given a codename, return the canonical URL for its traffic page.""" thing = things.get(code) if isinstance(thing, Link): return "/traffic/%s" % thing._id36 return "/traffic/adverts/%s" % code class LanguageTraffic(RedditTraffic): def __init__(self, langcode): self.langcode = langcode name = LanguageTraffic.get_language_name(langcode) RedditTraffic.__init__(self, name) def get_data_for_interval(self, interval, columns): return traffic.PageviewsByLanguage.history(interval, self.langcode) @staticmethod def get_language_name(language_code, locale=None): if not locale: locale = c.locale try: lang_locale = babel.core.Locale.parse(language_code, sep="-") except (babel.core.UnknownLocaleError, ValueError): return language_code else: return lang_locale.get_display_name(locale) class AdvertTraffic(RedditTraffic): def __init__(self, code): self.code = code name = AdvertTrafficSummary.get_ad_name(code) RedditTraffic.__init__(self, name) def get_data_for_interval(self, interval, columns): columns[1]["title"] = _("impressions by %s" % interval) columns[1]["shortname"] = _("impressions") columns += [ dict(shortname=_("unique clicks")), dict( color=COLORS.MISCELLANEOUS, title=_("clicks by %s" % interval), shortname=_("total clicks"), ), ] imps = traffic.AdImpressionsByCodename.history(interval, self.code) clicks = traffic.ClickthroughsByCodename.history(interval, self.code) return traffic.zip_timeseries(imps, clicks) class SubredditTraffic(RedditTraffic): def __init__(self): RedditTraffic.__init__(self, "/r/" + c.site.name) if c.user_is_sponsor: fullname = c.site._fullname codes = traffic.AdImpressionsByCodename.recent_codenames(fullname) self.codenames = [ (code, AdvertTrafficSummary.split_codename(code)[1]) for code in codes ] @staticmethod def make_period_link(interval, date): date = date.replace(tzinfo=g.tz) # won't be necessary after tz fixup if interval == "month": if date.month != 12: end = date.replace(month=date.month + 1) else: end = date.replace(month=1, year=date.year + 1) else: end = date + timedelta_by_name(interval) query = urllib.urlencode( { "syntax": "cloudsearch", "restrict_sr": "on", "sort": "top", "q": "timestamp:{:d}..{:d}".format( int(epoch_seconds(date)), int(epoch_seconds(end)) ), } ) return "/r/%s/search?%s" % (c.site.name, query) def get_dow_summary(self): return traffic.PageviewsBySubreddit.history("day", c.site.name) def get_data_for_interval(self, interval, columns): pageviews = traffic.PageviewsBySubreddit.history(interval, c.site.name) if interval == "day": columns.append( dict( color=COLORS.MISCELLANEOUS, title=_("subscriptions by day"), shortname=_("subscriptions"), ) ) sr_name = c.site.name subscriptions = traffic.SubscriptionsBySubreddit.history(interval, sr_name) return traffic.zip_timeseries(pageviews, subscriptions) else: return pageviews def _clickthrough_rate(impressions, clicks): """Return the click-through rate percentage.""" if impressions: return (float(clicks) / impressions) * 100.0 else: return 0 def _is_promo_preliminary(end_date): """Return if results are preliminary for this promotion. Results are preliminary until 1 day after the promotion ends. """ now = datetime.datetime.now(g.tz) return end_date + datetime.timedelta(days=1) > now def get_promo_traffic(thing, start, end): """Get traffic for a Promoted Link or PromoCampaign""" if isinstance(thing, Link): imp_fn = traffic.AdImpressionsByCodename.promotion_history click_fn = traffic.ClickthroughsByCodename.promotion_history elif isinstance(thing, PromoCampaign): imp_fn = traffic.TargetedImpressionsByCodename.promotion_history click_fn = traffic.TargetedClickthroughsByCodename.promotion_history imps = imp_fn(thing._fullname, start.replace(tzinfo=None), end.replace(tzinfo=None)) clicks = click_fn( thing._fullname, start.replace(tzinfo=None), end.replace(tzinfo=None) ) if imps and not clicks: clicks = [(imps[0][0], (0,))] elif clicks and not imps: imps = [(clicks[0][0], (0,))] history = traffic.zip_timeseries(imps, clicks, order="ascending") return history def get_billable_traffic(campaign): """Get traffic for dates when PromoCampaign is active.""" start, end = promote.get_traffic_dates(campaign) return get_promo_traffic(campaign, start, end) def is_early_campaign(campaign): # traffic by campaign was only recorded starting 2012/9/12 return campaign.end_date < datetime.datetime(2012, 9, 12, 0, 0, tzinfo=g.tz) def is_launched_campaign(campaign): now = datetime.datetime.now(g.tz).date() return promote.charged_or_not_needed(campaign) and campaign.start_date.date() <= now class PromotedLinkTraffic(Templated): def __init__(self, thing, campaign, before, after): self.thing = thing self.campaign = campaign self.before = before self.after = after self.period = datetime.timedelta(days=7) self.prev = None self.next = None self.has_live_campaign = False self.has_early_campaign = False self.detail_name = ( "campaign %s" % campaign._id36 if campaign else "all campaigns" ) editable = c.user_is_sponsor or c.user._id == thing.author_id self.traffic_last_modified = traffic.get_traffic_last_modified() self.traffic_lag = datetime.datetime.utcnow() - self.traffic_last_modified self.make_hourly_table(campaign or thing) self.make_campaign_table() Templated.__init__(self) @classmethod def make_campaign_table_row( cls, id, start, end, target, location, budget_dollars, spent, paid_impressions, impressions, clicks, is_live, is_active, url, is_total, ): if impressions: cpm = format_currency( promote.cost_per_mille(spent, impressions), "USD", locale=c.locale ) else: cpm = "---" if clicks: cpc = format_currency( promote.cost_per_click(spent, clicks), "USD", locale=c.locale ) ctr = format_number(_clickthrough_rate(impressions, clicks)) else: cpc = "---" ctr = "---" return { "id": id, "start": start, "end": end, "target": target, "location": location, "budget": format_currency(budget_dollars, "USD", locale=c.locale), "spent": format_currency(spent, "USD", locale=c.locale), "impressions_purchased": format_number(paid_impressions), "impressions_delivered": format_number(impressions), "cpm": cpm, "clicks": format_number(clicks), "cpc": cpc, "ctr": ctr, "live": is_live, "active": is_active, "url": url, "csv": url + ".csv", "total": is_total, } def make_campaign_table(self): campaigns = PromoCampaign._by_link(self.thing._id) total_budget_dollars = 0.0 total_spent = 0 total_paid_impressions = 0 total_impressions = 0 total_clicks = 0 self.campaign_table = [] for camp in campaigns: if not is_launched_campaign(camp): continue is_live = camp.is_live_now() self.has_early_campaign |= is_early_campaign(camp) self.has_live_campaign |= is_live history = get_billable_traffic(camp) impressions, clicks = 0, 0 for date, (imp, click) in history: impressions += imp clicks += click start = to_date(camp.start_date).strftime("%Y-%m-%d") end = to_date(camp.end_date).strftime("%Y-%m-%d") target = camp.target.pretty_name location = camp.location_str spent = promote.get_spent_amount(camp) is_active = self.campaign and self.campaign._id36 == camp._id36 url = "/traffic/%s/%s" % (self.thing._id36, camp._id36) is_total = False campaign_budget_dollars = camp.total_budget_dollars row = self.make_campaign_table_row( camp._id36, start=start, end=end, target=target, location=location, budget_dollars=campaign_budget_dollars, spent=spent, paid_impressions=camp.impressions, impressions=impressions, clicks=clicks, is_live=is_live, is_active=is_active, url=url, is_total=is_total, ) self.campaign_table.append(row) total_budget_dollars += campaign_budget_dollars total_spent += spent total_paid_impressions += camp.impressions total_impressions += impressions total_clicks += clicks # total row start = "---" end = "---" target = "---" location = "---" is_live = False is_active = not self.campaign url = "/traffic/%s" % self.thing._id36 is_total = True row = self.make_campaign_table_row( _("total"), start=start, end=end, target=target, location=location, budget_dollars=total_budget_dollars, spent=total_spent, paid_impressions=total_paid_impressions, impressions=total_impressions, clicks=total_clicks, is_live=is_live, is_active=is_active, url=url, is_total=is_total, ) self.campaign_table.append(row) def check_dates(self, thing): """Shorten range for display and add next/prev buttons.""" start, end = promote.get_traffic_dates(thing) # Check date of latest traffic (campaigns can end early). history = list(get_promo_traffic(thing, start, end)) if history: end = max(date for date, data in history) end = end.replace(tzinfo=g.tz) # get_promo_traffic returns tz naive # datetimes but is actually g.tz if self.period: display_start = self.after display_end = self.before if not display_start and not display_end: display_end = end display_start = end - self.period elif not display_end: display_end = display_start + self.period elif not display_start: display_start = display_end - self.period if display_start > start: p = request.GET.copy() p.update( { "after": None, "before": display_start.strftime("%Y%m%d%H"), } ) self.prev = "%s?%s" % (request.path, urllib.urlencode(p)) else: display_start = start if display_end < end: p = request.GET.copy() p.update( { "after": display_end.strftime("%Y%m%d%H"), "before": None, } ) self.next = "%s?%s" % (request.path, urllib.urlencode(p)) else: display_end = end else: display_start, display_end = start, end return display_start, display_end @classmethod def get_hourly_traffic(cls, thing, start, end): """Retrieve hourly traffic for a Promoted Link or PromoCampaign.""" history = get_promo_traffic(thing, start, end) computed_history = [] for date, data in history: imps, clicks = data ctr = _clickthrough_rate(imps, clicks) date = date.replace(tzinfo=pytz.utc) date = date.astimezone(pytz.timezone("EST")) datestr = format_datetime( date, locale=c.locale, format="yyyy-MM-dd HH:mm zzz", ) computed_history.append((date, datestr, data + (ctr,))) return computed_history def make_hourly_table(self, thing): start, end = self.check_dates(thing) self.history = self.get_hourly_traffic(thing, start, end) self.total_impressions, self.total_clicks = 0, 0 for date, datestr, data in self.history: imps, clicks, ctr = data self.total_impressions += imps self.total_clicks += clicks if self.total_impressions > 0: self.total_ctr = _clickthrough_rate( self.total_impressions, self.total_clicks ) # XXX: _is_promo_preliminary correctly expects tz-aware datetimes # because it's also used with datetimes from promo code. this hack # relies on the fact that we're storing UTC w/o timezone info. # TODO: remove this when traffic is correctly using timezones. end_aware = end.replace(tzinfo=g.tz) self.is_preliminary = _is_promo_preliminary(end_aware) @classmethod def as_csv(cls, thing): """Return the traffic data in CSV format for reports.""" import csv import cStringIO start, end = promote.get_traffic_dates(thing) history = cls.get_hourly_traffic(thing, start, end) out = cStringIO.StringIO() writer = csv.writer(out) writer.writerow( ( _("date and time (UTC)"), _("impressions"), _("clicks"), _("click-through rate (%)"), ) ) for date, datestr, values in history: # flatten (date, datestr, value-tuple) to (date, value1, value2...) writer.writerow((date,) + values) return out.getvalue() class SubredditTrafficReport(Templated): def __init__(self): self.srs, self.invalid_srs, self.report = [], [], [] self.textarea = request.params.get("subreddits") if self.textarea: requested_srs = [srname.strip() for srname in self.textarea.splitlines()] subreddits = Subreddit._by_name(requested_srs) for srname in requested_srs: if srname in subreddits: self.srs.append(srname) else: self.invalid_srs.append(srname) if subreddits: self.report = make_subreddit_traffic_report(subreddits.values()) param = urllib.quote(self.textarea) self.csv_url = "/traffic/subreddits/report.csv?subreddits=" + param Templated.__init__(self) def as_csv(self): """Return the traffic data in CSV format for reports.""" import csv import cStringIO out = cStringIO.StringIO() writer = csv.writer(out) writer.writerow((_("subreddit"), _("uniques"), _("pageviews"))) for (name, url), (uniques, pageviews) in self.report: writer.writerow((name, uniques, pageviews)) return out.getvalue()
versions
2bceb2cb4d7c_add_comment_count_to_torrent
"""Add comment_count to Torrent Revision ID: 2bceb2cb4d7c Revises: d0eeb8049623 Create Date: 2017-05-26 15:07:21.114331 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = "2bceb2cb4d7c" down_revision = "d0eeb8049623" branch_labels = None depends_on = None COMMENT_UPDATE_SQL = """UPDATE {0}_torrents SET comment_count = ( SELECT COUNT(*) FROM {0}_comments WHERE {0}_torrents.id = {0}_comments.torrent_id );""" def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column( "nyaa_torrents", sa.Column("comment_count", sa.Integer(), nullable=False) ) op.create_index( op.f("ix_nyaa_torrents_comment_count"), "nyaa_torrents", ["comment_count"], unique=False, ) op.add_column( "sukebei_torrents", sa.Column("comment_count", sa.Integer(), nullable=False) ) op.create_index( op.f("ix_sukebei_torrents_comment_count"), "sukebei_torrents", ["comment_count"], unique=False, ) # ### end Alembic commands ### connection = op.get_bind() print("Updating comment counts on nyaa_torrents...") connection.execute(sa.sql.text(COMMENT_UPDATE_SQL.format("nyaa"))) print("Done.") print("Updating comment counts on sukebei_torrents...") connection.execute(sa.sql.text(COMMENT_UPDATE_SQL.format("sukebei"))) print("Done.") def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.drop_index(op.f("ix_nyaa_torrents_comment_count"), table_name="nyaa_torrents") op.drop_column("nyaa_torrents", "comment_count") op.drop_index( op.f("ix_sukebei_torrents_comment_count"), table_name="sukebei_torrents" ) op.drop_column("sukebei_torrents", "comment_count") # ### end Alembic commands ###
filters
curve
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com thumbor@googlegroups.com import ast from thumbor.ext.filters import _curve from thumbor.filters import BaseFilter, filter_method # pylint: disable=line-too-long class Filter(BaseFilter): """ Usage: /filters:curve(<curve of all channels>, <curve of R>, <curve o f G>, <curve of B>) Format of each curve : [(x1,y1),(x2,y2),...] Examples of use: /filters:curve([(0,0),(40,59),(255,255)],[(32,59),(64,80),(92,111),(128,153),(140,169),(164,201),(192,214),(224,215),(240,214),(255,212)],[(34,41),(64,51),(92,76),(128,112),(140,124),(164,147),(192,180),(224,216),(240,236),(255,255)],[(40,46),(64,55),(92,83),(128,127),(140,144),(164,174),(192,197),(224,199),(240,197),(255,198)])/ /filters:curve([(0,0),(255,255)],[(0,50),(16,51),(32,69),(58,85),(92,120),(128,170),(140,186),(167,225),(192,245),(225,255),(244,255),(255,254)],[(0,0),(16,2),(32,18),(64,59),(92,116),(128,182),(167,211),(192,227),(224,240),(244,247),(255,252)],[(0,48),(16,50),(62,77),(92,110),(128,144),(140,153),(167,180),(192,192),(224,217),(244,225),(255,225)])/ """ # NOQA regex = r"\[(?:\(\d+,\d+\),?)*\]" @filter_method(regex, regex, regex, regex) async def curve(self, alpha, red, green, blue): mode, data = self.engine.image_data_as_rgb() imgdata = _curve.apply( mode, data, tuple(ast.literal_eval(alpha)), tuple(ast.literal_eval(red)), tuple(ast.literal_eval(green)), tuple(ast.literal_eval(blue)), ) self.engine.set_image_data(imgdata)
utils
html5_entities
entity_map = { "AElig": "\xc6", "AMP": "&", "Aacute": "\xc1", "Abreve": "\u0102", "Acirc": "\xc2", "Acy": "\u0410", "Afr": "\U0001d504", "Agrave": "\xc0", "Alpha": "\u0391", "Amacr": "\u0100", "And": "\u2a53", "Aogon": "\u0104", "Aopf": "\U0001d538", "ApplyFunction": "\u2061", "Aring": "\xc5", "Ascr": "\U0001d49c", "Assign": "\u2254", "Atilde": "\xc3", "Auml": "\xc4", "Backslash": "\u2216", "Barv": "\u2ae7", "Barwed": "\u2306", "Bcy": "\u0411", "Because": "\u2235", "Bernoullis": "\u212c", "Beta": "\u0392", "Bfr": "\U0001d505", "Bopf": "\U0001d539", "Breve": "\u02d8", "Bscr": "\u212c", "Bumpeq": "\u224e", "CHcy": "\u0427", "COPY": "\xa9", "Cacute": "\u0106", "Cap": "\u22d2", "CapitalDifferentialD": "\u2145", "Cayleys": "\u212d", "Ccaron": "\u010c", "Ccedil": "\xc7", "Ccirc": "\u0108", "Cconint": "\u2230", "Cdot": "\u010a", "Cedilla": "\xb8", "CenterDot": "\xb7", "Cfr": "\u212d", "Chi": "\u03a7", "CircleDot": "\u2299", "CircleMinus": "\u2296", "CirclePlus": "\u2295", "CircleTimes": "\u2297", "ClockwiseContourIntegral": "\u2232", "CloseCurlyDoubleQuote": "\u201d", "CloseCurlyQuote": "\u2019", "Colon": "\u2237", "Colone": "\u2a74", "Congruent": "\u2261", "Conint": "\u222f", "ContourIntegral": "\u222e", "Copf": "\u2102", "Coproduct": "\u2210", "CounterClockwiseContourIntegral": "\u2233", "Cross": "\u2a2f", "Cscr": "\U0001d49e", "Cup": "\u22d3", "CupCap": "\u224d", "DD": "\u2145", "DDotrahd": "\u2911", "DJcy": "\u0402", "DScy": "\u0405", "DZcy": "\u040f", "Dagger": "\u2021", "Darr": "\u21a1", "Dashv": "\u2ae4", "Dcaron": "\u010e", "Dcy": "\u0414", "Del": "\u2207", "Delta": "\u0394", "Dfr": "\U0001d507", "DiacriticalAcute": "\xb4", "DiacriticalDot": "\u02d9", "DiacriticalDoubleAcute": "\u02dd", "DiacriticalGrave": "`", "DiacriticalTilde": "\u02dc", "Diamond": "\u22c4", "DifferentialD": "\u2146", "Dopf": "\U0001d53b", "Dot": "\xa8", "DotDot": "\u20dc", "DotEqual": "\u2250", "DoubleContourIntegral": "\u222f", "DoubleDot": "\xa8", "DoubleDownArrow": "\u21d3", "DoubleLeftArrow": "\u21d0", "DoubleLeftRightArrow": "\u21d4", "DoubleLeftTee": "\u2ae4", "DoubleLongLeftArrow": "\u27f8", "DoubleLongLeftRightArrow": "\u27fa", "DoubleLongRightArrow": "\u27f9", "DoubleRightArrow": "\u21d2", "DoubleRightTee": "\u22a8", "DoubleUpArrow": "\u21d1", "DoubleUpDownArrow": "\u21d5", "DoubleVerticalBar": "\u2225", "DownArrow": "\u2193", "DownArrowBar": "\u2913", "DownArrowUpArrow": "\u21f5", "DownBreve": "\u0311", "DownLeftRightVector": "\u2950", "DownLeftTeeVector": "\u295e", "DownLeftVector": "\u21bd", "DownLeftVectorBar": "\u2956", "DownRightTeeVector": "\u295f", "DownRightVector": "\u21c1", "DownRightVectorBar": "\u2957", "DownTee": "\u22a4", "DownTeeArrow": "\u21a7", "Downarrow": "\u21d3", "Dscr": "\U0001d49f", "Dstrok": "\u0110", "ENG": "\u014a", "ETH": "\xd0", "Eacute": "\xc9", "Ecaron": "\u011a", "Ecirc": "\xca", "Ecy": "\u042d", "Edot": "\u0116", "Efr": "\U0001d508", "Egrave": "\xc8", "Element": "\u2208", "Emacr": "\u0112", "EmptySmallSquare": "\u25fb", "EmptyVerySmallSquare": "\u25ab", "Eogon": "\u0118", "Eopf": "\U0001d53c", "Epsilon": "\u0395", "Equal": "\u2a75", "EqualTilde": "\u2242", "Equilibrium": "\u21cc", "Escr": "\u2130", "Esim": "\u2a73", "Eta": "\u0397", "Euml": "\xcb", "Exists": "\u2203", "ExponentialE": "\u2147", "Fcy": "\u0424", "Ffr": "\U0001d509", "FilledSmallSquare": "\u25fc", "FilledVerySmallSquare": "\u25aa", "Fopf": "\U0001d53d", "ForAll": "\u2200", "Fouriertrf": "\u2131", "Fscr": "\u2131", "GJcy": "\u0403", "GT": ">", "Gamma": "\u0393", "Gammad": "\u03dc", "Gbreve": "\u011e", "Gcedil": "\u0122", "Gcirc": "\u011c", "Gcy": "\u0413", "Gdot": "\u0120", "Gfr": "\U0001d50a", "Gg": "\u22d9", "Gopf": "\U0001d53e", "GreaterEqual": "\u2265", "GreaterEqualLess": "\u22db", "GreaterFullEqual": "\u2267", "GreaterGreater": "\u2aa2", "GreaterLess": "\u2277", "GreaterSlantEqual": "\u2a7e", "GreaterTilde": "\u2273", "Gscr": "\U0001d4a2", "Gt": "\u226b", "HARDcy": "\u042a", "Hacek": "\u02c7", "Hat": "^", "Hcirc": "\u0124", "Hfr": "\u210c", "HilbertSpace": "\u210b", "Hopf": "\u210d", "HorizontalLine": "\u2500", "Hscr": "\u210b", "Hstrok": "\u0126", "HumpDownHump": "\u224e", "HumpEqual": "\u224f", "IEcy": "\u0415", "IJlig": "\u0132", "IOcy": "\u0401", "Iacute": "\xcd", "Icirc": "\xce", "Icy": "\u0418", "Idot": "\u0130", "Ifr": "\u2111", "Igrave": "\xcc", "Im": "\u2111", "Imacr": "\u012a", "ImaginaryI": "\u2148", "Implies": "\u21d2", "Int": "\u222c", "Integral": "\u222b", "Intersection": "\u22c2", "InvisibleComma": "\u2063", "InvisibleTimes": "\u2062", "Iogon": "\u012e", "Iopf": "\U0001d540", "Iota": "\u0399", "Iscr": "\u2110", "Itilde": "\u0128", "Iukcy": "\u0406", "Iuml": "\xcf", "Jcirc": "\u0134", "Jcy": "\u0419", "Jfr": "\U0001d50d", "Jopf": "\U0001d541", "Jscr": "\U0001d4a5", "Jsercy": "\u0408", "Jukcy": "\u0404", "KHcy": "\u0425", "KJcy": "\u040c", "Kappa": "\u039a", "Kcedil": "\u0136", "Kcy": "\u041a", "Kfr": "\U0001d50e", "Kopf": "\U0001d542", "Kscr": "\U0001d4a6", "LJcy": "\u0409", "LT": "<", "Lacute": "\u0139", "Lambda": "\u039b", "Lang": "\u27ea", "Laplacetrf": "\u2112", "Larr": "\u219e", "Lcaron": "\u013d", "Lcedil": "\u013b", "Lcy": "\u041b", "LeftAngleBracket": "\u27e8", "LeftArrow": "\u2190", "LeftArrowBar": "\u21e4", "LeftArrowRightArrow": "\u21c6", "LeftCeiling": "\u2308", "LeftDoubleBracket": "\u27e6", "LeftDownTeeVector": "\u2961", "LeftDownVector": "\u21c3", "LeftDownVectorBar": "\u2959", "LeftFloor": "\u230a", "LeftRightArrow": "\u2194", "LeftRightVector": "\u294e", "LeftTee": "\u22a3", "LeftTeeArrow": "\u21a4", "LeftTeeVector": "\u295a", "LeftTriangle": "\u22b2", "LeftTriangleBar": "\u29cf", "LeftTriangleEqual": "\u22b4", "LeftUpDownVector": "\u2951", "LeftUpTeeVector": "\u2960", "LeftUpVector": "\u21bf", "LeftUpVectorBar": "\u2958", "LeftVector": "\u21bc", "LeftVectorBar": "\u2952", "Leftarrow": "\u21d0", "Leftrightarrow": "\u21d4", "LessEqualGreater": "\u22da", "LessFullEqual": "\u2266", "LessGreater": "\u2276", "LessLess": "\u2aa1", "LessSlantEqual": "\u2a7d", "LessTilde": "\u2272", "Lfr": "\U0001d50f", "Ll": "\u22d8", "Lleftarrow": "\u21da", "Lmidot": "\u013f", "LongLeftArrow": "\u27f5", "LongLeftRightArrow": "\u27f7", "LongRightArrow": "\u27f6", "Longleftarrow": "\u27f8", "Longleftrightarrow": "\u27fa", "Longrightarrow": "\u27f9", "Lopf": "\U0001d543", "LowerLeftArrow": "\u2199", "LowerRightArrow": "\u2198", "Lscr": "\u2112", "Lsh": "\u21b0", "Lstrok": "\u0141", "Lt": "\u226a", "Map": "\u2905", "Mcy": "\u041c", "MediumSpace": "\u205f", "Mellintrf": "\u2133", "Mfr": "\U0001d510", "MinusPlus": "\u2213", "Mopf": "\U0001d544", "Mscr": "\u2133", "Mu": "\u039c", "NJcy": "\u040a", "Nacute": "\u0143", "Ncaron": "\u0147", "Ncedil": "\u0145", "Ncy": "\u041d", "NegativeMediumSpace": "\u200b", "NegativeThickSpace": "\u200b", "NegativeThinSpace": "\u200b", "NegativeVeryThinSpace": "\u200b", "NestedGreaterGreater": "\u226b", "NestedLessLess": "\u226a", "NewLine": "\n", "Nfr": "\U0001d511", "NoBreak": "\u2060", "NonBreakingSpace": "\xa0", "Nopf": "\u2115", "Not": "\u2aec", "NotCongruent": "\u2262", "NotCupCap": "\u226d", "NotDoubleVerticalBar": "\u2226", "NotElement": "\u2209", "NotEqual": "\u2260", "NotEqualTilde": "\u2242\u0338", "NotExists": "\u2204", "NotGreater": "\u226f", "NotGreaterEqual": "\u2271", "NotGreaterFullEqual": "\u2267\u0338", "NotGreaterGreater": "\u226b\u0338", "NotGreaterLess": "\u2279", "NotGreaterSlantEqual": "\u2a7e\u0338", "NotGreaterTilde": "\u2275", "NotHumpDownHump": "\u224e\u0338", "NotHumpEqual": "\u224f\u0338", "NotLeftTriangle": "\u22ea", "NotLeftTriangleBar": "\u29cf\u0338", "NotLeftTriangleEqual": "\u22ec", "NotLess": "\u226e", "NotLessEqual": "\u2270", "NotLessGreater": "\u2278", "NotLessLess": "\u226a\u0338", "NotLessSlantEqual": "\u2a7d\u0338", "NotLessTilde": "\u2274", "NotNestedGreaterGreater": "\u2aa2\u0338", "NotNestedLessLess": "\u2aa1\u0338", "NotPrecedes": "\u2280", "NotPrecedesEqual": "\u2aaf\u0338", "NotPrecedesSlantEqual": "\u22e0", "NotReverseElement": "\u220c", "NotRightTriangle": "\u22eb", "NotRightTriangleBar": "\u29d0\u0338", "NotRightTriangleEqual": "\u22ed", "NotSquareSubset": "\u228f\u0338", "NotSquareSubsetEqual": "\u22e2", "NotSquareSuperset": "\u2290\u0338", "NotSquareSupersetEqual": "\u22e3", "NotSubset": "\u2282\u20d2", "NotSubsetEqual": "\u2288", "NotSucceeds": "\u2281", "NotSucceedsEqual": "\u2ab0\u0338", "NotSucceedsSlantEqual": "\u22e1", "NotSucceedsTilde": "\u227f\u0338", "NotSuperset": "\u2283\u20d2", "NotSupersetEqual": "\u2289", "NotTilde": "\u2241", "NotTildeEqual": "\u2244", "NotTildeFullEqual": "\u2247", "NotTildeTilde": "\u2249", "NotVerticalBar": "\u2224", "Nscr": "\U0001d4a9", "Ntilde": "\xd1", "Nu": "\u039d", "OElig": "\u0152", "Oacute": "\xd3", "Ocirc": "\xd4", "Ocy": "\u041e", "Odblac": "\u0150", "Ofr": "\U0001d512", "Ograve": "\xd2", "Omacr": "\u014c", "Omega": "\u03a9", "Omicron": "\u039f", "Oopf": "\U0001d546", "OpenCurlyDoubleQuote": "\u201c", "OpenCurlyQuote": "\u2018", "Or": "\u2a54", "Oscr": "\U0001d4aa", "Oslash": "\xd8", "Otilde": "\xd5", "Otimes": "\u2a37", "Ouml": "\xd6", "OverBar": "\u203e", "OverBrace": "\u23de", "OverBracket": "\u23b4", "OverParenthesis": "\u23dc", "PartialD": "\u2202", "Pcy": "\u041f", "Pfr": "\U0001d513", "Phi": "\u03a6", "Pi": "\u03a0", "PlusMinus": "\xb1", "Poincareplane": "\u210c", "Popf": "\u2119", "Pr": "\u2abb", "Precedes": "\u227a", "PrecedesEqual": "\u2aaf", "PrecedesSlantEqual": "\u227c", "PrecedesTilde": "\u227e", "Prime": "\u2033", "Product": "\u220f", "Proportion": "\u2237", "Proportional": "\u221d", "Pscr": "\U0001d4ab", "Psi": "\u03a8", "QUOT": '"', "Qfr": "\U0001d514", "Qopf": "\u211a", "Qscr": "\U0001d4ac", "RBarr": "\u2910", "REG": "\xae", "Racute": "\u0154", "Rang": "\u27eb", "Rarr": "\u21a0", "Rarrtl": "\u2916", "Rcaron": "\u0158", "Rcedil": "\u0156", "Rcy": "\u0420", "Re": "\u211c", "ReverseElement": "\u220b", "ReverseEquilibrium": "\u21cb", "ReverseUpEquilibrium": "\u296f", "Rfr": "\u211c", "Rho": "\u03a1", "RightAngleBracket": "\u27e9", "RightArrow": "\u2192", "RightArrowBar": "\u21e5", "RightArrowLeftArrow": "\u21c4", "RightCeiling": "\u2309", "RightDoubleBracket": "\u27e7", "RightDownTeeVector": "\u295d", "RightDownVector": "\u21c2", "RightDownVectorBar": "\u2955", "RightFloor": "\u230b", "RightTee": "\u22a2", "RightTeeArrow": "\u21a6", "RightTeeVector": "\u295b", "RightTriangle": "\u22b3", "RightTriangleBar": "\u29d0", "RightTriangleEqual": "\u22b5", "RightUpDownVector": "\u294f", "RightUpTeeVector": "\u295c", "RightUpVector": "\u21be", "RightUpVectorBar": "\u2954", "RightVector": "\u21c0", "RightVectorBar": "\u2953", "Rightarrow": "\u21d2", "Ropf": "\u211d", "RoundImplies": "\u2970", "Rrightarrow": "\u21db", "Rscr": "\u211b", "Rsh": "\u21b1", "RuleDelayed": "\u29f4", "SHCHcy": "\u0429", "SHcy": "\u0428", "SOFTcy": "\u042c", "Sacute": "\u015a", "Sc": "\u2abc", "Scaron": "\u0160", "Scedil": "\u015e", "Scirc": "\u015c", "Scy": "\u0421", "Sfr": "\U0001d516", "ShortDownArrow": "\u2193", "ShortLeftArrow": "\u2190", "ShortRightArrow": "\u2192", "ShortUpArrow": "\u2191", "Sigma": "\u03a3", "SmallCircle": "\u2218", "Sopf": "\U0001d54a", "Sqrt": "\u221a", "Square": "\u25a1", "SquareIntersection": "\u2293", "SquareSubset": "\u228f", "SquareSubsetEqual": "\u2291", "SquareSuperset": "\u2290", "SquareSupersetEqual": "\u2292", "SquareUnion": "\u2294", "Sscr": "\U0001d4ae", "Star": "\u22c6", "Sub": "\u22d0", "Subset": "\u22d0", "SubsetEqual": "\u2286", "Succeeds": "\u227b", "SucceedsEqual": "\u2ab0", "SucceedsSlantEqual": "\u227d", "SucceedsTilde": "\u227f", "SuchThat": "\u220b", "Sum": "\u2211", "Sup": "\u22d1", "Superset": "\u2283", "SupersetEqual": "\u2287", "Supset": "\u22d1", "THORN": "\xde", "TRADE": "\u2122", "TSHcy": "\u040b", "TScy": "\u0426", "Tab": "\t", "Tau": "\u03a4", "Tcaron": "\u0164", "Tcedil": "\u0162", "Tcy": "\u0422", "Tfr": "\U0001d517", "Therefore": "\u2234", "Theta": "\u0398", "ThickSpace": "\u205f\u200a", "ThinSpace": "\u2009", "Tilde": "\u223c", "TildeEqual": "\u2243", "TildeFullEqual": "\u2245", "TildeTilde": "\u2248", "Topf": "\U0001d54b", "TripleDot": "\u20db", "Tscr": "\U0001d4af", "Tstrok": "\u0166", "Uacute": "\xda", "Uarr": "\u219f", "Uarrocir": "\u2949", "Ubrcy": "\u040e", "Ubreve": "\u016c", "Ucirc": "\xdb", "Ucy": "\u0423", "Udblac": "\u0170", "Ufr": "\U0001d518", "Ugrave": "\xd9", "Umacr": "\u016a", "UnderBar": "_", "UnderBrace": "\u23df", "UnderBracket": "\u23b5", "UnderParenthesis": "\u23dd", "Union": "\u22c3", "UnionPlus": "\u228e", "Uogon": "\u0172", "Uopf": "\U0001d54c", "UpArrow": "\u2191", "UpArrowBar": "\u2912", "UpArrowDownArrow": "\u21c5", "UpDownArrow": "\u2195", "UpEquilibrium": "\u296e", "UpTee": "\u22a5", "UpTeeArrow": "\u21a5", "Uparrow": "\u21d1", "Updownarrow": "\u21d5", "UpperLeftArrow": "\u2196", "UpperRightArrow": "\u2197", "Upsi": "\u03d2", "Upsilon": "\u03a5", "Uring": "\u016e", "Uscr": "\U0001d4b0", "Utilde": "\u0168", "Uuml": "\xdc", "VDash": "\u22ab", "Vbar": "\u2aeb", "Vcy": "\u0412", "Vdash": "\u22a9", "Vdashl": "\u2ae6", "Vee": "\u22c1", "Verbar": "\u2016", "Vert": "\u2016", "VerticalBar": "\u2223", "VerticalLine": "|", "VerticalSeparator": "\u2758", "VerticalTilde": "\u2240", "VeryThinSpace": "\u200a", "Vfr": "\U0001d519", "Vopf": "\U0001d54d", "Vscr": "\U0001d4b1", "Vvdash": "\u22aa", "Wcirc": "\u0174", "Wedge": "\u22c0", "Wfr": "\U0001d51a", "Wopf": "\U0001d54e", "Wscr": "\U0001d4b2", "Xfr": "\U0001d51b", "Xi": "\u039e", "Xopf": "\U0001d54f", "Xscr": "\U0001d4b3", "YAcy": "\u042f", "YIcy": "\u0407", "YUcy": "\u042e", "Yacute": "\xdd", "Ycirc": "\u0176", "Ycy": "\u042b", "Yfr": "\U0001d51c", "Yopf": "\U0001d550", "Yscr": "\U0001d4b4", "Yuml": "\u0178", "ZHcy": "\u0416", "Zacute": "\u0179", "Zcaron": "\u017d", "Zcy": "\u0417", "Zdot": "\u017b", "ZeroWidthSpace": "\u200b", "Zeta": "\u0396", "Zfr": "\u2128", "Zopf": "\u2124", "Zscr": "\U0001d4b5", "aacute": "\xe1", "abreve": "\u0103", "ac": "\u223e", "acE": "\u223e\u0333", "acd": "\u223f", "acirc": "\xe2", "acute": "\xb4", "acy": "\u0430", "aelig": "\xe6", "af": "\u2061", "afr": "\U0001d51e", "agrave": "\xe0", "alefsym": "\u2135", "aleph": "\u2135", "alpha": "\u03b1", "amacr": "\u0101", "amalg": "\u2a3f", "amp": "&", "and": "\u2227", "andand": "\u2a55", "andd": "\u2a5c", "andslope": "\u2a58", "andv": "\u2a5a", "ang": "\u2220", "ange": "\u29a4", "angle": "\u2220", "angmsd": "\u2221", "angmsdaa": "\u29a8", "angmsdab": "\u29a9", "angmsdac": "\u29aa", "angmsdad": "\u29ab", "angmsdae": "\u29ac", "angmsdaf": "\u29ad", "angmsdag": "\u29ae", "angmsdah": "\u29af", "angrt": "\u221f", "angrtvb": "\u22be", "angrtvbd": "\u299d", "angsph": "\u2222", "angst": "\xc5", "angzarr": "\u237c", "aogon": "\u0105", "aopf": "\U0001d552", "ap": "\u2248", "apE": "\u2a70", "apacir": "\u2a6f", "ape": "\u224a", "apid": "\u224b", "apos": "'", "approx": "\u2248", "approxeq": "\u224a", "aring": "\xe5", "ascr": "\U0001d4b6", "ast": "*", "asymp": "\u2248", "asympeq": "\u224d", "atilde": "\xe3", "auml": "\xe4", "awconint": "\u2233", "awint": "\u2a11", "bNot": "\u2aed", "backcong": "\u224c", "backepsilon": "\u03f6", "backprime": "\u2035", "backsim": "\u223d", "backsimeq": "\u22cd", "barvee": "\u22bd", "barwed": "\u2305", "barwedge": "\u2305", "bbrk": "\u23b5", "bbrktbrk": "\u23b6", "bcong": "\u224c", "bcy": "\u0431", "bdquo": "\u201e", "becaus": "\u2235", "because": "\u2235", "bemptyv": "\u29b0", "bepsi": "\u03f6", "bernou": "\u212c", "beta": "\u03b2", "beth": "\u2136", "between": "\u226c", "bfr": "\U0001d51f", "bigcap": "\u22c2", "bigcirc": "\u25ef", "bigcup": "\u22c3", "bigodot": "\u2a00", "bigoplus": "\u2a01", "bigotimes": "\u2a02", "bigsqcup": "\u2a06", "bigstar": "\u2605", "bigtriangledown": "\u25bd", "bigtriangleup": "\u25b3", "biguplus": "\u2a04", "bigvee": "\u22c1", "bigwedge": "\u22c0", "bkarow": "\u290d", "blacklozenge": "\u29eb", "blacksquare": "\u25aa", "blacktriangle": "\u25b4", "blacktriangledown": "\u25be", "blacktriangleleft": "\u25c2", "blacktriangleright": "\u25b8", "blank": "\u2423", "blk12": "\u2592", "blk14": "\u2591", "blk34": "\u2593", "block": "\u2588", "bne": "=\u20e5", "bnequiv": "\u2261\u20e5", "bnot": "\u2310", "bopf": "\U0001d553", "bot": "\u22a5", "bottom": "\u22a5", "bowtie": "\u22c8", "boxDL": "\u2557", "boxDR": "\u2554", "boxDl": "\u2556", "boxDr": "\u2553", "boxH": "\u2550", "boxHD": "\u2566", "boxHU": "\u2569", "boxHd": "\u2564", "boxHu": "\u2567", "boxUL": "\u255d", "boxUR": "\u255a", "boxUl": "\u255c", "boxUr": "\u2559", "boxV": "\u2551", "boxVH": "\u256c", "boxVL": "\u2563", "boxVR": "\u2560", "boxVh": "\u256b", "boxVl": "\u2562", "boxVr": "\u255f", "boxbox": "\u29c9", "boxdL": "\u2555", "boxdR": "\u2552", "boxdl": "\u2510", "boxdr": "\u250c", "boxh": "\u2500", "boxhD": "\u2565", "boxhU": "\u2568", "boxhd": "\u252c", "boxhu": "\u2534", "boxminus": "\u229f", "boxplus": "\u229e", "boxtimes": "\u22a0", "boxuL": "\u255b", "boxuR": "\u2558", "boxul": "\u2518", "boxur": "\u2514", "boxv": "\u2502", "boxvH": "\u256a", "boxvL": "\u2561", "boxvR": "\u255e", "boxvh": "\u253c", "boxvl": "\u2524", "boxvr": "\u251c", "bprime": "\u2035", "breve": "\u02d8", "brvbar": "\xa6", "bscr": "\U0001d4b7", "bsemi": "\u204f", "bsim": "\u223d", "bsime": "\u22cd", "bsol": "\\", "bsolb": "\u29c5", "bsolhsub": "\u27c8", "bull": "\u2022", "bullet": "\u2022", "bump": "\u224e", "bumpE": "\u2aae", "bumpe": "\u224f", "bumpeq": "\u224f", "cacute": "\u0107", "cap": "\u2229", "capand": "\u2a44", "capbrcup": "\u2a49", "capcap": "\u2a4b", "capcup": "\u2a47", "capdot": "\u2a40", "caps": "\u2229\ufe00", "caret": "\u2041", "caron": "\u02c7", "ccaps": "\u2a4d", "ccaron": "\u010d", "ccedil": "\xe7", "ccirc": "\u0109", "ccups": "\u2a4c", "ccupssm": "\u2a50", "cdot": "\u010b", "cedil": "\xb8", "cemptyv": "\u29b2", "cent": "\xa2", "centerdot": "\xb7", "cfr": "\U0001d520", "chcy": "\u0447", "check": "\u2713", "checkmark": "\u2713", "chi": "\u03c7", "cir": "\u25cb", "cirE": "\u29c3", "circ": "\u02c6", "circeq": "\u2257", "circlearrowleft": "\u21ba", "circlearrowright": "\u21bb", "circledR": "\xae", "circledS": "\u24c8", "circledast": "\u229b", "circledcirc": "\u229a", "circleddash": "\u229d", "cire": "\u2257", "cirfnint": "\u2a10", "cirmid": "\u2aef", "cirscir": "\u29c2", "clubs": "\u2663", "clubsuit": "\u2663", "colon": ":", "colone": "\u2254", "coloneq": "\u2254", "comma": ",", "commat": "@", "comp": "\u2201", "compfn": "\u2218", "complement": "\u2201", "complexes": "\u2102", "cong": "\u2245", "congdot": "\u2a6d", "conint": "\u222e", "copf": "\U0001d554", "coprod": "\u2210", "copy": "\xa9", "copysr": "\u2117", "crarr": "\u21b5", "cross": "\u2717", "cscr": "\U0001d4b8", "csub": "\u2acf", "csube": "\u2ad1", "csup": "\u2ad0", "csupe": "\u2ad2", "ctdot": "\u22ef", "cudarrl": "\u2938", "cudarrr": "\u2935", "cuepr": "\u22de", "cuesc": "\u22df", "cularr": "\u21b6", "cularrp": "\u293d", "cup": "\u222a", "cupbrcap": "\u2a48", "cupcap": "\u2a46", "cupcup": "\u2a4a", "cupdot": "\u228d", "cupor": "\u2a45", "cups": "\u222a\ufe00", "curarr": "\u21b7", "curarrm": "\u293c", "curlyeqprec": "\u22de", "curlyeqsucc": "\u22df", "curlyvee": "\u22ce", "curlywedge": "\u22cf", "curren": "\xa4", "curvearrowleft": "\u21b6", "curvearrowright": "\u21b7", "cuvee": "\u22ce", "cuwed": "\u22cf", "cwconint": "\u2232", "cwint": "\u2231", "cylcty": "\u232d", "dArr": "\u21d3", "dHar": "\u2965", "dagger": "\u2020", "daleth": "\u2138", "darr": "\u2193", "dash": "\u2010", "dashv": "\u22a3", "dbkarow": "\u290f", "dblac": "\u02dd", "dcaron": "\u010f", "dcy": "\u0434", "dd": "\u2146", "ddagger": "\u2021", "ddarr": "\u21ca", "ddotseq": "\u2a77", "deg": "\xb0", "delta": "\u03b4", "demptyv": "\u29b1", "dfisht": "\u297f", "dfr": "\U0001d521", "dharl": "\u21c3", "dharr": "\u21c2", "diam": "\u22c4", "diamond": "\u22c4", "diamondsuit": "\u2666", "diams": "\u2666", "die": "\xa8", "digamma": "\u03dd", "disin": "\u22f2", "div": "\xf7", "divide": "\xf7", "divideontimes": "\u22c7", "divonx": "\u22c7", "djcy": "\u0452", "dlcorn": "\u231e", "dlcrop": "\u230d", "dollar": "$", "dopf": "\U0001d555", "dot": "\u02d9", "doteq": "\u2250", "doteqdot": "\u2251", "dotminus": "\u2238", "dotplus": "\u2214", "dotsquare": "\u22a1", "doublebarwedge": "\u2306", "downarrow": "\u2193", "downdownarrows": "\u21ca", "downharpoonleft": "\u21c3", "downharpoonright": "\u21c2", "drbkarow": "\u2910", "drcorn": "\u231f", "drcrop": "\u230c", "dscr": "\U0001d4b9", "dscy": "\u0455", "dsol": "\u29f6", "dstrok": "\u0111", "dtdot": "\u22f1", "dtri": "\u25bf", "dtrif": "\u25be", "duarr": "\u21f5", "duhar": "\u296f", "dwangle": "\u29a6", "dzcy": "\u045f", "dzigrarr": "\u27ff", "eDDot": "\u2a77", "eDot": "\u2251", "eacute": "\xe9", "easter": "\u2a6e", "ecaron": "\u011b", "ecir": "\u2256", "ecirc": "\xea", "ecolon": "\u2255", "ecy": "\u044d", "edot": "\u0117", "ee": "\u2147", "efDot": "\u2252", "efr": "\U0001d522", "eg": "\u2a9a", "egrave": "\xe8", "egs": "\u2a96", "egsdot": "\u2a98", "el": "\u2a99", "elinters": "\u23e7", "ell": "\u2113", "els": "\u2a95", "elsdot": "\u2a97", "emacr": "\u0113", "empty": "\u2205", "emptyset": "\u2205", "emptyv": "\u2205", "emsp": "\u2003", "emsp13": "\u2004", "emsp14": "\u2005", "eng": "\u014b", "ensp": "\u2002", "eogon": "\u0119", "eopf": "\U0001d556", "epar": "\u22d5", "eparsl": "\u29e3", "eplus": "\u2a71", "epsi": "\u03b5", "epsilon": "\u03b5", "epsiv": "\u03f5", "eqcirc": "\u2256", "eqcolon": "\u2255", "eqsim": "\u2242", "eqslantgtr": "\u2a96", "eqslantless": "\u2a95", "equals": "=", "equest": "\u225f", "equiv": "\u2261", "equivDD": "\u2a78", "eqvparsl": "\u29e5", "erDot": "\u2253", "erarr": "\u2971", "escr": "\u212f", "esdot": "\u2250", "esim": "\u2242", "eta": "\u03b7", "eth": "\xf0", "euml": "\xeb", "euro": "\u20ac", "excl": "!", "exist": "\u2203", "expectation": "\u2130", "exponentiale": "\u2147", "fallingdotseq": "\u2252", "fcy": "\u0444", "female": "\u2640", "ffilig": "\ufb03", "fflig": "\ufb00", "ffllig": "\ufb04", "ffr": "\U0001d523", "filig": "\ufb01", "fjlig": "fj", "flat": "\u266d", "fllig": "\ufb02", "fltns": "\u25b1", "fnof": "\u0192", "fopf": "\U0001d557", "forall": "\u2200", "fork": "\u22d4", "forkv": "\u2ad9", "fpartint": "\u2a0d", "frac12": "\xbd", "frac13": "\u2153", "frac14": "\xbc", "frac15": "\u2155", "frac16": "\u2159", "frac18": "\u215b", "frac23": "\u2154", "frac25": "\u2156", "frac34": "\xbe", "frac35": "\u2157", "frac38": "\u215c", "frac45": "\u2158", "frac56": "\u215a", "frac58": "\u215d", "frac78": "\u215e", "frasl": "\u2044", "frown": "\u2322", "fscr": "\U0001d4bb", "gE": "\u2267", "gEl": "\u2a8c", "gacute": "\u01f5", "gamma": "\u03b3", "gammad": "\u03dd", "gap": "\u2a86", "gbreve": "\u011f", "gcirc": "\u011d", "gcy": "\u0433", "gdot": "\u0121", "ge": "\u2265", "gel": "\u22db", "geq": "\u2265", "geqq": "\u2267", "geqslant": "\u2a7e", "ges": "\u2a7e", "gescc": "\u2aa9", "gesdot": "\u2a80", "gesdoto": "\u2a82", "gesdotol": "\u2a84", "gesl": "\u22db\ufe00", "gesles": "\u2a94", "gfr": "\U0001d524", "gg": "\u226b", "ggg": "\u22d9", "gimel": "\u2137", "gjcy": "\u0453", "gl": "\u2277", "glE": "\u2a92", "gla": "\u2aa5", "glj": "\u2aa4", "gnE": "\u2269", "gnap": "\u2a8a", "gnapprox": "\u2a8a", "gne": "\u2a88", "gneq": "\u2a88", "gneqq": "\u2269", "gnsim": "\u22e7", "gopf": "\U0001d558", "grave": "`", "gscr": "\u210a", "gsim": "\u2273", "gsime": "\u2a8e", "gsiml": "\u2a90", "gt": ">", "gtcc": "\u2aa7", "gtcir": "\u2a7a", "gtdot": "\u22d7", "gtlPar": "\u2995", "gtquest": "\u2a7c", "gtrapprox": "\u2a86", "gtrarr": "\u2978", "gtrdot": "\u22d7", "gtreqless": "\u22db", "gtreqqless": "\u2a8c", "gtrless": "\u2277", "gtrsim": "\u2273", "gvertneqq": "\u2269\ufe00", "gvnE": "\u2269\ufe00", "hArr": "\u21d4", "hairsp": "\u200a", "half": "\xbd", "hamilt": "\u210b", "hardcy": "\u044a", "harr": "\u2194", "harrcir": "\u2948", "harrw": "\u21ad", "hbar": "\u210f", "hcirc": "\u0125", "hearts": "\u2665", "heartsuit": "\u2665", "hellip": "\u2026", "hercon": "\u22b9", "hfr": "\U0001d525", "hksearow": "\u2925", "hkswarow": "\u2926", "hoarr": "\u21ff", "homtht": "\u223b", "hookleftarrow": "\u21a9", "hookrightarrow": "\u21aa", "hopf": "\U0001d559", "horbar": "\u2015", "hscr": "\U0001d4bd", "hslash": "\u210f", "hstrok": "\u0127", "hybull": "\u2043", "hyphen": "\u2010", "iacute": "\xed", "ic": "\u2063", "icirc": "\xee", "icy": "\u0438", "iecy": "\u0435", "iexcl": "\xa1", "iff": "\u21d4", "ifr": "\U0001d526", "igrave": "\xec", "ii": "\u2148", "iiiint": "\u2a0c", "iiint": "\u222d", "iinfin": "\u29dc", "iiota": "\u2129", "ijlig": "\u0133", "imacr": "\u012b", "image": "\u2111", "imagline": "\u2110", "imagpart": "\u2111", "imath": "\u0131", "imof": "\u22b7", "imped": "\u01b5", "in": "\u2208", "incare": "\u2105", "infin": "\u221e", "infintie": "\u29dd", "inodot": "\u0131", "int": "\u222b", "intcal": "\u22ba", "integers": "\u2124", "intercal": "\u22ba", "intlarhk": "\u2a17", "intprod": "\u2a3c", "iocy": "\u0451", "iogon": "\u012f", "iopf": "\U0001d55a", "iota": "\u03b9", "iprod": "\u2a3c", "iquest": "\xbf", "iscr": "\U0001d4be", "isin": "\u2208", "isinE": "\u22f9", "isindot": "\u22f5", "isins": "\u22f4", "isinsv": "\u22f3", "isinv": "\u2208", "it": "\u2062", "itilde": "\u0129", "iukcy": "\u0456", "iuml": "\xef", "jcirc": "\u0135", "jcy": "\u0439", "jfr": "\U0001d527", "jmath": "\u0237", "jopf": "\U0001d55b", "jscr": "\U0001d4bf", "jsercy": "\u0458", "jukcy": "\u0454", "kappa": "\u03ba", "kappav": "\u03f0", "kcedil": "\u0137", "kcy": "\u043a", "kfr": "\U0001d528", "kgreen": "\u0138", "khcy": "\u0445", "kjcy": "\u045c", "kopf": "\U0001d55c", "kscr": "\U0001d4c0", "lAarr": "\u21da", "lArr": "\u21d0", "lAtail": "\u291b", "lBarr": "\u290e", "lE": "\u2266", "lEg": "\u2a8b", "lHar": "\u2962", "lacute": "\u013a", "laemptyv": "\u29b4", "lagran": "\u2112", "lambda": "\u03bb", "lang": "\u27e8", "langd": "\u2991", "langle": "\u27e8", "lap": "\u2a85", "laquo": "\xab", "larr": "\u2190", "larrb": "\u21e4", "larrbfs": "\u291f", "larrfs": "\u291d", "larrhk": "\u21a9", "larrlp": "\u21ab", "larrpl": "\u2939", "larrsim": "\u2973", "larrtl": "\u21a2", "lat": "\u2aab", "latail": "\u2919", "late": "\u2aad", "lates": "\u2aad\ufe00", "lbarr": "\u290c", "lbbrk": "\u2772", "lbrace": "{", "lbrack": "[", "lbrke": "\u298b", "lbrksld": "\u298f", "lbrkslu": "\u298d", "lcaron": "\u013e", "lcedil": "\u013c", "lceil": "\u2308", "lcub": "{", "lcy": "\u043b", "ldca": "\u2936", "ldquo": "\u201c", "ldquor": "\u201e", "ldrdhar": "\u2967", "ldrushar": "\u294b", "ldsh": "\u21b2", "le": "\u2264", "leftarrow": "\u2190", "leftarrowtail": "\u21a2", "leftharpoondown": "\u21bd", "leftharpoonup": "\u21bc", "leftleftarrows": "\u21c7", "leftrightarrow": "\u2194", "leftrightarrows": "\u21c6", "leftrightharpoons": "\u21cb", "leftrightsquigarrow": "\u21ad", "leftthreetimes": "\u22cb", "leg": "\u22da", "leq": "\u2264", "leqq": "\u2266", "leqslant": "\u2a7d", "les": "\u2a7d", "lescc": "\u2aa8", "lesdot": "\u2a7f", "lesdoto": "\u2a81", "lesdotor": "\u2a83", "lesg": "\u22da\ufe00", "lesges": "\u2a93", "lessapprox": "\u2a85", "lessdot": "\u22d6", "lesseqgtr": "\u22da", "lesseqqgtr": "\u2a8b", "lessgtr": "\u2276", "lesssim": "\u2272", "lfisht": "\u297c", "lfloor": "\u230a", "lfr": "\U0001d529", "lg": "\u2276", "lgE": "\u2a91", "lhard": "\u21bd", "lharu": "\u21bc", "lharul": "\u296a", "lhblk": "\u2584", "ljcy": "\u0459", "ll": "\u226a", "llarr": "\u21c7", "llcorner": "\u231e", "llhard": "\u296b", "lltri": "\u25fa", "lmidot": "\u0140", "lmoust": "\u23b0", "lmoustache": "\u23b0", "lnE": "\u2268", "lnap": "\u2a89", "lnapprox": "\u2a89", "lne": "\u2a87", "lneq": "\u2a87", "lneqq": "\u2268", "lnsim": "\u22e6", "loang": "\u27ec", "loarr": "\u21fd", "lobrk": "\u27e6", "longleftarrow": "\u27f5", "longleftrightarrow": "\u27f7", "longmapsto": "\u27fc", "longrightarrow": "\u27f6", "looparrowleft": "\u21ab", "looparrowright": "\u21ac", "lopar": "\u2985", "lopf": "\U0001d55d", "loplus": "\u2a2d", "lotimes": "\u2a34", "lowast": "\u2217", "lowbar": "_", "loz": "\u25ca", "lozenge": "\u25ca", "lozf": "\u29eb", "lpar": "(", "lparlt": "\u2993", "lrarr": "\u21c6", "lrcorner": "\u231f", "lrhar": "\u21cb", "lrhard": "\u296d", "lrm": "\u200e", "lrtri": "\u22bf", "lsaquo": "\u2039", "lscr": "\U0001d4c1", "lsh": "\u21b0", "lsim": "\u2272", "lsime": "\u2a8d", "lsimg": "\u2a8f", "lsqb": "[", "lsquo": "\u2018", "lsquor": "\u201a", "lstrok": "\u0142", "lt": "<", "ltcc": "\u2aa6", "ltcir": "\u2a79", "ltdot": "\u22d6", "lthree": "\u22cb", "ltimes": "\u22c9", "ltlarr": "\u2976", "ltquest": "\u2a7b", "ltrPar": "\u2996", "ltri": "\u25c3", "ltrie": "\u22b4", "ltrif": "\u25c2", "lurdshar": "\u294a", "luruhar": "\u2966", "lvertneqq": "\u2268\ufe00", "lvnE": "\u2268\ufe00", "mDDot": "\u223a", "macr": "\xaf", "male": "\u2642", "malt": "\u2720", "maltese": "\u2720", "map": "\u21a6", "mapsto": "\u21a6", "mapstodown": "\u21a7", "mapstoleft": "\u21a4", "mapstoup": "\u21a5", "marker": "\u25ae", "mcomma": "\u2a29", "mcy": "\u043c", "mdash": "\u2014", "measuredangle": "\u2221", "mfr": "\U0001d52a", "mho": "\u2127", "micro": "\xb5", "mid": "\u2223", "midast": "*", "midcir": "\u2af0", "middot": "\xb7", "minus": "\u2212", "minusb": "\u229f", "minusd": "\u2238", "minusdu": "\u2a2a", "mlcp": "\u2adb", "mldr": "\u2026", "mnplus": "\u2213", "models": "\u22a7", "mopf": "\U0001d55e", "mp": "\u2213", "mscr": "\U0001d4c2", "mstpos": "\u223e", "mu": "\u03bc", "multimap": "\u22b8", "mumap": "\u22b8", "nGg": "\u22d9\u0338", "nGt": "\u226b\u20d2", "nGtv": "\u226b\u0338", "nLeftarrow": "\u21cd", "nLeftrightarrow": "\u21ce", "nLl": "\u22d8\u0338", "nLt": "\u226a\u20d2", "nLtv": "\u226a\u0338", "nRightarrow": "\u21cf", "nVDash": "\u22af", "nVdash": "\u22ae", "nabla": "\u2207", "nacute": "\u0144", "nang": "\u2220\u20d2", "nap": "\u2249", "napE": "\u2a70\u0338", "napid": "\u224b\u0338", "napos": "\u0149", "napprox": "\u2249", "natur": "\u266e", "natural": "\u266e", "naturals": "\u2115", "nbsp": "\xa0", "nbump": "\u224e\u0338", "nbumpe": "\u224f\u0338", "ncap": "\u2a43", "ncaron": "\u0148", "ncedil": "\u0146", "ncong": "\u2247", "ncongdot": "\u2a6d\u0338", "ncup": "\u2a42", "ncy": "\u043d", "ndash": "\u2013", "ne": "\u2260", "neArr": "\u21d7", "nearhk": "\u2924", "nearr": "\u2197", "nearrow": "\u2197", "nedot": "\u2250\u0338", "nequiv": "\u2262", "nesear": "\u2928", "nesim": "\u2242\u0338", "nexist": "\u2204", "nexists": "\u2204", "nfr": "\U0001d52b", "ngE": "\u2267\u0338", "nge": "\u2271", "ngeq": "\u2271", "ngeqq": "\u2267\u0338", "ngeqslant": "\u2a7e\u0338", "nges": "\u2a7e\u0338", "ngsim": "\u2275", "ngt": "\u226f", "ngtr": "\u226f", "nhArr": "\u21ce", "nharr": "\u21ae", "nhpar": "\u2af2", "ni": "\u220b", "nis": "\u22fc", "nisd": "\u22fa", "niv": "\u220b", "njcy": "\u045a", "nlArr": "\u21cd", "nlE": "\u2266\u0338", "nlarr": "\u219a", "nldr": "\u2025", "nle": "\u2270", "nleftarrow": "\u219a", "nleftrightarrow": "\u21ae", "nleq": "\u2270", "nleqq": "\u2266\u0338", "nleqslant": "\u2a7d\u0338", "nles": "\u2a7d\u0338", "nless": "\u226e", "nlsim": "\u2274", "nlt": "\u226e", "nltri": "\u22ea", "nltrie": "\u22ec", "nmid": "\u2224", "nopf": "\U0001d55f", "not": "\xac", "notin": "\u2209", "notinE": "\u22f9\u0338", "notindot": "\u22f5\u0338", "notinva": "\u2209", "notinvb": "\u22f7", "notinvc": "\u22f6", "notni": "\u220c", "notniva": "\u220c", "notnivb": "\u22fe", "notnivc": "\u22fd", "npar": "\u2226", "nparallel": "\u2226", "nparsl": "\u2afd\u20e5", "npart": "\u2202\u0338", "npolint": "\u2a14", "npr": "\u2280", "nprcue": "\u22e0", "npre": "\u2aaf\u0338", "nprec": "\u2280", "npreceq": "\u2aaf\u0338", "nrArr": "\u21cf", "nrarr": "\u219b", "nrarrc": "\u2933\u0338", "nrarrw": "\u219d\u0338", "nrightarrow": "\u219b", "nrtri": "\u22eb", "nrtrie": "\u22ed", "nsc": "\u2281", "nsccue": "\u22e1", "nsce": "\u2ab0\u0338", "nscr": "\U0001d4c3", "nshortmid": "\u2224", "nshortparallel": "\u2226", "nsim": "\u2241", "nsime": "\u2244", "nsimeq": "\u2244", "nsmid": "\u2224", "nspar": "\u2226", "nsqsube": "\u22e2", "nsqsupe": "\u22e3", "nsub": "\u2284", "nsubE": "\u2ac5\u0338", "nsube": "\u2288", "nsubset": "\u2282\u20d2", "nsubseteq": "\u2288", "nsubseteqq": "\u2ac5\u0338", "nsucc": "\u2281", "nsucceq": "\u2ab0\u0338", "nsup": "\u2285", "nsupE": "\u2ac6\u0338", "nsupe": "\u2289", "nsupset": "\u2283\u20d2", "nsupseteq": "\u2289", "nsupseteqq": "\u2ac6\u0338", "ntgl": "\u2279", "ntilde": "\xf1", "ntlg": "\u2278", "ntriangleleft": "\u22ea", "ntrianglelefteq": "\u22ec", "ntriangleright": "\u22eb", "ntrianglerighteq": "\u22ed", "nu": "\u03bd", "num": "#", "numero": "\u2116", "numsp": "\u2007", "nvDash": "\u22ad", "nvHarr": "\u2904", "nvap": "\u224d\u20d2", "nvdash": "\u22ac", "nvge": "\u2265\u20d2", "nvgt": ">\u20d2", "nvinfin": "\u29de", "nvlArr": "\u2902", "nvle": "\u2264\u20d2", "nvlt": "<\u20d2", "nvltrie": "\u22b4\u20d2", "nvrArr": "\u2903", "nvrtrie": "\u22b5\u20d2", "nvsim": "\u223c\u20d2", "nwArr": "\u21d6", "nwarhk": "\u2923", "nwarr": "\u2196", "nwarrow": "\u2196", "nwnear": "\u2927", "oS": "\u24c8", "oacute": "\xf3", "oast": "\u229b", "ocir": "\u229a", "ocirc": "\xf4", "ocy": "\u043e", "odash": "\u229d", "odblac": "\u0151", "odiv": "\u2a38", "odot": "\u2299", "odsold": "\u29bc", "oelig": "\u0153", "ofcir": "\u29bf", "ofr": "\U0001d52c", "ogon": "\u02db", "ograve": "\xf2", "ogt": "\u29c1", "ohbar": "\u29b5", "ohm": "\u03a9", "oint": "\u222e", "olarr": "\u21ba", "olcir": "\u29be", "olcross": "\u29bb", "oline": "\u203e", "olt": "\u29c0", "omacr": "\u014d", "omega": "\u03c9", "omicron": "\u03bf", "omid": "\u29b6", "ominus": "\u2296", "oopf": "\U0001d560", "opar": "\u29b7", "operp": "\u29b9", "oplus": "\u2295", "or": "\u2228", "orarr": "\u21bb", "ord": "\u2a5d", "order": "\u2134", "orderof": "\u2134", "ordf": "\xaa", "ordm": "\xba", "origof": "\u22b6", "oror": "\u2a56", "orslope": "\u2a57", "orv": "\u2a5b", "oscr": "\u2134", "oslash": "\xf8", "osol": "\u2298", "otilde": "\xf5", "otimes": "\u2297", "otimesas": "\u2a36", "ouml": "\xf6", "ovbar": "\u233d", "par": "\u2225", "para": "\xb6", "parallel": "\u2225", "parsim": "\u2af3", "parsl": "\u2afd", "part": "\u2202", "pcy": "\u043f", "percnt": "%", "period": ".", "permil": "\u2030", "perp": "\u22a5", "pertenk": "\u2031", "pfr": "\U0001d52d", "phi": "\u03c6", "phiv": "\u03d5", "phmmat": "\u2133", "phone": "\u260e", "pi": "\u03c0", "pitchfork": "\u22d4", "piv": "\u03d6", "planck": "\u210f", "planckh": "\u210e", "plankv": "\u210f", "plus": "+", "plusacir": "\u2a23", "plusb": "\u229e", "pluscir": "\u2a22", "plusdo": "\u2214", "plusdu": "\u2a25", "pluse": "\u2a72", "plusmn": "\xb1", "plussim": "\u2a26", "plustwo": "\u2a27", "pm": "\xb1", "pointint": "\u2a15", "popf": "\U0001d561", "pound": "\xa3", "pr": "\u227a", "prE": "\u2ab3", "prap": "\u2ab7", "prcue": "\u227c", "pre": "\u2aaf", "prec": "\u227a", "precapprox": "\u2ab7", "preccurlyeq": "\u227c", "preceq": "\u2aaf", "precnapprox": "\u2ab9", "precneqq": "\u2ab5", "precnsim": "\u22e8", "precsim": "\u227e", "prime": "\u2032", "primes": "\u2119", "prnE": "\u2ab5", "prnap": "\u2ab9", "prnsim": "\u22e8", "prod": "\u220f", "profalar": "\u232e", "profline": "\u2312", "profsurf": "\u2313", "prop": "\u221d", "propto": "\u221d", "prsim": "\u227e", "prurel": "\u22b0", "pscr": "\U0001d4c5", "psi": "\u03c8", "puncsp": "\u2008", "qfr": "\U0001d52e", "qint": "\u2a0c", "qopf": "\U0001d562", "qprime": "\u2057", "qscr": "\U0001d4c6", "quaternions": "\u210d", "quatint": "\u2a16", "quest": "?", "questeq": "\u225f", "quot": '"', "rAarr": "\u21db", "rArr": "\u21d2", "rAtail": "\u291c", "rBarr": "\u290f", "rHar": "\u2964", "race": "\u223d\u0331", "racute": "\u0155", "radic": "\u221a", "raemptyv": "\u29b3", "rang": "\u27e9", "rangd": "\u2992", "range": "\u29a5", "rangle": "\u27e9", "raquo": "\xbb", "rarr": "\u2192", "rarrap": "\u2975", "rarrb": "\u21e5", "rarrbfs": "\u2920", "rarrc": "\u2933", "rarrfs": "\u291e", "rarrhk": "\u21aa", "rarrlp": "\u21ac", "rarrpl": "\u2945", "rarrsim": "\u2974", "rarrtl": "\u21a3", "rarrw": "\u219d", "ratail": "\u291a", "ratio": "\u2236", "rationals": "\u211a", "rbarr": "\u290d", "rbbrk": "\u2773", "rbrace": "}", "rbrack": "]", "rbrke": "\u298c", "rbrksld": "\u298e", "rbrkslu": "\u2990", "rcaron": "\u0159", "rcedil": "\u0157", "rceil": "\u2309", "rcub": "}", "rcy": "\u0440", "rdca": "\u2937", "rdldhar": "\u2969", "rdquo": "\u201d", "rdquor": "\u201d", "rdsh": "\u21b3", "real": "\u211c", "realine": "\u211b", "realpart": "\u211c", "reals": "\u211d", "rect": "\u25ad", "reg": "\xae", "rfisht": "\u297d", "rfloor": "\u230b", "rfr": "\U0001d52f", "rhard": "\u21c1", "rharu": "\u21c0", "rharul": "\u296c", "rho": "\u03c1", "rhov": "\u03f1", "rightarrow": "\u2192", "rightarrowtail": "\u21a3", "rightharpoondown": "\u21c1", "rightharpoonup": "\u21c0", "rightleftarrows": "\u21c4", "rightleftharpoons": "\u21cc", "rightrightarrows": "\u21c9", "rightsquigarrow": "\u219d", "rightthreetimes": "\u22cc", "ring": "\u02da", "risingdotseq": "\u2253", "rlarr": "\u21c4", "rlhar": "\u21cc", "rlm": "\u200f", "rmoust": "\u23b1", "rmoustache": "\u23b1", "rnmid": "\u2aee", "roang": "\u27ed", "roarr": "\u21fe", "robrk": "\u27e7", "ropar": "\u2986", "ropf": "\U0001d563", "roplus": "\u2a2e", "rotimes": "\u2a35", "rpar": ")", "rpargt": "\u2994", "rppolint": "\u2a12", "rrarr": "\u21c9", "rsaquo": "\u203a", "rscr": "\U0001d4c7", "rsh": "\u21b1", "rsqb": "]", "rsquo": "\u2019", "rsquor": "\u2019", "rthree": "\u22cc", "rtimes": "\u22ca", "rtri": "\u25b9", "rtrie": "\u22b5", "rtrif": "\u25b8", "rtriltri": "\u29ce", "ruluhar": "\u2968", "rx": "\u211e", "sacute": "\u015b", "sbquo": "\u201a", "sc": "\u227b", "scE": "\u2ab4", "scap": "\u2ab8", "scaron": "\u0161", "sccue": "\u227d", "sce": "\u2ab0", "scedil": "\u015f", "scirc": "\u015d", "scnE": "\u2ab6", "scnap": "\u2aba", "scnsim": "\u22e9", "scpolint": "\u2a13", "scsim": "\u227f", "scy": "\u0441", "sdot": "\u22c5", "sdotb": "\u22a1", "sdote": "\u2a66", "seArr": "\u21d8", "searhk": "\u2925", "searr": "\u2198", "searrow": "\u2198", "sect": "\xa7", "semi": ";", "seswar": "\u2929", "setminus": "\u2216", "setmn": "\u2216", "sext": "\u2736", "sfr": "\U0001d530", "sfrown": "\u2322", "sharp": "\u266f", "shchcy": "\u0449", "shcy": "\u0448", "shortmid": "\u2223", "shortparallel": "\u2225", "shy": "\xad", "sigma": "\u03c3", "sigmaf": "\u03c2", "sigmav": "\u03c2", "sim": "\u223c", "simdot": "\u2a6a", "sime": "\u2243", "simeq": "\u2243", "simg": "\u2a9e", "simgE": "\u2aa0", "siml": "\u2a9d", "simlE": "\u2a9f", "simne": "\u2246", "simplus": "\u2a24", "simrarr": "\u2972", "slarr": "\u2190", "smallsetminus": "\u2216", "smashp": "\u2a33", "smeparsl": "\u29e4", "smid": "\u2223", "smile": "\u2323", "smt": "\u2aaa", "smte": "\u2aac", "smtes": "\u2aac\ufe00", "softcy": "\u044c", "sol": "/", "solb": "\u29c4", "solbar": "\u233f", "sopf": "\U0001d564", "spades": "\u2660", "spadesuit": "\u2660", "spar": "\u2225", "sqcap": "\u2293", "sqcaps": "\u2293\ufe00", "sqcup": "\u2294", "sqcups": "\u2294\ufe00", "sqsub": "\u228f", "sqsube": "\u2291", "sqsubset": "\u228f", "sqsubseteq": "\u2291", "sqsup": "\u2290", "sqsupe": "\u2292", "sqsupset": "\u2290", "sqsupseteq": "\u2292", "squ": "\u25a1", "square": "\u25a1", "squarf": "\u25aa", "squf": "\u25aa", "srarr": "\u2192", "sscr": "\U0001d4c8", "ssetmn": "\u2216", "ssmile": "\u2323", "sstarf": "\u22c6", "star": "\u2606", "starf": "\u2605", "straightepsilon": "\u03f5", "straightphi": "\u03d5", "strns": "\xaf", "sub": "\u2282", "subE": "\u2ac5", "subdot": "\u2abd", "sube": "\u2286", "subedot": "\u2ac3", "submult": "\u2ac1", "subnE": "\u2acb", "subne": "\u228a", "subplus": "\u2abf", "subrarr": "\u2979", "subset": "\u2282", "subseteq": "\u2286", "subseteqq": "\u2ac5", "subsetneq": "\u228a", "subsetneqq": "\u2acb", "subsim": "\u2ac7", "subsub": "\u2ad5", "subsup": "\u2ad3", "succ": "\u227b", "succapprox": "\u2ab8", "succcurlyeq": "\u227d", "succeq": "\u2ab0", "succnapprox": "\u2aba", "succneqq": "\u2ab6", "succnsim": "\u22e9", "succsim": "\u227f", "sum": "\u2211", "sung": "\u266a", "sup": "\u2283", "sup1": "\xb9", "sup2": "\xb2", "sup3": "\xb3", "supE": "\u2ac6", "supdot": "\u2abe", "supdsub": "\u2ad8", "supe": "\u2287", "supedot": "\u2ac4", "suphsol": "\u27c9", "suphsub": "\u2ad7", "suplarr": "\u297b", "supmult": "\u2ac2", "supnE": "\u2acc", "supne": "\u228b", "supplus": "\u2ac0", "supset": "\u2283", "supseteq": "\u2287", "supseteqq": "\u2ac6", "supsetneq": "\u228b", "supsetneqq": "\u2acc", "supsim": "\u2ac8", "supsub": "\u2ad4", "supsup": "\u2ad6", "swArr": "\u21d9", "swarhk": "\u2926", "swarr": "\u2199", "swarrow": "\u2199", "swnwar": "\u292a", "szlig": "\xdf", "target": "\u2316", "tau": "\u03c4", "tbrk": "\u23b4", "tcaron": "\u0165", "tcedil": "\u0163", "tcy": "\u0442", "tdot": "\u20db", "telrec": "\u2315", "tfr": "\U0001d531", "there4": "\u2234", "therefore": "\u2234", "theta": "\u03b8", "thetasym": "\u03d1", "thetav": "\u03d1", "thickapprox": "\u2248", "thicksim": "\u223c", "thinsp": "\u2009", "thkap": "\u2248", "thksim": "\u223c", "thorn": "\xfe", "tilde": "\u02dc", "times": "\xd7", "timesb": "\u22a0", "timesbar": "\u2a31", "timesd": "\u2a30", "tint": "\u222d", "toea": "\u2928", "top": "\u22a4", "topbot": "\u2336", "topcir": "\u2af1", "topf": "\U0001d565", "topfork": "\u2ada", "tosa": "\u2929", "tprime": "\u2034", "trade": "\u2122", "triangle": "\u25b5", "triangledown": "\u25bf", "triangleleft": "\u25c3", "trianglelefteq": "\u22b4", "triangleq": "\u225c", "triangleright": "\u25b9", "trianglerighteq": "\u22b5", "tridot": "\u25ec", "trie": "\u225c", "triminus": "\u2a3a", "triplus": "\u2a39", "trisb": "\u29cd", "tritime": "\u2a3b", "trpezium": "\u23e2", "tscr": "\U0001d4c9", "tscy": "\u0446", "tshcy": "\u045b", "tstrok": "\u0167", "twixt": "\u226c", "twoheadleftarrow": "\u219e", "twoheadrightarrow": "\u21a0", "uArr": "\u21d1", "uHar": "\u2963", "uacute": "\xfa", "uarr": "\u2191", "ubrcy": "\u045e", "ubreve": "\u016d", "ucirc": "\xfb", "ucy": "\u0443", "udarr": "\u21c5", "udblac": "\u0171", "udhar": "\u296e", "ufisht": "\u297e", "ufr": "\U0001d532", "ugrave": "\xf9", "uharl": "\u21bf", "uharr": "\u21be", "uhblk": "\u2580", "ulcorn": "\u231c", "ulcorner": "\u231c", "ulcrop": "\u230f", "ultri": "\u25f8", "umacr": "\u016b", "uml": "\xa8", "uogon": "\u0173", "uopf": "\U0001d566", "uparrow": "\u2191", "updownarrow": "\u2195", "upharpoonleft": "\u21bf", "upharpoonright": "\u21be", "uplus": "\u228e", "upsi": "\u03c5", "upsih": "\u03d2", "upsilon": "\u03c5", "upuparrows": "\u21c8", "urcorn": "\u231d", "urcorner": "\u231d", "urcrop": "\u230e", "uring": "\u016f", "urtri": "\u25f9", "uscr": "\U0001d4ca", "utdot": "\u22f0", "utilde": "\u0169", "utri": "\u25b5", "utrif": "\u25b4", "uuarr": "\u21c8", "uuml": "\xfc", "uwangle": "\u29a7", "vArr": "\u21d5", "vBar": "\u2ae8", "vBarv": "\u2ae9", "vDash": "\u22a8", "vangrt": "\u299c", "varepsilon": "\u03f5", "varkappa": "\u03f0", "varnothing": "\u2205", "varphi": "\u03d5", "varpi": "\u03d6", "varpropto": "\u221d", "varr": "\u2195", "varrho": "\u03f1", "varsigma": "\u03c2", "varsubsetneq": "\u228a\ufe00", "varsubsetneqq": "\u2acb\ufe00", "varsupsetneq": "\u228b\ufe00", "varsupsetneqq": "\u2acc\ufe00", "vartheta": "\u03d1", "vartriangleleft": "\u22b2", "vartriangleright": "\u22b3", "vcy": "\u0432", "vdash": "\u22a2", "vee": "\u2228", "veebar": "\u22bb", "veeeq": "\u225a", "vellip": "\u22ee", "verbar": "|", "vert": "|", "vfr": "\U0001d533", "vltri": "\u22b2", "vnsub": "\u2282\u20d2", "vnsup": "\u2283\u20d2", "vopf": "\U0001d567", "vprop": "\u221d", "vrtri": "\u22b3", "vscr": "\U0001d4cb", "vsubnE": "\u2acb\ufe00", "vsubne": "\u228a\ufe00", "vsupnE": "\u2acc\ufe00", "vsupne": "\u228b\ufe00", "vzigzag": "\u299a", "wcirc": "\u0175", "wedbar": "\u2a5f", "wedge": "\u2227", "wedgeq": "\u2259", "weierp": "\u2118", "wfr": "\U0001d534", "wopf": "\U0001d568", "wp": "\u2118", "wr": "\u2240", "wreath": "\u2240", "wscr": "\U0001d4cc", "xcap": "\u22c2", "xcirc": "\u25ef", "xcup": "\u22c3", "xdtri": "\u25bd", "xfr": "\U0001d535", "xhArr": "\u27fa", "xharr": "\u27f7", "xi": "\u03be", "xlArr": "\u27f8", "xlarr": "\u27f5", "xmap": "\u27fc", "xnis": "\u22fb", "xodot": "\u2a00", "xopf": "\U0001d569", "xoplus": "\u2a01", "xotime": "\u2a02", "xrArr": "\u27f9", "xrarr": "\u27f6", "xscr": "\U0001d4cd", "xsqcup": "\u2a06", "xuplus": "\u2a04", "xutri": "\u25b3", "xvee": "\u22c1", "xwedge": "\u22c0", "yacute": "\xfd", "yacy": "\u044f", "ycirc": "\u0177", "ycy": "\u044b", "yen": "\xa5", "yfr": "\U0001d536", "yicy": "\u0457", "yopf": "\U0001d56a", "yscr": "\U0001d4ce", "yucy": "\u044e", "yuml": "\xff", "zacute": "\u017a", "zcaron": "\u017e", "zcy": "\u0437", "zdot": "\u017c", "zeetrf": "\u2128", "zeta": "\u03b6", "zfr": "\U0001d537", "zhcy": "\u0436", "zigrarr": "\u21dd", "zopf": "\U0001d56b", "zscr": "\U0001d4cf", "zwj": "\u200d", "zwnj": "\u200c", }
engines
base
# SPDX-License-Identifier: AGPL-3.0-or-later """ BASE (Scholar publications) """ import re from datetime import datetime from urllib.parse import urlencode from lxml import etree from searx.utils import searx_useragent # about about = { "website": "https://base-search.net", "wikidata_id": "Q448335", "official_api_documentation": "https://api.base-search.net/", "use_official_api": True, "require_api_key": False, "results": "XML", } categories = ["science"] base_url = ( "https://api.base-search.net/cgi-bin/BaseHttpSearchInterface.fcgi" + "?func=PerformSearch&{query}&boost=oa&hits={hits}&offset={offset}" ) # engine dependent config paging = True number_of_results = 10 # shortcuts for advanced search shorcut_dict = { # user-friendly keywords "format:": "dcformat:", "author:": "dccreator:", "collection:": "dccollection:", "hdate:": "dchdate:", "contributor:": "dccontributor:", "coverage:": "dccoverage:", "date:": "dcdate:", "abstract:": "dcdescription:", "urls:": "dcidentifier:", "language:": "dclanguage:", "publisher:": "dcpublisher:", "relation:": "dcrelation:", "rights:": "dcrights:", "source:": "dcsource:", "subject:": "dcsubject:", "title:": "dctitle:", "type:": "dcdctype:", } def request(query, params): # replace shortcuts with API advanced search keywords for key in shorcut_dict.keys(): query = re.sub(key, shorcut_dict[key], query) # basic search offset = (params["pageno"] - 1) * number_of_results string_args = dict( query=urlencode({"query": query}), offset=offset, hits=number_of_results ) params["url"] = base_url.format(**string_args) params["headers"]["User-Agent"] = searx_useragent() return params def response(resp): results = [] search_results = etree.XML(resp.content) for entry in search_results.xpath("./result/doc"): content = "No description available" date = datetime.now() # needed in case no dcdate is available for an item for item in entry: if item.attrib["name"] == "dcdate": date = item.text elif item.attrib["name"] == "dctitle": title = item.text elif item.attrib["name"] == "dclink": url = item.text elif item.attrib["name"] == "dcdescription": content = item.text[:300] if len(item.text) > 300: content += "..." # dates returned by the BASE API are not several formats publishedDate = None for date_format in ["%Y-%m-%dT%H:%M:%SZ", "%Y-%m-%d", "%Y-%m", "%Y"]: try: publishedDate = datetime.strptime(date, date_format) break except: pass if publishedDate is not None: res_dict = { "url": url, "title": title, "publishedDate": publishedDate, "content": content, } else: res_dict = {"url": url, "title": title, "content": content} results.append(res_dict) return results
connectors
format_mappings
""" comparing a free text format to the standardized one """ format_mappings = { "paperback": "Paperback", "soft": "Paperback", "pamphlet": "Paperback", "peperback": "Paperback", "tapa blanda": "Paperback", "turtleback": "Paperback", "pocket": "Paperback", "spiral": "Paperback", "ring": "Paperback", "平装": "Paperback", "简装": "Paperback", "hardcover": "Hardcover", "hardcocer": "Hardcover", "hardover": "Hardcover", "hardback": "Hardcover", "library": "Hardcover", "tapa dura": "Hardcover", "leather": "Hardcover", "clothbound": "Hardcover", "精装": "Hardcover", "ebook": "EBook", "e-book": "EBook", "digital": "EBook", "computer file": "EBook", "epub": "EBook", "online": "EBook", "pdf": "EBook", "elektronische": "EBook", "electronic": "EBook", "audiobook": "AudiobookFormat", "audio": "AudiobookFormat", "cd": "AudiobookFormat", "dvd": "AudiobookFormat", "mp3": "AudiobookFormat", "cassette": "AudiobookFormat", "kindle": "AudiobookFormat", "talking": "AudiobookFormat", "sound": "AudiobookFormat", "comic": "GraphicNovel", "graphic": "GraphicNovel", }
util
json_data
# Copyright 2012-2020 Nick Boultbee # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. from __future__ import absolute_import import json from collections import namedtuple from typing import Dict from quodlibet.util.dprint import print_d, print_w from quodlibet.util.misc import total_ordering @total_ordering class JSONObject: """ Base class for simple, named data objects that can be edited and persisted as JSON. """ NAME = "" # The format for JSONObject. Field = namedtuple("Field", ["human_name", "doc"]) EMPTY_FIELD = Field(None, None) # Override this to specify a set of field names, # or a dict of field: FieldData # Must include "name" if dict is specified. FIELDS: Dict[str, Field] = {} @classmethod def _should_store(cls, field_name): """Decides if a field should be stored""" return not field_name.startswith("_") def __init__(self, name): if not name: raise ValueError("%s objects must be named" % type(self).__name__) self.name = str(name) @property def data(self): """A list of tuples of the persisted key:values in this class""" if self.FIELDS: return [ (k, self.__getattribute__(k) if hasattr(self, k) else None) for k in self.FIELDS ] else: print_d("No order specified for class %s" % type(self).__name__) return dict( (k, v) for k, v in self.__dict__.items() if self._should_store(k) ) def field(self, name): """Returns the Field metadata of field `name` if available, or an null / empty one""" if isinstance(self.FIELDS, dict): return self.FIELDS.get(name, self.EMPTY_FIELD) @property def json(self): return json.dumps(dict(self.data)) def __eq__(self, other): return self.data == other.data def __lt__(self, other): return self.data < other.data def __str__(self): return "<%s '%s' with %s>" % (self.__class__.__name__, self.name, self.json) class JSONObjectDict(dict): """A dict wrapper to persist named `JSONObject`-style objects""" def __init__(self, Item=JSONObject): self.Item = Item dict.__init__(self) @classmethod def from_json(cls, ItemKind, json_str): """ Factory method for building from an input string, a JSON map of {item_name1: {key:value, key2:value2...}, item_name2:...} """ new = cls(ItemKind) try: data = json.loads(json_str) except ValueError: print_w("Broken JSON: %s" % json_str) else: for name, blob in data.items(): try: new[name] = ItemKind(**blob) except TypeError as e: raise IOError( "Couldn't instantiate %s from JSON (%s)" % (ItemKind.__name__, e) ) return new @classmethod def from_list(cls, json_objects, raise_errors=True): new = cls() for j in json_objects: if not isinstance(j, JSONObject): msg = ( "Incorrect type (%s) found in list of objects" % j.__class__.__name__ ) if raise_errors: raise TypeError(msg) else: print_d(msg) else: if not j.name and raise_errors: raise ValueError("Null key for %s object %s" % (cls.__name__, j)) if j.name in new: print_w( "Duplicate %s found named '%s'. Removing..." % (cls.__name__, j.name) ) new[j.name] = j return new def save(self, filename=None): """ Takes a list of `JSONObject` objects and returns the data serialised as a JSON string, also writing (prettily) to file `filename` if specified. """ print_d("Saving %d %s(s) to JSON.." % (len(self), self.Item.__name__)) try: obj_dict = dict((o.name, dict(o.data)) for o in self.values()) except AttributeError: raise json_str = json.dumps(obj_dict, indent=4) json_str = json_str.encode("utf-8") if filename: try: with open(filename, "wb") as f: f.write(json_str) except IOError as e: print_w( "Couldn't write JSON for %s object(s) (%s)" % (type(self).__name__, e) ) return json_str
blocks
qa_transcendental
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # import math from gnuradio import blocks, gr, gr_unittest class test_transcendental(gr_unittest.TestCase): def setUp(self): self.tb = gr.top_block() def tearDown(self): self.tb = None def test_01(self): tb = self.tb data = 100 * [ 0, ] expected_result = 100 * [ 1, ] src = blocks.vector_source_f(data, False) op = blocks.transcendental("cos", "float") dst = blocks.vector_sink_f() tb.connect(src, op) tb.connect(op, dst) tb.run() dst_data = dst.data() self.assertFloatTuplesAlmostEqual(expected_result, dst_data, 5) def test_02(self): tb = self.tb data = 100 * [ 3, ] expected_result = 100 * [ math.log10(3), ] src = blocks.vector_source_f(data, False) op = blocks.transcendental("log10", "float") dst = blocks.vector_sink_f() tb.connect(src, op) tb.connect(op, dst) tb.run() dst_data = dst.data() self.assertFloatTuplesAlmostEqual(expected_result, dst_data, 5) def test_03(self): tb = self.tb data = 100 * [ 3, ] expected_result = 100 * [ math.tanh(3), ] src = blocks.vector_source_f(data, False) op = blocks.transcendental("tanh", "float") dst = blocks.vector_sink_f() tb.connect(src, op) tb.connect(op, dst) tb.run() dst_data = dst.data() self.assertFloatTuplesAlmostEqual(expected_result, dst_data, 5) if __name__ == "__main__": gr_unittest.run(test_transcendental)
auth
http
# The contents of this file are subject to the Common Public Attribution # License Version 1.0. (the "License"); you may not use this file except in # compliance with the License. You may obtain a copy of the License at # http://code.reddit.com/LICENSE. The License is based on the Mozilla Public # License Version 1.1, but Sections 14 and 15 have been added to cover use of # software over a computer network and provide for limited attribution for the # Original Developer. In addition, Exhibit A has been modified to be consistent # with Exhibit B. # # Software distributed under the License is distributed on an "AS IS" basis, # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for # the specific language governing rights and limitations under the License. # # The Original Code is reddit. # # The Original Developer is the Initial Developer. The Initial Developer of # the Original Code is reddit Inc. # # All portions of the code written by reddit are Copyright (c) 2006-2015 reddit # Inc. All Rights Reserved. ############################################################################### import crypt import bcrypt from pylons import app_globals as g from pylons import request from r2.lib.configparse import ConfigValue from r2.lib.providers.auth import AuthenticationProvider from r2.lib.require import RequirementException from r2.lib.utils import constant_time_compare, parse_http_basic class HttpAuthenticationProvider(AuthenticationProvider): """An authentication provider based on HTTP basic authentication. This provider uses HTTP basic authentication (via the Authorization header) to authenticate the user. Logout is disallowed. If auth_trust_http_authorization is set to true, the Authorization header is fully trusted. The password will not be checked and accounts will be automatically registered when not already present. """ config = { ConfigValue.bool: [ "auth_trust_http_authorization", ], } def is_logout_allowed(self): return False def get_authenticated_account(self): from r2.models import Account, NotFound, register try: authorization = request.environ.get("HTTP_AUTHORIZATION") username, password = parse_http_basic(authorization) except RequirementException: return None try: account = Account._by_name(username) except NotFound: if g.auth_trust_http_authorization: # note: we're explicitly allowing automatic re-registration of # _deleted accounts and login of _banned accounts here because # we're trusting you know what you're doing in an SSO situation account = register(username, password, request.ip) else: return None # if we're to trust the authorization headers, don't check passwords if g.auth_trust_http_authorization: return account # not all systems support bcrypt in the standard crypt if account.password.startswith("$2a$"): expected_hash = bcrypt.hashpw(password, account.password) else: expected_hash = crypt.crypt(password, account.password) if not constant_time_compare(expected_hash, account.password): return None return account
resources
schedules
import datetime from dataclasses import dataclass from enum import Enum from typing import Optional from uuid import uuid4 from migrator import oncall_api_client from migrator.config import ( SCHEDULE_MIGRATION_MODE, SCHEDULE_MIGRATION_MODE_ICAL, SCHEDULE_MIGRATION_MODE_WEB, ) def match_schedule( schedule: dict, oncall_schedules: list[dict], user_id_map: dict[str, str] ) -> None: oncall_schedule = None for candidate in oncall_schedules: if schedule["name"].lower().strip() == candidate["name"].lower().strip(): oncall_schedule = candidate schedule["migration_errors"] = [] if SCHEDULE_MIGRATION_MODE == SCHEDULE_MIGRATION_MODE_WEB: _, errors = Schedule.from_dict(schedule).to_oncall_schedule(user_id_map) schedule["migration_errors"] = errors schedule["oncall_schedule"] = oncall_schedule def migrate_schedule(schedule: dict, user_id_map: dict[str, str]) -> None: if schedule["oncall_schedule"]: oncall_api_client.delete( "schedules/{}".format(schedule["oncall_schedule"]["id"]) ) if SCHEDULE_MIGRATION_MODE == SCHEDULE_MIGRATION_MODE_WEB: # Migrate shifts oncall_schedule = Schedule.from_dict(schedule).migrate(user_id_map) elif SCHEDULE_MIGRATION_MODE == SCHEDULE_MIGRATION_MODE_ICAL: # Migrate using ICal URL payload = { "name": schedule["name"], "type": "ical", "ical_url_primary": schedule["http_cal_url"], "team_id": None, } oncall_schedule = oncall_api_client.create("schedules", payload) else: raise ValueError("Invalid schedule migration mode") schedule["oncall_schedule"] = oncall_schedule def duration_to_frequency_and_interval(duration: datetime.timedelta) -> tuple[str, int]: """ Convert a duration to shift frequency and interval. For example, 1 day duration returns ("daily", 1), 14 days returns ("weekly", 2), """ seconds = int(duration.total_seconds()) assert seconds >= 3600, "Rotation must be at least 1 hour" hours = seconds // 3600 if hours >= 24 and hours % 24 == 0: days = hours // 24 if days >= 7 and days % 7 == 0: weeks = days // 7 return "weekly", weeks else: return "daily", days else: return "hourly", hours def _pd_datetime_to_dt(text: str) -> datetime.datetime: """ Convert a PagerDuty datetime string to a datetime object. """ dt = datetime.datetime.strptime(text, "%Y-%m-%dT%H:%M:%SZ") return dt.replace(tzinfo=datetime.timezone.utc) def _dt_to_oncall_datetime(dt: datetime.datetime) -> str: """ Convert a datetime object to an OnCall datetime string. """ return dt.strftime("%Y-%m-%dT%H:%M:%S") @dataclass class Schedule: """ Utility class for converting a PagerDuty schedule to an OnCall schedule. A PagerDuty schedule has multiple layers, each with a rotation of users. """ name: str time_zone: str layers: list["Layer"] overrides: list["Override"] @classmethod def from_dict(cls, schedule: dict) -> "Schedule": """ Create a Schedule object from a PagerDuty API response for a schedule. """ layers = [] # PagerDuty API returns layers in reverse order (e.g. Layer 3, Layer 2, Layer 1) for level, layer_dict in enumerate( reversed(schedule["schedule_layers"]), start=1 ): layer = Layer.from_dict(layer_dict, level) # skip any layers that have already ended if layer.end and layer.end < datetime.datetime.now(datetime.timezone.utc): continue layers.append(layer) overrides = [] for override in schedule["overrides"]: overrides.append(Override.from_dict(override)) return cls( name=schedule["name"], time_zone=schedule["time_zone"], layers=layers, overrides=overrides, ) def to_oncall_schedule( self, user_id_map: dict[str, str] ) -> tuple[Optional[dict], list[str]]: """ Convert a Schedule object to an OnCall schedule. Note that it also returns shifts, but these are not created at the same time as the schedule (see migrate method for more info). """ shifts = [] errors = [] for layer in self.layers: # Check if all users in the layer exist in PD deactivated_user_ids = [ user_id for user_id in layer.user_ids if user_id not in user_id_map ] if deactivated_user_ids: errors.append( f"{layer.name}: Users with IDs {deactivated_user_ids} not found. The users probably have been deactivated in PagerDuty." ) continue # A single PagerDuty layer can result in multiple OnCall shifts layer_shifts, error = layer.to_oncall_shifts(user_id_map) if layer_shifts: shifts += layer_shifts if error: error_text = f"{layer.name}: {error}" # If a layer has a single user, it's likely can be easily tweaked in PD to make it possible to migrate if len(set(layer.user_ids)) == 1: error_text += " Layer has a single user, consider simplifying the rotation in PD." errors.append(error_text) for override in self.overrides: if override.user_id not in user_id_map: errors.append( f"Override: User with ID '{override.user_id}' not found. The user probably has been deactivated in PagerDuty." ) continue shifts.append(override.to_oncall_shift(user_id_map)) if errors: return None, errors return { "name": self.name, "type": "web", "team_id": None, "time_zone": self.time_zone, "shifts": shifts, }, [] def migrate(self, user_id_map: dict[str, str]) -> dict: """ Create an OnCall schedule and its shifts. First create the shifts, then create a schedule with shift IDs provided. """ schedule, errors = self.to_oncall_schedule(user_id_map) assert not errors, "Unexpected errors: {}".format(errors) # Create shifts in OnCall shift_ids = [] for shift in schedule["shifts"]: created_shift = oncall_api_client.create("on_call_shifts", shift) shift_ids.append(created_shift["id"]) # Create schedule in OnCall with shift IDs provided schedule["shifts"] = shift_ids new_schedule = oncall_api_client.create("schedules", schedule) return new_schedule @dataclass class Layer: """ Utility class for converting a PagerDuty schedule layer to OnCall shifts. """ name: str level: int rotation_virtual_start: datetime.datetime rotation_turn_length: datetime.timedelta start: datetime.datetime end: Optional[datetime.datetime] user_ids: list[str] restrictions: list["Restriction"] @classmethod def from_dict(cls, layer: dict, level: int) -> "Layer": """ Create a Layer object from a PagerDuty API response for a schedule layer. Converts PagerDuty datetime strings to datetime objects for easier manipulation. """ return cls( name=layer["name"], level=level, rotation_virtual_start=_pd_datetime_to_dt(layer["rotation_virtual_start"]), rotation_turn_length=datetime.timedelta( seconds=layer["rotation_turn_length_seconds"] ), start=_pd_datetime_to_dt(layer["start"]), end=_pd_datetime_to_dt(layer["end"]) if layer["end"] else None, user_ids=[u["user"]["id"] for u in layer["users"]], restrictions=[Restriction.from_dict(r) for r in layer["restrictions"]], ) def to_oncall_shifts( self, user_id_map: dict[str, str] ) -> tuple[Optional[list[dict]], Optional[str]]: frequency, interval = duration_to_frequency_and_interval( self.rotation_turn_length ) rolling_users = [] for user_id in self.user_ids: oncall_user_id = user_id_map[user_id] rolling_users.append([oncall_user_id]) if not self.restrictions: return [ { "name": uuid4().hex, "level": self.level, "type": "rolling_users", "rotation_start": _dt_to_oncall_datetime(self.start), "until": _dt_to_oncall_datetime(self.end) if self.end else None, "start": _dt_to_oncall_datetime(self.rotation_virtual_start), "duration": int(self.rotation_turn_length.total_seconds()), "frequency": frequency, "interval": interval, "rolling_users": rolling_users, "start_rotation_from_user_index": 0, "week_start": "MO", "time_zone": "UTC", "source": 0, # 0 is alias for "web" } ], None restrictions_type = self.restrictions[0].type if (frequency, restrictions_type) in ( ("daily", Restriction.Type.DAILY), ("weekly", Restriction.Type.WEEKLY), ): # TODO: some of this can use by_day? shifts, _ = self._generate_shifts(unique=False) shifts = [(s[0], s[1], "MO", None) for s in shifts] elif frequency == "weekly" and restrictions_type == Restriction.Type.DAILY: shifts, is_split = self._generate_shifts(unique=True) if is_split: return ( None, f"Cannot migrate {interval}-weekly rotation with daily restrictions that are split by handoff.", ) # repeat ["MO", "TU", "WE", "TH", "FR", "SA", "SU"] shift for the number of weeks in the rotation shifts_for_multiple_weeks = [] for shift in shifts: for week in range(interval): start = shift[0] + datetime.timedelta(weeks=week) end = shift[1] + datetime.timedelta(weeks=week) shifts_for_multiple_weeks.append((start, end)) shifts = [ ( shift[0], shift[1], ["MO", "TU", "WE", "TH", "FR", "SA", "SU"][ shift[0].date().weekday() ], ["MO", "TU", "WE", "TH", "FR", "SA", "SU"], ) for shift in shifts_for_multiple_weeks ] elif ( frequency == "daily" and restrictions_type == Restriction.Type.WEEKLY and interval == 1 ): # the only case when it's possible to migrate a daily rotation with weekly restrictions # is when the restrictions start at the same time as the shift start # and the restrictions are a multiple of 24 hours restrictions = Restriction.merge_restrictions(self.restrictions) for restriction in restrictions: if ( not restriction.start_time_of_day == self.rotation_virtual_start.time() ): return ( None, f"Cannot migrate {interval}-daily rotation with weekly restrictions that start at a different time than the shift start.", ) if not restriction.duration % datetime.timedelta( days=1 ) == datetime.timedelta(0): return ( None, f"Cannot migrate {interval}-daily rotation with weekly restrictions that have durations that are not a multiple of a 24 hours.", ) # get the first restriction and use its start time as the start of the shift restriction, shift_start = Restriction.current_or_next_restriction( restrictions, self.rotation_virtual_start ) shift_end = shift_start + datetime.timedelta(days=1) # determine which days of the week are covered by_day = set() for restriction in restrictions: days = restriction.duration // datetime.timedelta(days=1) for day in range(days): weekday = ["MO", "TU", "WE", "TH", "FR", "SA", "SU"][ (restriction.start_day_of_week + day) % 7 ] by_day.add(weekday) # sort by_day so that the order is always the same by_day = sorted( list(by_day), key=lambda d: ["MO", "TU", "WE", "TH", "FR", "SA", "SU"].index(d), ) shifts = [(shift_start, shift_end, "MO", by_day)] else: restrictions_type_verbal = ( "daily" if restrictions_type == Restriction.Type.DAILY else "weekly" ) return ( None, f"Cannot migrate {interval}-{frequency} rotation with {restrictions_type_verbal} restrictions.", ) payloads = [] for shift in shifts: payload = { "name": uuid4().hex, "level": self.level, "type": "rolling_users", "rotation_start": _dt_to_oncall_datetime(self.start), "until": _dt_to_oncall_datetime(self.end) if self.end else None, "start": _dt_to_oncall_datetime(shift[0]), "duration": int((shift[1] - shift[0]).total_seconds()), "frequency": frequency, "interval": interval, "by_day": shift[3], "rolling_users": rolling_users, "start_rotation_from_user_index": 0, "week_start": shift[2], "time_zone": "UTC", "source": 0, # 0 is alias for "web" } payloads.append(payload) return payloads, None def _generate_shifts( self, unique: bool = True ) -> tuple[list[tuple[datetime.datetime, datetime.datetime]], bool]: """ Returns a list of (start, end) tuples representing the shifts in this layer. Note that these are not the actual shifts for OnCall API but rather a list of unique intervals generated by traversing the restrictions. Also returns a boolean indicating whether there are restrictions split by on-call handoff. """ start = self.rotation_virtual_start end = self.rotation_virtual_start + self.rotation_turn_length # Convert restrictions to weekly restrictions, then merge overlapping ones restrictions = [] for restriction in self.restrictions: restrictions += restriction.to_weekly_restrictions() restrictions = Restriction.merge_restrictions(restrictions) is_split = False current = start shifts = [] unique_shift_times = [] while current < end: restriction, restriction_start = Restriction.current_or_next_restriction( restrictions, current ) restriction_end = restriction_start + restriction.duration shift_start = max(current, restriction_start) shift_end = min(restriction_end, end) # If the next restriction starts after the end of the rotation or shift is empty, we're done if restriction_start > end or shift_start == shift_end: break # Check if restriction is split by handoff if (shift_start == start and shift_start > restriction_start) or ( shift_end == end and shift_end < restriction_end ): is_split = True shift = (shift_start, shift_end) # check that we haven't already added this shift if ( not unique or (shift[0].time(), shift[1].time()) not in unique_shift_times ): shifts.append(shift) unique_shift_times.append((shift[0].time(), shift[1].time())) current = shift_end return shifts, is_split @dataclass class Restriction: """ Utility class for representing a restriction on a rotation in PagerDuty. """ class Type(Enum): DAILY = "daily_restriction" WEEKLY = "weekly_restriction" type: Type start_time_of_day: datetime.time duration: datetime.timedelta start_day_of_week: Optional[int] # this is only present for weekly restrictions @classmethod def from_dict(cls, restriction: dict) -> "Restriction": """ Create a Restriction object from PagerDuty's API representation. Converts PagerDuty datetime strings to datetime objects for easier manipulation as well. """ # PagerDuty's API uses 1-indexed days of the week, converting to 0-indexed for ease of use start_day_of_week = restriction.get("start_day_of_week") if start_day_of_week is not None: start_day_of_week -= 1 return cls( type=Restriction.Type(restriction["type"]), start_time_of_day=datetime.time.fromisoformat( restriction["start_time_of_day"] ), duration=datetime.timedelta(seconds=restriction["duration_seconds"]), start_day_of_week=start_day_of_week, ) def to_weekly_restrictions(self) -> list["Restriction"]: """ Convert a daily restriction to a list of weekly restrictions. Daily restriction is basically 7 weekly restrictions with the same start time and duration, but different days of the week (e.g. 9am-5pm daily restriction is the same as 9am-5pm on Monday, 9am-5pm on Tuesday, etc.) Converting to weekly restrictions makes it easier to work with restrictions and only care about weekly ones. """ if self.type == Restriction.Type.WEEKLY: return [self] else: return [ Restriction( type=Restriction.Type.WEEKLY, start_time_of_day=self.start_time_of_day, duration=self.duration, start_day_of_week=day, ) for day in range(7) ] @staticmethod def merge_restrictions(restrictions: list["Restriction"]) -> list["Restriction"]: """ Merge a list of weekly restrictions into a list of the fewest possible weekly restrictions that cover the same time period. Example: (9am - 5pm restriction on Monday, 10am - 4pm restriction on Monday) -> (9am - 5pm restriction on Monday). Only works on weekly restrictions, as daily restrictions are converted to weekly restrictions first. """ assert all(r.type == Restriction.Type.WEEKLY for r in restrictions) restrictions = sorted( restrictions, key=lambda r: (r.start_day_of_week, r.start_time_of_day) ) merged = [] for restriction in restrictions: restriction_start = datetime.datetime.combine( datetime.date.min + datetime.timedelta(days=restriction.start_day_of_week), restriction.start_time_of_day, ) restriction_end = restriction_start + restriction.duration if not merged: merged.append(restriction) continue last = merged[-1] last_start = datetime.datetime.combine( datetime.date.min + datetime.timedelta(days=last.start_day_of_week), last.start_time_of_day, ) last_end = last_start + last.duration if last_end < restriction_start: merged.append(restriction) else: restriction.start_day_of_week = last_start.weekday() restriction.start_time_of_day = last_start.time() restriction.duration = max(last_end, restriction_end) - last_start merged = merged[:-1] + [restriction] return merged @staticmethod def current_or_next_restriction( restrictions: list["Restriction"], dt: datetime.datetime ) -> tuple["Restriction", datetime.datetime]: """ Get the current or next restriction for a given datetime. This is useful for finding all the restrictions that apply to a given rotation shift. """ assert all(r.type == Restriction.Type.WEEKLY for r in restrictions) for weeks in (-1, 0, 1): # check last week, this week, and next week for restriction in restrictions: restriction_date = ( dt.date() - datetime.timedelta(days=dt.weekday()) + datetime.timedelta(days=restriction.start_day_of_week) + datetime.timedelta(weeks=weeks) ) restriction_start = datetime.datetime.combine( restriction_date, restriction.start_time_of_day, tzinfo=datetime.timezone.utc, ) restriction_end = restriction_start + restriction.duration if restriction_end > dt: return restriction, restriction_start # there should always be a restriction raise ValueError("No restriction found for given datetime") @dataclass class Override: start: datetime.datetime end: datetime.datetime user_id: str @classmethod def from_dict(cls, override: dict) -> "Override": # convert start and end to datetime objects in UTC start = datetime.datetime.fromisoformat(override["start"]).astimezone( datetime.timezone.utc ) end = datetime.datetime.fromisoformat(override["end"]).astimezone( datetime.timezone.utc ) return cls(start=start, end=end, user_id=override["user"]["id"]) def to_oncall_shift(self, user_id_map: dict[str, str]) -> dict: start = _dt_to_oncall_datetime(self.start) duration = int((self.end - self.start).total_seconds()) user_id = user_id_map[self.user_id] return { "name": uuid4().hex, "team_id": None, "type": "override", "time_zone": "UTC", "start": start, "duration": duration, "rotation_start": start, "users": [user_id], "source": 0, # 0 is alias for "web" }
example-idatastorebackend
example_sqlite
# -*- coding: utf-8 -*- # type: ignore import logging from ckanext.datastore.backend import DatastoreBackend from sqlalchemy import create_engine log = logging.getLogger(__name__) class DatastoreExampleSqliteBackend(DatastoreBackend): def __init__(self): self._engine = None def _get_engine(self): if not self._engine: self._engine = create_engine(self.write_url) return self._engine def _insert_records(self, table, records): if len(records): for record in records: self._get_engine().execute( 'INSERT INTO "{0}"({1}) VALUES({2})'.format( table, ", ".join(record.keys()), ", ".join(["?"] * len(record.keys())), ), list(record.values()), ) pass def configure(self, config): self.write_url = config.get("ckan.datastore.write_url").replace("example-", "") return config def create(self, context, data_dict): columns = str(", ".join([e["id"] + " text" for e in data_dict["fields"]])) engine = self._get_engine() engine.execute( ' CREATE TABLE IF NOT EXISTS "{name}"({columns});'.format( name=data_dict["resource_id"], columns=columns ) ) self._insert_records(data_dict["resource_id"], data_dict["records"]) return data_dict def upsert(self, context, data_dict): raise NotImplementedError() def delete(self, context, data_dict): engine = self._get_engine() engine.execute('DROP TABLE IF EXISTS "{0}"'.format(data_dict["resource_id"])) return data_dict def search(self, context, data_dict): engine = self._get_engine() result = engine.execute( 'SELECT * FROM "{0}" LIMIT {1}'.format( data_dict["resource_id"], data_dict.get("limit", 10) ) ) data_dict["records"] = list(map(dict, result.fetchall())) data_dict["total"] = len(data_dict["records"]) fields_info = [] for name, type in self.resource_fields(data_dict["resource_id"])[ "schema" ].items(): fields_info.append({"type": type, "id": name}) data_dict["fields"] = fields_info return data_dict def search_sql(self, context, data_dict): raise NotImplementedError() def make_private(self, context, data_dict): pass def make_public(self, context, data_dict): pass def resource_exists(self, id): return ( self._get_engine() .execute( ''' select name from sqlite_master where type = "table" and name = "{0}"'''.format(id) ) .fetchone() ) def resource_fields(self, id): engine = self._get_engine() info = engine.execute('PRAGMA table_info("{0}")'.format(id)).fetchall() schema = {} for col in info: schema[col.name] = col.type return {"schema": schema, "meta": {}} def resource_id_from_alias(self, alias): if self.resource_exists(alias): return True, alias return False, alias def get_all_ids(self): return [ t.name for t in self._get_engine() .execute( ''' select name from sqlite_master where type = "table"''' ) .fetchall() ]
python
noise
#!/usr/bin/env python # # Copyright 2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from argparse import ArgumentParser from gnuradio import audio, digital, gr from gnuradio.eng_arg import eng_float class my_top_block(gr.top_block): def __init__(self): gr.top_block.__init__(self) parser = ArgumentParser() parser.add_argument( "-O", "--audio-output", default="", help="pcm output device name. E.g., hw:0,0 or /dev/dsp", ) parser.add_argument( "-r", "--sample-rate", type=eng_float, default=48000, help="set sample rate to RATE (48000)", ) args = parser.parse_args() sample_rate = int(args.sample_rate) ampl = 0.1 src = digital.glfsr_source_b(32) # Pseudorandom noise source b2f = digital.chunks_to_symbols_bf([ampl, -ampl], 1) dst = audio.sink(sample_rate, args.audio_output) self.connect(src, b2f, dst) if __name__ == "__main__": try: my_top_block().run() except KeyboardInterrupt: pass
quickinsert
dynamics
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/ # # Copyright (c) 2008 - 2014 by Wilbert Berendsen # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # See http://www.gnu.org/licenses/ for more information. """ The Quick Insert panel dynamics Tool. """ import app import cursortools import documentactions import icons import ly.document import ly.lex.lilypond import ly.rhythm import lydocument import symbols import tokeniter from PyQt5.QtGui import QTextCursor from PyQt5.QtWidgets import QHBoxLayout, QToolButton from . import buttongroup, tool class Dynamics(tool.Tool): """Dynamics tool in the quick insert panel toolbox.""" def __init__(self, panel): super().__init__(panel) self.removemenu = QToolButton( self, autoRaise=True, popupMode=QToolButton.InstantPopup, icon=icons.get("edit-clear"), ) mainwindow = panel.parent().mainwindow() mainwindow.selectionStateChanged.connect(self.removemenu.setEnabled) self.removemenu.setEnabled(mainwindow.hasSelection()) ac = documentactions.DocumentActions.instance(mainwindow).actionCollection self.removemenu.addAction(ac.tools_quick_remove_dynamics) layout = QHBoxLayout() layout.addWidget(self.removemenu) layout.addStretch(1) self.layout().addLayout(layout) self.layout().addWidget(DynamicGroup(self)) self.layout().addWidget(SpannerGroup(self)) self.layout().addStretch(1) def icon(self): """Should return an icon for our tab.""" return symbols.icon("dynamic_f") def title(self): """Should return a title for our tab.""" return _("Dynamics") def tooltip(self): """Returns a tooltip""" return _("Dynamic symbols.") class Group(buttongroup.ButtonGroup): """Base class for dynamic button groups with insert implementation.""" def actionTriggered(self, name): name = name[8:] direction = ["_", "", "^"][self.direction() + 1] isSpanner = name not in dynamic_marks if isSpanner: dynamic = dynamic_spanners[name] else: dynamic = "\\" + name cursor = self.mainwindow().textCursor() if not cursor.hasSelection(): # dynamic right before the cursor? left = tokeniter.partition(cursor).left if not left or not isinstance(left[-1], ly.lex.lilypond.Dynamic): # no, find the first pitch c = lydocument.cursor(cursor) c.end = None for item in ly.rhythm.music_items(c, partial=ly.document.OUTSIDE): cursor.setPosition(item.end) break cursor.insertText(direction + dynamic) self.mainwindow().currentView().setTextCursor(cursor) else: c = lydocument.cursor(cursor) cursors = [] for item in ly.rhythm.music_items(c): csr = QTextCursor(cursor.document()) csr.setPosition(item.end) cursors.append(csr) if not cursors: return c1, c2 = cursors[0], cursors[-1] # are there dynamics at the cursor? then skip them d1 = dynamics(c1) if d1: c1 = tokeniter.cursor(c1.block(), d1[-1], start=len(d1[-1])) with cursortools.compress_undo(cursor): if len(cursors) > 1: # dynamics after the end cursor? d2 = dynamics(c2) if isSpanner and not d2: # don't terminate the spanner if there's a dynamic there c2.insertText("\\!") elif set(d1).intersection(dynamic_spanners.values()): # write the dynamic at the end if there's a spanner at start # remove ending \! if there terminator = tokeniter.find("\\!", d2) if terminator: c2 = tokeniter.cursor(c2.block(), terminator) if direction in d1: c2.insertText(dynamic) else: c2.insertText(direction + dynamic) return c1.insertText(direction + dynamic) class DynamicGroup(Group): def translateUI(self): # L10N: dynamic signs self.setTitle(_("Signs")) def actionData(self): """Should yield name, icon, function (may be None) for every action.""" for m in dynamic_marks: name = "dynamic_" + m yield name, symbols.icon(name), None def actionTexts(self): """Should yield name, text for very action.""" for m in dynamic_marks: name = "dynamic_" + m bold = "<b><i>{}</i></b>".format yield name, _("Dynamic sign {name}").format(name=bold(m)) class SpannerGroup(Group): def translateUI(self): self.setTitle(_("Spanners")) def actionData(self): """Should yield name, icon, function (may be None) for every action.""" for name, title in self.actionTexts(): yield name, symbols.icon(name), None def actionTexts(self): """Should yield name, text for very action.""" yield "dynamic_hairpin_cresc", _("Hairpin crescendo") yield "dynamic_cresc", _("Crescendo") yield "dynamic_hairpin_dim", _("Hairpin diminuendo") yield "dynamic_dim", _("Diminuendo") yield "dynamic_decresc", _("Decrescendo") def dynamics(cursor): """Returns a tuple of dynamic tokens (including _ or ^) at the cursor.""" right = tokeniter.partition(cursor).right i = 0 for j, t in enumerate(right, 1): if isinstance(t, ly.lex.lilypond.Dynamic): i = j elif not isinstance(t, (ly.lex.Space, ly.lex.lilypond.Direction)): break return right[:i] dynamic_marks = ( "f", "ff", "fff", "ffff", "fffff", "p", "pp", "ppp", "pppp", "ppppp", "mf", "mp", "fp", "sfz", "rfz", "sf", "sff", "sp", "spp", ) dynamic_spanners = { "hairpin_cresc": "\\<", "hairpin_dim": "\\>", "cresc": "\\cresc", "decresc": "\\decresc", "dim": "\\dim", }
lib
cssfilter
# The contents of this file are subject to the Common Public Attribution # License Version 1.0. (the "License"); you may not use this file except in # compliance with the License. You may obtain a copy of the License at # http://code.reddit.com/LICENSE. The License is based on the Mozilla Public # License Version 1.1, but Sections 14 and 15 have been added to cover use of # software over a computer network and provide for limited attribution for the # Original Developer. In addition, Exhibit A has been modified to be consistent # with Exhibit B. # # Software distributed under the License is distributed on an "AS IS" basis, # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for # the specific language governing rights and limitations under the License. # # The Original Code is reddit. # # The Original Developer is the Initial Developer. The Initial Developer of # the Original Code is reddit Inc. # # All portions of the code written by reddit are Copyright (c) 2006-2015 reddit # Inc. All Rights Reserved. ############################################################################### """Parse and validate a safe subset of CSS. The goal of this validation is not to ensure functionally correct stylesheets but rather that the stylesheet is safe to show to downstream users. This includes: * not generating requests to third party hosts (information leak) * xss via strange syntax in buggy browsers Beyond that, every effort is made to allow the full gamut of modern CSS. """ import itertools import re import unicodedata import tinycss2 from pylons.i18n import N_ from r2.lib.contrib import rcssmin from r2.lib.utils import tup __all__ = ["validate_css"] SIMPLE_TOKEN_TYPES = { "dimension", "hash", "ident", "literal", "number", "percentage", "string", "whitespace", } VENDOR_PREFIXES = { "-apple-", "-khtml-", "-moz-", "-ms-", "-o-", "-webkit-", } assert all(prefix == prefix.lower() for prefix in VENDOR_PREFIXES) SAFE_PROPERTIES = { "align-content", "align-items", "align-self", "animation", "animation-delay", "animation-direction", "animation-duration", "animation-fill-mode", "animation-iteration-count", "animation-name", "animation-play-state", "animation-timing-function", "appearance", "backface-visibility", "background", "background-attachment", "background-blend-mode", "background-clip", "background-color", "background-image", "background-origin", "background-position", "background-position-x", "background-position-y", "background-repeat", "background-size", "border", "border-bottom", "border-bottom-color", "border-bottom-left-radius", "border-bottom-right-radius", "border-bottom-style", "border-bottom-width", "border-collapse", "border-color", "border-image", "border-image-outset", "border-image-repeat", "border-image-slice", "border-image-source", "border-image-width", "border-left", "border-left-color", "border-left-style", "border-left-width", "border-radius", "border-radius-bottomleft", "border-radius-bottomright", "border-radius-topleft", "border-radius-topright", "border-right", "border-right-color", "border-right-style", "border-right-width", "border-spacing", "border-style", "border-top", "border-top-color", "border-top-left-radius", "border-top-right-radius", "border-top-style", "border-top-width", "border-width", "bottom", "box-shadow", "box-sizing", "caption-side", "clear", "clip", "clip-path", "color", "content", "counter-increment", "counter-reset", "cue", "cue-after", "cue-before", "cursor", "direction", "display", "elevation", "empty-cells", # the "filter" property cannot be safely added while IE9 is allowed to # use subreddit stylesheets. see explanation here: # https://github.com/reddit/reddit/pull/1058#issuecomment-76466180 # "filter", "flex", "flex-align", "flex-basis", "flex-direction", "flex-flow", "flex-grow", "flex-item-align", "flex-line-pack", "flex-order", "flex-pack", "flex-shrink", "flex-wrap", "float", "font", "font-family", "font-size", "font-style", "font-variant", "font-weight", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow", "grid-auto-position", "grid-auto-rows", "grid-column", "grid-column-start", "grid-column-end", "grid-row", "grid-row-start", "grid-row-end", "grid-template", "grid-template-areas", "grid-template-rows", "grid-template-columns", "hanging-punctuation", "height", "hyphens", "image-orientation", "image-rendering", "image-resolution", "justify-content", "left", "letter-spacing", "line-break", "line-height", "list-style", "list-style-image", "list-style-position", "list-style-type", "margin", "margin-bottom", "margin-left", "margin-right", "margin-top", "max-height", "max-width", "mask", "mask-border", "mask-border-mode", "mask-border-outset", "mask-border-repeat", "mask-border-source", "mask-border-slice", "mask-border-width", "mask-clip", "mask-composite", "mask-image", "mask-mode", "mask-origin", "mask-position", "mask-repeat", "mask-size", "min-height", "min-width", "mix-blend-mode", "opacity", "order", "orphans", "outline", "outline-color", "outline-offset", "outline-style", "outline-width", "overflow", "overflow-wrap", "overflow-x", "overflow-y", "padding", "padding-bottom", "padding-left", "padding-right", "padding-top", "page-break-after", "page-break-before", "page-break-inside", "pause", "pause-after", "pause-before", "perspective", "perspective-origin", "pitch", "pitch-range", "play-during", "pointer-events", "position", "quotes", "resize", "richness", "right", "speak", "speak-header", "speak-numeral", "speak-punctuation", "speech-rate", "stress", "table-layout", "tab-size", "text-align", "text-align-last", "text-decoration", "text-decoration-color", "text-decoration-line", "text-decoration-skip", "text-decoration-style", "text-indent", "text-justify", "text-overflow", "text-rendering", "text-shadow", "text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position", "text-wrap", "top", "transform", "transform-origin", "transform-style", "transition", "transition-delay", "transition-duration", "transition-property", "transition-timing-function", "unicode-bidi", "vertical-align", "visibility", "voice-family", "volume", "white-space", "widows", "width", "will-change", "word-break", "word-spacing", "z-index", } assert all(property == property.lower() for property in SAFE_PROPERTIES) SAFE_FUNCTIONS = { "attr", "calc", "circle", "counter", "counters", "cubic-bezier", "ellipse", "hsl", "hsla", "lang", "line", "linear-gradient", "matrix", "matrix3d", "not", "nth-child", "nth-last-child", "nth-last-of-type", "nth-of-type", "perspective", "polygon", "polyline", "radial-gradient", "rect", "repeating-linear-gradient", "repeating-radial-gradient", "rgb", "rgba", "rotate", "rotate3d", "rotatex", "rotatey", "rotatez", "scale", "scale3d", "scalex", "scaley", "scalez", "skewx", "skewy", "steps", "translate", "translate3d", "translatex", "translatey", "translatez", } assert all(function == function.lower() for function in SAFE_FUNCTIONS) ERROR_MESSAGES = { "IMAGE_NOT_FOUND": N_('no image found with name "%(name)s"'), "NON_PLACEHOLDER_URL": N_( "only uploaded images are allowed; reference " "them with the %%%%imagename%%%% system" ), "SYNTAX_ERROR": N_("syntax error: %(message)s"), "UNKNOWN_AT_RULE": N_("@%(keyword)s is not allowed"), "UNKNOWN_PROPERTY": N_('unknown property "%(name)s"'), "UNKNOWN_FUNCTION": N_('unknown function "%(function)s"'), "UNEXPECTED_TOKEN": N_('unexpected token "%(token)s"'), "BACKSLASH": N_("backslashes are not allowed"), "CONTROL_CHARACTER": N_("control characters are not allowed"), "TOO_BIG": N_("the stylesheet is too big. maximum size: %(size)d KiB"), } MAX_SIZE_KIB = 100 SUBREDDIT_IMAGE_URL_PLACEHOLDER = re.compile(r"\A%%([a-zA-Z0-9\-]+)%%\Z") def strip_vendor_prefix(identifier): for prefix in VENDOR_PREFIXES: if identifier.startswith(prefix): return identifier[len(prefix) :] return identifier class ValidationError(object): def __init__(self, line_number, error_code, message_params=None): self.line = line_number self.error_code = error_code self.message_params = message_params or {} # note: _source_lines is added to these objects by the parser @property def offending_line(self): return self._source_lines[self.line - 1] @property def message_key(self): return ERROR_MESSAGES[self.error_code] class StylesheetValidator(object): def __init__(self, images): self.images = images def validate_url(self, url_node): m = SUBREDDIT_IMAGE_URL_PLACEHOLDER.match(url_node.value) if not m: return ValidationError(url_node.source_line, "NON_PLACEHOLDER_URL") image_name = m.group(1) if image_name not in self.images: return ValidationError( url_node.source_line, "IMAGE_NOT_FOUND", {"name": image_name} ) # rewrite the url value to the actual url of the image url_node.value = self.images[image_name] def validate_function(self, function_node): function_name = strip_vendor_prefix(function_node.lower_name) if function_name not in SAFE_FUNCTIONS: return ValidationError( function_node.source_line, "UNKNOWN_FUNCTION", {"function": function_node.name}, ) # property: attr(something url) # https://developer.mozilla.org/en-US/docs/Web/CSS/attr elif function_name == "attr": for argument in function_node.arguments: if argument.type == "ident" and argument.lower_value == "url": return ValidationError(argument.source_line, "NON_PLACEHOLDER_URL") return self.validate_component_values(function_node.arguments) def validate_block(self, block): return self.validate_component_values(block.content) def validate_component_values(self, component_values): return self.validate_list( component_values, { # {} blocks are technically part of component values but i don't # know of any actual valid uses for them in selectors etc. and they # can cause issues with e.g. # Safari 5: p[foo=bar{}*{background:green}]{background:red} "[] block": self.validate_block, "() block": self.validate_block, "url": self.validate_url, "function": self.validate_function, }, ignored_types=SIMPLE_TOKEN_TYPES, ) def validate_declaration(self, declaration): if strip_vendor_prefix(declaration.lower_name) not in SAFE_PROPERTIES: return ValidationError( declaration.source_line, "UNKNOWN_PROPERTY", {"name": declaration.name} ) return self.validate_component_values(declaration.value) def validate_declaration_list(self, declarations): return self.validate_list( declarations, { "at-rule": self.validate_at_rule, "declaration": self.validate_declaration, }, ) def validate_qualified_rule(self, rule): prelude_errors = self.validate_component_values(rule.prelude) declarations = tinycss2.parse_declaration_list(rule.content) declaration_errors = self.validate_declaration_list(declarations) return itertools.chain(prelude_errors, declaration_errors) def validate_at_rule(self, rule): prelude_errors = self.validate_component_values(rule.prelude) keyword = strip_vendor_prefix(rule.lower_at_keyword) if keyword in ("media", "keyframes"): rules = tinycss2.parse_rule_list(rule.content) rule_errors = self.validate_rule_list(rules) elif keyword == "page": rule_errors = self.validate_qualified_rule(rule) else: return ValidationError( rule.source_line, "UNKNOWN_AT_RULE", {"keyword": rule.at_keyword} ) return itertools.chain(prelude_errors, rule_errors) def validate_rule_list(self, rules): return self.validate_list( rules, { "qualified-rule": self.validate_qualified_rule, "at-rule": self.validate_at_rule, }, ) def validate_list(self, nodes, validators_by_type, ignored_types=None): for node in nodes: if node.type == "error": yield ValidationError( node.source_line, "SYNTAX_ERROR", {"message": node.message} ) continue elif node.type == "literal": if node.value == ";": # if we're seeing a semicolon as a literal, it's in a place # that doesn't fit naturally in the syntax. # Safari 5 will treat this as two color properties: # color: calc(;color:red;); message = "semicolons are not allowed in this context" yield ValidationError( node.source_line, "SYNTAX_ERROR", {"message": message} ) continue validator = validators_by_type.get(node.type) if validator: for error in tup(validator(node)): if error: yield error else: if not ignored_types or node.type not in ignored_types: yield ValidationError( node.source_line, "UNEXPECTED_TOKEN", {"token": node.type} ) def check_for_evil_codepoints(self, source_lines): for line_number, line_text in enumerate(source_lines, start=1): for codepoint in line_text: # IE<8: *{color: expression\28 alert\28 1 \29 \29 } if codepoint == "\\": yield ValidationError(line_number, "BACKSLASH") break # accept these characters that get classified as control elif codepoint in ("\t", "\n", "\r"): continue # Safari: *{font-family:'foobar\x03;background:url(evil);';} elif unicodedata.category(codepoint).startswith("C"): yield ValidationError(line_number, "CONTROL_CHARACTER") break def parse_and_validate(self, stylesheet_source): if len(stylesheet_source) > (MAX_SIZE_KIB * 1024): return "", [ValidationError(0, "TOO_BIG", {"size": MAX_SIZE_KIB})] nodes = tinycss2.parse_stylesheet(stylesheet_source) source_lines = stylesheet_source.splitlines() backslash_errors = self.check_for_evil_codepoints(source_lines) validation_errors = self.validate_rule_list(nodes) errors = [] for error in itertools.chain(backslash_errors, validation_errors): error._source_lines = source_lines errors.append(error) errors.sort(key=lambda e: e.line) if not errors: serialized = rcssmin.cssmin(tinycss2.serialize(nodes)) else: serialized = "" return serialized.encode("utf-8"), errors def validate_css(stylesheet, images): """Validate and re-serialize the user submitted stylesheet. images is a mapping of subreddit image names to their URLs. The re-serialized stylesheet will have %%name%% tokens replaced with their appropriate URLs. The return value is a two-tuple of the re-serialized (and minified) stylesheet and a list of errors. If the list is empty, the stylesheet is valid. """ assert isinstance(stylesheet, unicode) validator = StylesheetValidator(images) return validator.parse_and_validate(stylesheet)
extractor
yourporn
from __future__ import unicode_literals from ..compat import compat_str from ..utils import parse_duration, urljoin from .common import InfoExtractor class YourPornIE(InfoExtractor): _VALID_URL = r"https?://(?:www\.)?sxyprn\.com/post/(?P<id>[^/?#&.]+)" _TESTS = [ { "url": "https://sxyprn.com/post/57ffcb2e1179b.html", "md5": "6f8682b6464033d87acaa7a8ff0c092e", "info_dict": { "id": "57ffcb2e1179b", "ext": "mp4", "title": "md5:c9f43630bd968267672651ba905a7d35", "thumbnail": r"re:^https?://.*\.jpg$", "duration": 165, "age_limit": 18, }, "params": { "skip_download": True, }, }, { "url": "https://sxyprn.com/post/57ffcb2e1179b.html", "only_matching": True, }, ] def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) parts = self._parse_json( self._search_regex( r'data-vnfo=(["\'])(?P<data>{.+?})\1', webpage, "data info", group="data", ), video_id, )[video_id].split("/") num = 0 for c in parts[6] + parts[7]: if c.isnumeric(): num += int(c) parts[5] = compat_str(int(parts[5]) - num) parts[1] += "8" video_url = urljoin(url, "/".join(parts)) title = ( self._search_regex( r'<[^>]+\bclass=["\']PostEditTA[^>]+>([^<]+)', webpage, "title", default=None, ) or self._og_search_description(webpage) ).strip() thumbnail = self._og_search_thumbnail(webpage) duration = parse_duration( self._search_regex( r"duration\s*:\s*<[^>]+>([\d:]+)", webpage, "duration", default=None ) ) return { "id": video_id, "url": video_url, "title": title, "thumbnail": thumbnail, "duration": duration, "age_limit": 18, "ext": "mp4", }
fta
conditionalevent
"""Conditional Event item definition.""" from gaphor.diagram.presentation import ( Classified, ElementPresentation, from_package_str, ) from gaphor.diagram.shapes import Box, IconBox, Text from gaphor.diagram.support import represents from gaphor.diagram.text import FontStyle, FontWeight from gaphor.RAAML import raaml from gaphor.RAAML.fta.basicevent import draw_basic_event from gaphor.UML.recipes import stereotypes_str @represents(raaml.ConditionalEvent) class ConditionalEventItem(Classified, ElementPresentation): def __init__(self, diagram, id=None): super().__init__(diagram, id, width=70, height=35) self.watch("subject[NamedElement].name").watch( "subject[NamedElement].namespace.name" ) def update_shapes(self, event=None): self.shape = IconBox( Box( draw=draw_basic_event, ), Text( text=lambda: stereotypes_str( self.subject, [self.diagram.gettext("Conditional Event")] ), ), Text( text=lambda: self.subject.name or "", width=lambda: self.width - 4, style={ "font-weight": FontWeight.BOLD, "font-style": FontStyle.NORMAL, }, ), Text( text=lambda: from_package_str(self), style={"font-size": "x-small"}, ), )
accounts
OneFichierCom
# -*- coding: utf-8 -*- import re import time from pyload.core.network.http.exceptions import BadHeader from ..base.account import BaseAccount class OneFichierCom(BaseAccount): __name__ = "OneFichierCom" __type__ = "account" __version__ = "0.24" __status__ = "testing" __description__ = """1fichier.com account plugin""" __license__ = "GPLv3" __authors__ = [ ("Elrick69", "elrick69[AT]rocketmail[DOT]com"), ("Walter Purcaro", "vuolter@gmail.com"), ("GammaC0de", "nitzo2001[AT]yahoo[DOT]com"), ] VALID_UNTIL_PATTERN = r'valid until <span style="font-weight:bold">(\d+\-\d+\-\d+)<' def grab_info(self, user, password, data): validuntil = None trafficleft = -1 premium = False html = self.load("https://1fichier.com/console/abo.pl") m = re.search(self.VALID_UNTIL_PATTERN, html) if m is not None: expire_date = m.group(1) self.log_debug("Expire date: " + expire_date) try: validuntil = time.mktime(time.strptime(expire_date, "%Y-%m-%d")) except Exception as exc: self.log_error(exc) else: premium = True return { "validuntil": validuntil, "trafficleft": trafficleft, "premium": premium, } def signin(self, user, password, data): login_url = "https://1fichier.com/login.pl?lg=en" try: html = self.load( login_url, ref=login_url, post={ "mail": user, "pass": password, "It": "on", "purge": "off", "valider": "Send", }, ) if any( x in html for x in ( ">Invalid username or Password", ">Invalid email address", ">Invalid password", ) ): self.fail_login() except BadHeader as exc: if exc.code == 403: self.fail_login() else: raise
Code
GestorGM
import copy import random from Code import GM, Apertura, Gestor, Jugada, Util from Code.Constantes import * from Code.QT import PantallaGM, PantallaJuicio, QTUtil2 class GestorGM(Gestor.Gestor): def inicio(self, record): self.tipoJuego = kJugGM self.ayudas = 9999 # Para que analice sin problemas self.puntos = 0 self.record = record self.siWoman = self.record.siWoman self.gm = record.gm self.siBlancas = record.siBlancas self.modo = record.modo self.siJuez = record.siJuez self.showevals = record.showevals self.motor = record.motor self.tiempo = record.tiempo self.depth = record.depth self.multiPV = record.multiPV self.mostrar = record.mostrar self.jugContrario = record.jugContrario self.jugInicial = record.jugInicial self.partidaElegida = record.partidaElegida self.bypassBook = record.bypassBook self.apertura = record.apertura self.onBypassBook = True if self.bypassBook else False if self.onBypassBook: self.bypassBook.polyglot() self.onApertura = True if self.apertura else False self.siAnalizando = False if self.siJuez: self.puntos = 0 tutor = self.configuracion.buscaRivalExt(self.motor) t_t = self.tiempo * 100 self.xtutor = self.procesador.creaGestorMotor(tutor, t_t, self.depth) self.xtutor.actMultiPV(self.multiPV) self.analisis = None self.book = Apertura.AperturaPol(999) self.pensando(True) default = "WGM" if self.siWoman else "GM" carpeta = ( default if self.modo == "estandar" else self.configuracion.dirPersonalTraining ) self.motorGM = GM.GM(carpeta, self.gm) self.motorGM.colorFilter(self.siBlancas) if self.partidaElegida is not None: self.motorGM.ponPartidaElegida(self.partidaElegida) self.siJugamosConBlancas = self.siBlancas self.siRivalConBlancas = not self.siBlancas self.pensando(False) self.pantalla.ponToolBar((k_mainmenu, k_reiniciar, k_configurar, k_utilidades)) self.pantalla.activaJuego(True, False) self.ponMensajero(self.mueveHumano) self.ponPosicion(self.partida.ultPosicion) self.mostrarIndicador(True) self.quitaAyudas() self.ponPiezasAbajo(self.siBlancas) dic = GM.dicGM(self.siWoman) self.nombreGM = dic[self.gm.lower()] if self.modo == "estandar" else self.gm rot = _("Woman Grandmaster") if self.siWoman else _("Grandmaster") rotulo1 = rot + ": <b>%s</b>" if self.modo == "estandar" else "<b>%s</b>" self.ponRotulo1(rotulo1 % self.nombreGM) self.nombreRival = "" self.textoPuntuacion = "" self.ponRotuloSecundario() self.pgnRefresh(True) self.ponCapInfoPorDefecto() self.estado = kJugando self.ponPosicionDGT() self.siguienteJugada() def ponRotuloSecundario(self): self.ponRotulo2(self.nombreRival + "<br><br>" + self.textoPuntuacion) def procesarAccion(self, clave): if clave == k_mainmenu: self.finPartida() elif clave == k_reiniciar: self.reiniciar() elif clave == k_configurar: self.configurar(siSonidos=True) elif clave == k_utilidades: self.utilidades() elif clave in self.procesador.liOpcionesInicio: self.procesador.procesarAccion(clave) else: Gestor.Gestor.rutinaAccionDef(self, clave) def finalX(self): if self.estado == kFinJuego: return True return self.finPartida() def finPartida(self): self.analizaTerminar() siJugadas = self.partida.numJugadas() > 0 if siJugadas and self.estado != kFinJuego: self.resultado = kDesconocido self.partida.last_jg().siDesconocido = True # self.guardarNoTerminados( ) self.ponFinJuego() self.procesador.inicio() return False def reiniciar(self): if QTUtil2.pregunta(self.pantalla, _("Restart the game?")): self.analizaTerminar() self.partida.reset() self.inicio(self.record) def analizaInicio(self): if not self.siTerminada(): self.xtutor.ac_inicio(self.partida) self.siAnalizando = True def analizaEstado(self): self.xtutor.motor.ac_lee() self.mrm = copy.deepcopy(self.xtutor.ac_estado()) return self.mrm def analizaMinimo(self, minTime): self.mrm = copy.deepcopy(self.xtutor.ac_minimo(minTime, False)) return self.mrm def analizaFinal(self): if self.siAnalizando: self.siAnalizando = False self.xtutor.ac_final(-1) def siguienteJugada(self): self.analizaTerminar() self.desactivaTodas() if self.estado == kFinJuego: return self.estado = kJugando self.siJuegaHumano = False self.ponVista() siBlancas = self.partida.ultPosicion.siBlancas if (self.partida.numJugadas() > 0) and self.motorGM.isFinished(): self.ponResultado() return self.ponIndicador(siBlancas) self.refresh() siRival = siBlancas == self.siRivalConBlancas if self.jugInicial > 1: siJugInicial = (self.partida.numJugadas() / 2 + 1) <= self.jugInicial else: siJugInicial = False liAlternativas = self.motorGM.alternativas() nliAlternativas = len(liAlternativas) # Movimiento automatico if siJugInicial or self.onApertura or self.onBypassBook: siBuscar = True if self.onApertura: liPV = self.apertura.a1h8.split(" ") nj = self.partida.numJugadas() if len(liPV) > nj: move = liPV[nj] if move in liAlternativas: siBuscar = False else: self.onApertura = False else: self.onApertura = False if siBuscar: if self.onBypassBook: liJugadas = self.bypassBook.miraListaJugadas(self.fenUltimo()) liN = [] for desde, hasta, coronacion, pgn, peso in liJugadas: move = desde + hasta + coronacion if move in liAlternativas: liN.append(move) if liN: siBuscar = False nliAlternativas = len(liN) if nliAlternativas > 1: pos = random.randint(0, nliAlternativas - 1) move = liN[pos] else: move = liN[0] else: self.onBypassBook = None if siBuscar: if siJugInicial: siBuscar = False if nliAlternativas > 1: pos = random.randint(0, nliAlternativas - 1) move = liAlternativas[pos] elif nliAlternativas == 1: move = liAlternativas[0] if not siBuscar: self.mueveRival(move) self.siguienteJugada() return if siRival: if nliAlternativas > 1: if self.jugContrario: liJugadas = self.motorGM.dameJugadasTXT( self.partida.ultPosicion, False ) desde, hasta, coronacion = PantallaGM.eligeJugada( self, liJugadas, False ) move = desde + hasta + coronacion else: pos = random.randint(0, nliAlternativas - 1) move = liAlternativas[pos] else: move = liAlternativas[0] self.mueveRival(move) self.siguienteJugada() else: self.siJuegaHumano = True self.pensando(True) self.analizaInicio() self.activaColor(siBlancas) self.pensando(False) def analizaTerminar(self): if self.siAnalizando: self.siAnalizando = False self.xtutor.terminar() def mueveHumano(self, desde, hasta, coronacion=None): jgUsu = self.checkMueveHumano(desde, hasta, coronacion) if not jgUsu: return False movimiento = jgUsu.movimiento() posicion = self.partida.ultPosicion isValid = self.motorGM.isValidMove(movimiento) analisis = None if not isValid: self.tablero.ponPosicion(posicion) self.tablero.activaColor(self.siJugamosConBlancas) liJugadas = self.motorGM.dameJugadasTXT(posicion, True) desdeGM, hastaGM, coronacionGM = PantallaGM.eligeJugada( self, liJugadas, True ) siAnalizaJuez = self.siJuez if siAnalizaJuez: if self.book: fen = self.fenUltimo() siH = self.book.compruebaHumano(fen, desde, hasta) siGM = self.book.compruebaHumano(fen, desdeGM, hastaGM) if siGM and siH: siAnalizaJuez = False else: self.book = False else: siAnalizaJuez = ( self.siJuez and self.mostrar is None ) # None es ver siempre False no ver nunca True ver si diferentes if len(movimiento) == 5: coronacion = movimiento[4].lower() desdeGM, hastaGM, coronacionGM = desde, hasta, coronacion siBien, mens, jgGM = Jugada.dameJugada(posicion, desdeGM, hastaGM, coronacionGM) movGM = jgGM.pgnSP() movUsu = jgUsu.pgnSP() if siAnalizaJuez: um = QTUtil2.analizando(self.pantalla) mrm = self.analizaMinimo(self.tiempo * 100) rmUsu, nada = mrm.buscaRM(jgUsu.movimiento()) if rmUsu is None: um = QTUtil2.analizando(self.pantalla) self.analizaFinal() rmUsu = self.xtutor.valora(posicion, desde, hasta, coronacion) mrm.agregaRM(rmUsu) self.analizaInicio() um.final() rmGM, posGM = mrm.buscaRM(jgGM.movimiento()) if rmGM is None: self.analizaFinal() rmGM = self.xtutor.valora(posicion, desdeGM, hastaGM, coronacionGM) posGM = mrm.agregaRM(rmGM) self.analizaInicio() um.final() analisis = mrm, posGM dpts = rmUsu.puntosABS() - rmGM.puntosABS() if self.mostrar is None or (self.mostrar == True and not isValid): w = PantallaJuicio.WJuicio( self, self.xtutor, self.nombreGM, posicion, mrm, rmGM, rmUsu, analisis, siCompetitivo=not self.showevals, ) w.exec_() rm, posGM = w.analisis[0].buscaRM(jgGM.movimiento()) analisis = w.analisis[0], posGM dpts = w.difPuntos() self.puntos += dpts comentario0 = "<b>%s</b> : %s = %s<br>" % ( self.configuracion.jugador, movUsu, rmUsu.texto(), ) comentario0 += "<b>%s</b> : %s = %s<br>" % ( self.nombreGM, movGM, rmGM.texto(), ) comentario1 = "<br><b>%s</b> = %+d<br>" % (_("Difference"), dpts) comentario2 = "<b>%s</b> = %+d<br>" % (_("Points accumulated"), self.puntos) self.textoPuntuacion = comentario2 self.ponRotuloSecundario() if not isValid: jgGM.comentario = ( (comentario0 + comentario1 + comentario2) .replace("<b>", "") .replace("</b>", "") .replace("<br>", "\n") ) self.analizaFinal() self.movimientosPiezas(jgGM.liMovs) self.partida.ultPosicion = jgGM.posicion jgGM.analisis = analisis self.masJugada(jgGM, True) self.error = "" self.siguienteJugada() return True def analizaPosicion(self, fila, clave): if self.estado != kFinJuego: return Gestor.Gestor.analizaPosicion(self, fila, clave) def mueveRival(self, move): desde = move[:2] hasta = move[2:4] coronacion = move[4:] siBien, mens, jg = Jugada.dameJugada( self.partida.ultPosicion, desde, hasta, coronacion ) if siBien: self.partida.ultPosicion = jg.posicion self.error = "" self.masJugada(jg, False) self.movimientosPiezas(jg.liMovs, True) return True else: self.error = mens return False def masJugada(self, jg, siNuestra): # Preguntamos al motor si hay movimiento if self.siTerminada(): jg.siJaqueMate = jg.siJaque jg.siAhogado = not jg.siJaque self.partida.append_jg(jg) if self.partida.pendienteApertura: self.partida.asignaApertura() self.ponFlechaSC(jg.desde, jg.hasta) self.beepExtendido(siNuestra) txt = self.motorGM.rotuloPartidaSiUnica(siGM=self.modo == "estandar") if txt: self.nombreRival = txt self.ponRotuloSecundario() self.pgnRefresh(self.partida.ultPosicion.siBlancas) self.refresh() self.motorGM.play(jg.movimiento()) self.ponPosicionDGT() def ponResultado(self): self.estado = kFinJuego self.tablero.desactivaTodas() mensaje = _("Game ended") txt, porc, txtResumen = self.motorGM.resultado(self.partida) mensaje += "<br><br>" + txt if self.siJuez: mensaje += "<br><br><b>%s</b> = %+d<br>" % ( _("Points accumulated"), self.puntos, ) # QTUtil2.mensaje(self.pantalla, mensaje, siResalta=False) self.mensajeEnPGN(mensaje) dbHisto = Util.DicSQL(self.configuracion.ficheroGMhisto) gmK = "P_%s" % self.gm if self.modo == "personal" else self.gm dic = {} dic["FECHA"] = Util.hoy() dic["PUNTOS"] = self.puntos dic["PACIERTOS"] = porc dic["JUEZ"] = self.motor dic["TIEMPO"] = self.tiempo dic["RESUMEN"] = txtResumen liHisto = dbHisto[gmK] if liHisto is None: liHisto = [] liHisto.insert(0, dic) dbHisto[gmK] = liHisto dbHisto.pack() dbHisto.close()
extractor
picarto
# coding: utf-8 from __future__ import unicode_literals from ..utils import ExtractorError, js_to_json from .common import InfoExtractor class PicartoIE(InfoExtractor): _VALID_URL = r"https?://(?:www.)?picarto\.tv/(?P<id>[a-zA-Z0-9]+)" _TEST = { "url": "https://picarto.tv/Setz", "info_dict": { "id": "Setz", "ext": "mp4", "title": "re:^Setz [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$", "timestamp": int, "is_live": True, }, "skip": "Stream is offline", } @classmethod def suitable(cls, url): return ( False if PicartoVodIE.suitable(url) else super(PicartoIE, cls).suitable(url) ) def _real_extract(self, url): channel_id = self._match_id(url) data = self._download_json( "https://ptvintern.picarto.tv/ptvapi", channel_id, query={ "query": """{ channel(name: "%s") { adult id online stream_name title } getLoadBalancerUrl(channel_name: "%s") { url } }""" % (channel_id, channel_id), }, )["data"] metadata = data["channel"] if metadata.get("online") == 0: raise ExtractorError("Stream is offline", expected=True) title = metadata["title"] cdn_data = self._download_json( data["getLoadBalancerUrl"]["url"] + "/stream/json_" + metadata["stream_name"] + ".js", channel_id, "Downloading load balancing info", ) formats = [] for source in cdn_data.get("source") or []: source_url = source.get("url") if not source_url: continue source_type = source.get("type") if source_type == "html5/application/vnd.apple.mpegurl": formats.extend( self._extract_m3u8_formats( source_url, channel_id, "mp4", m3u8_id="hls", fatal=False ) ) elif source_type == "html5/video/mp4": formats.append( { "url": source_url, } ) self._sort_formats(formats) mature = metadata.get("adult") if mature is None: age_limit = None else: age_limit = 18 if mature is True else 0 return { "id": channel_id, "title": self._live_title(title.strip()), "is_live": True, "channel": channel_id, "channel_id": metadata.get("id"), "channel_url": "https://picarto.tv/%s" % channel_id, "age_limit": age_limit, "formats": formats, } class PicartoVodIE(InfoExtractor): _VALID_URL = r"https?://(?:www.)?picarto\.tv/videopopout/(?P<id>[^/?#&]+)" _TESTS = [ { "url": "https://picarto.tv/videopopout/ArtofZod_2017.12.12.00.13.23.flv", "md5": "3ab45ba4352c52ee841a28fb73f2d9ca", "info_dict": { "id": "ArtofZod_2017.12.12.00.13.23.flv", "ext": "mp4", "title": "ArtofZod_2017.12.12.00.13.23.flv", "thumbnail": r"re:^https?://.*\.jpg", }, }, { "url": "https://picarto.tv/videopopout/Plague", "only_matching": True, }, ] def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) vod_info = self._parse_json( self._search_regex( r'(?s)#vod-player["\']\s*,\s*(\{.+?\})\s*\)', webpage, video_id ), video_id, transform_source=js_to_json, ) formats = self._extract_m3u8_formats( vod_info["vod"], video_id, "mp4", entry_protocol="m3u8_native", m3u8_id="hls", ) self._sort_formats(formats) return { "id": video_id, "title": video_id, "thumbnail": vod_info.get("vodThumb"), "formats": formats, }
core
authmanager
# # Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com> # Copyright (C) 2011 Pedro Algarvio <pedro@algarvio.me> # # This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with # the additional special exception to link portions of this program with the OpenSSL library. # See LICENSE for more details. # import logging import os import shutil import deluge.component as component import deluge.configmanager as configmanager from deluge.common import ( AUTH_LEVEL_ADMIN, AUTH_LEVEL_DEFAULT, AUTH_LEVEL_NONE, AUTH_LEVEL_NORMAL, AUTH_LEVEL_READONLY, create_localclient_account, ) from deluge.error import AuthenticationRequired, AuthManagerError, BadLoginError log = logging.getLogger(__name__) AUTH_LEVELS_MAPPING = { "NONE": AUTH_LEVEL_NONE, "READONLY": AUTH_LEVEL_READONLY, "DEFAULT": AUTH_LEVEL_DEFAULT, "NORMAL": AUTH_LEVEL_NORMAL, "ADMIN": AUTH_LEVEL_ADMIN, } AUTH_LEVELS_MAPPING_REVERSE = {v: k for k, v in AUTH_LEVELS_MAPPING.items()} class Account: __slots__ = ("username", "password", "authlevel") def __init__(self, username, password, authlevel): self.username = username self.password = password self.authlevel = authlevel def data(self): return { "username": self.username, "password": self.password, "authlevel": AUTH_LEVELS_MAPPING_REVERSE[self.authlevel], "authlevel_int": self.authlevel, } def __repr__(self): return '<Account username="{username}" authlevel={authlevel}>'.format( username=self.username, authlevel=self.authlevel, ) class AuthManager(component.Component): def __init__(self): component.Component.__init__(self, "AuthManager", interval=10) self.__auth = {} self.__auth_modification_time = None def start(self): self.__load_auth_file() def stop(self): self.__auth = {} def shutdown(self): pass def update(self): auth_file = configmanager.get_config_dir("auth") # Check for auth file and create if necessary if not os.path.isfile(auth_file): log.info("Authfile not found, recreating it.") self.__load_auth_file() return auth_file_modification_time = os.stat(auth_file).st_mtime if self.__auth_modification_time != auth_file_modification_time: log.info("Auth file changed, reloading it!") self.__load_auth_file() def authorize(self, username, password): """Authorizes users based on username and password. Args: username (str): Username password (str): Password Returns: int: The auth level for this user. Raises: AuthenticationRequired: If additional details are required to authenticate. BadLoginError: If the username does not exist or password does not match. """ if not username: raise AuthenticationRequired( "Username and Password are required.", username ) if username not in self.__auth: # Let's try to re-load the file.. Maybe it's been updated self.__load_auth_file() if username not in self.__auth: raise BadLoginError("Username does not exist", username) if self.__auth[username].password == password: # Return the users auth level return self.__auth[username].authlevel elif not password and self.__auth[username].password: raise AuthenticationRequired("Password is required", username) else: raise BadLoginError("Password does not match", username) def has_account(self, username): return username in self.__auth def get_known_accounts(self): """Returns a list of known deluge usernames.""" self.__load_auth_file() return [account.data() for account in self.__auth.values()] def create_account(self, username, password, authlevel): if username in self.__auth: raise AuthManagerError("Username in use.", username) if authlevel not in AUTH_LEVELS_MAPPING: raise AuthManagerError("Invalid auth level: %s" % authlevel) try: self.__auth[username] = Account( username, password, AUTH_LEVELS_MAPPING[authlevel] ) self.write_auth_file() return True except Exception as ex: log.exception(ex) raise ex def update_account(self, username, password, authlevel): if username not in self.__auth: raise AuthManagerError("Username not known", username) if authlevel not in AUTH_LEVELS_MAPPING: raise AuthManagerError("Invalid auth level: %s" % authlevel) try: self.__auth[username].username = username self.__auth[username].password = password self.__auth[username].authlevel = AUTH_LEVELS_MAPPING[authlevel] self.write_auth_file() return True except Exception as ex: log.exception(ex) raise ex def remove_account(self, username): if username not in self.__auth: raise AuthManagerError("Username not known", username) elif username == component.get("RPCServer").get_session_user(): raise AuthManagerError( "You cannot delete your own account while logged in!", username ) del self.__auth[username] self.write_auth_file() return True def write_auth_file(self): filename = "auth" filepath = os.path.join(configmanager.get_config_dir(), filename) filepath_bak = filepath + ".bak" filepath_tmp = filepath + ".tmp" try: if os.path.isfile(filepath): log.debug("Creating backup of %s at: %s", filename, filepath_bak) shutil.copy2(filepath, filepath_bak) except OSError as ex: log.error("Unable to backup %s to %s: %s", filepath, filepath_bak, ex) else: log.info("Saving the %s at: %s", filename, filepath) try: with open(filepath_tmp, "w", encoding="utf8") as _file: for account in self.__auth.values(): _file.write( "%(username)s:%(password)s:%(authlevel_int)s\n" % account.data() ) _file.flush() os.fsync(_file.fileno()) shutil.move(filepath_tmp, filepath) except OSError as ex: log.error("Unable to save %s: %s", filename, ex) if os.path.isfile(filepath_bak): log.info("Restoring backup of %s from: %s", filename, filepath_bak) shutil.move(filepath_bak, filepath) self.__load_auth_file() def __load_auth_file(self): save_and_reload = False filename = "auth" auth_file = configmanager.get_config_dir(filename) auth_file_bak = auth_file + ".bak" # Check for auth file and create if necessary if not os.path.isfile(auth_file): create_localclient_account() return self.__load_auth_file() auth_file_modification_time = os.stat(auth_file).st_mtime if self.__auth_modification_time is None: self.__auth_modification_time = auth_file_modification_time elif self.__auth_modification_time == auth_file_modification_time: # File didn't change, no need for re-parsing's return for _filepath in (auth_file, auth_file_bak): log.info("Opening %s for load: %s", filename, _filepath) try: with open(_filepath, encoding="utf8") as _file: file_data = _file.readlines() except OSError as ex: log.warning("Unable to load %s: %s", _filepath, ex) file_data = [] else: log.info("Successfully loaded %s: %s", filename, _filepath) break # Load the auth file into a dictionary: {username: Account(...)} for line in file_data: line = line.strip() if line.startswith("#") or not line: # This line is a comment or empty continue lsplit = line.split(":") if len(lsplit) == 2: username, password = lsplit log.warning( "Your auth entry for %s contains no auth level, " "using AUTH_LEVEL_DEFAULT(%s)..", username, AUTH_LEVEL_DEFAULT, ) if username == "localclient": authlevel = AUTH_LEVEL_ADMIN else: authlevel = AUTH_LEVEL_DEFAULT # This is probably an old auth file save_and_reload = True elif len(lsplit) == 3: username, password, authlevel = lsplit else: log.error("Your auth file is malformed: Incorrect number of fields!") continue username = username.strip() password = password.strip() try: authlevel = int(authlevel) except ValueError: try: authlevel = AUTH_LEVELS_MAPPING[authlevel] except KeyError: log.error( "Your auth file is malformed: %r is not a valid auth level", authlevel, ) continue self.__auth[username] = Account(username, password, authlevel) if "localclient" not in self.__auth: create_localclient_account(True) return self.__load_auth_file() if save_and_reload: log.info("Re-writing auth file (upgrade)") self.write_auth_file() self.__auth_modification_time = auth_file_modification_time
Code
GestorTorneo
import time from Code import Books, Gestor, Jugada, Partida, Torneo, Util, XGestorMotor from Code.Constantes import * from Code.QT import Iconos, PantallaTorneos, QTUtil, QTVarios class GestorTorneo(Gestor.Gestor): def inicio(self, nombre_torneo, liNumGames): self.tipoJuego = kJugMvM self.torneo = Torneo.Torneo(nombre_torneo) self.torneo.leer() self.torneo.st_filtro = set(liNumGames) self.pantalla.ponActivarTutor(False) self.ponPiezasAbajo(True) self.mostrarIndicador(True) self.siTerminar = False self.siPausa = False self.pantalla.ponToolBar((k_cancelar, k_peliculaPausa, k_forceEnd)) self.colorJugando = True self.ponCapPorDefecto() self.wresult = PantallaTorneos.WResult(self.pantalla, self) self.wresult.show() numGames = len(liNumGames) for ng in range(numGames): gm = self.torneo._liGames[liNumGames[ng]] self.siguienteJuego(gm, liNumGames[ng], ng, numGames) self.procesador.pararMotores() if self.siTerminar: break if self.wresult: self.wresult.refresh() if self.wresult: self.wresult.terminar() def siguienteJuego(self, gm, ngame, posGame, numGames): self.estado = kJugando self.fenInicial = self.torneo.fenNorman() self.siPausa = False self.gm = gm self.ngame = ngame self.maxSegundos = self.gm.minutos() * 60.0 self.segundosJugada = self.gm.segundosJugada() rival = { True: self.torneo.buscaHEngine(self.gm.hwhite()), False: self.torneo.buscaHEngine(self.gm.hblack()), } self.tiempo = {} self.book = {} self.bookRR = {} self.xmotor = {} for color in (True, False): rv = rival[color] self.xmotor[color] = XGestorMotor.GestorMotor( self.procesador, rv.configMotor() ) self.xmotor[color].opciones(rv.time() * 1000, rv.depth(), False) self.xmotor[color].ponGuiDispatch(self.guiDispatch) self.tiempo[color] = Util.Timer(self.maxSegundos) bk = rv.book() if bk == "*": bk = self.torneo.book() if bk == "-": # Puede que el torneo tenga "-" bk = None if bk: self.book[color] = Books.Libro("P", bk, bk, True) self.book[color].polyglot() else: self.book[color] = None self.bookRR[color] = rv.bookRR() self.partida = Partida.Partida(fen=self.fenInicial) self.pgn.partida = self.partida self.alturaRotulo3(32) self.desactivaTodas() self.ponPosicion(self.partida.ultPosicion) self.pgnRefresh(True) # self.siPrimeraJugadaHecha = False tpBL = self.tiempo[True].etiqueta() tpNG = self.tiempo[False].etiqueta() bl = self.xmotor[True].nombre ng = self.xmotor[False].nombre self.pantalla.activaJuego(True, True, siAyudas=False) self.ponRotulo1( "<center><b>%s %d/%d</b></center>" % (_("Game"), posGame + 1, numGames) ) self.ponRotulo2(None) self.quitaAyudas() self.pantalla.ponDatosReloj(bl, tpBL, ng, tpNG) self.refresh() self.finPorTiempo = None self.finPorError = None self.finPorErrorMasInfo = "" self.finForce = None while self.siPausa or self.siguienteJugada(): QTUtil.refreshGUI() if self.siPausa: time.sleep(0.1) self.xmotor[True].terminar() self.xmotor[False].terminar() self.pantalla.paraReloj() def guiDispatch(self, rm): if not rm.sinInicializar: p = Partida.Partida(self.partida.ultPosicion) p.leerPV(rm.pv) rm.siBlancas = self.partida.ultPosicion.siBlancas txt = "<b>[%s]</b> (%s) %s" % (rm.nombre, rm.abrTexto(), p.pgnSP()) self.ponRotulo3(txt) self.showPV(rm.pv, 1) self.ponReloj() self.refresh() return not self.siTerminar def compruebaFinal(self): if self.partida.numJugadas() == 0: return False adjudication = None if self.finPorTiempo is not None: result = self.finPorTiempo elif self.finPorError is not None: result = self.finPorError elif self.finForce is not None: result = self.finForce else: jgUlt = self.partida.last_jg() result = None if self.partida.siTerminada(): if jgUlt.siJaqueMate: result = 1 if jgUlt.posicionBase.siBlancas else 2 else: result = 0 elif self.partida.numJugadas() >= 2: tiempoBlancas = self.tiempo[True].tiempoPendiente tiempoNegras = self.tiempo[False].tiempoPendiente if tiempoBlancas < 60 or tiempoNegras < 60: return False if not jgUlt.analisis: return False mrm, pos = jgUlt.analisis rmUlt = mrm.liMultiPV[pos] jgAnt = self.partida.jugada(-2) if not jgAnt.analisis: return False mrm, pos = jgAnt.analisis rmAnt = mrm.liMultiPV[pos] # Draw pUlt = rmUlt.puntosABS() pAnt = rmAnt.puntosABS() if self.partida.numJugadas() >= self.torneo.drawMinPly(): dr = self.torneo.drawRange() if abs(pUlt) <= dr and abs(pAnt) <= dr: if abs(tiempoBlancas - tiempoNegras) > 60: return False mrmTut = self.xtutor.analiza(self.partida.ultPosicion.fen()) rmTut = mrmTut.mejorMov() pTut = rmTut.puntosABS() if abs(pTut) <= dr: result = 0 # Dif puntos if result is None: rs = self.torneo.resign() if pUlt >= rs: rmTut = self.xtutor.analiza(self.partida.ultPosicion.fen()) pTut = -rmTut.mejorMov().puntosABS() if pTut >= rs: result = 1 if jgAnt.posicion.siBlancas else 2 adjudication = True if result is None: return False self.gm.partida(self.partida) self.gm.result(result) termination = "normal" if self.finPorTiempo: termination = "time forfeit" elif self.finPorError: termination = self.finPorErrorMasInfo elif self.finForce: termination = "adjudication" elif adjudication: termination = "adjudication" self.gm.termination(termination) self.torneo._liGames[self.ngame] = self.gm self.torneo.grabar() return True def siguienteJugada(self): if self.estado == kFinJuego: return False self.estado = kJugando siBlancas = self.partida.siBlancas() self.colorJugando = siBlancas if self.compruebaFinal(): return False self.ponIndicador(siBlancas) self.refresh() siEncontrada = False analisis = None bk = self.book[siBlancas] if bk: siEncontrada, desde, hasta, coronacion = self.eligeJugadaBook( bk, self.bookRR[siBlancas] ) if not siEncontrada: self.book[siBlancas] = None if not siEncontrada: xrival = self.xmotor[siBlancas] tiempoBlancas = self.tiempo[True].tiempoPendiente tiempoNegras = self.tiempo[False].tiempoPendiente segundosJugada = xrival.motorTiempoJugada if self.siTerminar: return False self.relojStart(siBlancas) mrm = xrival.juegaTiempoTorneo(tiempoBlancas, tiempoNegras, segundosJugada) self.relojStop(siBlancas) if mrm is None: if self.tiempo[siBlancas].siAgotado(): self.finPorTiempo = 2 if siBlancas else 1 else: self.finPorError = 2 if siBlancas else 1 self.finPorErrorMasInfo = "Engine error" self.compruebaFinal() return False rm = mrm.mejorMov() desde = rm.desde hasta = rm.hasta coronacion = rm.coronacion analisis = mrm, 0 if self.siTerminar: return False siBien, mens, jg = Jugada.dameJugada( self.partida.ultPosicion, desde, hasta, coronacion ) if not jg: if self.tiempo[siBlancas].siAgotado(): self.finPorTiempo = 2 if siBlancas else 1 else: self.finPorError = 2 if siBlancas else 1 self.finPorErrorMasInfo = "Engine error: bad move %s-%s%s" % ( desde, hasta, coronacion if coronacion else "", ) self.compruebaFinal() return False if analisis: jg.analisis = analisis jg.critica = "" self.masJugada(jg) self.movimientosPiezas(jg.liMovs, True) return not self.siTerminar def ponReloj(self): # if (not self.siPrimeraJugadaHecha) or (self.estado != kJugando): if self.estado != kJugando: return def mira(siBlancas): ot = self.tiempo[siBlancas] eti, eti2 = ot.etiquetaDif2() if eti: if siBlancas: self.pantalla.ponRelojBlancas(eti, eti2) else: self.pantalla.ponRelojNegras(eti, eti2) if ot.siAgotado(): self.finPorTiempo = 2 if siBlancas else 1 return False return True mira(self.colorJugando) self.refresh() def relojStart(self, siBlancas): self.tiempo[siBlancas].iniciaMarcador() def relojStop(self, siBlancas): self.tiempo[siBlancas].paraMarcador(self.segundosJugada) self.ponReloj() def relojPausa(self, siBlancas): self.tiempo[siBlancas].paraMarcador(0) self.ponReloj() def procesarAccion(self, clave): if clave == k_cancelar: self.siTerminar = True elif clave == k_peliculaPausa: self.siPausa = True self.relojPausa(self.partida.siBlancas()) self.pantalla.ponToolBar((k_cancelar, k_peliculaSeguir, k_forceEnd)) elif clave == k_peliculaSeguir: self.siPausa = False self.pantalla.ponToolBar((k_cancelar, k_peliculaPausa, k_forceEnd)) self.relojStart(self.partida.siBlancas()) elif clave == k_forceEnd: self.assignResult() def finalX(self): self.siTerminar = True self.xmotor[True].terminar() self.xmotor[False].terminar() return False def eligeJugadaBook(self, book, tipo): bdepth = self.torneo.bookDepth() if bdepth == 0 or self.partida.numJugadas() < bdepth: fen = self.fenUltimo() pv = book.eligeJugadaTipo(fen, tipo) if pv: return True, pv[:2], pv[2:4], pv[4:] return False, None, None, None def masJugada(self, jg): if self.siTerminada(): jg.siJaqueMate = jg.siJaque jg.siAhogado = not jg.siJaque self.partida.append_jg(jg) if self.partida.pendienteApertura: self.partida.asignaApertura() resp = self.partida.si3repetidas() if resp: jg.siTablasRepeticion = True rotulo = "" for j in resp: rotulo += "%d," % (j / 2 + 1,) rotulo = rotulo.strip(",") self.rotuloTablasRepeticion = rotulo if self.partida.ultPosicion.movPeonCap >= 100: jg.siTablas50 = True if self.partida.ultPosicion.siFaltaMaterial(): jg.siTablasFaltaMaterial = True self.ponFlechaSC(jg.desde, jg.hasta) self.ponVista() self.pgnRefresh(self.partida.ultPosicion.siBlancas) self.refresh() def assignResult(self): menu = QTVarios.LCMenu(self.pantalla) menu.opcion(0, "1/2-1/2", Iconos.Tablas()) menu.separador() menu.opcion(1, "1-0", Iconos.Blancas()) menu.separador() menu.opcion(2, "0-1", Iconos.Negras()) resp = menu.lanza() if resp is not None: self.finForce = resp
manager
db_manager
# The contents of this file are subject to the Common Public Attribution # License Version 1.0. (the "License"); you may not use this file except in # compliance with the License. You may obtain a copy of the License at # http://code.reddit.com/LICENSE. The License is based on the Mozilla Public # License Version 1.1, but Sections 14 and 15 have been added to cover use of # software over a computer network and provide for limited attribution for the # Original Developer. In addition, Exhibit A has been modified to be consistent # with Exhibit B. # # Software distributed under the License is distributed on an "AS IS" basis, # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for # the specific language governing rights and limitations under the License. # # The Original Code is reddit. # # The Original Developer is the Initial Developer. The Initial Developer of # the Original Code is reddit Inc. # # All portions of the code written by reddit are Copyright (c) 2006-2015 reddit # Inc. All Rights Reserved. ############################################################################### import logging import os import random import socket import time import traceback import sqlalchemy logger = logging.getLogger("dm_manager") logger.addHandler(logging.StreamHandler()) APPLICATION_NAME = "reddit@%s:%d" % (socket.gethostname(), os.getpid()) def get_engine( name, db_host="", db_user="", db_pass="", db_port="5432", pool_size=5, max_overflow=5, g_override=None, ): db_port = int(db_port) arguments = { "dbname": name, "host": db_host, "port": db_port, "application_name": APPLICATION_NAME, } if db_user: arguments["user"] = db_user if db_pass: arguments["password"] = db_pass dsn = "%20".join("%s=%s" % x for x in arguments.iteritems()) engine = sqlalchemy.create_engine( "postgresql:///?dsn=" + dsn, strategy="threadlocal", pool_size=int(pool_size), max_overflow=int(max_overflow), # our code isn't ready for unicode to appear # in place of strings yet use_native_unicode=False, ) if g_override: sqlalchemy.event.listens_for(engine, "before_cursor_execute")( g_override.stats.pg_before_cursor_execute ) sqlalchemy.event.listens_for(engine, "after_cursor_execute")( g_override.stats.pg_after_cursor_execute ) return engine class db_manager: def __init__(self): self.type_db = None self.relation_type_db = None self._things = {} self._relations = {} self._engines = {} self.avoid_master_reads = {} self.dead = {} def add_thing(self, name, thing_dbs, avoid_master=False, **kw): """thing_dbs is a list of database engines. the first in the list is assumed to be the master, the rest are slaves.""" self._things[name] = thing_dbs self.avoid_master_reads[name] = avoid_master def add_relation(self, name, type1, type2, relation_dbs, avoid_master=False, **kw): self._relations[name] = (type1, type2, relation_dbs) self.avoid_master_reads[name] = avoid_master def setup_db(self, db_name, g_override=None, **params): engine = get_engine(g_override=g_override, **params) self._engines[db_name] = engine if db_name not in ("email", "authorize", "hc", "traffic"): # test_engine creates a connection to the database, for some less # important and less used databases we will skip this and only # create the connection if it's needed self.test_engine(engine, g_override) def things_iter(self): for name, engines in self._things.iteritems(): # ensure we ALWAYS return the actual master as the first, # regardless of if we think it's dead or not. yield name, [engines[0]] + [e for e in engines[1:] if e not in self.dead] def rels_iter(self): for name, (t1_name, t2_name, engines) in self._relations.iteritems(): engines = [engines[0]] + [e for e in engines[1:] if e not in self.dead] yield name, (t1_name, t2_name, engines) def mark_dead(self, engine, g_override=None): logger.error("db_manager: marking connection dead: %r", engine) self.dead[engine] = time.time() def test_engine(self, engine, g_override=None): try: list(engine.execute("select 1")) if engine in self.dead: logger.error("db_manager: marking connection alive: %r", engine) del self.dead[engine] return True except Exception: logger.error(traceback.format_exc()) logger.error("connection failure: %r" % engine) self.mark_dead(engine, g_override) return False def get_engine(self, name): return self._engines[name] def get_engines(self, names): return [self._engines[name] for name in names if name in self._engines] def get_read_table(self, tables): if len(tables) == 1: return tables[0] return random.choice(list(tables))
metrics
license
import datetime import json import re import subprocess from collections import Counter import glom from apatite.utils import run_cap DETECT_CMD = "license-detector" required_cmds = { DETECT_CMD: "Download from: https://github.com/src-d/go-license-detector/releases," ' rename to "license-detector" (if need be), place it on your PATH,' " and make it executable." } # missing = "other" LICENSE_MAP = { "AFL-3.0": "AFL", "AGPL-1.0": "AGPL", "AGPL-3.0": "AGPL", "AGPL-3.0-only": "AGPL", "AGPL-3.0-or-later": "AGPL", "Apache-2.0": "Apache-2.0", "BSD-2-Clause": "BSD-2", "BSD-2-Clause-FreeBSD": "BSD-2", "BSD-2-Clause-NetBSD": "BSD-2", "BSD-3-Clause": "BSD-3", "BSD-3-Clause-Clear": "BSD-3", "BSD-3-Clause-No-Nuclear-License-2014": "BSD-3", "BSD-4-Clause": "BSD-3", # sure it exists, but not here "BSD-Source-Code": "BSD-3", "CDDL-1.0": "CDDL", "CDDL-1.1": "CDDL", "GPL-2.0": "GPL v2", "GPL-2.0-only": "GPL v2", "GPL-2.0-or-later": "GPL v2", "GPL-3.0-only": "GPL v3", "GPL-3.0-or-later": "GPL v3", "ISC": "ISC", "LGPL-2.0+": "LGPL v2", "LGPL-2.0-only": "LGPL v2", "LGPL-2.0-or-later": "LGPL v2", "LGPL-2.1": "LGPL v2", "LGPL-2.1-only": "LGPL v2", "LGPL-2.1-or-later": "LGPL v2", "LGPL-3.0-only": "LGPL v3", "LGPL-3.0-or-later": "LGPL v3", "MIT": "MIT", "MIT-feh": "MIT", "MPL-1.1": "MPL", "MPL-2.0": "MPL", "MPL-2.0-no-copyleft-exception": "MPL", "Unlicense": "Unlicense", "deprecated_AGPL-3.0": "AGPL ", "deprecated_GPL-2.0": "GPL v2", "deprecated_GPL-2.0+": "GPL v2", "deprecated_GPL-3.0": "GPL v3", "deprecated_GPL-3.0+": "GPL v3", "deprecated_LGPL-2.0": "LGPL v2", "deprecated_LGPL-2.0+": "LGPL v2", "deprecated_LGPL-2.1": "LGPL v2", "deprecated_LGPL-2.1+": "LGPL v2", "deprecated_LGPL-3.0": "LGPL v3", "deprecated_LGPL-3.0+": "LGPL v3", } # OSL: True GROUP_HEREDITARY_MAP = { "AFL": False, "AGPL": True, "Apache": True, "BSD": False, "CDDL": False, "GPL": True, "ISC": True, "LGPL": True, "MIT": False, "MPL": True, "Unlicense": True, } """ Too many false positives of these: 'CC-BY-3.0': 'CC', 'CC-BY-4.0': 'CC', 'CC0-1.0': 'CC0', """ def collect(plist, project, repo_dir): ret = {} proc_res = run_cap([DETECT_CMD, repo_dir, "--format", "json"]) output_json = json.loads(proc_res.stdout) possible_licenses = glom.glom(output_json, "0.matches", default=[]) # sort and set into descending order possible_licenses = sorted( possible_licenses, key=lambda x: x["confidence"], reverse=True )[:3] norm_licenses = [] for pl in possible_licenses: if pl["confidence"] < 0.9: continue elif pl["license"] not in LICENSE_MAP: continue norm_licenses.append((LICENSE_MAP[pl["license"]], round(pl["confidence"], 3))) if not norm_licenses or len(norm_licenses) > 3: ret["license"] = "Other" # not enough consensus on a known license else: sorted(norm_licenses, key=lambda x: x[1], reverse=True) if len(norm_licenses) < 3: ret["license"] = norm_licenses[0][0] else: most_common = Counter([x[0] for x in norm_licenses]).most_common(1)[0][0] ret["license"] = most_common group = re.split("\W+", ret["license"])[0] ret["license_group"] = group ret["hereditary"] = GROUP_HEREDITARY_MAP.get(group) return ret
fcbt
DistBin
# shell and operating system import os import sys from . import DistTools, FileTools # sys.path.append( "E:\\Develop\\Projekte\\FreeCADWin\\src\\Tools" ) # line separator ls = os.linesep # path separator ps = os.pathsep # dir separator ds = os.sep DistName = DistTools.BuildDistName() DistBin = DistName + "_binary_WinX86" DistDir = "../../DistTemp/" # ==================================================================== # script assumes to run in src/Tools DistTools.EnsureDir(DistDir) if DistTools.EnsureDir(DistDir + DistBin) == 1: raise RuntimeError("Dist path already there!!") # ==================================================================== # copy src sys.stdout.write("Copy src Tree ...\n") DistTools.EnsureDir(DistDir + DistBin + "/src") FileTools.cpallWithFilter( "../../src", DistDir + DistBin + "/src", FileTools.SetUpFilter(DistTools.SrcFilter) ) # ==================================================================== # copy bin and lib sys.stdout.write("Copy bin and lib Tree ...\n") DistTools.EnsureDir(DistDir + DistBin + "/bin") FileTools.cpallWithFilter( "../../bin", DistDir + DistBin + "/bin", FileTools.SetUpFilter(DistTools.BinFilter) ) DistTools.EnsureDir(DistDir + DistBin + "/lib") FileTools.cpallWithFilter( "../../lib", DistDir + DistBin + "/lib", FileTools.SetUpFilter(DistTools.LibFilter) ) # ==================================================================== # copy Modules sys.stdout.write("Copy module Tree ...\n") DistTools.EnsureDir(DistDir + DistBin + "/Mod") FileTools.cpallWithFilter( "../../src/Mod", DistDir + DistBin + "/Mod", FileTools.SetUpFilter(DistTools.ModFilter), ) # ==================================================================== # copy top level files # FileTools.cpfile("../Doc/README.html",DistDir+DistBin+"/README.html") # FileTools.cpfile("../Doc/INSTALL.html",DistDir+DistBin+"/INSTALL.html") # FileTools.cpfile("../Doc/LICENSE.GPL.html",DistDir+DistBin+"/LICENSE.GPL.html") # FileTools.cpfile("../Doc/LICENSE.LGPL.html",DistDir+DistBin+"/LICENSE.LGPL.html") # DistTools.cpfile("../Tools/BuildTool.py",DistDir+DistBin+"/BuildTool.py") # ==================================================================== # zipping an archive # os.popen("rar.exe a "+DistDir+DistBin+".rar "+ DistDir+DistBin) os.popen("7z a -tzip " + DistDir + DistBin + ".zip " + DistDir + DistBin + " -mx9") FileTools.rmall(DistDir + DistBin)
mopidy
listener
import logging import pykka from pykka.messages import ProxyCall logger = logging.getLogger(__name__) def send(cls, event, **kwargs): listeners = pykka.ActorRegistry.get_by_class(cls) logger.debug("Sending %s to %s: %s", event, cls.__name__, kwargs) for listener in listeners: # Save time by calling methods on Pykka actor without creating a # throwaway actor proxy. # # Because we use `.tell()` there is no return channel for any errors, # so Pykka logs them immediately. The alternative would be to use # `.ask()` and `.get()` the returned futures to block for the listeners # to react and return their exceptions to us. Since emitting events in # practise is making calls upwards in the stack, blocking here would # quickly deadlock. listener.tell( ProxyCall( attr_path=("on_event",), args=(event,), kwargs=kwargs, ) ) class Listener: def on_event(self, event, **kwargs): """Called on all events. *MAY* be implemented by actor. By default, this method forwards the event to the specific event methods. :param event: the event name :type event: string :param kwargs: any other arguments to the specific event handlers """ try: getattr(self, event)(**kwargs) except Exception: # Ensure we don't crash the actor due to "bad" events. logger.exception( "Triggering event failed: %s(%s)", event, ", ".join(kwargs) )
formats
remote
# Copyright 2004-2005 Joe Wreschnig, Michael Urman # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. from typing import List from senf import fsnative, path2fsn from ._audio import AudioFile extensions: List[str] = [] class RemoteFile(AudioFile): is_file = False fill_metadata = True format = "Remote File" def __init__(self, uri): assert not isinstance(uri, bytes) self["~uri"] = str(uri) self.sanitize(fsnative(self["~uri"])) def __getitem__(self, key): # we used to save them with the wrong type value = super().__getitem__(key) if key in ("~filename", "~mountpoint") and not isinstance(value, fsnative): value = path2fsn(value) return value def rename(self, newname): pass def reload(self): pass def exists(self): return True def valid(self): return True def mounted(self): return True def write(self): pass def can_change(self, k=None): if k is None: return [] else: return False @property def key(self): return self["~uri"] loader = RemoteFile types = [RemoteFile]
async-deletion
delete_cohorts
from typing import Any, Dict, List, Set, Tuple from posthog.client import sync_execute from posthog.models.async_deletion import AsyncDeletion, DeletionType from posthog.models.async_deletion.delete import AsyncDeletionProcess, logger class AsyncCohortDeletion(AsyncDeletionProcess): DELETION_TYPES = [DeletionType.Cohort_full, DeletionType.Cohort_stale] def process(self, deletions: List[AsyncDeletion]): if len(deletions) == 0: logger.warn("No AsyncDeletion for cohorts to perform") return logger.warn( "Starting AsyncDeletion on `cohortpeople` table in ClickHouse", { "count": len(deletions), "team_ids": list(set(row.team_id for row in deletions)), }, ) conditions, args = self._conditions(deletions) sync_execute( f""" DELETE FROM cohortpeople WHERE {" OR ".join(conditions)} """, args, ) def _verify_by_group( self, deletion_type: int, async_deletions: List[AsyncDeletion] ) -> List[AsyncDeletion]: if ( deletion_type == DeletionType.Cohort_stale or deletion_type == DeletionType.Cohort_full ): cohort_ids_with_data = self._verify_by_column( "team_id, cohort_id", async_deletions ) return [ row for row in async_deletions if (row.team_id, int(row.key.split("_")[0])) not in cohort_ids_with_data ] else: return [] def _verify_by_column( self, distinct_columns: str, async_deletions: List[AsyncDeletion] ) -> Set[Tuple[Any, ...]]: conditions, args = self._conditions(async_deletions) clickhouse_result = sync_execute( f""" SELECT DISTINCT {distinct_columns} FROM cohortpeople WHERE {" OR ".join(conditions)} """, args, ) return set(tuple(row) for row in clickhouse_result) def _column_name(self, async_deletion: AsyncDeletion): assert async_deletion.deletion_type in ( DeletionType.Cohort_full, DeletionType.Cohort_stale, ) return "cohort_id" def _condition( self, async_deletion: AsyncDeletion, suffix: str ) -> Tuple[str, Dict]: team_id_param = f"team_id{suffix}" key_param = f"key{suffix}" version_param = f"version{suffix}" if async_deletion.deletion_type == DeletionType.Cohort_full: key, _ = async_deletion.key.split("_") return ( f"( team_id = %({team_id_param})s AND {self._column_name(async_deletion)} = %({key_param})s )", { team_id_param: async_deletion.team_id, key_param: key, }, ) else: key, version = async_deletion.key.split("_") return ( f"( team_id = %({team_id_param})s AND {self._column_name(async_deletion)} = %({key_param})s AND version < %({version_param})s )", { team_id_param: async_deletion.team_id, version_param: version, key_param: key, }, )
migrations-data
mc_validate_cmd
import json import subprocess import sys import uuid from collections import namedtuple from lxml import etree SUCCESS_CODE = 0 ERROR_CODE = 1 NS = "{https://mediaarea.net/mediaconch}" class MediaConchException(Exception): pass Parse = namedtuple("Parse", "etree_el stdout") def parse_mediaconch_data(target): """Run `mediaconch -mc -fx -iv 4 <target>` against `target` and return an lxml etree parse of the output. """ args = ["mediaconch", "-mc", "-fx", "-iv", "4", target] try: output = subprocess.check_output(args) except subprocess.CalledProcessError: raise MediaConchException( "MediaConch failed when running: {}".format(" ".join(args)) ) try: return Parse(etree_el=etree.fromstring(output), stdout=output) except etree.XMLSyntaxError: raise MediaConchException( "MediaConch failed when attempting to parse the XML output by" " MediaConch" ) def get_impl_check_name(impl_check_el): name_el = impl_check_el.find("%sname" % NS) if name_el is not None: return name_el.text else: return "Unnamed Implementation Check %s" % uuid.uuid4() def get_check_name(check_el): return check_el.attrib.get( "name", check_el.attrib.get("icid", "Unnamed Check %s" % uuid.uuid4()) ) def get_check_tests_outcomes(check_el): """Return a list of outcome strings for the <check> element `check_el`.""" outcomes = [] for test_el in check_el.iterfind("%stest" % NS): outcome = test_el.attrib.get("outcome") if outcome: outcomes.append(outcome) return outcomes def get_impl_check_result(impl_check_el): """Return a dict mapping check names to lists of test outcome strings.""" checks = {} for check_el in impl_check_el.iterfind("%scheck" % NS): check_name = get_check_name(check_el) test_outcomes = get_check_tests_outcomes(check_el) if test_outcomes: checks[check_name] = test_outcomes return checks def get_impl_checks(doc): """When not provided with a policy file, MediaConch produces a series of XML <implementationChecks> elements that contain <check> sub-elements. This function returns a dict mapping implementation check names to dicts that map individual check names to lists of test outcomes, i.e., 'pass' or 'fail'. """ impl_checks = {} path = f".{NS}media/{NS}implementationChecks" for impl_check_el in doc.iterfind(path): impl_check_name = get_impl_check_name(impl_check_el) impl_check_result = get_impl_check_result(impl_check_el) if impl_check_result: impl_checks[impl_check_name] = impl_check_result return impl_checks def get_event_outcome_information_detail(impl_checks): """Return a 2-tuple of info and detail. - info: 'pass' or 'fail' - detail: human-readable string indicating which implementation checks passed or failed. If implementation check as a whole passed, just return the passed check names; if it failed, just return the failed ones. """ info = "pass" failed_impl_checks = [] passed_impl_checks = [] for impl_check, checks in impl_checks.items(): passed_checks = set() failed_checks = set() for check, outcomes in checks.items(): for outcome in outcomes: if outcome == "pass": passed_checks.add(check) else: info = "fail" failed_checks.add(check) if failed_checks: failed_impl_checks.append( "The implementation check %s returned" " failure for the following check(s): %s." % (impl_check, ", ".join(failed_checks)) ) else: passed_impl_checks.append( "The implementation check %s returned" " success for the following check(s): %s." % (impl_check, ", ".join(passed_checks)) ) prefix = "MediaConch implementation check result:" if info == "pass": if passed_impl_checks: return info, "{} {}".format(prefix, " ".join(passed_impl_checks)) return (info, f"{prefix} All checks passed.") else: return (info, "{} {}".format(prefix, " ".join(failed_impl_checks))) def main(target): """Return 0 if MediaConch can successfully assess whether the file at `target` is a valid Matroska (.mkv) file. Parse the XML output by MediaConch and print a JSON representation of that output. """ try: parse = parse_mediaconch_data(target) impl_checks = get_impl_checks(parse.etree_el) info, detail = get_event_outcome_information_detail(impl_checks) print( json.dumps( { "eventOutcomeInformation": info, "eventOutcomeDetailNote": detail, "stdout": parse.stdout, } ) ) return SUCCESS_CODE except MediaConchException as e: print( json.dumps( { "eventOutcomeInformation": "fail", "eventOutcomeDetailNote": str(e), "stdout": None, } ), file=sys.stderr, ) return ERROR_CODE if __name__ == "__main__": target = sys.argv[1] sys.exit(main(target))
frontend
views
import json import re import urllib from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse from django.core.validators import URLValidator from django.http import (HttpResponse, HttpResponseBadRequest, HttpResponseRedirect) from django.shortcuts import render from django.views.decorators.csrf import ensure_csrf_cookie from .forms import IndexForm from .models import Feed, FeedField, Field from .settings import DOWNLOADER_PAGE_URL, FEED_PAGE_URL from .setup_tool import build_xpathes_for_items, get_selection_tag_ids from .setup_tool_ext import build_xpath_results def index(request): if request.method == 'GET' and 'url' in request.GET: form = IndexForm(request.GET) if form.is_valid(): val = URLValidator() try: url = request.GET['url'] if not url.startswith('http'): url = 'http://' + url val(url) except ValidationError, e: form.add_error('url', 'Invalid url') else: return HttpResponseRedirect('%s?url=%s' % (reverse('setup'), urllib.quote(url.encode('utf8')))) else: form = IndexForm() return render(request, 'frontend/index.html', {'form': form}) def contact(request): return render(request, 'frontend/contact.html') @ensure_csrf_cookie def setup(request): if request.method == 'GET' and 'url' in request.GET: external_page_url = DOWNLOADER_PAGE_URL + urllib.quote(request.GET['url'], safe='') return render(request, 'frontend/setup.html', { 'external_page_url': external_page_url, 'page_url': request.GET['url'] }) return HttpResponseBadRequest('Url is required') def _validate_html(html): def walk(tag): if (len(tag) != 3 or not isinstance(tag[0], basestring) or type(tag[1]) is not dict or 'tag-id' not in tag[1] or type(tag[2]) is not list): return False for t in tag[2]: if not walk(t): return False return True return walk(html) def setup_get_selected_ids(request): if request.method == 'POST': obj = json.loads(request.body) if 'html' not in obj or 'names' not in obj: return HttpResponseBadRequest('"html" and "names" parameters are required') html_json = obj['html'] item_names = obj['names'] if not _validate_html(html_json): return HttpResponseBadRequest('html is invalid') xpathes = build_xpathes_for_items(item_names, html_json) if 'title' in xpathes[1]: xpathes[1]['link'] = _get_link_xpath(xpathes[1]['title']) resp = { 'xpathes': xpathes, 'ids': get_selection_tag_ids(item_names, html_json) } return HttpResponse(json.dumps(resp)) def _get_link_xpath(title_xpath): if title_xpath == './child::node()': return './ancestor-or-self::node()/@href' else: xpath = title_xpath[:len(title_xpath)-len('/child::node()')] return xpath +'/ancestor-or-self::node()/@href' _BASIC_TITLE_ID=1 _BASIC_DESCRIPTION_ID=2 _BASIC_LINK_ID=3 def _create_feed(url, xpathes, edited=False): feed_xpath = xpathes[0] item_xpathes = xpathes[1] feed = Feed(uri=url, xpath=feed_xpath, edited=edited) feed.save() fields = Field.objects.all() for field in fields: if field.id == _BASIC_LINK_ID and _BASIC_TITLE_ID in item_xpathes and not edited: ff = FeedField(feed=feed, field=field, xpath= _get_link_xpath(item_xpathes[_BASIC_TITLE_ID][0])) ff.save() elif field.id in item_xpathes: ff = FeedField(feed=feed, field=field, xpath=item_xpathes[field.id][0]) ff.save() return feed.id def setup_create_feed(request): if request.method == 'POST': obj = json.loads(request.body) if 'html' not in obj or 'names' not in obj or 'url' not in obj: return HttpResponseBadRequest('"html", "names" and "url" parameters are required') html_json = obj['html'] item_names = obj['names'] url = obj['url'] if not _validate_html(html_json): return HttpResponseBadRequest('html is invalid') xpathes = build_xpathes_for_items(item_names, html_json) field_xpathes = {} required = True if 'title' in xpathes[1]: field_xpathes[_BASIC_TITLE_ID] = [xpathes[1]['title'], required] if 'description' in xpathes[1]: field_xpathes[_BASIC_DESCRIPTION_ID] = [xpathes[1]['description'], required] xpathes[1] = field_xpathes feed_id = _create_feed(url, xpathes) return HttpResponse(reverse('preview', args=(feed_id,))) def _validate_selectors(selectors): if not isinstance(selectors, list) or len(selectors) != 2: return False feed_xpath = selectors[0] item_xpathes = selectors[1] if not isinstance(feed_xpath, basestring): return False if not isinstance(item_xpathes, dict): return False item_xpathes = {int(field_id): xpath for field_id, xpath in item_xpathes.iteritems()} fields = Field.objects.all() item_xpathes_out = {} for field in fields: if field.id in item_xpathes: if not isinstance(item_xpathes[field.id], basestring): return False else: item_xpathes_out[field.id] = [item_xpathes[field.id], field.required] return [feed_xpath, item_xpathes_out] def setup_validate_selectors(request): if request.method == 'POST': obj = json.loads(request.body) if 'selectors' not in obj or 'snapshot_time' not in obj: return HttpResponseBadRequest('"selectors" and "snapshot_time" are required') selectors = obj['selectors'] file_name = obj['snapshot_time'] if not re.match('^\d{10}\.\d+_[\da-f]{32}', file_name): return HttpResponseBadRequest('"snapshot_time" is invalid') validated_selectors = _validate_selectors(selectors) if not validated_selectors: return HttpResponseBadRequest('selectors are invalid') messages, posts, success = build_xpath_results(validated_selectors, file_name) return HttpResponse(json.dumps({'success': success, 'messages': messages, 'posts': posts})) def setup_create_feed_ext(request): if request.method == 'POST': obj = json.loads(request.body) if 'selectors' not in obj or 'snapshot_time' not in obj or 'url' not in obj: return HttpResponseBadRequest('"selectors", "snapshot_time" and "url" are required') selectors = obj['selectors'] file_name = obj['snapshot_time'] if not re.match('^\d{10}\.\d+_[\da-f]{32}', file_name): return HttpResponseBadRequest('"snapshot_time" is invalid') validated_selectors = _validate_selectors(selectors) if not validated_selectors: return HttpResponseBadRequest('selectors are invalid') messages, posts, success = build_xpath_results(validated_selectors, file_name) if success: url = obj['url'] feed_id = _create_feed(url, validated_selectors, True) return HttpResponse(json.dumps({'success': True, 'url': reverse('preview', args=(feed_id,))})) else: return HttpResponse(json.dumps({'success': False, 'messages': messages})) def preview(request, feed_id): if request.method == 'GET': return render(request, 'frontend/preview.html', { 'feed_url': FEED_PAGE_URL + feed_id }) return HttpResponseBadRequest('Only GET method supported')
FieldGraph
CGraphModel
from AppKit import NSBezierPath from fieldMath import * from Foundation import NSObject from objc import * # ____________________________________________________________ class CGraphModel(NSObject): def init(self): self.field = [1.0, 1.12, 0.567] self.phase = [degToRad(0), degToRad(152.6), degToRad(312.9 - 360)] self.RMSGain = 0 self.spacing = degToRad(90) return self def getGraph(self): path = NSBezierPath.bezierPath() maxMag = 0 mag = self.fieldValue(0) maxMag = max(maxMag, mag) path.moveToPoint_(polarToRect((mag, 0))) for deg in range(1, 359, 1): r = (deg / 180.0) * pi mag = self.fieldValue(r) maxMag = max(maxMag, mag) path.lineToPoint_(polarToRect((mag, r))) path.closePath() return path, maxMag def fieldGain(self): gain = 0 Et = self.field[0] + self.field[1] + self.field[2] if Et: # Don't want to divide by zero in the pathological case spacing = [0, self.spacing, 2 * self.spacing] # This could easily be optimized--but this is just anexample :-) for i in range(3): for j in range(3): gain += ( self.field[i] * self.field[j] * cos(self.phase[j] - self.phase[i]) * bessel(spacing[j] - spacing[i]) ) gain = sqrt(gain) / Et self.RMSGain = gain return gain def fieldValue(self, a): # The intermedate values are used to more closely match standard field equations nomenclature E0 = self.field[0] E1 = self.field[1] E2 = self.field[2] B0 = self.phase[0] B1 = self.phase[1] + self.spacing * cos(a) B2 = self.phase[2] + 2 * self.spacing * cos(a) phix = sin(B0) * E0 + sin(B1) * E1 + sin(B2) * E2 phiy = cos(B0) * E0 + cos(B1) * E1 + cos(B2) * E2 mag = hypot(phix, phiy) return mag def setField(self, tower, field): self.field[tower] = field def getField(self, tower): return self.field[tower] def setPhase(self, tower, phase): self.phase[tower] = phase def getPhase(self, tower): return self.phase[tower] def setSpacing(self, spacing): self.spacing = spacing def getSpacing(self): return self.spacing
views
resolution_note
from apps.alerts.models import ResolutionNote from apps.alerts.tasks import send_update_resolution_note_signal from apps.api.permissions import RBACPermission from apps.api.serializers.resolution_note import ( ResolutionNoteSerializer, ResolutionNoteUpdateSerializer, ) from apps.auth_token.auth import PluginAuthentication from apps.mobile_app.auth import MobileAppAuthTokenAuthentication from common.api_helpers.mixins import ( PublicPrimaryKeyMixin, TeamFilteringMixin, UpdateSerializerMixin, ) from rest_framework.permissions import IsAuthenticated from rest_framework.viewsets import ModelViewSet class ResolutionNoteView( TeamFilteringMixin, PublicPrimaryKeyMixin, UpdateSerializerMixin, ModelViewSet ): authentication_classes = ( MobileAppAuthTokenAuthentication, PluginAuthentication, ) permission_classes = (IsAuthenticated, RBACPermission) rbac_permissions = { "metadata": [RBACPermission.Permissions.ALERT_GROUPS_READ], "list": [RBACPermission.Permissions.ALERT_GROUPS_READ], "retrieve": [RBACPermission.Permissions.ALERT_GROUPS_READ], "create": [RBACPermission.Permissions.ALERT_GROUPS_WRITE], "update": [RBACPermission.Permissions.ALERT_GROUPS_WRITE], "partial_update": [RBACPermission.Permissions.ALERT_GROUPS_WRITE], "destroy": [RBACPermission.Permissions.ALERT_GROUPS_WRITE], } model = ResolutionNote serializer_class = ResolutionNoteSerializer update_serializer_class = ResolutionNoteUpdateSerializer TEAM_LOOKUP = "alert_group__channel__team" def get_queryset(self, ignore_filtering_by_available_teams=False): alert_group_id = self.request.query_params.get("alert_group", None) lookup_kwargs = {} if alert_group_id: lookup_kwargs = {"alert_group__public_primary_key": alert_group_id} queryset = ResolutionNote.objects.filter( alert_group__channel__organization=self.request.auth.organization, **lookup_kwargs, ) if not ignore_filtering_by_available_teams: queryset = queryset.filter(*self.available_teams_lookup_args).distinct() queryset = self.serializer_class.setup_eager_loading(queryset) return queryset def dispatch(self, request, *args, **kwargs): result = super().dispatch(request, *args, **kwargs) # send signal to update alert group and resolution note method = request.method.lower() if method in ["post", "put", "patch", "delete"]: instance_id = self.kwargs.get("pk") or result.data.get("id") if instance_id: instance = ResolutionNote.objects_with_deleted.filter( public_primary_key=instance_id ).first() if instance is not None: send_update_resolution_note_signal.apply_async( kwargs={ "alert_group_pk": instance.alert_group.pk, "resolution_note_pk": instance.pk, } ) return result
migrations
0173_default_user_auth_group_setting
# Generated by Django 3.2.16 on 2022-12-27 21:34 import django.db.models.deletion from django.db import migrations, models def backfill_sitesettings(apps, schema_editor): db_alias = schema_editor.connection.alias group_model = apps.get_model("auth", "Group") editor_group = group_model.objects.using(db_alias).filter(name="editor").first() sitesettings_model = apps.get_model("bookwyrm", "SiteSettings") sitesettings_model.objects.update(default_user_auth_group=editor_group) class Migration(migrations.Migration): dependencies = [ ("bookwyrm", "0175_merge_0173_author_website_0174_merge_20230111_1523"), ] operations = [ migrations.AddField( model_name="sitesettings", name="default_user_auth_group", field=models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.RESTRICT, to="auth.group", ), ), migrations.RunPython(backfill_sitesettings, migrations.RunPython.noop), ]
versions
057_660a5aae527e_tracking
# encoding: utf-8 """057 Tracking Revision ID: 660a5aae527e Revises: 11af3215ae89 Create Date: 2018-09-04 18:49:08.573692 """ import sqlalchemy as sa from alembic import op from ckan.migration import skip_based_on_legacy_engine_version # revision identifiers, used by Alembic. revision = "660a5aae527e" down_revision = "11af3215ae89" branch_labels = None depends_on = None def upgrade(): if skip_based_on_legacy_engine_version(op, __name__): return op.create_table( "tracking_raw", sa.Column("user_key", sa.String(100), nullable=False), sa.Column("url", sa.UnicodeText, nullable=False), sa.Column("tracking_type", sa.String(10), nullable=False), sa.Column( "access_timestamp", sa.TIMESTAMP, server_default=sa.func.current_timestamp() ), ) op.create_index("tracking_raw_url", "tracking_raw", ["url"]) op.create_index("tracking_raw_user_key", "tracking_raw", ["user_key"]) op.create_index( "tracking_raw_access_timestamp", "tracking_raw", ["access_timestamp"] ) op.create_table( "tracking_summary", sa.Column("url", sa.UnicodeText, nullable=False), sa.Column("package_id", sa.UnicodeText), sa.Column("tracking_type", sa.String(10), nullable=False), sa.Column("count", sa.Integer, nullable=False), sa.Column("running_total", sa.Integer, nullable=False, server_default="0"), sa.Column("recent_views", sa.Integer, nullable=False, server_default="0"), sa.Column("tracking_date", sa.Date), ) op.create_index("tracking_summary_url", "tracking_summary", ["url"]) op.create_index("tracking_summary_package_id", "tracking_summary", ["package_id"]) op.create_index("tracking_summary_date", "tracking_summary", ["tracking_date"]) def downgrade(): op.drop_table("tracking_summary") op.drop_table("tracking_raw")
database
table_bittorrent
#!/usr/bin/env python # # Copyright (c) 2011 Simone Basso <bassosimone@gmail.com>, # NEXA Center for Internet & Society at Politecnico di Torino # Copyright (c) 2011 Alessio Palmero Aprosio <alessio@apnetwork.it>, # Universita` degli Studi di Milano # # This file is part of Neubot <http://www.neubot.org/>. # # Neubot is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Neubot is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Neubot. If not, see <http://www.gnu.org/licenses/>. # import pprint import sqlite3 import sys import unittest if __name__ == "__main__": sys.path.insert(0, ".") from neubot import utils from neubot.database import table_bittorrent from regress.neubot.database.table_bittorrent_gen import ResultIterator class TestDatabase(unittest.TestCase): def runTest(self): """Make sure bittorrent table works as expected""" connection = sqlite3.connect(":memory:") connection.row_factory = sqlite3.Row table_bittorrent.create(connection) table_bittorrent.create(connection) v = map(None, ResultIterator()) for d in v: table_bittorrent.insert(connection, d, override_timestamp=False) v1 = table_bittorrent.listify(connection) self.assertEquals(sorted(v), sorted(v1)) since = utils.timestamp() - 7 * 24 * 60 * 60 until = utils.timestamp() - 3 * 24 * 60 * 60 v2 = table_bittorrent.listify(connection, since=since, until=until) self.assertTrue(len(v2) < len(v)) table_bittorrent.prune(connection, until) self.assertTrue(len(table_bittorrent.listify(connection)) < len(v1)) if __name__ == "__main__": unittest.main()
analog
wfm_rcv_fmdet
# # Copyright 2005,2006,2012-2013,2020 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # import math from gnuradio import blocks, fft, filter, gr from . import analog_python as analog from .fm_emph import fm_deemph class wfm_rcv_fmdet(gr.hier_block2): def __init__(self, demod_rate, audio_decimation): """ Hierarchical block for demodulating a broadcast FM signal. The input is the downconverted complex baseband signal (gr_complex). The output is two streams of the demodulated audio (float) 0=Left, 1=Right. Args: demod_rate: input sample rate of complex baseband input. (float) audio_decimation: how much to decimate demod_rate to get to audio. (integer) """ gr.hier_block2.__init__( self, "wfm_rcv_fmdet", # Input signature gr.io_signature(1, 1, gr.sizeof_gr_complex), gr.io_signature(2, 2, gr.sizeof_float), ) # Output signature if audio_decimation != int(audio_decimation): raise ValueError("audio_decimation needs to be an integer") audio_decimation = int(audio_decimation) lowfreq = -125e3 / demod_rate highfreq = 125e3 / demod_rate audio_rate = demod_rate / audio_decimation # We assign to self so that outsiders can grab the demodulator # if they need to. E.g., to plot its output. # # input: complex; output: float self.fm_demod = analog.fmdet_cf(demod_rate, lowfreq, highfreq, 0.05) # input: float; output: float self.deemph_Left = fm_deemph(audio_rate) self.deemph_Right = fm_deemph(audio_rate) # compute FIR filter taps for audio filter width_of_transition_band = audio_rate / 32 audio_coeffs = filter.firdes.low_pass( 1.0, # gain demod_rate, # sampling rate 15000, width_of_transition_band, fft.window.WIN_HAMMING, ) # input: float; output: float self.audio_filter = filter.fir_filter_fff(audio_decimation, audio_coeffs) if 1: # Pick off the stereo carrier/2 with this filter. It # attenuated 10 dB so apply 10 dB gain We pick off the # negative frequency half because we want to base band by # it! # NOTE THIS WAS HACKED TO OFFSET INSERTION LOSS DUE TO # DEEMPHASIS stereo_carrier_filter_coeffs = filter.firdes.complex_band_pass( 10.0, demod_rate, -19020, -18980, width_of_transition_band, fft.window.WIN_HAMMING, ) # print "len stereo carrier filter = ",len(stereo_carrier_filter_coeffs) # print "stereo carrier filter ", stereo_carrier_filter_coeffs # print "width of transition band = ",width_of_transition_band, " audio rate = ", audio_rate # Pick off the double side band suppressed carrier # Left-Right audio. It is attenuated 10 dB so apply 10 dB # gain stereo_dsbsc_filter_coeffs = filter.firdes.complex_band_pass( 20.0, demod_rate, 38000 - 15000 / 2, 38000 + 15000 / 2, width_of_transition_band, fft.window.WIN_HAMMING, ) # print "len stereo dsbsc filter = ",len(stereo_dsbsc_filter_coeffs) # print "stereo dsbsc filter ", stereo_dsbsc_filter_coeffs # construct overlap add filter system from coefficients # for stereo carrier self.stereo_carrier_filter = filter.fir_filter_fcc( audio_decimation, stereo_carrier_filter_coeffs ) # carrier is twice the picked off carrier so arrange to do # a complex multiply self.stereo_carrier_generator = blocks.multiply_cc() # Pick off the rds signal stereo_rds_filter_coeffs = filter.firdes.complex_band_pass( 30.0, demod_rate, 57000 - 1500, 57000 + 1500, width_of_transition_band, fft.window.WIN_HAMMING, ) # print "len stereo dsbsc filter = ",len(stereo_dsbsc_filter_coeffs) # print "stereo dsbsc filter ", stereo_dsbsc_filter_coeffs # construct overlap add filter system from coefficients for stereo carrier self.rds_signal_filter = filter.fir_filter_fcc( audio_decimation, stereo_rds_filter_coeffs ) self.rds_carrier_generator = blocks.multiply_cc() self.rds_signal_generator = blocks.multiply_cc() self_rds_signal_processor = blocks.null_sink(gr.sizeof_gr_complex) loop_bw = 2 * math.pi / 100.0 max_freq = -2.0 * math.pi * 18990 / audio_rate min_freq = -2.0 * math.pi * 19010 / audio_rate self.stereo_carrier_pll_recovery = analog.pll_refout_cc( loop_bw, max_freq, min_freq ) # self.stereo_carrier_pll_recovery.squelch_enable(False) # pll_refout does not have squelch yet, so disabled for # now # set up mixer (multiplier) to get the L-R signal at # baseband self.stereo_basebander = blocks.multiply_cc() # pick off the real component of the basebanded L-R # signal. The imaginary SHOULD be zero self.LmR_real = blocks.complex_to_real() self.Make_Left = blocks.add_ff() self.Make_Right = blocks.sub_ff() self.stereo_dsbsc_filter = filter.fir_filter_fcc( audio_decimation, stereo_dsbsc_filter_coeffs ) if 1: # send the real signal to complex filter to pick off the # carrier and then to one side of a multiplier self.connect( self, self.fm_demod, self.stereo_carrier_filter, self.stereo_carrier_pll_recovery, (self.stereo_carrier_generator, 0), ) # send the already filtered carrier to the otherside of the carrier # the resulting signal from this multiplier is the carrier # with correct phase but at -38000 Hz. self.connect( self.stereo_carrier_pll_recovery, (self.stereo_carrier_generator, 1) ) # send the new carrier to one side of the mixer (multiplier) self.connect(self.stereo_carrier_generator, (self.stereo_basebander, 0)) # send the demphasized audio to the DSBSC pick off filter, the complex # DSBSC signal at +38000 Hz is sent to the other side of the mixer/multiplier # the result is BASEBANDED DSBSC with phase zero! self.connect( self.fm_demod, self.stereo_dsbsc_filter, (self.stereo_basebander, 1) ) # Pick off the real part since the imaginary is # theoretically zero and then to one side of a summer self.connect(self.stereo_basebander, self.LmR_real, (self.Make_Left, 0)) # take the same real part of the DSBSC baseband signal and # send it to negative side of a subtracter self.connect(self.LmR_real, (self.Make_Right, 1)) # Make rds carrier by taking the squared pilot tone and # multiplying by pilot tone self.connect(self.stereo_basebander, (self.rds_carrier_generator, 0)) self.connect( self.stereo_carrier_pll_recovery, (self.rds_carrier_generator, 1) ) # take signal, filter off rds, send into mixer 0 channel self.connect( self.fm_demod, self.rds_signal_filter, (self.rds_signal_generator, 0) ) # take rds_carrier_generator output and send into mixer 1 # channel self.connect(self.rds_carrier_generator, (self.rds_signal_generator, 1)) # send basebanded rds signal and send into "processor" # which for now is a null sink self.connect(self.rds_signal_generator, self_rds_signal_processor) if 1: # pick off the audio, L+R that is what we used to have and # send it to the summer self.connect(self.fm_demod, self.audio_filter, (self.Make_Left, 1)) # take the picked off L+R audio and send it to the PLUS # side of the subtractor self.connect(self.audio_filter, (self.Make_Right, 0)) # The result of Make_Left gets (L+R) + (L-R) and results in 2*L # The result of Make_Right gets (L+R) - (L-R) and results in 2*R self.connect(self.Make_Left, self.deemph_Left, (self, 0)) self.connect(self.Make_Right, self.deemph_Right, (self, 1)) # NOTE: mono support will require variable number of outputs in hier_block2s # See ticket:174 in Trac database # else: # self.connect (self.fm_demod, self.audio_filter, self)
tools
segment
from gaphas.connector import ConnectionSink, Connector from gaphas.segment import LineSegment, Segment from gaphor.core.modeling.event import RevertibleEvent from gaphor.diagram.connectors import ItemTemporaryDisconnected from gaphor.diagram.presentation import LinePresentation @Segment.register(LinePresentation) class PresentationSegment(LineSegment): def split_segment(self, segment, count=2): self.temporary_disconnect() handles, ports = super().split_segment(segment, count) line = self.item line.handle(LineSplitSegmentEvent(line, segment, count)) return handles, ports def merge_segment(self, segment, count=2): self.temporary_disconnect() deleted_handles, deleted_ports = super().merge_segment(segment, count) line = self.item line.handle(LineMergeSegmentEvent(line, segment, count)) return deleted_handles, deleted_ports def temporary_disconnect(self): # Send an event to cause a "temporary disconnect". This is the contra-signal # of `ItemReconnected`, which is sent from the Connector in recreate_constraints(). connected = self.item model = self.model for cinfo in list(model.connections.get_connections(connected=connected)): model.handle( ItemTemporaryDisconnected( cinfo.item, cinfo.handle, connected, cinfo.port ) ) def recreate_constraints(self): connected = self.item model = self.model for cinfo in list(model.connections.get_connections(connected=connected)): item = cinfo.item handle = cinfo.handle connector = Connector(item, handle, model.connections) sink = ConnectionSink(connected, distance=float("inf")) connector.connect(sink) class LineSplitSegmentEvent(RevertibleEvent): def __init__(self, element, segment, count): super().__init__(element) self.segment = segment self.count = count def revert(self, target): segment = Segment(target, target.diagram) segment.merge_segment(self.segment, self.count) class LineMergeSegmentEvent(RevertibleEvent): def __init__(self, element, segment, count): super().__init__(element) self.segment = segment self.count = count def revert(self, target): segment = Segment(target, target.diagram) segment.split_segment(self.segment, self.count)
Gui
PocketShape
# -*- coding: utf-8 -*- # *************************************************************************** # * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> * # * * # * This program is free software; you can redistribute it and/or modify * # * it under the terms of the GNU Lesser General Public License (LGPL) * # * as published by the Free Software Foundation; either version 2 of * # * the License, or (at your option) any later version. * # * for detail see the LICENCE text file. * # * * # * This program is distributed in the hope that it will be useful, * # * but WITHOUT ANY WARRANTY; without even the implied warranty of * # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * # * GNU Library General Public License for more details. * # * * # * You should have received a copy of the GNU Library General Public * # * License along with this program; if not, write to the Free Software * # * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * # * USA * # * * # *************************************************************************** import FreeCAD import Path import Path.Op.Gui.Base as PathOpGui import Path.Op.Gui.FeatureExtension as PathFeatureExtensionsGui import Path.Op.Gui.PocketBase as PathPocketBaseGui import Path.Op.PocketShape as PathPocketShape # lazily loaded modules from lazy_loader.lazy_loader import LazyLoader from PySide.QtCore import QT_TRANSLATE_NOOP Part = LazyLoader("Part", globals(), "Part") __title__ = "Path Pocket Shape Operation UI" __author__ = "sliptonic (Brad Collette)" __url__ = "https://www.freecad.org" __doc__ = "Pocket Shape operation page controller and command implementation." if False: Path.Log.setLevel(Path.Log.Level.DEBUG, Path.Log.thisModule()) Path.Log.trackModule(Path.Log.thisModule()) else: Path.Log.setLevel(Path.Log.Level.INFO, Path.Log.thisModule()) translate = FreeCAD.Qt.translate class TaskPanelOpPage(PathPocketBaseGui.TaskPanelOpPage): """Page controller class for Pocket operation""" def pocketFeatures(self): """pocketFeatures() ... return FeaturePocket (see PathPocketBaseGui)""" return ( PathPocketBaseGui.FeaturePocket | PathPocketBaseGui.FeatureOutline | PathPocketBaseGui.FeatureRestMachining ) def taskPanelBaseLocationPage(self, obj, features): if not hasattr(self, "extensionsPanel"): self.extensionsPanel = PathFeatureExtensionsGui.TaskPanelExtensionPage( obj, features ) return self.extensionsPanel Command = PathOpGui.SetupOperation( "Pocket Shape", PathPocketShape.Create, TaskPanelOpPage, "Path_Pocket", QT_TRANSLATE_NOOP("Path_Pocket_Shape", "Pocket Shape"), QT_TRANSLATE_NOOP( "Path_Pocket_Shape", "Creates a Path Pocket object from a face or faces" ), PathPocketShape.SetupProperties, ) FreeCAD.Console.PrintLog("Loading PathPocketShapeGui... done\n")
DotView
DotView
"""DotView.py -- A one-window app demonstrating how to write a custom NSView. To build the demo program, run this line in Terminal.app: $ python setup.py py2app -A This creates a directory "dist" containing DotView.app. (The -A option causes the files to be symlinked to the .app bundle instead of copied. This means you don't have to rebuild the app if you edit the sources or nibs.) """ # Created by Etienne Posthumus on Thu Dec 26 2002, after Apple's # ObjC DotView example. # Edited and enhanced by JvR, 2003. # # The main difference with the Apple DotView demo is that our custom view # is embedded in a scroll view. It turns out that this is almost no work # in InterfaceBuilder (select the view, then go to Layout -> Make subvies of # -> Scroll View), and *no* work in the code. It was too easy, so for kicks # I added zoom functionality and a "Show rulers" checkbox. from Cocoa import * from PyObjCTools import AppHelper ZOOM = 2.0 # class defined in MainMenu.nib class DotView(NSView): colorWell = objc.IBOutlet() sizeSlider = objc.IBOutlet() def initWithFrame_(self, frame): self.center = (50.0, 50.0) super(DotView, self).initWithFrame_(frame) self.radius = 10.0 self.color = NSColor.redColor() return self def awakeFromNib(self): self.colorWell.setColor_(self.color) self.sizeSlider.setFloatValue_(self.radius) scrollView = self.superview().superview() scrollView.setHasHorizontalRuler_(1) scrollView.setHasVerticalRuler_(1) @objc.IBAction def zoomIn_(self, sender): (x, y), (bw, bh) = self.bounds() (x, y), (fw, fh) = self.frame() self.setBoundsSize_((bw / ZOOM, bh / ZOOM)) self.setFrameSize_((fw * ZOOM, fh * ZOOM)) self.setNeedsDisplay_(True) @objc.IBAction def zoomOut_(self, sender): (x, y), (bw, bh) = self.bounds() (x, y), (fw, fh) = self.frame() self.setBoundsSize_((bw * ZOOM, bh * ZOOM)) self.setFrameSize_((fw / ZOOM, fh / ZOOM)) self.setNeedsDisplay_(True) @objc.IBAction def setRulersVisible_(self, button): scrollView = self.superview().superview() scrollView.setRulersVisible_(button.state()) def isOpaque(self): return True def mouseDown_(self, event): eventLocation = event.locationInWindow() if event.modifierFlags() & NSCommandKeyMask: clipView = self.superview() self.originalPoint = eventLocation self.originalOffset = clipView.bounds()[0] else: self.center = self.convertPoint_fromView_(eventLocation, None) self.setNeedsDisplay_(True) self.autoscroll_(event) def mouseDragged_(self, event): if event.modifierFlags() & NSCommandKeyMask: clipView = self.superview() eventLocation = event.locationInWindow() ox, oy = self.originalPoint x, y = eventLocation dx, dy = x - ox, y - oy x, y = self.originalOffset ox, oy = clipView.constrainScrollPoint_((x - dx, y - dy)) clipView.scrollToPoint_((ox, oy)) clipView.superview().reflectScrolledClipView_(clipView) else: self.mouseDown_(event) def drawRect_(self, rect): NSColor.whiteColor().set() NSRectFill(self.bounds()) origin = (self.center[0] - self.radius, self.center[1] - self.radius) size = (2 * self.radius, 2 * self.radius) dotRect = (origin, size) self.color.set() NSBezierPath.bezierPathWithOvalInRect_(dotRect).fill() @objc.IBAction def setRadius_(self, sender): self.radius = sender.floatValue() self.setNeedsDisplay_(True) @objc.IBAction def setColor_(self, sender): self.color = sender.color() self.setNeedsDisplay_(True) if __name__ == "__main__": AppHelper.runEventLoop()
Models
SettingVisibilityPresetsModel
# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from typing import List, Optional from cura.Settings.SettingVisibilityPreset import SettingVisibilityPreset from PyQt6.QtCore import QObject, pyqtProperty, pyqtSignal, pyqtSlot from UM.i18n import i18nCatalog from UM.Logger import Logger from UM.Preferences import Preferences from UM.Resources import Resources catalog = i18nCatalog("cura") class SettingVisibilityPresetsModel(QObject): onItemsChanged = pyqtSignal() activePresetChanged = pyqtSignal() Version = 2 def __init__(self, preferences: Preferences, parent=None) -> None: super().__init__(parent) self._items = [] # type: List[SettingVisibilityPreset] self._custom_preset = SettingVisibilityPreset( preset_id="custom", name="Custom selection", weight=-100 ) self._populate() basic_item = self.getVisibilityPresetById("basic") if basic_item is not None: basic_visibile_settings = ";".join(basic_item.settings) else: Logger.log("w", "Unable to find the basic visibility preset.") basic_visibile_settings = "" self._preferences = preferences # Preference to store which preset is currently selected self._preferences.addPreference( "cura/active_setting_visibility_preset", "basic" ) # Preference that stores the "custom" set so it can always be restored (even after a restart) self._preferences.addPreference( "cura/custom_visible_settings", basic_visibile_settings ) self._preferences.preferenceChanged.connect(self._onPreferencesChanged) self._active_preset_item = self.getVisibilityPresetById( self._preferences.getValue("cura/active_setting_visibility_preset") ) # Initialize visible settings if it is not done yet visible_settings = self._preferences.getValue("general/visible_settings") if not visible_settings: new_visible_settings = ( self._active_preset_item.settings if self._active_preset_item is not None else [] ) self._preferences.setValue( "general/visible_settings", ";".join(new_visible_settings) ) else: self._onPreferencesChanged("general/visible_settings") self.activePresetChanged.emit() def getVisibilityPresetById( self, item_id: str ) -> Optional[SettingVisibilityPreset]: result = None for item in self._items: if item.presetId == item_id: result = item break return result def _populate(self) -> None: from cura.CuraApplication import CuraApplication items = [] # type: List[SettingVisibilityPreset] items.append(self._custom_preset) for file_path in Resources.getAllResourcesOfType( CuraApplication.ResourceTypes.SettingVisibilityPreset ): setting_visibility_preset = SettingVisibilityPreset() try: setting_visibility_preset.loadFromFile(file_path) except Exception: Logger.logException("e", "Failed to load setting preset %s", file_path) items.append(setting_visibility_preset) # Add the "all" visibility: all_setting_visibility_preset = SettingVisibilityPreset( preset_id="all", name="All", weight=9001 ) all_setting_visibility_preset.setSettings( list(CuraApplication.getInstance().getMachineManager().getAllSettingKeys()) ) items.append(all_setting_visibility_preset) # Sort them on weight (and if that fails, use ID) items.sort(key=lambda k: (int(k.weight), k.presetId)) self.setItems(items) @pyqtProperty("QVariantList", notify=onItemsChanged) def items(self) -> List[SettingVisibilityPreset]: return self._items def setItems(self, items: List[SettingVisibilityPreset]) -> None: if self._items != items: self._items = items self.onItemsChanged.emit() @pyqtSlot(str) def setActivePreset(self, preset_id: str) -> None: if ( self._active_preset_item is not None and preset_id == self._active_preset_item.presetId ): Logger.log( "d", "Same setting visibility preset [%s] selected, do nothing.", preset_id, ) return preset_item = self.getVisibilityPresetById(preset_id) if preset_item is None: Logger.log("w", "Tried to set active preset to unknown id [%s]", preset_id) return need_to_save_to_custom = self._active_preset_item is None or ( self._active_preset_item.presetId == "custom" and preset_id != "custom" ) if need_to_save_to_custom: # Save the current visibility settings to custom current_visibility_string = self._preferences.getValue( "general/visible_settings" ) if current_visibility_string: self._preferences.setValue( "cura/custom_visible_settings", current_visibility_string ) new_visibility_string = ";".join(preset_item.settings) if preset_id == "custom": # Get settings from the stored custom data new_visibility_string = self._preferences.getValue( "cura/custom_visible_settings" ) if new_visibility_string is None: new_visibility_string = self._preferences.getValue( "general/visible_settings" ) self._preferences.setValue("general/visible_settings", new_visibility_string) self._preferences.setValue("cura/active_setting_visibility_preset", preset_id) self._active_preset_item = preset_item self.activePresetChanged.emit() @pyqtProperty(str, notify=activePresetChanged) def activePreset(self) -> str: if self._active_preset_item is not None: return self._active_preset_item.presetId return "" def _onPreferencesChanged(self, name: str) -> None: if name != "general/visible_settings": return # Find the preset that matches with the current visible settings setup visibility_string = self._preferences.getValue("general/visible_settings") if not visibility_string: return visibility_set = set(visibility_string.split(";")) matching_preset_item = None for item in self._items: if item.presetId == "custom": continue if set(item.settings) == visibility_set: matching_preset_item = item break item_to_set = self._active_preset_item if matching_preset_item is None: # The new visibility setup is "custom" should be custom if ( self._active_preset_item is None or self._active_preset_item.presetId == "custom" ): # We are already in custom, just save the settings self._preferences.setValue( "cura/custom_visible_settings", visibility_string ) else: # We need to move to custom preset. item_to_set = self.getVisibilityPresetById("custom") else: item_to_set = matching_preset_item # If we didn't find a matching preset, fallback to custom. if item_to_set is None: item_to_set = self._custom_preset if ( self._active_preset_item is None or self._active_preset_item.presetId != item_to_set.presetId ): self._active_preset_item = item_to_set if self._active_preset_item is not None: self._preferences.setValue( "cura/active_setting_visibility_preset", self._active_preset_item.presetId, ) self.activePresetChanged.emit()
neubot
config
# neubot/config.py # # Copyright (c) 2010-2011, 2013 # Nexa Center for Internet & Society, Politecnico di Torino (DAUIN) # and Simone Basso <bassosimone@gmail.com> # # This file is part of Neubot <http://www.neubot.org/>. # # Neubot is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Neubot is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Neubot. If not, see <http://www.gnu.org/licenses/>. # # ================================================================= # The update() method of ConfigDict is a derivative work # of Python 2.5.2 Object/dictobject.c dict_update_common(). # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Python Software Foundation; All Rights Reserved. # # I've put a copy of Python LICENSE file at doc/LICENSE.Python. # ================================================================= # import itertools import logging import os import shlex from neubot import utils from neubot.database import table_config def string_to_kv(string): """Convert string to (key,value). Returns the empty tuple if the string is a comment or contains just spaces.""" string = string.strip() if not string or string[0] == "#": return tuple() kv = string.split("=", 1) if len(kv) == 1: kv.append("True") return tuple(kv) def kv_to_string(kv): """Convert (key,value) to string. Adds a trailing newline so we can pass the return value directly to fp.write().""" return "%s=%s\n" % (utils.stringify(kv[0]), utils.stringify(kv[1])) class ConfigDict(dict): """Modified dictionary. At the beginning we fill it with default values, e.g. when a new module is loaded. Then, when we update this dictionary we want new values to have the same type of the old ones. We perform the check when the dictionary is updated and not when it is accessed because in the latter case we might delay errors and that would be surprising.""" def __setitem__(self, key, value): if key in self: ovalue = self[key] cast = utils.smart_cast(ovalue) else: ovalue = "(none)" cast = utils.smart_cast(value) value = cast(value) logging.debug("config: %s: %s -> %s", key, ovalue, value) dict.__setitem__(self, key, value) def update(self, *args, **kwds): if args: arg = tuple(args)[0] if hasattr(arg, "keys"): arg = arg.iteritems() map(lambda t: self.__setitem__(t[0], t[1]), arg) if kwds: self.update(kwds.iteritems()) class ConfigError(Exception): pass class Config(object): """Configuration manager""" def __init__(self): self.properties = [] self.conf = ConfigDict() self.descriptions = {} def register_defaults(self, kvstore): self.conf.update(kvstore) def register_descriptions(self, d): self.descriptions.update(d) def copy(self): return dict(self.conf) def get(self, key, defvalue): return self.conf.get(key, defvalue) def __getitem__(self, key): return self.conf[key] def __setitem__(self, key, value): self.conf[key] = value def register_property(self, prop, module=""): if module and not prop.startswith(module): prop = "%s.%s" % (module, prop) self.properties.append(prop) def merge_fp(self, fp): logging.debug("config: reading properties from file") map(self.merge_kv, itertools.imap(string_to_kv, fp)) def merge_database(self, database): logging.debug("config: reading properties from database") dictionary = table_config.dictionarize(database) for key, value in dictionary.items(): self.merge_kv((key, value)) def merge_environ(self): logging.debug("config: reading properties from the environment") map( self.merge_kv, itertools.imap( string_to_kv, shlex.split(os.environ.get("NEUBOT_OPTIONS", "")) ), ) def merge_properties(self): logging.debug("config: reading properties from command-line") map(self.merge_kv, itertools.imap(string_to_kv, self.properties)) def merge_api(self, dictlike, database=None): # enforce all-or-nothing logging.debug("config: reading properties from /api/config") map(lambda t: self.merge_kv(t, dry=True), dictlike.iteritems()) map(self.merge_kv, dictlike.iteritems()) if database: table_config.update(database, dictlike.iteritems()) def merge_kv(self, t, dry=False): if t: key, value = t if not dry: self.conf[key] = value else: try: ovalue = self.conf[key] cast = utils.smart_cast(ovalue) cast(value) except KeyError: raise ConfigError("No such property: %s" % key) except TypeError: raise ConfigError( "Old value '%s' for property '%s'" " has the wrong type" % (ovalue, key) ) except ValueError: raise ConfigError( "Invalid value '%s' for property '%s'" % (value, key) ) def store_fp(self, fp): map(fp.write, itertools.imap(kv_to_string, self.conf.iteritems())) def store_database(self, database): table_config.update(database, self.conf.iteritems(), clear=True) def print_descriptions(self, fp): fp.write("Properties (current value in square brackets):\n") for key in sorted(self.descriptions.keys()): description = self.descriptions[key] value = self.conf[key] fp.write(" %-28s: %s [%s]\n" % (key, description, value)) fp.write("\n") CONFIG = Config() CONFIG.register_defaults_helper = lambda properties: CONFIG.register_defaults( dict(zip(map(lambda t: t[0], properties), map(lambda t: t[1], properties))) ) CONFIG.register_descriptions_helper = lambda properties: CONFIG.register_descriptions( dict(zip(map(lambda t: t[0], properties), map(lambda t: t[2], properties))) ) CONFIG.register_defaults( { "agent.api": True, "agent.api.address": "127.0.0.1 ::1", "agent.api.port": 9774, "agent.daemonize": True, "agent.interval": 0, "agent.master": "master.neubot.org master2.neubot.org", "agent.rendezvous": True, "agent.use_syslog": False, "bittorrent_test_version": 1, "enabled": True, "verbose": 0, "prefer_ipv6": 0, "privacy.informed": False, "privacy.can_collect": False, "privacy.can_publish": False, "runner.enabled": 1, "speedtest_test_version": 1, "uuid": "", "version": "", "win32_updater": 1, "win32_updater_channel": "latest", "win32_updater_interval": 1800, "www.lang": "default", "www_default_test_to_show": "speedtest", "www_no_description": 0, "www_no_legend": 0, "www_no_plot": 0, "www_no_split_by_ip": 0, "www_no_table": 0, "www_no_title": 0, } ) CONFIG.register_descriptions( { "agent.api": "Enable API server", # "agent.api.address": "Set API server address", # FIXME # "agent.api.port": "Set API server port", # FIXME "agent.daemonize": "Enable daemon behavior", "agent.interval": "Set rendezvous interval, in seconds (must be >= 1380 or 0 = random value in a given interval)", "agent.master": "Set master server address", "agent.rendezvous": "Enable rendezvous client", "agent.use_syslog": "Force syslog usage in any case", "bittorrent_test_version": "Version 1 is the old one, version 2 controls duration at the sender", "enabled": "Enable Neubot to perform automatic transmission tests", "verbose": "Set to 1 to get more log messages", "prefer_ipv6": "Prefer IPv6 over IPv4 when resolving domain names", "privacy.informed": "You assert that you have read and understood the privacy policy", "privacy.can_collect": "You give Neubot the permission to collect your Internet address for research purposes", "privacy.can_publish": "You give Neubot the permission to publish on the web your Internet address so that it can be reused for research purposes", "runner.enabled": "When true command line tests are executed in the context of the local daemon, provided that it is running", "speedtest_test_version": "Version 1 is the old one, version 2 controls duration at the sender", "uuid": "Random unique identifier of this Neubot agent", "version": "Version number of the Neubot database schema", "win32_updater": "Set to nonzero to enable Win32 automatic updates", "win32_updater_channel": "The channel used for automatic updates", "win32_updater_interval": "Interval between check for updates", "www.lang": "Web GUI language (`default' means: use browser default)", "www_default_test_to_show": "Test to show by default in results.html", "www_no_description": "Set to nonzero to hide test description", "www_no_legend": "Set to nonzero to hide the plot legend", "www_no_plot": "Set to nonzero to hide the plot(s)", "www_no_split_by_ip": "Set to nonzero to avoid split by IP address", "www_no_table": "Set to nonzero to hide the table", "www_no_title": "Set to nonzero to hide test-specific title", } )
bitmessageqt
statusbar
# pylint: disable=unused-argument """Status bar Module""" from time import time from PyQt4 import QtGui class BMStatusBar(QtGui.QStatusBar): """Status bar with queue and priorities""" duration = 10000 deleteAfter = 60 def __init__(self, parent=None): super(BMStatusBar, self).__init__(parent) self.important = [] self.timer = self.startTimer(BMStatusBar.duration) self.iterator = 0 def timerEvent(self, event): """an event handler which allows to queue and prioritise messages to show in the status bar, for example if many messages come very quickly after one another, it adds delays and so on""" while len(self.important) > 0: self.iterator += 1 try: if time() > self.important[self.iterator][1] + BMStatusBar.deleteAfter: del self.important[self.iterator] self.iterator -= 1 continue except IndexError: self.iterator = -1 continue super(BMStatusBar, self).showMessage(self.important[self.iterator][0], 0) break def addImportant(self, message): self.important.append([message, time()]) self.iterator = len(self.important) - 2 self.timerEvent(None)
QT
PantallaAnalisis
from Code import Partida, VarGen, XRun from Code.QT import ( Colocacion, Columnas, Controles, Delegados, Grid, Histogram, Iconos, PantallaAnalisisParam, QTUtil, QTUtil2, QTVarios, Tablero, WCapturas, ) from PyQt4 import QtCore, QtGui class WAnalisisGraph(QTVarios.WDialogo): def __init__(self, wowner, gestor, alm, muestraAnalisis): titulo = _("Result of analysis") icono = Iconos.Estadisticas() extparam = "estadisticasv1" QTVarios.WDialogo.__init__(self, wowner, titulo, icono, extparam) self.setWindowFlags( QtCore.Qt.WindowCloseButtonHint | QtCore.Qt.Dialog | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowMinimizeButtonHint ) self.alm = alm self.procesador = gestor.procesador self.gestor = gestor self.configuracion = gestor.configuracion self.siPawns = not gestor.procesador.configuracion.centipawns self.muestraAnalisis = muestraAnalisis self.colorWhite = QTUtil.qtColorRGB(231, 244, 254) def xcol(): oColumnas = Columnas.ListaColumnas() oColumnas.nueva("NUM", _("N."), 50, siCentrado=True) oColumnas.nueva( "MOVE", _("Move"), 120, siCentrado=True, edicion=Delegados.EtiquetaPGN(True, True, True), ) oColumnas.nueva( "BEST", _("Best move"), 120, siCentrado=True, edicion=Delegados.EtiquetaPGN(True, True, True), ) oColumnas.nueva("DIF", _("Difference"), 80, siCentrado=True) oColumnas.nueva("PORC", "%", 80, siCentrado=True) oColumnas.nueva("ELO", _("Elo"), 80, siCentrado=True) return oColumnas self.dicLiJG = {"A": self.alm.lijg, "W": self.alm.lijgW, "B": self.alm.lijgB} gridAll = Grid.Grid(self, xcol(), siSelecFilas=True, xid="A") anchoGrid = gridAll.fixMinWidth() self.registrarGrid(gridAll) gridW = Grid.Grid(self, xcol(), siSelecFilas=True, xid="W") anchoGrid = max(gridW.fixMinWidth(), anchoGrid) self.registrarGrid(gridW) gridB = Grid.Grid(self, xcol(), siSelecFilas=True, xid="B") anchoGrid = max(gridB.fixMinWidth(), anchoGrid) self.registrarGrid(gridB) self.emIndexes = Controles.EM(self, alm.indexesHTML).soloLectura() pbSave = Controles.PB( self, _("Save to game comments"), self.saveIndexes, plano=False ) pbSave.ponIcono(Iconos.Grabar()) ly0 = Colocacion.H().control(pbSave).relleno() ly = Colocacion.V().control(self.emIndexes).otro(ly0).relleno() wIdx = QtGui.QWidget() wIdx.setLayout(ly) self.tabGrid = tabGrid = Controles.Tab() tabGrid.nuevaTab(gridAll, _("All moves")) tabGrid.nuevaTab(gridW, _("White")) tabGrid.nuevaTab(gridB, _("Black")) tabGrid.nuevaTab(wIdx, _("Indexes")) tabGrid.dispatchChange(self.tabChanged) self.tabActive = 0 confTablero = VarGen.configuracion.confTablero("ANALISISGRAPH", 48) self.tablero = Tablero.Tablero(self, confTablero) self.tablero.crea() self.tablero.ponerPiezasAbajo(alm.siBlancasAbajo) self.tablero.dispatchSize(self.tableroSizeChanged) self.capturas = WCapturas.CapturaLista(self, self.tablero) ly_tc = Colocacion.H().control(self.tablero).control(self.capturas) self.rbShowValues = Controles.RB( self, _("Values"), rutina=self.cambiadoShow ).activa(True) self.rbShowElo = Controles.RB( self, _("Elo performance"), rutina=self.cambiadoShow ) self.chbShowLostPoints = Controles.CHB( self, _("Show lost points"), self.getShowLostPoints() ).capturaCambiado(self, self.showLostPointsChanged) ly_rb = ( Colocacion.H() .espacio(40) .control(self.rbShowValues) .espacio(20) .control(self.rbShowElo) .espacio(30) .control(self.chbShowLostPoints) .relleno(1) ) layout = Colocacion.G() layout.controlc(tabGrid, 0, 0) layout.otroc(ly_rb, 1, 0) layout.otroc(ly_tc, 0, 1, numFilas=2) Controles.Tab().ponPosicion("W") ancho = self.tablero.width() + anchoGrid self.htotal = [ Histogram.Histogram(self, alm.hgame, gridAll, ancho, True), Histogram.Histogram(self, alm.hwhite, gridW, ancho, True), Histogram.Histogram(self, alm.hblack, gridB, ancho, True), Histogram.Histogram(self, alm.hgame, gridAll, ancho, False, alm.eloT), Histogram.Histogram(self, alm.hwhite, gridW, ancho, False, alm.eloW), Histogram.Histogram(self, alm.hblack, gridB, ancho, False, alm.eloB), ] lh = Colocacion.V() for x in range(6): lh.control(self.htotal[x]) if x: self.htotal[x].hide() layout.otroc(lh, 2, 0, 1, 3) self.setLayout(layout) self.recuperarVideo() gridAll.gotop() gridB.gotop() gridW.gotop() self.gridBotonIzquierdo(gridAll, 0, None) th = self.tablero.height() self.tabGrid.setFixedHeight(th) self.adjustSize() self.emIndexes.setFixedHeight(th - 72) def valorShowLostPoints(self): # Llamada desde histogram return self.chbShowLostPoints.valor() def showLostPointsChanged(self): dic = {"SHOWLOSTPOINTS": self.valorShowLostPoints()} self.configuracion.escVariables("ANALISIS_GRAPH", dic) self.cambiadoShow() def getShowLostPoints(self): dic = self.configuracion.leeVariables("ANALISIS_GRAPH") return dic.get("SHOWLOSTPOINTS", True) if dic else True def cambiadoShow(self): self.tabChanged(self.tabGrid.currentIndex()) def tableroSizeChanged(self): th = self.tablero.height() self.tabGrid.setFixedHeight(th) self.emIndexes.setFixedHeight(th - 72) self.adjustSize() self.cambiadoShow() def tabChanged(self, ntab): QtGui.QApplication.processEvents() tab_vis = 0 if ntab == 3 else ntab if self.rbShowElo.isChecked(): tab_vis += 3 for n in range(6): self.htotal[n].setVisible(False) self.htotal[tab_vis].setVisible(True) self.adjustSize() self.tabActive = ntab def gridCambiadoRegistro(self, grid, fila, columna): self.gridBotonIzquierdo(grid, fila, columna) def saveIndexes(self): self.gestor.partida.setFirstComment(self.alm.indexesRAW) QTUtil2.mensajeTemporal(self, _("Saved"), 1.8) def gridBotonIzquierdo(self, grid, fila, columna): self.tablero.quitaFlechas() jg = self.dicLiJG[grid.id][fila] self.tablero.ponPosicion(jg.posicion) mrm, pos = jg.analisis rm = mrm.liMultiPV[pos] self.tablero.ponFlechaSC(rm.desde, rm.hasta) rm = mrm.liMultiPV[0] self.tablero.creaFlechaMulti(rm.movimiento(), False) grid.setFocus() ta = self.tabActive if self.tabActive < 3 else 0 self.htotal[ta].setPointActive(fila) self.htotal[ta + 3].setPointActive(fila) dic, siBlancas = jg.posicion.capturas() self.capturas.pon(dic) def gridDobleClick(self, grid, fila, columna): jg = self.dicLiJG[grid.id][fila] mrm, pos = jg.analisis self.muestraAnalisis( self.procesador, self.procesador.xtutor, jg, self.tablero.siBlancasAbajo, 999999, pos, pantalla=self, siGrabar=False, ) def gridTeclaControl(self, grid, k, siShift, siControl, siAlt): nrecno = grid.recno() if k in (QtCore.Qt.Key_Enter, QtCore.Qt.Key_Return): self.gridDobleClick(grid, nrecno, None) elif k == QtCore.Qt.Key_Right: if nrecno + 1 < self.gridNumDatos(grid): grid.goto(nrecno + 1, 0) elif k == QtCore.Qt.Key_Left: if nrecno > 0: grid.goto(nrecno - 1, 0) def gridColorFondo(self, grid, fila, oColumna): if grid.id == "A": jg = self.alm.lijg[fila] return self.colorWhite if jg.xsiW else None return None def gridAlineacion(self, grid, fila, oColumna): if grid.id == "A": jg = self.alm.lijg[fila] return "i" if jg.xsiW else "d" return None def gridNumDatos(self, grid): return len(self.dicLiJG[grid.id]) def gridDato(self, grid, fila, oColumna): columna = oColumna.clave jg = self.dicLiJG[grid.id][fila] if columna == "NUM": return " %s " % jg.xnum elif columna in ("MOVE", "BEST"): mrm, pos = jg.analisis rm = mrm.liMultiPV[pos if columna == "MOVE" else 0] pv1 = rm.pv.split(" ")[0] desde = pv1[:2] hasta = pv1[2:4] coronacion = pv1[4] if len(pv1) == 5 else None txt = rm.abrTextoBase() if txt: txt = " (%s)" % txt return jg.posicionBase.pgn(desde, hasta, coronacion) + txt elif columna == "DIF": mrm, pos = jg.analisis rm = mrm.liMultiPV[0] rm1 = mrm.liMultiPV[pos] pts = rm.puntosABS_5() - rm1.puntosABS_5() if self.siPawns: pts /= 100.0 return "%0.2f" % pts else: return "%d" % pts elif columna == "PORC": return "%3d%%" % jg.porcentaje elif columna == "ELO": return "%3d" % jg.elo def closeEvent(self, event): self.guardarVideo() def showGraph(wowner, gestor, alm, muestraAnalisis): w = WAnalisisGraph(wowner, gestor, alm, muestraAnalisis) w.exec_() class WMuestra(QtGui.QWidget): def __init__(self, owner, um): super(WMuestra, self).__init__(owner) self.um = um self.owner = owner self.etiquetaMotor = um.etiquetaMotor() self.etiquetaTiempo = um.etiquetaTiempo() self.tablero = owner.tablero self.lbMotorM = ( Controles.LB(self, self.etiquetaMotor) .alinCentrado() .ponTipoLetra(puntos=9, peso=75) ) self.lbTiempoM = ( Controles.LB(self, self.etiquetaTiempo) .alinCentrado() .ponTipoLetra(puntos=9, peso=75) ) self.dicFonts = {True: "blue", False: "grey"} self.btCancelar = Controles.PB(self, "", self.cancelar).ponIcono(Iconos.X()) self.lbPuntuacion = owner.lbPuntuacion self.lbMotor = owner.lbMotor self.lbTiempo = owner.lbTiempo self.lbPGN = owner.lbPGN self.listaRM = um.listaRM self.siTiempoActivo = False self.colorNegativo = QTUtil.qtColorRGB(255, 0, 0) self.colorImpares = QTUtil.qtColorRGB(231, 244, 254) oColumnas = Columnas.ListaColumnas() self.siFigurinesPGN = VarGen.configuracion.figurinesPGN oColumnas.nueva( "JUGADAS", "%d %s" % (len(self.listaRM), _("Moves")), 120, siCentrado=True, edicion=Delegados.EtiquetaPGN( um.jg.siBlancas() if self.siFigurinesPGN else None ), ) self.wrm = Grid.Grid(self, oColumnas, siLineas=False) self.wrm.tipoLetra(puntos=VarGen.configuracion.puntosPGN) nAncho = self.wrm.anchoColumnas() + 20 self.wrm.setFixedWidth(nAncho) self.wrm.goto(self.um.posElegida, 0) # Layout ly2 = ( Colocacion.H() .relleno() .control(self.lbTiempoM) .relleno() .control(self.btCancelar) ) layout = Colocacion.V().control(self.lbMotorM).otro(ly2).control(self.wrm) self.setLayout(layout) self.wrm.setFocus() def activa(self, siActivar): color = self.dicFonts[siActivar] self.lbMotorM.ponColorN(color) self.lbTiempoM.ponColorN(color) self.btCancelar.setEnabled(not siActivar) self.siTiempoActivo = False if siActivar: self.lbMotor.ponTexto(self.etiquetaMotor) self.lbTiempo.ponTexto(self.etiquetaTiempo) def cancelar(self): self.owner.borrarMuestra(self.um) def cambiadoRM(self, fila): self.um.ponPosRMactual(fila) self.lbPuntuacion.ponTexto(self.um.puntuacionActual()) self.lbPGN.ponTexto(self.um.pgnActual()) self.ponTablero() self.owner.adjustSize() QTUtil.refreshGUI() def ponTablero(self): posicion, desde, hasta = self.um.posicionActual() self.tablero.ponPosicion(posicion) if desde: self.tablero.ponFlechaSC(desde, hasta) def gridNumDatos(self, grid): return len(self.listaRM) def gridBotonIzquierdo(self, grid, fila, columna): self.cambiadoRM(fila) self.owner.activaMuestra(self.um) def gridBotonDerecho(self, grid, fila, columna, modificadores): self.cambiadoRM(fila) def gridBold(self, grid, fila, columna): return self.um.siElegido(fila) def gridDato(self, grid, fila, oColumna): return self.listaRM[fila][1] def gridColorTexto(self, grid, fila, oColumna): rm = self.listaRM[fila][0] return None if rm.puntosABS() >= 0 else self.colorNegativo def gridColorFondo(self, grid, fila, oColumna): if fila % 2 == 1: return self.colorImpares else: return None def situate(self, recno): if 0 <= recno < len(self.listaRM): self.wrm.goto(recno, 0) self.cambiadoRM(recno) self.owner.activaMuestra(self.um) def abajo(self): self.situate(self.wrm.recno() + 1) def primero(self): self.situate(0) def arriba(self): self.situate(self.wrm.recno() - 1) def ultimo(self): self.situate(len(self.listaRM) - 1) def procesarTB(self, accion): accion = accion[5:] if accion in ("Adelante", "Atras", "Inicio", "Final"): self.um.cambiaMovActual(accion) self.ponTablero() elif accion == "Libre": self.um.analizaExterior(self.owner, self.owner.siBlancas) elif accion == "Tiempo": self.lanzaTiempo() elif accion == "Grabar": self.grabar() elif accion == "GrabarTodos": self.grabarTodos() elif accion == "Jugar": self.jugarPosicion() elif accion == "FEN": QTUtil.ponPortapapeles(self.um.fenActual()) QTUtil2.mensaje(self, _("FEN is in clipboard")) def jugarPosicion(self): posicion, desde, hasta = self.um.posicionBaseActual() fen = posicion.fen() XRun.run_lucas("-play", fen) def lanzaTiempo(self): self.siTiempoActivo = not self.siTiempoActivo if self.siTiempoActivo: self.um.cambiaMovActual("Inicio") self.ponTablero() QtCore.QTimer.singleShot(400, self.siguienteTiempo) def siguienteTiempo(self): if self.siTiempoActivo: self.um.cambiaMovActual("Adelante") self.ponTablero() if self.um.siPosFinal(): self.siTiempoActivo = False else: QtCore.QTimer.singleShot(1400, self.siguienteTiempo) def grabar(self): menu = QTVarios.LCMenu(self) menu.opcion(True, _("Complete variant"), Iconos.PuntoVerde()) menu.separador() menu.opcion(False, _("Only the first move"), Iconos.PuntoRojo()) resp = menu.lanza() if resp is None: return self.um.grabarBase(self.um.partida, self.um.rm, resp) self.um.ponVistaGestor() def grabarTodos(self): menu = QTVarios.LCMenu(self) menu.opcion(True, _("Complete variants"), Iconos.PuntoVerde()) menu.separador() menu.opcion(False, _("Only the first move of each variant"), Iconos.PuntoRojo()) resp = menu.lanza() if resp: for pos, tp in enumerate(self.um.listaRM): rm = tp[0] partida = Partida.Partida(self.um.jg.posicionBase) partida.leerPV(rm.pv) self.um.grabarBase(partida, rm, resp) self.um.ponVistaGestor() class WAnalisis(QTVarios.WDialogo): def __init__( self, mAnalisis, ventana, siBlancas, siLibre, siGrabar, muestraInicial ): titulo = _("Analysis") icono = Iconos.Tutor() extparam = "analysis" QTVarios.WDialogo.__init__(self, ventana, titulo, icono, extparam) self.mAnalisis = mAnalisis self.muestraActual = None configuracion = VarGen.configuracion confTablero = configuracion.confTablero("ANALISIS", 48) self.siLibre = siLibre self.siGrabar = siGrabar self.siBlancas = siBlancas tbWork = QTVarios.LCTB(self, tamIcon=24) tbWork.new(_("Close"), Iconos.MainMenu(), self.terminar) tbWork.new(_("New"), Iconos.NuevoMas(), self.crear) self.tablero = Tablero.Tablero(self, confTablero) self.tablero.crea() self.tablero.ponerPiezasAbajo(siBlancas) self.lbMotor = Controles.LB(self).alinCentrado() self.lbTiempo = Controles.LB(self).alinCentrado() self.lbPuntuacion = ( Controles.LB(self) .alinCentrado() .ponTipoLetra(puntos=configuracion.puntosPGN, peso=75) ) self.lbPGN = ( Controles.LB(self).ponWrap().ponTipoLetra(puntos=configuracion.puntosPGN) ) self.setStyleSheet( "QStatusBar::item { border-style: outset; border-width: 1px; border-color: LightSlateGray ;}" ) liMasAcciones = ( ("FEN:%s" % _("Copy to clipboard"), "MoverFEN", Iconos.Clip()), ) lytb, self.tb = QTVarios.lyBotonesMovimiento( self, "", siLibre=siLibre, siGrabar=siGrabar, siGrabarTodos=siGrabar, siJugar=mAnalisis.maxRecursion > 10, liMasAcciones=liMasAcciones, ) lyTabl = Colocacion.H().relleno().control(self.tablero).relleno() lyMotor = ( Colocacion.H() .control(self.lbPuntuacion) .relleno() .control(self.lbMotor) .control(self.lbTiempo) ) lyV = Colocacion.V() lyV.control(tbWork) lyV.otro(lyTabl) lyV.otro(lytb) lyV.otro(lyMotor) lyV.control(self.lbPGN) lyV.relleno() wm = WMuestra(self, muestraInicial) muestraInicial.wmu = wm # Layout self.ly = Colocacion.H().margen(10) self.ly.otro(lyV) self.ly.control(wm) lyM = Colocacion.H().margen(0).otro(self.ly).relleno() layout = Colocacion.V() layout.otro(lyM) layout.margen(3) layout.setSpacing(1) self.setLayout(layout) self.recuperarVideo(siTam=False) self.show() wm.cambiadoRM(muestraInicial.posElegida) self.activaMuestra(muestraInicial) def keyPressEvent(self, event): k = event.key() if k == 16777237: # abajo self.muestraActual.wmu.abajo() elif k == 16777235: # arriba self.muestraActual.wmu.arriba() elif k == 16777234: # izda self.muestraActual.wmu.procesarTB("MoverAtras") elif k == 16777236: # dcha self.muestraActual.wmu.procesarTB("MoverAdelante") elif k == 16777232: # inicio self.muestraActual.wmu.procesarTB("MoverInicio") elif k == 16777233: # final self.muestraActual.wmu.procesarTB("MoverFinal") elif k == 16777238: # avpag self.muestraActual.wmu.primero() elif k == 16777239: # dnpag self.muestraActual.wmu.ultimo() elif k == 16777220: # enter self.muestraActual.wmu.procesarTB("MoverLibre") elif k == 16777216: # esc self.terminar() def closeEvent(self, event): # Cierre con X self.terminar(False) def terminar(self, siAccept=True): for una in self.mAnalisis.liMuestras: una.wmu.siTiempoActivo = False self.guardarVideo() if siAccept: self.accept() def activaMuestra(self, um): self.muestraActual = um for una in self.mAnalisis.liMuestras: if hasattr(una, "wmu"): una.wmu.activa(una == um) def crearMuestra(self, um): wm = WMuestra(self, um) self.ly.control(wm) wm.show() um.ponWMU(wm) self.activaMuestra(um) wm.gridBotonIzquierdo(wm.wrm, um.posRMactual, 0) return wm def borrarMuestra(self, um): um.desactiva() self.adjustSize() QTUtil.refreshGUI() def procesarTB(self): clave = self.sender().clave if clave == "terminar": self.terminar() self.accept() elif clave == "crear": self.crear() else: self.muestraActual.wmu.procesarTB(clave) def iniciaReloj(self, funcion): if not hasattr(self, "timer"): self.timer = QtCore.QTimer(self) self.connect(self.timer, QtCore.SIGNAL("timeout()"), funcion) self.timer.start(1000) def paraReloj(self): if hasattr(self, "timer"): self.timer.stop() delattr(self, "timer") def crear(self): alm = PantallaAnalisisParam.paramAnalisis( self, VarGen.configuracion, False, siTodosMotores=True ) if alm: um = self.mAnalisis.creaMuestra(self, alm) self.crearMuestra(um) class WAnalisisVariantes(QtGui.QDialog): def __init__( self, oBase, ventana, segundosPensando, siBlancas, cPuntos, maxRecursion ): super(WAnalisisVariantes, self).__init__(ventana) self.oBase = oBase # Creamos los controles self.setWindowTitle(_("Variants")) self.setWindowFlags( QtCore.Qt.WindowCloseButtonHint | QtCore.Qt.Dialog | QtCore.Qt.WindowMinimizeButtonHint ) self.setWindowIcon(Iconos.Tutor()) f = Controles.TipoLetra(puntos=12, peso=75) flb = Controles.TipoLetra(puntos=10) lbPuntuacionAnterior = Controles.LB(self, cPuntos).alinCentrado().ponFuente(flb) self.lbPuntuacionNueva = Controles.LB(self).alinCentrado().ponFuente(flb) confTablero = VarGen.configuracion.confTablero("ANALISISVARIANTES", 32) self.tablero = Tablero.Tablero(self, confTablero) self.tablero.crea() self.tablero.ponerPiezasAbajo(siBlancas) self.tableroT = Tablero.Tablero(self, confTablero) self.tableroT.crea() self.tableroT.ponerPiezasAbajo(siBlancas) btTerminar = Controles.PB(self, _("Close"), self.close).ponPlano(False) btReset = ( Controles.PB(self, _("Another change"), oBase.reset) .ponIcono(Iconos.MoverLibre()) .ponPlano(False) ) liMasAcciones = ( ("FEN:%s" % _("Copy to clipboard"), "MoverFEN", Iconos.Clip()), ) lytbTutor, self.tb = QTVarios.lyBotonesMovimiento( self, "", siLibre=maxRecursion > 0, liMasAcciones=liMasAcciones ) self.maxRecursion = maxRecursion - 1 self.segundos, lbSegundos = QTUtil2.spinBoxLB( self, segundosPensando, 1, 999, maxTam=40, etiqueta=_("Second(s)") ) # Creamos los layouts lyVariacion = Colocacion.V().control(lbPuntuacionAnterior).control(self.tablero) gbVariacion = ( Controles.GB(self, _("Proposed change"), lyVariacion) .ponFuente(f) .alinCentrado() ) lyTutor = Colocacion.V().control(self.lbPuntuacionNueva).control(self.tableroT) gbTutor = ( Controles.GB(self, _("Tutor's prediction"), lyTutor) .ponFuente(f) .alinCentrado() ) lyBT = ( Colocacion.H() .control(btTerminar) .control(btReset) .relleno() .control(lbSegundos) .control(self.segundos) ) layout = Colocacion.G().control(gbVariacion, 0, 0).control(gbTutor, 0, 1) layout.otro(lyBT, 1, 0).otro(lytbTutor, 1, 1) self.setLayout(layout) self.move(ventana.x() + 20, ventana.y() + 20) def dameSegundos(self): return int(self.segundos.value()) def ponPuntuacion(self, pts): self.lbPuntuacionNueva.ponTexto(pts) def procesarTB(self): self.oBase.procesarTB(self.sender().clave, self.maxRecursion) def iniciaReloj(self, funcion): if not hasattr(self, "timer"): self.timer = QtCore.QTimer(self) self.connect(self.timer, QtCore.SIGNAL("timeout()"), funcion) self.timer.start(1000) def paraReloj(self): if hasattr(self, "timer"): self.timer.stop() delattr(self, "timer") def closeEvent(self, event): # Cierre con X self.paraReloj() def keyPressEvent(self, event): k = event.key() if k == 16777237: # abajo clave = "MoverAtras" elif k == 16777235: # arriba clave = "MoverAdelante" elif k == 16777234: # izda clave = "MoverAtras" elif k == 16777236: # dcha clave = "MoverAdelante" elif k == 16777232: # inicio clave = "MoverInicio" elif k == 16777233: # final clave = "MoverFinal" elif k == 16777216: # esc self.paraReloj() self.accept() else: return self.oBase.procesarTB(clave, self.maxRecursion)
frescobaldi-app
bookmarkmanager
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/ # # Copyright (c) 2008 - 2014 by Wilbert Berendsen # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # See http://www.gnu.org/licenses/ for more information. """ Manages the actions that manipulate the bookmarks (see also bookmarks.py). """ import actioncollection import actioncollectionmanager import bookmarks import icons import plugin from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QAction class BookmarkManager(plugin.MainWindowPlugin): def __init__(self, mainwindow): ac = self.actionCollection = Actions() actioncollectionmanager.manager(mainwindow).addActionCollection(ac) ac.view_next_mark.triggered.connect(self.nextMark) ac.view_previous_mark.triggered.connect(self.previousMark) ac.view_bookmark.triggered.connect(self.markCurrentLine) ac.view_clear_error_marks.triggered.connect(self.clearErrorMarks) ac.view_clear_all_marks.triggered.connect(self.clearAllMarks) mainwindow.currentViewChanged.connect(self.slotViewChanged) mainwindow.currentDocumentChanged.connect(self.slotDocumentChanged) if mainwindow.currentView(): self.slotViewChanged(mainwindow.currentView()) self.slotDocumentChanged(mainwindow.currentDocument()) def slotViewChanged(self, view, prev=None): if prev: prev.cursorPositionChanged.disconnect(self.updateMarkStatus) view.cursorPositionChanged.connect(self.updateMarkStatus) def slotDocumentChanged(self, doc, prev=None): if prev: bookmarks.bookmarks(prev).marksChanged.disconnect(self.updateMarkStatus) bookmarks.bookmarks(doc).marksChanged.connect(self.updateMarkStatus) def updateMarkStatus(self): view = self.mainwindow().currentView() self.actionCollection.view_bookmark.setChecked( bookmarks.bookmarks(view.document()).hasMark( view.textCursor().blockNumber(), "mark" ) ) def markCurrentLine(self): view = self.mainwindow().currentView() lineNumber = view.textCursor().blockNumber() bookmarks.bookmarks(view.document()).toggleMark(lineNumber, "mark") def clearErrorMarks(self): doc = self.mainwindow().currentDocument() bookmarks.bookmarks(doc).clear("error") def clearAllMarks(self): doc = self.mainwindow().currentDocument() bookmarks.bookmarks(doc).clear() def nextMark(self): view = self.mainwindow().currentView() cursor = view.textCursor() cursor = bookmarks.bookmarks(view.document()).nextMark(cursor) if cursor: view.gotoTextCursor(cursor) def previousMark(self): view = self.mainwindow().currentView() cursor = view.textCursor() cursor = bookmarks.bookmarks(view.document()).previousMark(cursor) if cursor: view.gotoTextCursor(cursor) class Actions(actioncollection.ActionCollection): name = "bookmarkmanager" def createActions(self, parent): self.view_bookmark = QAction(parent) self.view_bookmark.setCheckable(True) self.view_clear_error_marks = QAction(parent) self.view_clear_all_marks = QAction(parent) self.view_next_mark = QAction(parent) self.view_previous_mark = QAction(parent) self.view_bookmark.setShortcut(Qt.CTRL + Qt.Key_B) self.view_next_mark.setShortcut(Qt.ALT + Qt.Key_PageDown) self.view_previous_mark.setShortcut(Qt.ALT + Qt.Key_PageUp) self.view_bookmark.setIcon(icons.get("bookmark-new")) self.view_clear_all_marks.setIcon(icons.get("edit-clear")) def translateUI(self): self.view_bookmark.setText(_("&Mark Current Line")) self.view_clear_error_marks.setText(_("Clear &Error Marks")) self.view_clear_all_marks.setText(_("Clear &All Marks")) self.view_next_mark.setText(_("Next Mark")) self.view_previous_mark.setText(_("Previous Mark"))
gui
single_application
# Copied and modified from http://stackoverflow.com/a/12712362/605356 import logging import sys from typing import Optional from PyQt5.QtCore import QTextStream, pyqtSignal from PyQt5.QtNetwork import QLocalServer, QLocalSocket from PyQt5.QtWidgets import QApplication from tribler.gui.tribler_window import TriblerWindow from tribler.gui.utilities import connect, disconnect class QtSingleApplication(QApplication): """ This class makes sure that we can only start one Tribler application. When a user tries to open a second Tribler instance, the current active one will be brought to front. """ message_received = pyqtSignal(str) def __init__(self, win_id: str, start_local_server: bool, *argv): self.logger = logging.getLogger(self.__class__.__name__) self.logger.info( f'Start Tribler application. Win id: "{win_id}". ' f'Sys argv: "{sys.argv}"' ) QApplication.__init__(self, *argv) self.tribler_window: Optional[TriblerWindow] = None self._id = win_id # Is there another instance running? self._outgoing_connection = QLocalSocket() self._outgoing_connection.connectToServer(self._id) self.connected_to_previous_instance = ( self._outgoing_connection.waitForConnected() ) self._stream_to_running_app = None self._incoming_connection = None self._incoming_stream = None self._server = None if self.connected_to_previous_instance: self.logger.info("Another instance is running") self._stream_to_running_app = QTextStream(self._outgoing_connection) self._stream_to_running_app.setCodec("UTF-8") elif start_local_server: # Cleanup any past, crashed server. error = self._outgoing_connection.error() self.logger.info(f"No running instances (socket error: {error})") if error == QLocalSocket.ConnectionRefusedError: self.logger.info( "Received QLocalSocket.ConnectionRefusedError; removing server." ) self.cleanup_crashed_server() self._outgoing_connection = None self._server = QLocalServer() self._server.listen(self._id) connect(self._server.newConnection, self._on_new_connection) def cleanup_crashed_server(self): self.logger.info("Cleaning up crashed server...") if self._incoming_connection: self._incoming_connection.disconnectFromServer() if self._outgoing_connection: self._outgoing_connection.disconnectFromServer() if self._server: self._server.close() QLocalServer.removeServer(self._id) self.logger.info("Crashed server was removed") def get_id(self): return self._id def send_message(self, msg): self.logger.info(f"Send message: {msg}") if not self._stream_to_running_app: return False self._stream_to_running_app << msg << "\n" # pylint: disable=pointless-statement self._stream_to_running_app.flush() return self._outgoing_connection.waitForBytesWritten() def _on_new_connection(self): if self._incoming_connection: disconnect(self._incoming_connection.readyRead, self._on_ready_read) self._incoming_connection = self._server.nextPendingConnection() if not self._incoming_connection: return self._incoming_stream = QTextStream(self._incoming_connection) self._incoming_stream.setCodec("UTF-8") connect(self._incoming_connection.readyRead, self._on_ready_read) if self.tribler_window: self.tribler_window.raise_window() def _on_ready_read(self): while True: msg = self._incoming_stream.readLine() if not msg: break self.logger.info(f"A message received via the local socket: {msg}") self.message_received.emit(msg)
representatives
alert_group_representative
import logging from apps.alerts.constants import ActionSource from apps.alerts.representative import AlertGroupAbstractRepresentative from apps.slack.scenarios.scenario_step import ScenarioStep from celery.utils.log import get_task_logger from common.custom_celery_tasks import shared_dedicated_queue_retry_task from django.conf import settings logger = get_task_logger(__name__) logger.setLevel(logging.DEBUG) @shared_dedicated_queue_retry_task( autoretry_for=(Exception,), retry_backoff=True, max_retries=1 if settings.DEBUG else None, ) def on_create_alert_slack_representative_async(alert_pk): """ It's asynced in order to prevent Slack downtime causing issues with SMS and other destinations. """ from apps.alerts.models import Alert alert = ( Alert.objects.filter(pk=alert_pk) .select_related( "group", "group__channel", "group__channel__organization", "group__channel__organization__slack_team_identity", ) .get() ) logger.debug( f"Start on_create_alert_slack_representative for alert {alert_pk} from alert_group {alert.group_id}" ) organization = alert.group.channel.organization if organization.slack_team_identity: logger.debug( f"Process on_create_alert_slack_representative for alert {alert_pk} from alert_group {alert.group_id}" ) AlertShootingStep = ScenarioStep.get_step( "distribute_alerts", "AlertShootingStep" ) step = AlertShootingStep(organization.slack_team_identity, organization) step.process_signal(alert) else: logger.debug( f"Drop on_create_alert_slack_representative for alert {alert_pk} from alert_group {alert.group_id}" ) logger.debug( f"Finish on_create_alert_slack_representative for alert {alert_pk} from alert_group {alert.group_id}" ) @shared_dedicated_queue_retry_task( autoretry_for=(Exception,), retry_backoff=True, max_retries=1 if settings.DEBUG else None, ) def on_alert_group_action_triggered_async(log_record_id): from apps.alerts.models import AlertGroupLogRecord logger.debug(f"SLACK representative: get log record {log_record_id}") log_record = AlertGroupLogRecord.objects.get(pk=log_record_id) alert_group_id = log_record.alert_group_id logger.debug( f"Start on_alert_group_action_triggered for alert_group {alert_group_id}, log record {log_record_id}" ) instance = AlertGroupSlackRepresentative(log_record) if instance.is_applicable(): logger.debug( f"SLACK representative is applicable for alert_group {alert_group_id}, log record {log_record_id}" ) handler = instance.get_handler() logger.debug( f"Found handler {handler.__name__} in SLACK representative for alert_group {alert_group_id}, " f"log record {log_record_id}" ) handler() logger.debug( f"Finish handler {handler.__name__} in SLACK representative for alert_group {alert_group_id}, " f"log record {log_record_id}" ) else: logger.debug( f"SLACK representative is NOT applicable for alert_group {alert_group_id}, log record {log_record_id}" ) logger.debug( f"Finish on_alert_group_action_triggered for alert_group {alert_group_id}, log record {log_record_id}" ) @shared_dedicated_queue_retry_task( autoretry_for=(Exception,), retry_backoff=True, max_retries=1 if settings.DEBUG else None, ) def on_alert_group_update_log_report_async(alert_group_id): from apps.alerts.models import AlertGroup alert_group = AlertGroup.objects.get(pk=alert_group_id) logger.debug( f"Start on_alert_group_update_log_report for alert_group {alert_group_id}" ) organization = alert_group.channel.organization if alert_group.slack_message and organization.slack_team_identity: logger.debug( f"Process on_alert_group_update_log_report for alert_group {alert_group_id}" ) UpdateLogReportMessageStep = ScenarioStep.get_step( "distribute_alerts", "UpdateLogReportMessageStep" ) step = UpdateLogReportMessageStep( organization.slack_team_identity, organization ) step.process_signal(alert_group) else: logger.debug( f"Drop on_alert_group_update_log_report for alert_group {alert_group_id}" ) logger.debug( f"Finish on_alert_group_update_log_report for alert_group {alert_group_id}" ) class AlertGroupSlackRepresentative(AlertGroupAbstractRepresentative): def __init__(self, log_record): self.log_record = log_record def is_applicable(self): slack_message = self.log_record.alert_group.slack_message slack_team_identity = ( self.log_record.alert_group.channel.organization.slack_team_identity ) return ( slack_message is not None and slack_team_identity is not None and slack_message.slack_team_identity == slack_team_identity ) @classmethod def on_create_alert(cls, **kwargs): from apps.alerts.models import Alert alert = kwargs["alert"] if isinstance(alert, Alert): alert_id = alert.pk else: alert_id = alert alert = Alert.objects.get(pk=alert_id) logger.debug( f"Received alert_create_signal in SLACK representative for alert {alert_id} " f"from alert_group {alert.group_id}" ) if alert.group.notify_in_slack_enabled is False: logger.debug( f"Skipping alert with id {alert_id} from alert_group {alert.group_id} since notify_in_slack is disabled" ) return on_create_alert_slack_representative_async.apply_async((alert_id,)) logger.debug( f"Async process alert_create_signal in SLACK representative for alert {alert_id} " f"from alert_group {alert.group_id}" ) @classmethod def on_alert_group_action_triggered(cls, **kwargs): logger.debug( "Received alert_group_action_triggered signal in SLACK representative" ) from apps.alerts.models import AlertGroupLogRecord log_record = kwargs["log_record"] action_source = kwargs.get("action_source") force_sync = kwargs.get("force_sync", False) if isinstance(log_record, AlertGroupLogRecord): log_record_id = log_record.pk else: log_record_id = log_record if action_source == ActionSource.SLACK or force_sync: on_alert_group_action_triggered_async(log_record_id) else: on_alert_group_action_triggered_async.apply_async((log_record_id,)) @classmethod def on_alert_group_update_log_report(cls, **kwargs): from apps.alerts.models import AlertGroup alert_group = kwargs["alert_group"] if isinstance(alert_group, AlertGroup): alert_group_id = alert_group.pk else: alert_group_id = alert_group alert_group = AlertGroup.objects.get(pk=alert_group_id) logger.debug( f"Received alert_group_update_log_report signal in SLACK representative for alert_group {alert_group_id}" ) if alert_group.notify_in_slack_enabled is False: logger.debug( f"Skipping alert_group {alert_group_id} since notify_in_slack is disabled" ) return on_alert_group_update_log_report_async.apply_async((alert_group_id,)) @classmethod def on_alert_group_update_resolution_note(cls, **kwargs): alert_group = kwargs["alert_group"] resolution_note = kwargs.get("resolution_note") organization = alert_group.channel.organization logger.debug( f"Received alert_group_update_resolution_note signal in SLACK representative for alert_group {alert_group.pk}" ) if alert_group.slack_message and organization.slack_team_identity: UpdateResolutionNoteStep = ScenarioStep.get_step( "resolution_note", "UpdateResolutionNoteStep" ) step = UpdateResolutionNoteStep( organization.slack_team_identity, organization ) step.process_signal(alert_group, resolution_note) def on_acknowledge(self): AcknowledgeGroupStep = ScenarioStep.get_step( "distribute_alerts", "AcknowledgeGroupStep" ) step = AcknowledgeGroupStep( self.log_record.alert_group.channel.organization.slack_team_identity ) step.process_signal(self.log_record) def on_un_acknowledge(self): UnAcknowledgeGroupStep = ScenarioStep.get_step( "distribute_alerts", "UnAcknowledgeGroupStep" ) step = UnAcknowledgeGroupStep( self.log_record.alert_group.channel.organization.slack_team_identity ) step.process_signal(self.log_record) def on_resolve(self): ResolveGroupStep = ScenarioStep.get_step( "distribute_alerts", "ResolveGroupStep" ) step = ResolveGroupStep( self.log_record.alert_group.channel.organization.slack_team_identity ) step.process_signal(self.log_record) def on_un_resolve(self): UnResolveGroupStep = ScenarioStep.get_step( "distribute_alerts", "UnResolveGroupStep" ) step = UnResolveGroupStep( self.log_record.alert_group.channel.organization.slack_team_identity ) step.process_signal(self.log_record) def on_attach(self): AttachGroupStep = ScenarioStep.get_step("distribute_alerts", "AttachGroupStep") step = AttachGroupStep( self.log_record.alert_group.channel.organization.slack_team_identity ) step.process_signal(self.log_record) def on_fail_attach(self): AttachGroupStep = ScenarioStep.get_step("distribute_alerts", "AttachGroupStep") step = AttachGroupStep( self.log_record.alert_group.channel.organization.slack_team_identity ) step.process_signal(self.log_record) def on_un_attach(self): UnAttachGroupStep = ScenarioStep.get_step( "distribute_alerts", "UnAttachGroupStep" ) step = UnAttachGroupStep( self.log_record.alert_group.channel.organization.slack_team_identity ) step.process_signal(self.log_record) def on_silence(self): SilenceGroupStep = ScenarioStep.get_step( "distribute_alerts", "SilenceGroupStep" ) step = SilenceGroupStep( self.log_record.alert_group.channel.organization.slack_team_identity ) step.process_signal(self.log_record) def on_un_silence(self): UnSilenceGroupStep = ScenarioStep.get_step( "distribute_alerts", "UnSilenceGroupStep" ) step = UnSilenceGroupStep( self.log_record.alert_group.channel.organization.slack_team_identity ) step.process_signal(self.log_record) def on_invite(self): InviteOtherPersonToIncident = ScenarioStep.get_step( "distribute_alerts", "InviteOtherPersonToIncident" ) step = InviteOtherPersonToIncident( self.log_record.alert_group.channel.organization.slack_team_identity ) step.process_signal(self.log_record) def on_re_invite(self): self.on_invite() def on_un_invite(self): StopInvitationProcess = ScenarioStep.get_step( "distribute_alerts", "StopInvitationProcess" ) step = StopInvitationProcess( self.log_record.alert_group.channel.organization.slack_team_identity ) step.process_signal(self.log_record) def on_auto_un_acknowledge(self): self.on_un_acknowledge() def on_ack_reminder_triggered(self): AcknowledgeConfirmationStep = ScenarioStep.get_step( "distribute_alerts", "AcknowledgeConfirmationStep" ) step = AcknowledgeConfirmationStep( self.log_record.alert_group.channel.organization.slack_team_identity ) step.process_signal(self.log_record) def on_custom_button_triggered(self): CustomButtonProcessStep = ScenarioStep.get_step( "distribute_alerts", "CustomButtonProcessStep" ) step = CustomButtonProcessStep( self.log_record.alert_group.channel.organization.slack_team_identity ) step.process_signal(self.log_record) def on_wiped(self): WipeGroupStep = ScenarioStep.get_step("distribute_alerts", "WipeGroupStep") step = WipeGroupStep( self.log_record.alert_group.channel.organization.slack_team_identity ) step.process_signal(self.log_record) def on_deleted(self): DeleteGroupStep = ScenarioStep.get_step("distribute_alerts", "DeleteGroupStep") step = DeleteGroupStep( self.log_record.alert_group.channel.organization.slack_team_identity ) step.process_signal(self.log_record) def get_handler(self): handler_name = self.get_handler_name() if hasattr(self, handler_name): handler = getattr(self, handler_name) else: handler = self.on_handler_not_found return handler def get_handler_name(self): return self.HANDLER_PREFIX + self.get_handlers_map()[self.log_record.type] @classmethod def on_handler_not_found(cls): pass
gstreamer
converter
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # SoundConverter - GNOME application for converting between audio formats. # Copyright 2004 Lars Wirzenius # Copyright 2005-2020 Gautier Portet # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 3 of the License. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA import os from gettext import gettext as _ from gi.repository import Gio, GLib, Gst from soundconverter.util.error import show_error from soundconverter.util.fileoperations import ( beautify_uri, vfs_encode_filename, vfs_exists, vfs_rename, vfs_unlink, ) from soundconverter.util.logger import logger from soundconverter.util.settings import get_gio_settings from soundconverter.util.task import Task GSTREAMER_SOURCE = "giosrc" GSTREAMER_SINK = "giosink" available_elements = set() def find_available_elements(): """Figure out which gstreamer pipeline plugins are available.""" # gst-plugins-good, gst-plugins-bad, etc. packages provide them global available_elements GOOD = "gst-plugins-good" BAD = "gst-plugins-bad" BASE = "gst-plugins-base" UGLY = "gst-plugins-ugly" LIBAV = "gst-libav" # some functions can be provided by various packages. # move preferred packages towards the bottom. encoders = [ ("flacenc", "FLAC", "flac-enc", GOOD), ("wavenc", "WAV", "wav-enc", GOOD), ("vorbisenc", "Ogg Vorbis", "vorbis-enc", BASE), ("oggmux", "Ogg Vorbis", "vorbis-mux", BASE), ("id3mux", "MP3 tags", "mp3-id-tags", BAD), ("id3v2mux", "MP3 tags", "mp3-id-tags", GOOD), ("xingmux", "VBR tags", "mp3-vbr-tags", UGLY), ("lamemp3enc", "MP3", "mp3-enc", GOOD), ("mp4mux", "AAC", "aac-mux", GOOD), ("opusenc", "Opus", "opus-enc", BASE), ("faac", "AAC", "aac-enc", BAD), ("avenc_aac", "AAC", "aac-enc", LIBAV), ("fdkaacenc", "AAC", "aac-enc", BAD), ] result = dict() for encoder, name, function, package in encoders: have_it = bool(Gst.ElementFactory.find(encoder)) if have_it: available_elements.add(encoder) else: logger.debug( '{} gstreamer element from "{}" not found\n'.format(encoder, package) ) result[function] = (have_it, package) for function in result: have_it, package = result[function] if not have_it: logger.error( 'Disabling {} output. Do you have "{}" installed?'.format( function, package ) ) if "oggmux" not in available_elements: available_elements.discard("vorbisenc") if "mp4mux" not in available_elements: available_elements.discard("faac") available_elements.discard("avenc_aac") find_available_elements() def create_flac_encoder(): """Return an flac encoder for the gst pipeline string.""" flac_compression = get_gio_settings().get_int("flac-compression") return "flacenc mid-side-stereo=true quality={}".format(flac_compression) def create_wav_encoder(): """Return a wav encoder for the gst pipeline string.""" wav_sample_width = get_gio_settings().get_int("wav-sample-width") formats = {8: "U8", 16: "S16LE", 24: "S24LE", 32: "S32LE"} return "audioconvert ! audio/x-raw,format={} ! wavenc".format( formats[wav_sample_width] ) def create_oggvorbis_encoder(): """Return an ogg encoder for the gst pipeline string.""" cmd = "vorbisenc" vorbis_quality = get_gio_settings().get_double("vorbis-quality") if vorbis_quality is not None: cmd += " quality={}".format(vorbis_quality) cmd += " ! oggmux " return cmd def create_mp3_encoder(): """Return an mp3 encoder for the gst pipeline string.""" quality = { "cbr": "mp3-cbr-quality", "abr": "mp3-abr-quality", "vbr": "mp3-vbr-quality", } mode = get_gio_settings().get_string("mp3-mode") mp3_mode = mode mp3_quality = get_gio_settings().get_int(quality[mode]) cmd = "lamemp3enc encoding-engine-quality=2 " if mp3_mode is not None: properties = { "cbr": "target=bitrate cbr=true bitrate=%s ", "abr": "target=bitrate cbr=false bitrate=%s ", "vbr": "target=quality cbr=false quality=%s ", } cmd += properties[mp3_mode] % mp3_quality if "xingmux" in available_elements and mp3_mode != "cbr": # add xing header when creating vbr/abr mp3 cmd += "! xingmux " if "id3mux" in available_elements: # add tags cmd += "! id3mux " elif "id3v2mux" in available_elements: # add tags cmd += "! id3v2mux " return cmd def create_aac_encoder(): """Return an aac encoder for the gst pipeline string.""" aac_quality = get_gio_settings().get_int("aac-quality") # it seemed like I couldn't get vbr to work with any of these, not even # with rate-control and quality of faac or with maxrate of avenc_aac. # Or it was audacious not displaying the current vbr rate correctly. bitrate = aac_quality * 1000 # list of recommended aac encoders: # https://wiki.hydrogenaud.io/index.php?title=AAC_encoders if "fdkaacenc" in available_elements: return "fdkaacenc bitrate={} ! mp4mux".format(bitrate) encoder = "faac" if "faac" in available_elements else "avenc_aac" logger.warning( "fdkaacenc is recommended for aac conversion but it is not " "available. It can be installed with gst-plugins-bad. " "Using {} instead.".format(encoder) ) if "faac" in available_elements: return "faac bitrate={} rate-control=2 ! mp4mux".format(bitrate) return "avenc_aac bitrate={} ! mp4mux".format(bitrate) def create_opus_encoder(): """Return an opus encoder for the gst pipeline string.""" opus_quality = get_gio_settings().get_int("opus-bitrate") return ("opusenc bitrate={} bitrate-type=vbr " "bandwidth=auto ! oggmux").format( opus_quality * 1000 ) class Converter(Task): """Completely handle the conversion of a single file.""" INCREMENT = "increment" OVERWRITE = "overwrite" SKIP = "skip" def __init__(self, sound_file, name_generator): """create a converter that converts a single file. Parameters ---------- name_generator : TargetNameGenerator TargetNameGenerator that creates filenames for all converters of the current TaskQueue """ # Configuration self.sound_file = sound_file self.temporary_filename = None self.newname = None self.existing_behaviour = Converter.INCREMENT self.name_generator = name_generator # All relevant gio settings have to be copied and remembered, so that # they don't suddenly change during the conversion settings = get_gio_settings() self.output_mime_type = settings.get_string("output-mime-type") self.output_resample = settings.get_boolean("output-resample") self.resample_rate = settings.get_int("resample-rate") self.force_mono = settings.get_boolean("force-mono") self.replace_messy_chars = settings.get_boolean("replace-messy-chars") self.delete_original = settings.get_boolean("delete-original") # State self.command = None self.pipeline = None self._done = False self.error = None self.output_uri = None super().__init__() def _query_position(self): """Ask for the stream position of the current pipeline.""" if self.pipeline: # during Gst.State.PAUSED it returns super small numbers, # so take care position = self.pipeline.query_position(Gst.Format.TIME)[1] return max(0, position / Gst.SECOND) return 0 def get_progress(self): """Fraction of how much of the task is completed.""" duration = self.sound_file.duration if self._done: return 1, duration if self.pipeline is None or duration is None: return 0, duration position = self._query_position() progress = position / duration if duration else 0 progress = min(max(progress, 0.0), 1.0) return progress, duration def cancel(self): """Cancel execution of the task.""" self._stop_pipeline() self.done() def pause(self): """Pause execution of the task.""" if not self.pipeline: logger.debug("pause(): pipeline is None!") return self.pipeline.set_state(Gst.State.PAUSED) def resume(self): """Resume execution of the task.""" if not self.pipeline: logger.debug("resume(): pipeline is None!") return self.pipeline.set_state(Gst.State.PLAYING) def _cleanup(self): """Delete the pipeline.""" if self.pipeline is not None: bus = self.pipeline.get_bus() if hasattr(self, "watch_id"): bus.disconnect(self.watch_id) bus.remove_signal_watch() self.pipeline.set_state(Gst.State.NULL) self.pipeline = None def _stop_pipeline(self): # remove partial file if self.temporary_filename is not None: if vfs_exists(self.temporary_filename): try: vfs_unlink(self.temporary_filename) except Exception as error: logger.error( "cannot delete: '{}': {}".format( beautify_uri(self.temporary_filename), str(error) ) ) if not self.pipeline: logger.debug("pipeline already stopped!") return self._cleanup() def _convert(self): """Run the gst pipeline that converts files. Handlers for messages sent from gst are added, which also triggers renaming the file to it's final path. """ command = self.command if self.pipeline is None: logger.debug("launching: '{}'".format(command)) try: self.pipeline = Gst.parse_launch(command) bus = self.pipeline.get_bus() except GLib.Error as error: self.error = "gstreamer error when creating pipeline: {}".format( str(error) ) self._on_error(self.error) return bus.add_signal_watch() self.watch_id = bus.connect("message", self._on_message) self.pipeline.set_state(Gst.State.PLAYING) def _conversion_done(self): """Should be called when the EOS message arrived or on error. Will clear the temporary data on error or move the temporary file to the final path on success. """ input_uri = self.sound_file.uri newname = self.newname if newname is None: raise AssertionError("the conversion was not started") if self.error: logger.debug( "error in task, skipping rename: {}".format(self.temporary_filename) ) vfs_unlink(self.temporary_filename) logger.error( "could not convert {}: {}".format(beautify_uri(input_uri), self.error) ) self.done() return if not vfs_exists(self.temporary_filename): self.error = "Expected {} to exist after conversion.".format( self.temporary_filename ) self.done() return # rename temporary file logger.debug( "{} -> {}".format( beautify_uri(self.temporary_filename), beautify_uri(newname) ) ) path, extension = os.path.splitext(newname) path = path.replace("%", "%%") space = " " if self.replace_messy_chars: space = "_" exists = vfs_exists(newname) if self.existing_behaviour == Converter.INCREMENT and exists: # If the file already exists, increment the filename so that # nothing gets overwritten. path = path + space + "(%d)" + extension i = 1 while vfs_exists(newname): newname = path % i i += 1 try: if self.existing_behaviour == Converter.OVERWRITE and exists: logger.info("overwriting '{}'".format(beautify_uri(newname))) vfs_unlink(newname) vfs_rename(self.temporary_filename, newname) except Exception as error: self.error = str(error) logger.error( "could not rename '{}' to '{}':".format( beautify_uri(self.temporary_filename), beautify_uri(newname), str(error), ) ) self.done() return assert vfs_exists(newname) logger.info( "converted '{}' to '{}'".format( beautify_uri(input_uri), beautify_uri(newname) ) ) # finish up the target file try: # Copy file permissions source = Gio.file_parse_name(self.sound_file.uri) destination = Gio.file_parse_name(newname) source.copy_attributes(destination, Gio.FileCopyFlags.NONE) # the modification date of the destination should be now info = Gio.FileInfo() now = GLib.DateTime.new_now(GLib.TimeZone()) if callable(getattr(info, "set_modification_date_time", None)): info.set_modification_date_time(now) else: # deprecated method timeval = GLib.TimeVal() now.to_timeval(timeval) info.set_modification_time(timeval) destination.set_attributes_from_info(info, Gio.FileQueryInfoFlags.NONE) except Exception as error: logger.error( "Could not set some attributes of the target '{}': {}".format( beautify_uri(newname), str(error) ) ) if self.delete_original and not self.error: logger.info("deleting: '{}'".format(self.sound_file.uri)) try: vfs_unlink(self.sound_file.uri) except Exception as error: logger.info( "cannot remove '{}': {}".format( beautify_uri(self.sound_file.uri), str(error) ) ) self.output_uri = newname self.done() def done(self): self._done = True self._cleanup() super().done() def run(self): """Call this in order to run the whole Converter task.""" self.newname = self.name_generator.generate_target_uri(self.sound_file) # temporary output file, in order to easily remove it without # any overwritten file and therefore caused damage in the target dir. self.temporary_filename = self.name_generator.generate_temp_path( self.sound_file ) exists = vfs_exists(self.newname) if self.existing_behaviour == Converter.SKIP and exists: logger.info( "output file already exists, skipping '{}'".format( beautify_uri(self.newname) ) ) self.done() return # construct a pipeline for conversion # Add default decoding step that remains the same for all formats. command = [ '{} location="{}" name=src ! decodebin name=decoder'.format( GSTREAMER_SOURCE, vfs_encode_filename(self.sound_file.uri) ), "audiorate ! audioconvert ! audioresample", ] # audio resampling support if self.output_resample: command.append("audio/x-raw,rate={}".format(self.resample_rate)) command.append("audioconvert ! audioresample") if self.force_mono: command.append("audio/x-raw,channels=1 ! audioconvert") # figure out the rest of the gst pipeline string encoder = { "audio/x-vorbis": create_oggvorbis_encoder, "audio/x-flac": create_flac_encoder, "audio/x-wav": create_wav_encoder, "audio/mpeg": create_mp3_encoder, "audio/x-m4a": create_aac_encoder, "audio/ogg; codecs=opus": create_opus_encoder, }[self.output_mime_type]() command.append(encoder) gfile = Gio.file_parse_name(self.temporary_filename) dirname = gfile.get_parent() if dirname and not dirname.query_exists(None): logger.info("creating folder: '{}'".format(beautify_uri(dirname.get_uri()))) if not dirname.make_directory_with_parents(): show_error( _("cannot create '{}' folder.").format(beautify_uri(dirname)) ) return command.append( '{} location="{}"'.format( GSTREAMER_SINK, vfs_encode_filename(self.temporary_filename) ) ) # preparation done, now convert self.command = " ! ".join(command) self._convert() def _on_error(self, error): """Log errors and write down that this Task failed. The TaskQueue is interested in reading the error. """ self.error = error show_error(error, beautify_uri(self.sound_file.uri)) self._stop_pipeline() self.done() def _on_message(self, _, message): """Handle message events sent by gstreamer. Parameters ---------- message : Gst.Message """ if message.type == Gst.MessageType.ERROR: error, __ = message.parse_error() self._on_error(error) elif message.type == Gst.MessageType.EOS: # Conversion done self._conversion_done()
drone
localChangeAmount
import wx from gui.fitCommands.helpers import DroneInfo from logbook import Logger from service.fit import Fit pyfalog = Logger(__name__) class CalcChangeLocalDroneAmountCommand(wx.Command): def __init__(self, fitID, position, amount): wx.Command.__init__(self, True, "Change Local Drone Amount") self.fitID = fitID self.position = position self.amount = amount self.savedDroneInfo = None def Do(self): pyfalog.debug( "Doing change of local drone amount to {} at position {} on fit {}".format( self.amount, self.position, self.fitID ) ) fit = Fit.getInstance().getFit(self.fitID) drone = fit.drones[self.position] self.savedDroneInfo = DroneInfo.fromDrone(drone) if self.amount == self.savedDroneInfo.amount: return False drone.amount = self.amount if drone.amountActive > 0: difference = self.amount - self.savedDroneInfo.amount drone.amount = self.amount drone.amountActive = max( min(drone.amountActive + difference, drone.amount), 0 ) return True def Undo(self): pyfalog.debug( "Undoing change of local drone quantity to {} at position {} on fit {}".format( self.amount, self.position, self.fitID ) ) if self.savedDroneInfo is not None: fit = Fit.getInstance().getFit(self.fitID) drone = fit.drones[self.position] drone.amount = self.savedDroneInfo.amount drone.amountActive = self.savedDroneInfo.amountActive return True return False
clients
utorrent
import os from libs.utorrent.client import UTorrentClient # Only compatible with uTorrent 3.0+ class TorrentClient(object): def __init__(self): self.conn = None def connect(self, host, username, password): if self.conn is not None: return self.conn if not host: return False if username and password: self.conn = UTorrentClient(host, username, password) else: self.conn = UTorrentClient(host) return self.conn def find_torrent(self, hash): try: torrent_list = self.conn.list()[1] for t in torrent_list["torrents"]: if t[0] == hash: torrent = t except Exception: raise return torrent if torrent else False def get_torrent(self, torrent): if not torrent[26]: raise "Only compatible with uTorrent 3.0+" torrent_files = [] torrent_completed = False torrent_directory = os.path.normpath(torrent[26]) try: if torrent[4] == 1000: torrent_completed = True files = self.conn.getfiles(torrent[0])[1]["files"][1] for f in files: if not os.path.normpath(f[0]).startswith(torrent_directory): file_path = os.path.join(torrent_directory, f[0].lstrip("/")) else: file_path = f[0] torrent_files.append(file_path) torrent_info = { "hash": torrent[0], "name": torrent[2], "label": torrent[11] if torrent[11] else "", "folder": torrent[26], "completed": torrent_completed, "files": torrent_files, } except Exception: raise return torrent_info def start_torrent(self, torrent_hash): return self.conn.start(torrent_hash) def stop_torrent(self, torrent_hash): return self.conn.stop(torrent_hash) def delete_torrent(self, torrent): deleted = [] try: files = self.conn.getfiles(torrent[0])[1]["files"][1] for f in files: deleted.append(os.path.normpath(os.path.join(torrent[26], f[0]))) self.conn.removedata(torrent[0]) except Exception: raise return deleted
version-checks
github_commit
__author__ = "Gina Häußge <osd@foosel.net>" __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html" __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License" import logging import requests BRANCH_HEAD_URL = "https://api.github.com/repos/{user}/{repo}/git/refs/heads/{branch}" logger = logging.getLogger( "octoprint.plugins.softwareupdate.version_checks.github_commit" ) def _get_latest_commit(user, repo, branch, apikey=None): from ..exceptions import NetworkError headers = {} if apikey: auth = "token " + apikey headers = {"Authorization": auth} try: r = requests.get( BRANCH_HEAD_URL.format(user=user, repo=repo, branch=branch), timeout=(3.05, 30), headers=headers, ) except requests.ConnectionError as exc: raise NetworkError(cause=exc) from . import check_github_apiresponse, check_github_ratelimit check_github_ratelimit(logger, r) check_github_apiresponse(logger, r) reference = r.json() if "object" not in reference or "sha" not in reference["object"]: return None return reference["object"]["sha"] def get_latest(target, check, online=True, credentials=None, *args, **kwargs): from ..exceptions import ConfigurationInvalid user = check.get("user") repo = check.get("repo") if user is None or repo is None: raise ConfigurationInvalid( "Update configuration for {} of type github_commit needs user and repo set and not None".format( target ) ) branch = "master" if "branch" in check and check["branch"] is not None: branch = check["branch"] current = check.get("current") information = { "local": { "name": "Commit {commit}".format( commit=current if current is not None else "?" ), "value": current, }, "remote": {"name": "?", "value": "?"}, "needs_online": not check.get("offline", False), } if not online and information["needs_online"]: return information, True apikey = None if credentials: apikey = credentials.get("github") remote_commit = _get_latest_commit( check["user"], check["repo"], branch, apikey=apikey ) remote_name = f"Commit {remote_commit}" if remote_commit is not None else "-" information["remote"] = {"name": remote_name, "value": remote_commit} is_current = ( current is not None and current == remote_commit ) or remote_commit is None logger.debug(f"Target: {target}, local: {current}, remote: {remote_commit}") return information, is_current
models
transition_model
""" @file @brief This file contains the transitions model, used by the main window @author Jonathan Thomas <jonathan@openshot.org> @section LICENSE Copyright (c) 2008-2018 OpenShot Studios, LLC (http://www.openshotstudios.com). This file is part of OpenShot Video Editor (http://www.openshot.org), an open-source project dedicated to delivering high quality video editing and animation solutions to the world. OpenShot Video Editor is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenShot Video Editor is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>. """ import json import os import openshot # Python module for libopenshot (required video editing module installed separately) from classes import info from classes.app import get_app from classes.logger import log from PyQt5.QtCore import ( QItemSelectionModel, QMimeData, QObject, QPersistentModelIndex, QSortFilterProxyModel, Qt, pyqtSignal, ) from PyQt5.QtGui import QIcon, QStandardItem, QStandardItemModel from PyQt5.QtWidgets import QMessageBox class TransitionFilterProxyModel(QSortFilterProxyModel): """Proxy class used for sorting and filtering model data""" def filterAcceptsRow(self, sourceRow, sourceParent): """Filter for common transitions and text filter""" if get_app().window.actionTransitionsShowCommon.isChecked(): # Fetch the group name index = self.sourceModel().index( sourceRow, 2, sourceParent ) # group name column group_name = self.sourceModel().data(index) # group name (i.e. common) # Fetch the transitions name index = self.sourceModel().index( sourceRow, 0, sourceParent ) # transition name column trans_name = self.sourceModel().data( index ) # transition name (i.e. Fade In) # Return, if regExp match in displayed format. return ( group_name == "common" and self.filterRegExp().indexIn(trans_name) >= 0 ) # Continue running built-in parent filter logic return super(TransitionFilterProxyModel, self).filterAcceptsRow( sourceRow, sourceParent ) def lessThan(self, left, right): """Sort with both group name and transition name""" leftData = left.data(self.sortRole()) # Transition name (or other role data) rightData = right.data(self.sortRole()) leftGroup = left.sibling(left.row(), 2).data() # group column rightGroup = right.sibling(right.row(), 2).data() return leftGroup <= rightGroup and leftData < rightData def mimeData(self, indexes): # Create MimeData for drag operation data = QMimeData() # Create list from requested transition indexes items = [i.sibling(i.row(), 3).data() for i in indexes] data.setText(json.dumps(items)) data.setHtml("transition") # Return Mimedata return data class TransitionsModel(QObject): ModelRefreshed = pyqtSignal() def update_model(self, clear=True): log.info("updating transitions model.") app = get_app() # Translations _ = app._tr # Clear all items if clear: self.model_paths = {} self.model.clear() # Add Headers self.model.setHorizontalHeaderLabels([_("Thumb"), _("Name")]) # get a list of files in the OpenShot /transitions directory transitions_dir = os.path.join(info.PATH, "transitions") common_dir = os.path.join(transitions_dir, "common") extra_dir = os.path.join(transitions_dir, "extra") transition_groups = [ {"type": "common", "dir": common_dir, "files": os.listdir(common_dir)}, {"type": "extra", "dir": extra_dir, "files": os.listdir(extra_dir)}, ] # Add optional user-defined transitions folder if os.path.exists(info.TRANSITIONS_PATH) and os.listdir(info.TRANSITIONS_PATH): transition_groups.append( { "type": "user", "dir": info.TRANSITIONS_PATH, "files": os.listdir(info.TRANSITIONS_PATH), } ) for group in transition_groups: type = group["type"] dir = group["dir"] files = group["files"] for filename in sorted(files): path = os.path.join(dir, filename) fileBaseName = os.path.splitext(filename)[0] # Skip hidden files (such as .DS_Store, etc...) if filename[0] == "." or "thumbs.db" in filename.lower(): continue # split the name into parts (looking for a number) suffix_number = None name_parts = fileBaseName.split("_") if name_parts[-1].isdigit(): suffix_number = name_parts[-1] # get name of transition trans_name = fileBaseName.replace("_", " ").capitalize() # replace suffix number with placeholder (if any) if suffix_number: trans_name = trans_name.replace(suffix_number, "%s") trans_name = self.app._tr(trans_name) % suffix_number else: trans_name = self.app._tr(trans_name) # Check for thumbnail path (in build-in cache) thumb_path = os.path.join( info.IMAGES_PATH, "cache", "{}.png".format(fileBaseName) ) # Check built-in cache (if not found) if not os.path.exists(thumb_path): # Check user folder cache thumb_path = os.path.join( info.CACHE_PATH, "{}.png".format(fileBaseName) ) # Generate thumbnail (if needed) if not os.path.exists(thumb_path): try: # Reload this reader clip = openshot.Clip(path) reader = clip.Reader() # Open reader reader.Open() # Save thumbnail reader.GetFrame(0).Thumbnail( thumb_path, 98, 64, os.path.join(info.IMAGES_PATH, "mask.png"), "", "#000", True, "png", 85, ) reader.Close() clip.Close() except Exception: # Handle exception log.debug( "Invalid transition image file %s", filename, exc_info=1 ) msg = QMessageBox() msg.setText( _("{} is not a valid transition file.".format(filename)) ) msg.exec_() continue row = [] # Load icon (using display DPI) icon = QIcon() icon.addFile(thumb_path) # Append thumbnail col = QStandardItem() col.setIcon(icon) col.setText(trans_name) col.setToolTip(trans_name) col.setData(type) col.setFlags( Qt.ItemIsSelectable | Qt.ItemIsEnabled | Qt.ItemIsUserCheckable | Qt.ItemIsDragEnabled ) row.append(col) # Append Filename col = QStandardItem("Name") col.setData(trans_name, Qt.DisplayRole) col.setText(trans_name) col.setFlags( Qt.ItemIsSelectable | Qt.ItemIsEnabled | Qt.ItemIsUserCheckable | Qt.ItemIsDragEnabled ) row.append(col) # Append Media Type col = QStandardItem("Type") col.setData(type, Qt.DisplayRole) col.setText(type) col.setFlags( Qt.ItemIsSelectable | Qt.ItemIsEnabled | Qt.ItemIsUserCheckable | Qt.ItemIsDragEnabled ) row.append(col) # Append Path col = QStandardItem("Path") col.setData(path, Qt.DisplayRole) col.setText(path) col.setFlags( Qt.ItemIsSelectable | Qt.ItemIsEnabled | Qt.ItemIsUserCheckable | Qt.ItemIsDragEnabled ) row.append(col) # Append ROW to MODEL (if does not already exist in model) if path not in self.model_paths: self.model.appendRow(row) self.model_paths[path] = QPersistentModelIndex(row[3].index()) # Emit signal when model is updated self.ModelRefreshed.emit() def __init__(self, *args): # Init QObject superclass super().__init__(*args) # Create standard model self.app = get_app() self.model = QStandardItemModel() self.model.setColumnCount(4) self.model_paths = {} # Create proxy model (for sorting and filtering) self.proxy_model = TransitionFilterProxyModel() self.proxy_model.setDynamicSortFilter(True) self.proxy_model.setFilterCaseSensitivity(Qt.CaseInsensitive) self.proxy_model.setSortCaseSensitivity(Qt.CaseSensitive) self.proxy_model.setSourceModel(self.model) self.proxy_model.setSortLocaleAware(True) # Create selection model to share between views self.selection_model = QItemSelectionModel(self.proxy_model) # Attempt to load model testing interface, if requested # (will only succeed with Qt 5.11+) if info.MODEL_TEST: try: # Create model tester objects from PyQt5.QtTest import QAbstractItemModelTester self.model_tests = [] for m in [self.proxy_model, self.model]: self.model_tests.append( QAbstractItemModelTester( m, QAbstractItemModelTester.FailureReportingMode.Warning ) ) log.info( "Enabled {} model tests for transition data".format( len(self.model_tests) ) ) except ImportError: pass
library
playlist
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. import os import re from typing import Generator, Iterable, Optional import quodlibet from quodlibet import _, ngettext, print_d, print_e, print_w from quodlibet.formats import AudioFile from quodlibet.library.base import Library from quodlibet.util.collection import FileBackedPlaylist, Playlist, XSPFBackedPlaylist from senf import _fsnative, fsn2text, text2fsn _DEFAULT_PLAYLIST_DIR = text2fsn(os.path.join(quodlibet.get_user_dir(), "playlists")) """Directory for playlist files""" HIDDEN_RE = re.compile(r"^\.\w[^.]*") """Hidden-like files, to ignored""" _MIN_NON_EMPTY_PL_BYTES = 4 """Arbitrary minimum file size for a legacy non-empty playlist file""" class PlaylistLibrary(Library[str, Playlist]): """A PlaylistLibrary listens to a SongLibrary, and keeps tracks of playlists of these songs. The library behaves like a dictionary: the keys are playlist names, the values are Playlist objects. """ def __init__(self, library: Library, pl_dir: _fsnative = _DEFAULT_PLAYLIST_DIR): self.librarian = None super().__init__(f"{type(self).__name__} for {library._name}") print_d(f"Initializing Playlist Library {self} to watch {library._name!r}") self.pl_dir = pl_dir if library is None: raise ValueError("Need a library to listen to") self._library = library self._read_playlists(library) self._rsig = library.connect("removed", self.__songs_removed) self._csig = library.connect("changed", self.__songs_changed) def _read_playlists(self, library) -> None: print_d(f"Reading playlist directory {self.pl_dir} (library: {library})") try: fns = os.listdir(self.pl_dir) except FileNotFoundError as e: print_w(f"No playlist dir found in {self.pl_dir!r}, creating. ({e})") os.mkdir(self.pl_dir) fns = [] # Populate this library by relying on existing signal passing. # Weird, but allows keeping the logic in one place failed = [] for fn in fns: full_path = os.path.join(self.pl_dir, fn) if os.path.isdir(full_path): continue if HIDDEN_RE.match(fsn2text(fn)): print_d(f"Ignoring hidden file {fn!r}") continue try: XSPFBackedPlaylist(self.pl_dir, fn, songs_lib=library, pl_lib=self) except TypeError as e: # Don't add to library - it's temporary legacy = FileBackedPlaylist( self.pl_dir, fn, songs_lib=library, pl_lib=None ) if not len(legacy): try: size = os.stat(legacy._last_fn).st_size if size >= _MIN_NON_EMPTY_PL_BYTES: data = {"filename": fn, "size": size / 1024} print_w( _( "No library songs found in legacy playlist " "%(filename)r (of size %(size).1f kB)." ) % data + " " + _( "Have you changed library root dir(s), " "but not this playlist?" ) ) continue except OSError: print_e(f"Problem reading {legacy._last_fn!r}") continue finally: failed.append(fn) print_w(f"Converting {fn!r} to XSPF format ({e})") XSPFBackedPlaylist.from_playlist(legacy, songs_lib=library, pl_lib=self) except EnvironmentError: print_w(f"Invalid Playlist {fn!r}") failed.append(fn) if failed: total = len(failed) print_e( ngettext( "%d playlist failed to convert", "%d playlists failed to convert", total, ) % len(failed) ) def create(self, name_base: Optional[str] = None) -> Playlist: if name_base: return XSPFBackedPlaylist.new( self.pl_dir, name_base, songs_lib=self._library, pl_lib=self ) return XSPFBackedPlaylist.new(self.pl_dir, songs_lib=self._library, pl_lib=self) def create_from_songs(self, songs: Iterable[AudioFile], title=None) -> Playlist: """Creates a playlist visible to this library""" return XSPFBackedPlaylist.from_songs( self.pl_dir, songs, title=title, songs_lib=self._library, pl_lib=self ) def destroy(self): for sig in [self._rsig, self._csig]: self._library.disconnect(sig) def playlists_featuring(self, song: AudioFile) -> Generator[Playlist, None, None]: """Returns a generator yielding playlists in which this song appears""" return (pl for pl in self if song in pl._list) def __songs_removed(self, library, songs): print_d( f"Removing {len(songs)} song(s) " f"across {len(self)} playlist(s) in {self}" ) changed = {pl for pl in self if pl.remove_songs(songs)} if changed: for pl in changed: pl.write() self.changed(changed) def __songs_changed(self, library, songs) -> None: # Q: what if the changes are entirely due to changes *from* this library? # A: seems safest to still emit 'changed' as collections can cache metadata etc changed = set() for playlist in self: for song in songs: if song in playlist.songs: changed.add(playlist) # It's definitely changed now, nothing else is interesting break if changed: # TODO: only write if anything *persisted* changes (#3622) # i.e. not internal stuff (notably: ~playlists itself) for pl in changed: pl.finalize() pl.write() self.changed(changed) def recreate(self, playlist: Playlist, songs: Iterable[AudioFile]): """Keep a playlist but entirely replace its contents This is useful for applying new external sorting etc""" playlist._list.clear() playlist._list.extend(songs) playlist.finalize() playlist.write() self.changed([playlist])
PyObjCTools
NibClassBuilder
#!/usr/bin/env python """NibClassBuilder.py -- Tools for working with class definitions in "Next Interface Builder" files ("nibs"). NOTE: This module is deprecated and is not supported with modern versions of Interface Builder because those uses a NIB format that is not compatibility with NibClassBuilder. We have no intention whatsoever to fix the compatibility issues, use explicit definitions instead. On a more possitive note: IB 3.0 fully supports reading class definitions from Python files, which removes the reason why we wrote this module in the first place. Extracting class definitions from nibs. The module maintains a global set of class definitions, extracted from nibs. To add the classes from a nib to this set, use the extractClasses() function. It can be called in two ways: extractClasses(nibName, bundle=<main-bundle>) This finds the nib by name from a bundle. If no bundle if given, the main bundle is searched. extractClasses(path=pathToNib) This uses an explicit path to a nib. extractClasses() can be called multiple times for the same bundle: the results are cached so no almost extra overhead is caused. Using the class definitions. The module contains a "magic" base (super) class called AutoBaseClass. Subclassing AutoBaseClass will invoke some magic that will look up the proper base class in the class definitions extracted from the nib(s). If you use multiple inheritance to use Cocoa's "informal protocols", you _must_ list AutoBaseClass as the first base class. For example: class PyModel(AutoBaseClass, NSTableSource): ... The NibInfo class. The parsing of nibs and collecting the class definition is done by the NibInfo class. You normally don't use it directly, but it's here if you have special needs. The command line tool. When run from the command line, this module invokes a simple command line program, which you feed paths to nibs. This will print a Python template for all classes defined in the nib(s). For more documentation, see the commandline_doc variable, or simply run the program without arguments. It also contains a simple test program. """ # # Written by Just van Rossum <just@letterror.com>, borrowing heavily # from Ronald Oussoren's classnib.py module, which this module # supercedes. Lots of additional input from Bill Bumgarner and Jack # Jansen. # import os import sys import warnings import objc warnings.warn( "PyObjCTools.NibClassBuilder is deprecated, use explicit definitions instead", DeprecationWarning, ) __all__ = ["AutoBaseClass", "NibInfo", "extractClasses"] import AppKit # not used directly, but we look up classes from AppKit from Foundation import NSBundle, NSDictionary, NSObject # dynamically, so it has to be loaded. class NibLoaderError(Exception): pass class ClassInfo: attrNames = ("nibs", "name", "super", "actions", "outlets") def __repr__(self): items = self.__dict__.items() items.sort() return ( self.__class__.__name__ + "(" + ", ".join(["%s=%s" % i for i in items]) + ")" ) def merge(self, other): assert self.name == other.name if self.super != other.super: raise NibLoaderError("Incompatible superclass for %s" % self.name) self.nibs = mergeLists(self.nibs, other.nibs) self.outlets = mergeLists(self.outlets, other.outlets) self.actions = mergeLists(self.actions, other.actions) def __cmp__(self, other): s = [getattr(self, x) for x in self.attrNames] o = [getattr(other, x) for x in self.attrNames] return cmp(s, o) class NibInfo(object): def __init__(self): self.classes = {} self.parsedNibs = {} # we implement a subset of the dictionary protocol, for convenience. def keys(self): return self.classes.keys() def has_key(self, name): return self.classes.has_key(name) def len(self): return len(self.classes) def __iter__(self): return iter(self.classes) def __getitem__(self, name): return self.classes[name] def get(self, name, default=None): return self.classes.get(name, default) def extractClasses(self, nibName=None, bundle=None, path=None): """Extract the class definitions from a nib. The nib can be specified by name, in which case it will be searched in the main bundle (or in the bundle specified), or by path. """ if path is None: self._extractClassesFromNibFromBundle(nibName, bundle) else: if nibName is not None or bundle is not None: raise ValueError( "Can't specify 'nibName' or " "'bundle' when specifying 'path'" ) self._extractClassesFromNibFromPath(path) def _extractClassesFromNibFromBundle(self, nibName, bundle=None): if not bundle: bundle = objc.currentBundle() if nibName[-4:] == ".nib": resType = None else: resType = "nib" path = bundle.pathForResource_ofType_(nibName, resType) if not path: raise NibLoaderError( "Could not find nib named '%s' " "in bundle '%s'" % (nibName, bundle) ) self._extractClassesFromNibFromPath(path) def _extractClassesFromNibFromPath(self, path): path = os.path.normpath(path) if self.parsedNibs.has_key(path): return # we've already parsed this nib nibName = os.path.basename(path) nibInfo = NSDictionary.dictionaryWithContentsOfFile_( os.path.join(path, "classes.nib") ) if nibInfo is None: raise NibLoaderError("Invalid NIB file [%s]" % path) if not nibInfo.has_key("IBVersion"): raise NibLoaderError("Invalid NIB info") if nibInfo["IBVersion"] != "1": raise NibLoaderError("Unsupported NIB version") for rawClsInfo in nibInfo["IBClasses"]: self._addClass(nibName, rawClsInfo) self.parsedNibs[path] = 1 def _addClass(self, nibName, rawClsInfo): classes = self.classes name = rawClsInfo["CLASS"] if name == "FirstResponder": # a FirstResponder never needs to be made return clsInfo = ClassInfo() clsInfo.nibs = [nibName] # a class can occur in multiple nibs clsInfo.name = name clsInfo.super = rawClsInfo.get("SUPERCLASS", "NSObject") clsInfo.actions = [a + "_" for a in rawClsInfo.get("ACTIONS", ())] clsInfo.outlets = list(rawClsInfo.get("OUTLETS", ())) if not classes.has_key(name): classes[name] = clsInfo else: classes[name].merge(clsInfo) def makeClass(self, name, bases, methods): """Construct a new class using the proper base class, as specified in the nib. """ clsInfo = self.classes.get(name) if clsInfo is None: raise NibLoaderError("No class named '%s' found in " "nibs" % name) try: superClass = objc.lookUpClass(clsInfo.super) except objc.nosuchclass_error: raise NibLoaderError( ("Superclass '%s' for '%s' not " "found." % (clsInfo.super, name)) ) bases = (superClass,) + bases metaClass = superClass.__class__ for o in clsInfo.outlets: if not methods.has_key(o): methods[o] = objc.IBOutlet(o) for a in clsInfo.actions: if not methods.has_key(a): # XXX we could issue warning here! pass # don't insert a stub as it effectively disables # AppKit's own method validation # methods[a] = _actionStub return metaClass(name, bases, methods) def printTemplate(self, file=None): """Print a Python template of classes, matching their specification in the nib(s). """ if file is None: file = sys.stdout writer = IndentWriter(file) self._printTemplateHeader(writer) classes = self.classes.values() classes.sort() # see ClassInfo.__cmp__ for clsInfo in classes: if _classExists(clsInfo.super): self._printClass(writer, clsInfo) else: writer.writeln("if 0:") writer.indent() writer.writeln("# *** base class not found: %s" % clsInfo.super) self._printClass(writer, clsInfo) writer.dedent() self._printTemplateFooter(writer) def _printTemplateHeader(self, writer): nibs = {} for clsInfo in self.classes.values(): for nib in clsInfo.nibs: nibs[nib] = 1 writer.writeln("import objc") writer.writeln("from Foundation import *") writer.writeln("from AppKit import *") writer.writeln("from PyObjCTools import NibClassBuilder, AppHelper") writer.writeln() writer.writeln() nibs = nibs.keys() nibs.sort() for nib in nibs: assert nib[-4:] == ".nib" nib = nib[:-4] writer.writeln('NibClassBuilder.extractClasses("%s")' % nib) writer.writeln() writer.writeln() def _printTemplateFooter(self, writer): writer.writeln() writer.writeln('if __name__ == "__main__":') writer.indent() writer.writeln("AppHelper.runEventLoop()") writer.dedent() def _printClass(self, writer, clsInfo): nibs = clsInfo.nibs if len(nibs) > 1: nibs[-2] = nibs[-2] + " and " + nibs[-1] del nibs[-1] nibs = ", ".join(nibs) writer.writeln("# class defined in %s" % nibs) writer.writeln("class %s(NibClassBuilder.AutoBaseClass):" % clsInfo.name) writer.indent() writer.writeln("# the actual base class is %s" % clsInfo.super) outlets = clsInfo.outlets actions = clsInfo.actions if outlets: writer.writeln("# The following outlets are added to the class:") outlets.sort() for o in outlets: writer.writeln("# %s" % o) writer.writeln() if not actions: writer.writeln("pass") writer.writeln() else: if actions: actions.sort() for a in actions: writer.writeln("def %s(self, sender):" % a) writer.indent() writer.writeln("pass") writer.dedent() writer.writeln() writer.writeln() writer.dedent() def _frameworkForClass(className): """Return the name of the framework containing the class.""" try: cls = objc.lookUpClass(className) except objc.error: return "" path = NSBundle.bundleForClass_(cls).bundlePath() if path == "/System/Library/Frameworks/Foundation.framework": return "Foundation" elif path == "/System/Library/Frameworks/AppKit.framework": return "AppKit" else: return "" def _classExists(className): """Return True if a class exists in the Obj-C runtime.""" try: objc.lookUpClass(className) except objc.error: return 0 else: return 1 class IndentWriter: """Simple helper class for generating (Python) code.""" def __init__(self, file=None, indentString=" "): if file is None: file = sys.stdout self.file = file self.indentString = indentString self.indentLevel = 0 def writeln(self, line=""): if line: self.file.write(self.indentLevel * self.indentString + line + "\n") else: self.file.write("\n") def indent(self): self.indentLevel += 1 def dedent(self): assert self.indentLevel > 0, "negative dedent" self.indentLevel -= 1 def mergeLists(l1, l2): r = {} for i in l1: r[i] = 1 for i in l2: r[i] = 1 return r.keys() class _NibClassBuilder(type): def _newSubclass(cls, name, bases, methods): # Constructor for AutoBaseClass: create an actual # instance of _NibClassBuilder that can be subclassed # to invoke the magic behavior. return type.__new__(cls, name, bases, methods) _newSubclass = classmethod(_newSubclass) def __new__(cls, name, bases, methods): # __new__ would normally create a subclass of cls, but # instead we create a completely different class. if bases and bases[0].__class__ is cls: # get rid of the AutoBaseClass base class bases = bases[1:] return _nibInfo.makeClass(name, bases, methods) # AutoBaseClass is a class that has _NibClassBuilder is its' metaclass. # This means that if you subclass from AutoBaseClass, _NibClassBuilder # will be used to create the new "subclass". This will however _not_ # be a real subclass of AutoBaseClass, but rather a subclass of the # Cocoa class specified in the nib. AutoBaseClass = _NibClassBuilder._newSubclass("AutoBaseClass", (), {}) _nibInfo = NibInfo() extractClasses = _nibInfo.extractClasses # # The rest of this file is a simple command line tool. # commandline_doc = """\ NibLoader.py [-th] nib1 [...nibN] Print an overview of the classes found in the nib file(s) specified, listing their superclass, actions and outlets as Python source. This output can be used as a template or a stub. -t Instead of printing the overview, perform a simple test on the arguments. -h Print this text.""" def usage(msg, code): if msg: print(msg) print(commandline_doc) sys.exit(code) def test(*nibFiles): for path in nibFiles: print("Loading %s" % (path,)) extractClasses(path=path) print classNames = _nibInfo.keys() classNames.sort() for className in classNames: try: # instantiate class, equivalent to # class <className>(AutoBaseClass): # pass cls = type(className.encode("ascii"), (AutoBaseClass,), {}) except NibLoaderError as why: print("*** Failed class: %s; NibLoaderError: %s" % (className, why[0])) else: print( "Created class: %s, superclass: %s" % (cls.__name__, cls.__bases__[0].__name__) ) def printTemplate(*nibFiles): for path in nibFiles: extractClasses(path=path) _nibInfo.printTemplate() def commandline(): import getopt try: opts, nibFiles = getopt.getopt(sys.argv[1:], "th") except getopt.error as msg: usage(msg, 1) doTest = 0 for opt, val in opts: if opt == "-t": doTest = 1 elif opt == "-h": usage("", 0) if not nibFiles: usage("No nib file specified.", 1) if doTest: test(*nibFiles) else: printTemplate(*nibFiles) if __name__ == "__main__": commandline()
windows
about
""" @file @brief This file loads the About dialog (i.e about Openshot Project) @author Jonathan Thomas <jonathan@openshot.org> @author Olivier Girard <olivier@openshot.org> @section LICENSE Copyright (c) 2008-2018 OpenShot Studios, LLC (http://www.openshotstudios.com). This file is part of OpenShot Video Editor (http://www.openshot.org), an open-source project dedicated to delivering high quality video editing and animation solutions to the world. OpenShot Video Editor is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenShot Video Editor is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>. """ import codecs import datetime import json import os import re import threading from functools import partial import openshot import requests from classes import info, ui_util from classes.app import get_app from classes.logger import log from classes.metrics import track_metric_screen from PyQt5.QtCore import Qt, pyqtSignal from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QDialog from windows.views.changelog_treeview import ChangelogTreeView from windows.views.credits_treeview import CreditsTreeView def parse_changelog(changelog_path): """Parse changelog data from specified gitlab-ci generated file.""" if not os.path.exists(changelog_path): return None changelog_regex = re.compile( r"(\w{6,10})\s+(\d{4}-\d{2}-\d{2})\s+(.*)\s{2,99}?(.*)" ) changelog_list = [] try: with codecs.open(changelog_path, "r", encoding="utf_8") as changelog_file: # Split changelog safely (since multiline regex fails to parse the windows line endings correctly) # All our log files use unit line endings (even on Windows) change_log_lines = changelog_file.read().split("\n") for change in change_log_lines: # Generate match object with fields from all matching lines match = changelog_regex.findall(change) if match: changelog_list.append( { "hash": match[0][0].strip(), "date": match[0][1].strip(), "author": match[0][2].strip(), "subject": match[0][3].strip(), } ) except Exception: log.warning("Parse error reading {}".format(changelog_path), exc_info=1) return None log.debug( "Parsed {} changelog lines from {}".format(len(changelog_list), changelog_path) ) return changelog_list class About(QDialog): """About Dialog""" ui_path = os.path.join(info.PATH, "windows", "ui", "about.ui") releaseFound = pyqtSignal(str) def __init__(self): # Create dialog class QDialog.__init__(self) # Load UI from designer & init ui_util.load_ui(self, self.ui_path) ui_util.init_ui(self) # get translations self.app = get_app() _ = self.app._tr # Load logo banner (using display DPI) icon = QIcon(":/about/AboutLogo.png") self.lblAboutLogo.setPixmap(icon.pixmap(icon.availableSizes()[0])) # Hide chnagelog button by default self.btnchangelog.setVisible(False) projects = ["openshot-qt", "libopenshot", "libopenshot-audio"] # Old paths paths = [ os.path.join(info.PATH, "settings", "{}.log".format(p)) for p in projects ] # New paths paths.extend( [os.path.join(info.PATH, "resources", "{}.log".format(p)) for p in projects] ) if any([os.path.exists(path) for path in paths]): self.btnchangelog.setVisible(True) else: log.warn("No changelog files found, disabling button") create_text = _("Create &amp; Edit Amazing Videos and Movies") description_text = _( "OpenShot Video Editor is an Award-Winning, Free, and<br> Open-Source Video Editor for Linux, Mac, and Windows." ) learnmore_text = _("Learn more") copyright_text = _("Copyright &copy; %(begin_year)s-%(current_year)s") % { "begin_year": "2008", "current_year": str(datetime.datetime.today().year), } about_html = """ <html><head/><body style="padding:24px 0;"><hr/> <div align="center" style="margin:12px 0;"> <p style="font-size:10pt;font-weight:600;margin-bottom:18px;"> %s </p> <p style="font-size:10pt;margin-bottom:12px;">%s <a href="https://www.openshot.org/%s?r=about-us" style="text-decoration:none;">%s</a> </p> </div> </body></html> """ % ( create_text, description_text, info.website_language(), learnmore_text, ) company_html = """ <html><head/> <body style="font-size:10pt;font-weight:400;font-style:normal;padding:24px 0;"> <hr /> <div style="margin:12px 0;font-weight:600;" align="center"> %s <a href="http://www.openshotstudios.com?r=about-us" style="text-decoration:none;">OpenShot Studios, LLC</a><br/> </div> </body></html> """ % (copyright_text) # Set description and company labels self.lblAboutDescription.setText(about_html) self.lblAboutCompany.setText(company_html) # set events handlers self.btncredit.clicked.connect(self.load_credit) self.btnlicense.clicked.connect(self.load_license) self.btnchangelog.clicked.connect(self.load_changelog) # Track metrics track_metric_screen("about-screen") # Connect signals self.releaseFound.connect(self.display_release) # Load release details from HTTP self.get_current_release() def display_release(self, version_text): self.txtversion.setText(version_text) self.txtversion.setAlignment(Qt.AlignCenter) def get_current_release(self): """Get the current version""" t = threading.Thread(target=self.get_release_from_http, daemon=True) t.start() def get_release_from_http(self): """Get the current version # from openshot.org""" RELEASE_URL = "http://www.openshot.org/releases/%s/" # Send metric HTTP data try: release_details = {} r = requests.get( RELEASE_URL % info.VERSION, headers={"user-agent": "openshot-qt-%s" % info.VERSION}, verify=False, ) if r.ok: log.warning("Found current release: %s" % r.json()) release_details = r.json() else: log.warning("Failed to find current release: %s" % r.status_code) release_git_SHA = release_details.get("sha", "") release_notes = release_details.get("notes", "") # get translations self.app = get_app() _ = self.app._tr # Look for frozen version info frozen_version_label = "" version_path = os.path.join(info.PATH, "settings", "version.json") if os.path.exists(version_path): with open(version_path, "r", encoding="UTF-8") as f: version_info = json.loads(f.read()) if version_info: frozen_git_SHA = version_info.get("openshot-qt", {}).get( "CI_COMMIT_SHA", "" ) build_name = version_info.get("build_name") if frozen_git_SHA == release_git_SHA: # Remove -release-candidate... from build name log.warning( "Official release detected with SHA (%s) for v%s" % (release_git_SHA, info.VERSION) ) build_name = build_name.replace("-candidate", "") frozen_version_label = ( '<br/><br/><b>%s (Official)</b><br/>Release Date: %s<br><a href="%s" style="text-decoration:none;">Release Notes</a>' % (build_name, version_info.get("date"), release_notes) ) else: # Display current build name - unedited log.warning( "Build SHA (%s) does not match an official release SHA (%s) for v%s" % (frozen_git_SHA, release_git_SHA, info.VERSION) ) frozen_version_label = ( "<br/><br/><b>%s</b><br/>Build Date: %s" % (build_name, version_info.get("date")) ) # Init some variables openshot_qt_version = _("Version: %s") % info.VERSION libopenshot_version = "libopenshot: %s" % openshot.OPENSHOT_VERSION_FULL # emit release found self.releaseFound.emit( "<b>%s</b><br/>%s%s" % (openshot_qt_version, libopenshot_version, frozen_version_label) ) except Exception as Ex: log.error("Failed to get version from: %s" % RELEASE_URL % info.VERSION) def load_credit(self): """Load Credits for everybody who has contributed in several domain for Openshot""" log.debug("Credit screen has been opened") windo = Credits() windo.exec_() def load_license(self): """Load License of the project""" log.debug("License screen has been opened") windo = License() windo.exec_() def load_changelog(self): """Load the changelog window""" log.debug("Changelog screen has been opened") windo = Changelog() windo.exec_() class License(QDialog): """License Dialog""" ui_path = os.path.join(info.PATH, "windows", "ui", "license.ui") def __init__(self): # Create dialog class QDialog.__init__(self) # Load UI from designer ui_util.load_ui(self, self.ui_path) # Init Ui ui_util.init_ui(self) # get translations self.app = get_app() _ = self.app._tr # Init license with open(os.path.join(info.RESOURCES_PATH, "license.txt"), "r") as my_license: text = my_license.read() self.textBrowser.append(text) # Scroll to top cursor = self.textBrowser.textCursor() cursor.setPosition(0) self.textBrowser.setTextCursor(cursor) class Credits(QDialog): """Credits Dialog""" ui_path = os.path.join(info.PATH, "windows", "ui", "credits.ui") def Filter_Triggered(self, textbox, treeview): """Callback for filter being changed""" # Update model for treeview treeview.refresh_view(filter=textbox.text()) def __init__(self): # Create dialog class QDialog.__init__(self) # Load UI from designer ui_util.load_ui(self, self.ui_path) # Init Ui ui_util.init_ui(self) # get translations self.app = get_app() _ = self.app._tr # Update supporter button supporter_text = _("Become a Supporter") supporter_html = """ <html><head/><body> <p align="center"> <a href="https://www.openshot.org/%sdonate/?app-about-us">%s</a> </p> </body></html> """ % ( info.website_language(), supporter_text, ) self.lblBecomeSupporter.setText(supporter_html) # Get list of developers developer_list = [] with codecs.open( os.path.join(info.RESOURCES_PATH, "contributors.json"), "r", "utf_8" ) as contributors_file: developer_string = contributors_file.read() developer_list = json.loads(developer_string) self.developersListView = CreditsTreeView( credits=developer_list, columns=["email", "website"] ) self.vboxDevelopers.addWidget(self.developersListView) self.txtDeveloperFilter.textChanged.connect( partial( self.Filter_Triggered, self.txtDeveloperFilter, self.developersListView ) ) # Get string of translators for the current language translator_credits = [] unique_translators = [] translator_credits_string = ( _("translator-credits") .replace("Launchpad Contributions:\n", "") .replace("translator-credits", "") ) if translator_credits_string: # Parse string into a list of dictionaries translator_rows = translator_credits_string.split("\n") stripped_rows = [ s.strip().capitalize() for s in translator_rows if "Template-Name:" not in s ] for row in sorted(stripped_rows): # Split each row into 2 parts (name and username) translator_parts = row.split("https://launchpad.net/") if len(translator_parts) >= 2: name = translator_parts[0].strip().title() username = translator_parts[1].strip() if username not in unique_translators: unique_translators.append(username) translator_credits.append( { "name": name, "website": "https://launchpad.net/%s" % username, } ) # Add translators listview self.translatorsListView = CreditsTreeView( translator_credits, columns=["website"] ) self.vboxTranslators.addWidget(self.translatorsListView) self.txtTranslatorFilter.textChanged.connect( partial( self.Filter_Triggered, self.txtTranslatorFilter, self.translatorsListView, ) ) else: # No translations for this language, hide credits self.tabCredits.removeTab(1) # Get list of supporters supporter_list = [] with codecs.open( os.path.join(info.RESOURCES_PATH, "supporters.json"), "r", "utf_8" ) as supporter_file: supporter_string = supporter_file.read() supporter_list = json.loads(supporter_string) # Add supporters listview self.supportersListView = CreditsTreeView(supporter_list, columns=["website"]) self.vboxSupporters.addWidget(self.supportersListView) self.txtSupporterFilter.textChanged.connect( partial( self.Filter_Triggered, self.txtSupporterFilter, self.supportersListView ) ) class Changelog(QDialog): """Changelog Dialog""" ui_path = os.path.join(info.PATH, "windows", "ui", "changelog.ui") def Filter_Triggered(self, textbox, treeview): """Callback for filter being changed""" # Update model for treeview treeview.refresh_view(filter=textbox.text()) def __init__(self): # Create dialog class QDialog.__init__(self) # Load UI from designer ui_util.load_ui(self, self.ui_path) # Init Ui ui_util.init_ui(self) # get translations _ = get_app()._tr # Connections to objects imported from .ui file tab = { "openshot-qt": self.tab_openshot_qt, "libopenshot": self.tab_libopenshot, "libopenshot-audio": self.tab_libopenshot_audio, } vbox = { "openshot-qt": self.vbox_openshot_qt, "libopenshot": self.vbox_libopenshot, "libopenshot-audio": self.vbox_libopenshot_audio, } filter = { "openshot-qt": self.txtChangeLogFilter_openshot_qt, "libopenshot": self.txtChangeLogFilter_libopenshot, "libopenshot-audio": self.txtChangeLogFilter_libopenshot_audio, } # Update github link button github_text = _("OpenShot on GitHub") github_html = """ <html><head/><body> <p align="center"> <a href="https://github.com/OpenShot/">%s</a> </p> </body></html> """ % (github_text) self.lblGitHubLink.setText(github_html) # Read changelog file for each project for project in ["openshot-qt", "libopenshot", "libopenshot-audio"]: changelog_path = os.path.join( info.PATH, "settings", "{}.log".format(project) ) if os.path.exists(changelog_path): log.debug("Reading changelog file: {}".format(changelog_path)) changelog_list = parse_changelog(changelog_path) else: changelog_list = None if changelog_list is None: log.warn("Could not load changelog for {}".format(project)) # Hide the tab for this changelog tabindex = self.tabChangelog.indexOf(tab[project]) if tabindex >= 0: self.tabChangelog.removeTab(tabindex) continue # Populate listview widget with changelog data cl_treeview = ChangelogTreeView( commits=changelog_list, commit_url="https://github.com/OpenShot/{}/commit/%s/".format(project), ) vbox[project].addWidget(cl_treeview) filter[project].textChanged.connect( partial(self.Filter_Triggered, filter[project], cl_treeview) )
migrations
0289_add_tags_to_feature_flags
# Generated by Django 3.2.16 on 2023-01-12 17:33 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("posthog", "0288_add_session_recording_persistence"), ] operations = [ migrations.RemoveConstraint( model_name="taggeditem", name="exactly_one_related_object", ), migrations.AddField( model_name="taggeditem", name="feature_flag", field=models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name="tagged_items", to="posthog.featureflag", ), ), migrations.AlterUniqueTogether( name="taggeditem", unique_together={ ( "tag", "dashboard", "insight", "event_definition", "property_definition", "action", "feature_flag", ) }, ), migrations.AddConstraint( model_name="taggeditem", constraint=models.UniqueConstraint( condition=models.Q(("feature_flag__isnull", False)), fields=("tag", "feature_flag"), name="unique_feature_flag_tagged_item", ), ), migrations.AddConstraint( model_name="taggeditem", constraint=models.CheckConstraint( check=models.Q( models.Q( ("dashboard__isnull", False), ("insight__isnull", True), ("event_definition__isnull", True), ("property_definition__isnull", True), ("action__isnull", True), ("feature_flag__isnull", True), ), models.Q( ("dashboard__isnull", True), ("insight__isnull", False), ("event_definition__isnull", True), ("property_definition__isnull", True), ("action__isnull", True), ("feature_flag__isnull", True), ), models.Q( ("dashboard__isnull", True), ("insight__isnull", True), ("event_definition__isnull", False), ("property_definition__isnull", True), ("action__isnull", True), ("feature_flag__isnull", True), ), models.Q( ("dashboard__isnull", True), ("insight__isnull", True), ("event_definition__isnull", True), ("property_definition__isnull", False), ("action__isnull", True), ("feature_flag__isnull", True), ), models.Q( ("dashboard__isnull", True), ("insight__isnull", True), ("event_definition__isnull", True), ("property_definition__isnull", True), ("action__isnull", False), ("feature_flag__isnull", True), ), models.Q( ("dashboard__isnull", True), ("insight__isnull", True), ("event_definition__isnull", True), ("property_definition__isnull", True), ("action__isnull", True), ("feature_flag__isnull", False), ), _connector="OR", ), name="exactly_one_related_object", ), ), ]
statusbar
url
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # SPDX-License-Identifier: GPL-3.0-or-later """URL displayed in the statusbar.""" import enum from qutebrowser.config import stylesheet from qutebrowser.mainwindow.statusbar import textbase from qutebrowser.qt.core import QUrl, pyqtProperty, pyqtSlot from qutebrowser.utils import urlutils, usertypes class UrlType(enum.Enum): """The type/color of the URL being shown. Note this has entries for success/error/warn from widgets.webview:LoadStatus. """ success = enum.auto() success_https = enum.auto() error = enum.auto() warn = enum.auto() hover = enum.auto() normal = enum.auto() class UrlText(textbase.TextBase): """URL displayed in the statusbar. Attributes: _normal_url: The normal URL to be displayed as a UrlType instance. _normal_url_type: The type of the normal URL as a UrlType instance. _hover_url: The URL we're currently hovering over. _ssl_errors: Whether SSL errors occurred while loading. _urltype: The URL type to show currently (normal/ok/error/warn/hover). Accessed via the urltype property. """ STYLESHEET = """ QLabel#UrlText[urltype="normal"] { color: {{ conf.colors.statusbar.url.fg }}; } QLabel#UrlText[urltype="success"] { color: {{ conf.colors.statusbar.url.success.http.fg }}; } QLabel#UrlText[urltype="success_https"] { color: {{ conf.colors.statusbar.url.success.https.fg }}; } QLabel#UrlText[urltype="error"] { color: {{ conf.colors.statusbar.url.error.fg }}; } QLabel#UrlText[urltype="warn"] { color: {{ conf.colors.statusbar.url.warn.fg }}; } QLabel#UrlText[urltype="hover"] { color: {{ conf.colors.statusbar.url.hover.fg }}; } """ def __init__(self, parent=None): super().__init__(parent) self._urltype = None self.setObjectName(self.__class__.__name__) stylesheet.set_register(self) self._hover_url = None self._normal_url = None self._normal_url_type = UrlType.normal @pyqtProperty(str) # type: ignore[type-var] def urltype(self): """Getter for self.urltype, so it can be used as Qt property. Return: The urltype as a string (!) """ if self._urltype is None: return "" else: return self._urltype.name def _update_url(self): """Update the displayed URL if the url or the hover url changed.""" old_urltype = self._urltype if self._hover_url is not None: self.setText(self._hover_url) self._urltype = UrlType.hover elif self._normal_url is not None: self.setText(self._normal_url) self._urltype = self._normal_url_type else: self.setText("") self._urltype = UrlType.normal if old_urltype != self._urltype: # We can avoid doing an unpolish here because the new style will # always override the old one. style = self.style() assert style is not None style.polish(self) @pyqtSlot(usertypes.LoadStatus) def on_load_status_changed(self, status): """Slot for load_status_changed. Sets URL color accordingly. Args: status: The usertypes.LoadStatus. """ assert isinstance(status, usertypes.LoadStatus), status if status in [ usertypes.LoadStatus.success, usertypes.LoadStatus.success_https, usertypes.LoadStatus.error, usertypes.LoadStatus.warn, ]: self._normal_url_type = UrlType[status.name] else: self._normal_url_type = UrlType.normal self._update_url() @pyqtSlot(QUrl) def set_url(self, url): """Setter to be used as a Qt slot. Args: url: The URL to set as QUrl, or None. """ if url is None: self._normal_url = None elif not url.isValid(): self._normal_url = "Invalid URL!" else: self._normal_url = urlutils.safe_display_string(url) self._normal_url_type = UrlType.normal self._update_url() @pyqtSlot(str) def set_hover_url(self, link): """Setter to be used as a Qt slot. Saves old shown URL in self._old_url and restores it later if a link is "un-hovered" when it gets called with empty parameters. Args: link: The link which was hovered (string) """ if link: qurl = QUrl(link) if qurl.isValid(): self._hover_url = urlutils.safe_display_string(qurl) else: self._hover_url = "(invalid URL!) {}".format(link) else: self._hover_url = None self._update_url() def on_tab_changed(self, tab): """Update URL if the tab changed.""" self._hover_url = None if tab.url().isValid(): self._normal_url = urlutils.safe_display_string(tab.url()) else: self._normal_url = "" self.on_load_status_changed(tab.load_status()) self._update_url()
osf
tests
#!/usr/bin/env python # -*- coding: utf-8 -*- # Dissemin: open access policy enforcement tool # Copyright (C) 2014 Antonin Delpeuch # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Affero General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # from unittest import skip from deposit.models import Repository from deposit.osf.protocol import OSFProtocol from deposit.protocol import DepositError from deposit.tests.test_protocol import ProtocolTest from papers.baremodels import BareAuthor, BareName from papers.models import Paper # from mock import Mock @skip( """ OSF tests are currently disabled as the OSF sandbox is no longer accessible. (2019-01-24) """ ) class OSFProtocolTest(ProtocolTest): def setUp(self): super(OSFProtocolTest, self).setUp() api_key = "eJMuNoeFvKTIC5A6POx1nrmsiQoMZqwh" api_key += "CgeEXwDgggYWDeR96Y9KbypgVGNuCY5r9qVgan" self.setUpForProtocol( OSFProtocol, Repository( api_key=api_key, endpoint="https://test-api.osf.io/", username="pdcky" ), ) # go to https://api.osf.io/v2/users/me/ (once logged in) to get # this identifier. (it is returned as "id" in the JSON response) # Fill here the details of the metadata form # for your repository data = {"onbehalfof": ""} self.form = self.proto.get_bound_form(data) self.form.is_valid() # this validates our sample data def test_get_form_initial_data(self): paper = Paper.create_by_doi("10.1007/978-3-662-47666-6_5") record = paper.oairecords[0] record_value = "Supercalifragilisticexpialidocious." record.description = record_value record.save() self.proto.init_deposit(paper, self.user) data = self.proto.get_form_initial_data() self.assertIsInstance(data, dict) self.assertEqual(data.get("abstract"), record_value) def test_create_tags(self): # Init deposit with default paper and user self.proto.init_deposit(self.p1, self.user) tags = " Witch, Broom , ,Bed " form = self.proto.get_bound_form( { "license": "58fd62fcda3e2400012ca5d3", "abstract": "Treguna Mekoides Trecorum Satis Dee.", "subjects": ["59552884da3e240081ba32de"], "tags": tags, } ) self.assertTrue(form.is_valid()) tags_list = self.proto.create_tags(form) self.assertEqual(tags_list, ["Witch", "Broom", "Bed"]) def test_submit_deposit(self): paper = Paper.create_by_doi("10.1007/978-3-662-47666-6_5") request = self.dry_deposit( paper, license="58fd62fcda3e2400012ca5d3", abstract="Salagadoola menchicka boola bibbidi-bobbidi-boo.", subjects=["59552884da3e240081ba32de"], tags="Pumpkin, Mouse, Godmother", ) self.assertEqualOrLog(request.status, "published") def test_submit_deposit_nolicense(self): paper = Paper.create_by_doi("10.1007/978-3-662-47666-6_5") request = self.dry_deposit( paper, license="58fd62fcda3e2400012ca5cc", abstract="Higitus Figitus Migitus Mum.", subjects=["59552884da3e240081ba32de"], tags="Sword, King, Wizard", ) self.assertEqualOrLog(request.status, "published") def test_submit_deposit_notoken(self): no_token = Repository() no_token.api_key = None repo_without_token = OSFProtocol(no_token) data = {"onbehalfof": ""} repo_without_token.form = repo_without_token.get_bound_form(data) repo_without_token.form.is_valid() with self.assertRaises(DepositError): repo_without_token.submit_deposit(pdf=None, form=None) def test_form_with_no_subject(self): """ Submit a preprint with no subject selected, which is a problem if we want to make it public. """ paper = Paper.create_by_doi("10.1007/978-3-662-47666-6_5") self.proto.init_deposit(paper, self.user) # These are the initial data. No subject given. data = self.proto.get_form_initial_data() form_fields = { "licence": "563c1cf88c5e4a3877f9e965", "abstract": "This is a fake abstract.", "tags": "One, Two, Three, Four", "subjects": [], } data.update(form_fields) form = self.proto.get_bound_form(data) self.assertEqual(form.has_error("subjects", code=None), True) self.assertEqual(form.errors["subjects"], ["At least one subject is required."]) self.assertFalse(form.is_valid()) def test_deposit_on_behalf_of(self): paper = Paper.create_by_doi("10.1007/978-3-662-47666-6_5") prefs = self.proto.get_preferences(self.user) prefs.on_behalf_of = "mweg3" # sample user id on the sandbox # with name "Jean Saisrien" paper.add_author(BareAuthor(name=BareName.create_bare("Jean", "Saisrien"))) paper.save() request = self.dry_deposit( paper, license="58fd62fcda3e2400012ca5d3", abstract="Salagadoola menchicka boola bibbidi-bobbidi-boo.", subjects=["59552884da3e240081ba32de"], tags="Pumpkin, Mouse, Godmother", ) self.assertEqualOrLog(request.status, "published")
examples
fir_filter_fff
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # import sys from argparse import ArgumentParser import numpy from gnuradio import analog, blocks, eng_notation, filter, gr from gnuradio.eng_arg import eng_float, intx try: from matplotlib import pyplot except ImportError: print( "Error: could not from matplotlib import pyplot (http://matplotlib.sourceforge.net/)" ) sys.exit(1) class example_fir_filter_fff(gr.top_block): def __init__(self, N, fs, bw, tw, atten, D): gr.top_block.__init__(self) self._nsamps = N self._fs = fs self._bw = bw self._tw = tw self._at = atten self._decim = D taps = filter.firdes.low_pass_2(1, self._fs, self._bw, self._tw, self._at) print("Num. Taps: ", len(taps)) self.src = analog.noise_source_f(analog.GR_GAUSSIAN, 1) self.head = blocks.head(gr.sizeof_float, self._nsamps) self.filt0 = filter.fir_filter_fff(self._decim, taps) self.vsnk_src = blocks.vector_sink_f() self.vsnk_out = blocks.vector_sink_f() self.connect(self.src, self.head, self.vsnk_src) self.connect(self.head, self.filt0, self.vsnk_out) def main(): parser = ArgumentParser(conflict_handler="resolve") parser.add_argument( "-N", "--nsamples", type=int, default=10000, help="Number of samples to process [default=%(default)r]", ) parser.add_argument( "-s", "--samplerate", type=eng_float, default=8000, help="System sample rate [default=%(default)r]", ) parser.add_argument( "-B", "--bandwidth", type=eng_float, default=1000, help="Filter bandwidth [default=%(default)r]", ) parser.add_argument( "-T", "--transition", type=eng_float, default=100, help="Transition band [default=%(default)r]", ) parser.add_argument( "-A", "--attenuation", type=eng_float, default=80, help="Stopband attenuation [default=%(default)r]", ) parser.add_argument( "-D", "--decimation", type=int, default=1, help="Decmation factor [default=%(default)r]", ) args = parser.parse_args() put = example_fir_filter_fff( args.nsamples, args.samplerate, args.bandwidth, args.transition, args.attenuation, args.decimation, ) put.run() data_src = numpy.array(put.vsnk_src.data()) data_snk = numpy.array(put.vsnk_out.data()) # Plot the signals PSDs nfft = 1024 f1 = pyplot.figure(1, figsize=(12, 10)) s1 = f1.add_subplot(1, 1, 1) s1.psd(data_src, NFFT=nfft, noverlap=nfft / 4, Fs=args.samplerate) s1.psd(data_snk, NFFT=nfft, noverlap=nfft / 4, Fs=args.samplerate) f2 = pyplot.figure(2, figsize=(12, 10)) s2 = f2.add_subplot(1, 1, 1) s2.plot(data_src) s2.plot(data_snk.real, "g") pyplot.show() if __name__ == "__main__": try: main() except KeyboardInterrupt: pass
pwidgets
fillctrls
# -*- coding: utf-8 -*- # # Copyright (C) 2015 by Ihor E. Novikov # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. from copy import deepcopy import wal from colorctrls import ( CMYK_PALETTE, GRAY_PALETTE, RGB_PALETTE, SPOT_PALETTE, CmykMixer, FillColorRefPanel, FillFillRefPanel, FillRuleKeeper, GrayMixer, MiniPalette, PaletteMixer, PaletteSwatch, RgbMixer, SpotMixer, ) from gradientctrls import GradientEditor, GradientMiniPalette from patternctrls import PatternEditor, PatternMiniPalette from patterns import DEFAULT_PATTERN from sk1 import _ from sk1.resources import icons from uc2 import sk2const, uc2const from uc2.cms import color_to_spot, get_registration_black, rgb_to_hexcolor # --- Solid fill panels class SolidFillPanel(wal.VPanel): orig_fill = None cms = None built = False new_color = None def __init__(self, parent, app): self.app = app wal.VPanel.__init__(self, parent) def build(self): self.pack(wal.Label(self, self.orig_fill.__str__())) def activate(self, cms, orig_fill, new_color): self.orig_fill = orig_fill self.new_color = new_color if self.new_color and not self.new_color[0] == uc2const.COLOR_SPOT: self.new_color[3] = "" self.cms = cms if not self.built: self.build() self.built = True self.show() def get_color(self): return self.new_color def set_orig_fill(self): self.activate(self.cms, self.orig_fill, []) class CmykPanel(SolidFillPanel): color_sliders = [] color_spins = [] mixer = None refpanel = None def build(self): self.mixer = CmykMixer(self, self.cms, onchange=self.update) self.pack(self.mixer) self.pack(wal.HPanel(self), fill=True, expand=True) self.pack(wal.HLine(self), fill=True, padding=5) bot_panel = wal.HPanel(self) self.refpanel = FillColorRefPanel( bot_panel, self.cms, [], [], on_orig=self.set_orig_fill ) bot_panel.pack(self.refpanel) bot_panel.pack(wal.HPanel(bot_panel), fill=True, expand=True) minipal = MiniPalette(bot_panel, self.cms, CMYK_PALETTE, self.on_palette_click) bot_panel.pack(minipal, padding_all=5) self.pack(bot_panel, fill=True) def on_palette_click(self, color): self.new_color = color self.update() def update(self): self.mixer.set_color(self.new_color) self.refpanel.update(self.orig_fill, self.new_color) def activate(self, cms, orig_fill, new_color): fill = None if orig_fill and orig_fill[1] == sk2const.FILL_SOLID: fill = orig_fill if not new_color and fill: new_color = cms.get_cmyk_color(fill[2]) elif not new_color and not fill: new_color = [uc2const.COLOR_CMYK, [0.0, 0.0, 0.0, 1.0], 1.0, ""] else: new_color = cms.get_cmyk_color(new_color) SolidFillPanel.activate(self, cms, orig_fill, new_color) self.update() class RgbPanel(SolidFillPanel): mixer = None refpanel = None def build(self): self.mixer = RgbMixer(self, self.cms, onchange=self.update) self.pack(self.mixer) self.pack(wal.HLine(self), fill=True, padding=5) bot_panel = wal.HPanel(self) self.refpanel = FillColorRefPanel( bot_panel, self.cms, [], [], on_orig=self.set_orig_fill ) bot_panel.pack(self.refpanel) bot_panel.pack(wal.HPanel(bot_panel), fill=True, expand=True) minipal = MiniPalette(bot_panel, self.cms, RGB_PALETTE, self.on_palette_click) bot_panel.pack(minipal, padding_all=5) self.pack(bot_panel, fill=True) def on_palette_click(self, color): self.new_color = color self.update() def update(self): self.mixer.set_color(self.new_color) self.refpanel.update(self.orig_fill, self.new_color) def activate(self, cms, orig_fill, new_color): fill = None if orig_fill and orig_fill[1] == sk2const.FILL_SOLID: fill = orig_fill if not new_color and fill: new_color = cms.get_rgb_color(fill[2]) elif not new_color and not fill: new_color = [uc2const.COLOR_RGB, [0.0, 0.0, 0.0], 1.0, ""] else: new_color = cms.get_rgb_color(new_color) SolidFillPanel.activate(self, cms, orig_fill, new_color) self.update() class GrayPanel(SolidFillPanel): mixer = None refpanel = None def build(self): self.pack(wal.HPanel(self), fill=True, expand=True) self.mixer = GrayMixer(self, self.cms, onchange=self.update) self.pack(self.mixer) self.pack(wal.HPanel(self), fill=True, expand=True) self.pack(wal.HLine(self), fill=True, padding=5) bot_panel = wal.HPanel(self) self.refpanel = FillColorRefPanel( bot_panel, self.cms, [], [], on_orig=self.set_orig_fill ) bot_panel.pack(self.refpanel) bot_panel.pack(wal.HPanel(bot_panel), fill=True, expand=True) minipal = MiniPalette(bot_panel, self.cms, GRAY_PALETTE, self.on_palette_click) bot_panel.pack(minipal, padding_all=5) self.pack(bot_panel, fill=True) def on_palette_click(self, color): self.new_color = color self.update() def update(self): self.mixer.set_color(self.new_color) self.refpanel.update(self.orig_fill, self.new_color) def activate(self, cms, orig_fill, new_color): fill = None if orig_fill and orig_fill[1] == sk2const.FILL_SOLID: fill = orig_fill if not new_color and fill: new_color = cms.get_grayscale_color(fill[2]) elif not new_color and not fill: new_color = [ uc2const.COLOR_GRAY, [ 0.0, ], 1.0, "", ] else: new_color = cms.get_grayscale_color(new_color) SolidFillPanel.activate(self, cms, orig_fill, new_color) self.update() class SpotPanel(SolidFillPanel): mixer = None refpanel = None def build(self): self.pack(wal.HPanel(self), fill=True, expand=True) self.mixer = SpotMixer(self, self.cms, onchange=self.update) self.pack(self.mixer) self.pack(wal.HPanel(self), fill=True, expand=True) self.pack(wal.HLine(self), fill=True, padding=5) bot_panel = wal.HPanel(self) self.refpanel = FillColorRefPanel( bot_panel, self.cms, [], [], on_orig=self.set_orig_fill ) bot_panel.pack(self.refpanel) bot_panel.pack(wal.HPanel(bot_panel), fill=True, expand=True) minipal = MiniPalette(bot_panel, self.cms, SPOT_PALETTE, self.on_palette_click) bot_panel.pack(minipal, padding_all=5) self.pack(bot_panel, fill=True) def on_palette_click(self, color): self.new_color = color self.update() def update(self): self.mixer.set_color(self.new_color) self.refpanel.update(self.orig_fill, self.new_color) def activate(self, cms, orig_fill, new_color): fill = None if orig_fill and orig_fill[1] == sk2const.FILL_SOLID: fill = orig_fill if not new_color and fill: new_color = color_to_spot(fill[2]) elif not new_color and not fill: new_color = get_registration_black() else: new_color = color_to_spot(new_color) if not new_color[3]: new_color[3] = rgb_to_hexcolor(cms.get_rgb_color(new_color)[1]) SolidFillPanel.activate(self, cms, orig_fill, new_color) self.update() class EmptyPanel(SolidFillPanel): def build(self): self.pack(wal.HPanel(self), fill=True, expand=True) self.pack(PaletteSwatch(self, self.cms, [], (250, 150))) txt = _("Empty pattern selected") self.pack(wal.Label(self, txt), padding=10) self.pack(wal.HPanel(self), fill=True, expand=True) def activate(self, cms, orig_fill, new_color): new_color = [] SolidFillPanel.activate(self, cms, orig_fill, new_color) class PalettePanel(SolidFillPanel): mixer = None def build(self): self.mixer = PaletteMixer(self, self.app, self.cms, onchange=self.set_color) self.pack(self.mixer, fill=True, expand=True) def activate(self, cms, orig_fill, new_color): new_color = get_registration_black() SolidFillPanel.activate(self, cms, orig_fill, new_color) self.mixer.on_change() def set_color(self, color): self.new_color = color # --- Solid fill stuff CMYK_MODE = 0 RGB_MODE = 1 GRAY_MODE = 2 SPOT_MODE = 3 PAL_MODE = 4 EMPTY_MODE = 5 SOLID_MODES = [CMYK_MODE, RGB_MODE, GRAY_MODE, SPOT_MODE, PAL_MODE, EMPTY_MODE] SOLID_MODE_ICONS = { CMYK_MODE: icons.PD_CONV_TO_CMYK, RGB_MODE: icons.PD_CONV_TO_RGB, GRAY_MODE: icons.PD_CONV_TO_GRAY, SPOT_MODE: icons.PD_CONV_TO_SPOT, PAL_MODE: icons.PD_CONV_FROM_PALETTE, EMPTY_MODE: icons.PD_EMPTY, } SOLID_MODE_NAMES = { CMYK_MODE: _("CMYK color space"), RGB_MODE: _("RGB color space"), GRAY_MODE: _("Grayscale color space"), SPOT_MODE: _("SPOT colors"), PAL_MODE: _("Color from palette"), EMPTY_MODE: _("Empty pattern"), } SOLID_MODE_MAP = { uc2const.COLOR_CMYK: CMYK_MODE, uc2const.COLOR_RGB: RGB_MODE, uc2const.COLOR_GRAY: GRAY_MODE, uc2const.COLOR_SPOT: SPOT_MODE, } SOLID_MODE_CLASSES = { CMYK_MODE: CmykPanel, RGB_MODE: RgbPanel, GRAY_MODE: GrayPanel, SPOT_MODE: SpotPanel, PAL_MODE: PalettePanel, EMPTY_MODE: EmptyPanel, } class FillTab(wal.VPanel): name = "FillTab" built = False orig_fill = None def __init__(self, parent, dlg, cms): self.dlg = dlg self.app = dlg.app self.cms = cms wal.VPanel.__init__(self, parent) def build(self): pass def activate(self, fill_style): self.orig_fill = fill_style if not self.built: self.hide(update=False) self.build() self.built = True self.layout() self.show() def get_result(self): return deepcopy(self.orig_fill) class SolidFill(FillTab): name = _("Solid Fill") active_panel = None panels = {} new_color = None callback = None use_rule = True solid_keeper = None rule_keeper = None def activate(self, fill_style, use_rule=True, onmodechange=None): if onmodechange: self.callback = onmodechange self.use_rule = use_rule FillTab.activate(self, fill_style) if not fill_style: mode = EMPTY_MODE self.rule_keeper.set_mode(sk2const.FILL_EVENODD) else: self.rule_keeper.set_mode(fill_style[0]) if fill_style[1] in [sk2const.FILL_GRADIENT, sk2const.FILL_PATTERN]: mode = CMYK_MODE else: mode = SOLID_MODE_MAP[fill_style[2][0]] self.solid_keeper.set_mode(mode) self.on_mode_change(mode) def build(self): self.panels = {} panel = wal.HPanel(self) self.solid_keeper = wal.HToggleKeeper( panel, SOLID_MODES, SOLID_MODE_ICONS, SOLID_MODE_NAMES, self.on_mode_change ) panel.pack(self.solid_keeper) panel.pack(wal.HPanel(panel), fill=True, expand=True) self.rule_keeper = FillRuleKeeper(panel) panel.pack(self.rule_keeper) if not self.use_rule: self.rule_keeper.set_visible(False) self.pack(panel, fill=True, padding_all=5) self.pack(wal.HLine(self), fill=True) for item in SOLID_MODES: self.panels[item] = SOLID_MODE_CLASSES[item](self, self.app) if wal.IS_MSW: self.pack(self.panels[item], fill=True, expand=True, padding_all=5) self.layout() self.panels[item].hide() self.remove(self.panels[item]) else: self.panels[item].hide() def on_mode_change(self, mode): if self.active_panel: self.new_color = self.active_panel.get_color() self.active_panel.hide() self.remove(self.active_panel) self.active_panel = self.panels[mode] self.pack(self.active_panel, fill=True, expand=True, padding_all=5) self.active_panel.activate(self.cms, self.orig_fill, self.new_color) self.rule_keeper.set_enable(not mode == EMPTY_MODE) if self.callback: self.callback() self.active_panel.show() def get_result(self): clr = self.active_panel.get_color() if clr: return [self.rule_keeper.get_mode(), sk2const.FILL_SOLID, clr] else: return [] # --- Gradient fill stuff GRADIENT_MODES = [sk2const.GRADIENT_LINEAR, sk2const.GRADIENT_RADIAL] GRADIENT_MODE_ICONS = { sk2const.GRADIENT_LINEAR: icons.PD_LINEAR_GRAD, sk2const.GRADIENT_RADIAL: icons.PD_RADIAL_GRAD, } GRADIENT_MODE_NAMES = { sk2const.GRADIENT_LINEAR: _("Linear gradient"), sk2const.GRADIENT_RADIAL: _("Radial gradient"), } GRADIENT_CLR_MODES = [uc2const.COLOR_CMYK, uc2const.COLOR_RGB, uc2const.COLOR_GRAY] GRADIENT_CLR_ICONS = { uc2const.COLOR_CMYK: icons.PD_CONV_TO_CMYK, uc2const.COLOR_RGB: icons.PD_CONV_TO_RGB, uc2const.COLOR_GRAY: icons.PD_CONV_TO_GRAY, } GRADIENT_CLR_NAMES = { uc2const.COLOR_CMYK: _("CMYK color space"), uc2const.COLOR_RGB: _("RGB color space"), uc2const.COLOR_GRAY: _("Grayscale color space"), } DEFAULT_STOPS = [ [0.0, [uc2const.COLOR_CMYK, [0.0, 0.0, 0.0, 1.0], 1.0, "Black"]], [1.0, [uc2const.COLOR_CMYK, [0.0, 0.0, 0.0, 0.0], 1.0, "White"]], ] class GradientFill(FillTab): name = _("Gradient Fill") vector = [] new_fill = None grad_keeper = None grad_clrs = None rule_keeper = None grad_editor = None refpanel = None presets = None def activate(self, fill_style, new_color=None): FillTab.activate(self, fill_style) mode = sk2const.GRADIENT_LINEAR rule = sk2const.FILL_EVENODD self.vector = [] stops = deepcopy(DEFAULT_STOPS) if fill_style: rule = fill_style[0] if fill_style[1] == sk2const.FILL_GRADIENT: mode = fill_style[2][0] self.vector = deepcopy(fill_style[2][1]) stops = deepcopy(fill_style[2][2]) elif fill_style[1] == sk2const.FILL_SOLID: if fill_style[2][0] in GRADIENT_CLR_MODES: color0 = deepcopy(fill_style[2]) color0[3] = "" if ( new_color and new_color[0] in GRADIENT_CLR_MODES and not color0 == new_color ): color1 = deepcopy(new_color) if not color0[0] == color1[0]: color1 = self.cms.get_color(color1, color0[0]) else: color1 = deepcopy(fill_style[2]) color1[2] = 0.0 color1[3] = "" stops = [[0.0, color0], [1.0, color1]] self.new_fill = [rule, sk2const.FILL_GRADIENT, [mode, self.vector, stops]] self.update() def build(self): panel = wal.HPanel(self) self.grad_keeper = wal.HToggleKeeper( panel, GRADIENT_MODES, GRADIENT_MODE_ICONS, GRADIENT_MODE_NAMES, self.on_grad_mode_change, ) panel.pack(self.grad_keeper) panel.pack(wal.HPanel(panel), fill=True, expand=True) self.grad_clrs = wal.HToggleKeeper( panel, GRADIENT_CLR_MODES, GRADIENT_CLR_ICONS, GRADIENT_CLR_NAMES, self.on_clr_mode_change, ) panel.pack(self.grad_clrs) panel.pack(wal.HPanel(panel), fill=True, expand=True) self.rule_keeper = FillRuleKeeper(panel) panel.pack(self.rule_keeper) self.pack(panel, fill=True, padding_all=5) self.pack(wal.HLine(self), fill=True) self.grad_editor = GradientEditor( self, self.dlg, self.cms, DEFAULT_STOPS, onchange=self.on_stops_change ) self.pack(self.grad_editor, fill=True, expand=True, padding=3) self.pack(wal.HLine(self), fill=True) panel = wal.HPanel(self) self.refpanel = FillFillRefPanel( self, self.cms, self.orig_fill, deepcopy(self.orig_fill), on_orig=self.set_orig_fill, ) panel.pack(self.refpanel) panel.pack(wal.HPanel(panel), fill=True, expand=True) self.presets = GradientMiniPalette( panel, self.cms, onclick=self.on_presets_select ) panel.pack(self.presets) self.pack(panel, fill=True, padding_all=5) def set_orig_fill(self): self.activate(self.orig_fill) def on_clr_mode_change(self, mode): conv = self.cms.get_cmyk_color if mode == uc2const.COLOR_RGB: conv = self.cms.get_rgb_color elif mode == uc2const.COLOR_GRAY: conv = self.cms.get_grayscale_color new_stops = [] for stop in self.new_fill[2][2]: new_stops.append([stop[0], conv(stop[1])]) self.new_fill[2][2] = new_stops self.update() def on_grad_mode_change(self, mode): self.new_fill[2][0] = mode self.update() def on_stops_change(self): self.new_fill[2][2] = self.grad_editor.get_stops() self.update() def on_presets_select(self, stops): self.new_fill[2][2] = stops self.update() def get_result(self): stops = self.grad_editor.get_stops() vector = self.vector if not self.grad_editor.use_vector(): vector = [] grad = [self.grad_keeper.get_mode(), vector, stops] return [self.rule_keeper.get_mode(), sk2const.FILL_GRADIENT, grad] def update(self): self.grad_keeper.set_mode(self.new_fill[2][0]) self.grad_clrs.set_mode(self.new_fill[2][2][0][1][0]) self.rule_keeper.set_mode(self.new_fill[0]) self.grad_editor.set_stops(self.new_fill[2][2]) self.refpanel.update(self.orig_fill, self.new_fill) self.presets.set_stops(self.new_fill[2][2]) class PatternFill(FillTab): name = _("Pattern Fill") new_fill = None pattern_clrs = None rule_keeper = None refpanel = None presets = None pattern_editor = None def activate(self, fill_style, new_color=None): FillTab.activate(self, fill_style) rule = sk2const.FILL_EVENODD pattern_type = sk2const.PATTERN_IMG pattern = DEFAULT_PATTERN image_style = deepcopy([sk2const.CMYK_BLACK, sk2const.CMYK_WHITE]) trafo = [] + sk2const.NORMAL_TRAFO transforms = [] + sk2const.PATTERN_TRANSFORMS if fill_style: rule = fill_style[0] if fill_style[1] == sk2const.FILL_PATTERN: pattern_type = fill_style[2][0] pattern = deepcopy(fill_style[2][1]) if len(fill_style[2]) > 2: image_style = deepcopy(fill_style[2][2]) if len(fill_style[2]) > 3: trafo = [] + fill_style[2][3] if len(fill_style[2]) > 4: transforms = [] + fill_style[2][4] else: transforms = [] elif fill_style[1] == sk2const.FILL_SOLID: if fill_style[2][0] in GRADIENT_CLR_MODES: color0 = deepcopy(fill_style[2]) color0[3] = "" color1 = deepcopy(sk2const.CMYK_WHITE) if not color0[0] == color1[0]: color1 = self.cms.get_color(color1, color0[0]) color1[3] = "" image_style = [color0, color1] color0 = image_style[0] if new_color and new_color[0] in GRADIENT_CLR_MODES and not color0 == new_color: color1 = deepcopy(new_color) if not color0[0] == color1[0]: color1 = self.cms.get_color(color1, color0[0]) color1[3] = "" image_style[1] = color1 self.new_fill = [ rule, sk2const.FILL_PATTERN, [pattern_type, pattern, image_style, trafo, transforms], ] self.update() def build(self): panel = wal.HPanel(self) self.pattern_clrs = wal.HToggleKeeper( panel, GRADIENT_CLR_MODES, GRADIENT_CLR_ICONS, GRADIENT_CLR_NAMES, self.on_clr_mode_change, ) panel.pack(self.pattern_clrs) panel.pack(wal.HPanel(panel), fill=True, expand=True) self.rule_keeper = FillRuleKeeper(panel) panel.pack(self.rule_keeper) self.pack(panel, fill=True, padding_all=5) self.pack(wal.HLine(self), fill=True) default_pattern_def = [ sk2const.PATTERN_IMG, DEFAULT_PATTERN, deepcopy([sk2const.CMYK_BLACK, sk2const.CMYK_WHITE]), [] + sk2const.NORMAL_TRAFO, ] self.pattern_editor = PatternEditor( self, self.dlg, self.cms, default_pattern_def, onchange=self.on_pattern_change, ) self.pack(self.pattern_editor, fill=True, expand=True, padding_all=5) self.pack(wal.HLine(self), fill=True) panel = wal.HPanel(self) self.refpanel = FillFillRefPanel( self, self.cms, self.orig_fill, deepcopy(self.orig_fill), on_orig=self.set_orig_fill, ) panel.pack(self.refpanel) panel.pack(wal.HPanel(panel), fill=True, expand=True) self.presets = PatternMiniPalette( panel, self.cms, onclick=self.on_presets_select ) panel.pack(self.presets) self.pack(panel, fill=True, padding_all=5) def set_orig_fill(self): self.activate(self.orig_fill) def on_clr_mode_change(self, mode): image_style = deepcopy(self.new_fill[2][2]) image_style[0] = self.cms.get_color(image_style[0], mode) image_style[1] = self.cms.get_color(image_style[1], mode) self.new_fill[2][2] = image_style self.update() def on_presets_select(self, pattern): self.new_fill[2][1] = pattern self.new_fill[2][0] = sk2const.PATTERN_IMG self.update() def on_pattern_change(self, pattern_def): self.new_fill[2] = deepcopy(pattern_def) self.update() def get_result(self): return self.new_fill def update(self): self.pattern_clrs.set_mode(self.new_fill[2][2][0][0]) self.rule_keeper.set_mode(self.new_fill[0]) self.pattern_editor.set_pattern_def(self.new_fill[2]) self.refpanel.update(self.orig_fill, self.new_fill) self.pattern_clrs.set_visible(self.new_fill[2][0] == sk2const.PATTERN_IMG)
lib
opml
# version : 0.5 # https://pypi.python.org/pypi/opml import lxml.etree class OutlineElement(object): """A single outline object.""" def __init__(self, root): """Initialize from the root <outline> node.""" self._root = root def __getattr__(self, attr): if attr in self._root.attrib: return self._root.attrib[attr] else: return "" # added by cdhigh [2014.10.02] # raise AttributeError() @property def _outlines(self): """Return the available sub-outline objects as a seqeunce.""" return [OutlineElement(n) for n in self._root.xpath("./outline")] def __len__(self): return len(self._outlines) def __getitem__(self, index): return self._outlines[index] class Opml(object): """Python representation of an OPML file.""" def __init__(self, xml_tree): """Initialize the object using the parsed XML tree.""" self._tree = xml_tree def __getattr__(self, attr): """Fall back attribute handler -- attempt to find the attribute in the OPML <head>.""" result = self._tree.xpath("/opml/head/%s/text()" % attr) if len(result) == 1: return result[0] raise AttributeError() @property def _outlines(self): """Return the available sub-outline objects as a seqeunce.""" return [OutlineElement(n) for n in self._tree.xpath("/opml/body/outline")] def __len__(self): return len(self._outlines) def __getitem__(self, index): return self._outlines[index] def from_string(opml_text): return Opml(lxml.etree.fromstring(opml_text)) def parse(opml_url): return Opml(lxml.etree.parse(opml_url))
plugins
noduplicates_test
__copyright__ = "Copyright (C) 2014-2016 Martin Blais" __license__ = "GNU GPLv2" import unittest from beancount import loader from beancount.core import compare from beancount.parser import cmptest from beancount.plugins import noduplicates class TestValidateDuplicates(cmptest.TestCase): def checkDuplicates(self, entries, options_map): _, valid_errors = noduplicates.validate_no_duplicates(entries, options_map) self.assertEqual([compare.CompareError], list(map(type, valid_errors))) self.assertRegex(valid_errors[0].message, "Duplicate entry") # Note: validation already checks for dups in open/close. @loader.load_doc(expect_errors=True) def test_validate_no_duplicates__open(self, entries, _, options_map): """ 2000-01-01 open Assets:Checking 2000-01-01 open Assets:Checking """ self.checkDuplicates(entries, options_map) # Note: validation already checks for dups in open/close. @loader.load_doc(expect_errors=True) def test_validate_no_duplicates__close(self, entries, _, options_map): """ 2000-01-01 close Assets:Checking 2000-01-01 close Assets:Checking """ self.checkDuplicates(entries, options_map) # Note: The regular padding code will trigger an unused Pad entry error. @loader.load_doc(expect_errors=True) def test_validate_no_duplicates__pad(self, entries, _, options_map): """ 2000-01-01 open Assets:Checking 2000-01-01 open Equity:Opening-Balances 2000-01-15 pad Assets:Checking Equity:Opening-Balances 2000-01-15 pad Assets:Checking Equity:Opening-Balances 2001-01-01 balance Assets:Checking 1000.00 USD """ self.checkDuplicates(entries, options_map) @loader.load_doc() def test_validate_no_duplicates__balance(self, entries, _, options_map): """ 2014-01-01 open Assets:Checking 2014-01-01 open Equity:Opening-Balances 2014-06-24 * "Go negative from zero" Assets:Checking 201.00 USD Equity:Opening-Balances 2015-01-01 balance Assets:Checking 201.00 USD 2015-01-01 balance Assets:Checking 201.00 USD """ self.checkDuplicates(entries, options_map) @loader.load_doc() def test_validate_no_duplicates__transaction(self, entries, _, options_map): """ 2014-01-01 open Assets:Investments:Stock 2014-01-01 open Assets:Investments:Cash 2014-06-24 * "Go negative from zero" Assets:Investments:Stock 1 HOOL {500 USD} Assets:Investments:Cash -500 USD 2014-06-24 * "Go negative from zero" Assets:Investments:Stock 1 HOOL {500 USD} Assets:Investments:Cash -500 USD """ self.checkDuplicates(entries, options_map) @loader.load_doc() def test_validate_no_duplicates__note(self, entries, _, options_map): """ 2000-01-01 open Assets:Checking 2001-01-01 note Assets:Checking "Something about something" 2001-01-01 note Assets:Checking "Something about something" """ self.checkDuplicates(entries, options_map) @loader.load_doc() def test_validate_no_duplicates__event(self, entries, _, options_map): """ 2000-01-01 event "location" "Somewhere, Earth" 2000-01-01 event "location" "Somewhere, Earth" """ self.checkDuplicates(entries, options_map) @loader.load_doc(expect_errors=True) def test_validate_no_duplicates__document(self, entries, _, options_map): """ 2000-01-01 document Assets:Checking "/path/to/nowhere.pdf" 2000-01-01 document Assets:Checking "/path/to/nowhere.pdf" """ self.checkDuplicates(entries, options_map) @loader.load_doc() def test_validate_no_duplicates__price(self, entries, errors, options_map): """ 2000-01-01 price HOOL 500 USD 2000-01-01 price HOOL 500 USD """ self.assertEqual([], errors) _, valid_errors = noduplicates.validate_no_duplicates(entries, options_map) # Note! This is different. We allow exact duplicates of price directive # on purpose. They may be common, and they won't hurt anything. self.assertEqual([], list(map(type, valid_errors))) if __name__ == "__main__": unittest.main()
PyObjCTest
test_nsuserinterfaceitemsearching
from AppKit import * from PyObjCTools.TestSupport import * class TestNSUserInterfaceItemSearchingHelper(NSObject): def searchForItemsWithSearchString_resultLimit_matchedItemHandler_(self, s, l, h): pass class TestNSUserInterfaceItemSearching(TestCase): @min_os_level("10.6") def testMethods(self): self.assertArgHasType( TestNSUserInterfaceItemSearchingHelper.searchForItemsWithSearchString_resultLimit_matchedItemHandler_, 1, objc._C_NSInteger, ) self.assertArgIsBlock( TestNSUserInterfaceItemSearchingHelper.searchForItemsWithSearchString_resultLimit_matchedItemHandler_, 2, b"v@", ) self.assertResultIsBOOL( NSApplication.searchString_inUserInterfaceItemString_searchRange_foundRange_ ) self.assertArgHasType( NSApplication.searchString_inUserInterfaceItemString_searchRange_foundRange_, 2, NSRange.__typestr__, ) self.assertArgHasType( NSApplication.searchString_inUserInterfaceItemString_searchRange_foundRange_, 3, b"o^" + NSRange.__typestr__, ) if __name__ == "__main__": main()
bookwyrm
urls
""" url routing for the app and api """ from bookwyrm import settings, views from bookwyrm.utils import regex from django.conf.urls.static import static from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.urls import path, re_path from django.views.generic.base import TemplateView USER_PATH = rf"^user/(?P<username>{regex.USERNAME})" LOCAL_USER_PATH = rf"^user/(?P<username>{regex.LOCALNAME})" status_types = [ "status", "review", "reviewrating", "comment", "quotation", "boost", "generatednote", ] STATUS_TYPES_STRING = "|".join(status_types) STATUS_PATH = rf"{USER_PATH}/({STATUS_TYPES_STRING})/(?P<status_id>\d+)" BOOK_PATH = r"^book/(?P<book_id>\d+)" STREAMS = "|".join(s["key"] for s in settings.STREAMS) urlpatterns = [ path("admin/", admin.site.urls), path( "robots.txt", TemplateView.as_view(template_name="robots.txt", content_type="text/plain"), ), # federation endpoints re_path(r"^inbox/?$", views.Inbox.as_view(), name="inbox"), re_path(rf"{LOCAL_USER_PATH}/inbox/?$", views.Inbox.as_view(), name="user_inbox"), re_path( rf"{LOCAL_USER_PATH}/outbox/?$", views.Outbox.as_view(), name="user_outbox" ), re_path(r"^\.well-known/webfinger/?$", views.webfinger), re_path(r"^\.well-known/nodeinfo/?$", views.nodeinfo_pointer), re_path(r"^\.well-known/host-meta/?$", views.host_meta), re_path(r"^nodeinfo/2\.0/?$", views.nodeinfo), re_path(r"^api/v1/instance/?$", views.instance_info), re_path(r"^api/v1/instance/peers/?$", views.peers), re_path(r"^opensearch.xml$", views.opensearch, name="opensearch"), re_path(r"^ostatus_subscribe/?$", views.ostatus_follow_request), # polling updates re_path( "^api/updates/notifications/?$", views.get_notification_count, name="notification-updates", ), re_path( "^api/updates/stream/(?P<stream>[a-z]+)/?$", views.get_unread_status_string, name="stream-updates", ), # instance setup re_path(r"^setup/?$", views.InstanceConfig.as_view(), name="setup"), re_path(r"^setup/admin/?$", views.CreateAdmin.as_view(), name="setup-admin"), # authentication re_path(r"^login/?$", views.Login.as_view(), name="login"), re_path(r"^login/(?P<confirmed>confirmed)/?$", views.Login.as_view(), name="login"), re_path(r"^register/?$", views.Register.as_view()), re_path(r"confirm-email/?$", views.ConfirmEmail.as_view(), name="confirm-email"), re_path( r"confirm-email/(?P<code>[A-Za-z0-9]+)/?$", views.ConfirmEmailCode.as_view(), name="confirm-email-code", ), re_path(r"^resend-link/?$", views.ResendConfirmEmail.as_view(), name="resend-link"), re_path(r"^logout/?$", views.Logout.as_view(), name="logout"), re_path( r"^password-reset/?$", views.PasswordResetRequest.as_view(), name="password-reset", ), re_path( r"^password-reset/(?P<code>[A-Za-z0-9]+)/?$", views.PasswordReset.as_view() ), # admin re_path( r"^settings/dashboard/?$", views.Dashboard.as_view(), name="settings-dashboard" ), re_path(r"^settings/site-settings/?$", views.Site.as_view(), name="settings-site"), re_path( r"^settings/site-registration/?$", views.RegistrationLimited.as_view(), name="settings-registration-limited", ), re_path( r"^settings/site-registration-admin/?$", views.Registration.as_view(), name="settings-registration", ), re_path(r"^settings/themes/?$", views.Themes.as_view(), name="settings-themes"), re_path( r"^settings/themes/(?P<theme_id>\d+)/delete/?$", views.delete_theme, name="settings-themes-delete", ), re_path( r"^settings/announcements/?$", views.Announcements.as_view(), name="settings-announcements", ), re_path( r"^settings/announcements/(?P<announcement_id>\d+)/?$", views.Announcement.as_view(), name="settings-announcements", ), re_path( r"^settings/announcements/create/?$", views.EditAnnouncement.as_view(), name="settings-announcements-edit", ), re_path( r"^settings/announcements/(?P<announcement_id>\d+)/edit/?$", views.EditAnnouncement.as_view(), name="settings-announcements-edit", ), re_path( r"^settings/announcements/(?P<announcement_id>\d+)/delete/?$", views.delete_announcement, name="settings-announcements-delete", ), re_path( r"^settings/email-preview/?$", views.admin.email_config.email_preview, name="settings-email-preview", ), re_path( r"^settings/users/?$", views.UserAdminList.as_view(), name="settings-users" ), re_path( r"^settings/users/(?P<status>(local|federated|deleted))\/?$", views.UserAdminList.as_view(), name="settings-users", ), re_path( r"^settings/users/(?P<user_id>\d+)/(?P<report_id>\d+)?$", views.UserAdmin.as_view(), name="settings-user", ), re_path( r"^settings/users/(?P<user_id>\d+)/activate/?$", views.ActivateUserAdmin.as_view(), name="settings-activate-user", ), re_path( r"^settings/federation/(?P<status>(federated|blocked))?/?$", views.Federation.as_view(), name="settings-federation", ), re_path( r"^settings/federation/(?P<server>\d+)/?$", views.FederatedServer.as_view(), name="settings-federated-server", ), re_path( r"^settings/federation/(?P<server>\d+)/block/?$", views.block_server, name="settings-federated-server-block", ), re_path( r"^settings/federation/(?P<server>\d+)/unblock/?$", views.unblock_server, name="settings-federated-server-unblock", ), re_path( r"^settings/federation/(?P<server>\d+)/refresh/?$", views.refresh_server, name="settings-federated-server-refresh", ), re_path( r"^settings/federation/add/?$", views.AddFederatedServer.as_view(), name="settings-add-federated-server", ), re_path( r"^settings/federation/import/?$", views.ImportServerBlocklist.as_view(), name="settings-import-blocklist", ), re_path( r"^settings/invites/?$", views.ManageInvites.as_view(), name="settings-invites" ), re_path( r"^settings/requests/?$", views.ManageInviteRequests.as_view(), name="settings-invite-requests", ), re_path( r"^settings/requests/ignore/?$", views.ignore_invite_request, name="settings-invite-requests-ignore", ), re_path( r"^invite-request/?$", views.InviteRequest.as_view(), name="invite-request" ), re_path( r"^invite/(?P<code>[A-Za-z0-9]+)/?$", views.Invite.as_view(), name="invite" ), re_path( r"^settings/email-blocklist/?$", views.EmailBlocklist.as_view(), name="settings-email-blocks", ), re_path( r"^settings/email-blocks/(?P<domain_id>\d+)/delete/?$", views.EmailBlocklist.as_view(), name="settings-email-blocks-delete", ), re_path( r"^setting/link-domains/?$", views.LinkDomain.as_view(), name="settings-link-domain", ), re_path( r"^setting/link-domains/(?P<status>(pending|approved|blocked))/?$", views.LinkDomain.as_view(), name="settings-link-domain", ), # pylint: disable=line-too-long re_path( r"^setting/link-domains/(?P<status>(pending|approved|blocked))/(?P<domain_id>\d+)/?$", views.LinkDomain.as_view(), name="settings-link-domain", ), re_path( r"^setting/link-domains/(?P<domain_id>\d+)/(?P<status>(pending|approved|blocked))/(?P<report_id>\d+)?$", views.update_domain_status, name="settings-link-domain-status", ), re_path( r"^settings/ip-blocklist/?$", views.IPBlocklist.as_view(), name="settings-ip-blocks", ), re_path( r"^settings/ip-blocks/(?P<block_id>\d+)/delete/?$", views.IPBlocklist.as_view(), name="settings-ip-blocks-delete", ), # auto-moderation rules re_path(r"^settings/automod/?$", views.AutoMod.as_view(), name="settings-automod"), re_path( r"^settings/automod/(?P<rule_id>\d+)/delete/?$", views.automod_delete, name="settings-automod-delete", ), re_path( r"^settings/automod/schedule/?$", views.schedule_automod_task, name="settings-automod-schedule", ), re_path( r"^settings/automod/unschedule/(?P<task_id>\d+)/?$", views.unschedule_automod_task, name="settings-automod-unschedule", ), re_path( r"^settings/automod/run/?$", views.run_automod, name="settings-automod-run" ), # moderation re_path( r"^settings/reports/?$", views.ReportsAdmin.as_view(), name="settings-reports" ), re_path( r"^settings/reports/(?P<report_id>\d+)/?$", views.ReportAdmin.as_view(), name="settings-report", ), re_path( r"^settings/reports/(?P<user_id>\d+)/suspend/(?P<report_id>\d+)?$", views.suspend_user, name="settings-report-suspend", ), re_path( r"^settings/reports/(?P<user_id>\d+)/unsuspend/(?P<report_id>\d+)?$", views.unsuspend_user, name="settings-report-unsuspend", ), re_path( r"^settings/reports/(?P<user_id>\d+)/delete/(?P<report_id>\d+)?$", views.moderator_delete_user, name="settings-delete-user", ), re_path( r"^settings/reports/(?P<report_id>\d+)/resolve/?$", views.resolve_report, name="settings-report-resolve", ), re_path(r"^report/?$", views.Report.as_view(), name="report"), re_path(r"^report/(?P<user_id>\d+)/?$", views.Report.as_view(), name="report"), re_path( r"^report/(?P<user_id>\d+)/status/(?P<status_id>\d+)?$", views.Report.as_view(), name="report-status", ), re_path( r"^report/link/(?P<link_id>\d+)?$", views.Report.as_view(), name="report-link", ), re_path( r"^settings/imports/(?P<status>(complete|active))?/?$", views.ImportList.as_view(), name="settings-imports", ), re_path( r"^settings/imports/(?P<import_id>\d+)/complete/?$", views.ImportList.as_view(), name="settings-imports-complete", ), re_path( r"^settings/imports/disable/?$", views.disable_imports, name="settings-imports-disable", ), re_path( r"^settings/imports/enable/?$", views.enable_imports, name="settings-imports-enable", ), re_path( r"^settings/imports/set-limit/?$", views.set_import_size_limit, name="settings-imports-set-limit", ), re_path( r"^settings/celery/?$", views.CeleryStatus.as_view(), name="settings-celery" ), re_path( r"^settings/celery/ping/?$", views.celery_ping, name="settings-celery-ping" ), re_path( r"^settings/email-config/?$", views.EmailConfig.as_view(), name="settings-email-config", ), # landing pages re_path(r"^about/?$", views.about, name="about"), re_path(r"^privacy/?$", views.privacy, name="privacy"), re_path(r"^conduct/?$", views.conduct, name="conduct"), re_path(r"^impressum/?$", views.impressum, name="impressum"), path("", views.Home.as_view(), name="landing"), re_path(r"^discover/?$", views.Discover.as_view(), name="discover"), re_path(r"^notifications/?$", views.Notifications.as_view(), name="notifications"), re_path( r"^notifications/(?P<notification_type>mentions)/?$", views.Notifications.as_view(), name="notifications", ), re_path(r"^directory/?", views.Directory.as_view(), name="directory"), # hashtag re_path( r"^hashtag/(?P<hashtag_id>\d+)/?$", views.Hashtag.as_view(), name="hashtag" ), re_path( rf"^hashtag/(?P<hashtag_id>\d+){regex.SLUG}/?$", views.Hashtag.as_view(), name="hashtag", ), # Get started re_path( r"^get-started/profile/?$", views.GetStartedProfile.as_view(), name="get-started-profile", ), re_path( r"^get-started/books/?$", views.GetStartedBooks.as_view(), name="get-started-books", ), re_path( r"^get-started/users/?$", views.GetStartedUsers.as_view(), name="get-started-users", ), # feeds re_path(rf"^(?P<tab>{STREAMS})/?$", views.Feed.as_view()), re_path( r"^direct-messages/?$", views.DirectMessage.as_view(), name="direct-messages" ), re_path( rf"^direct-messages/(?P<username>{regex.USERNAME})/?$", views.DirectMessage.as_view(), name="direct-messages-user", ), # search re_path(r"^search.json/?$", views.Search.as_view(), name="search"), re_path(r"^search/?$", views.Search.as_view(), name="search"), # imports re_path(r"^import/?$", views.Import.as_view(), name="import"), re_path( r"^import/(?P<job_id>\d+)/?$", views.ImportStatus.as_view(), name="import-status", ), re_path( r"^import/(?P<job_id>\d+)/stop/?$", views.stop_import, name="import-stop", ), re_path( r"^import/(?P<job_id>\d+)/retry/(?P<item_id>\d+)/?$", views.retry_item, name="import-item-retry", ), re_path( r"^import/(?P<job_id>\d+)/failed/?$", views.ImportTroubleshoot.as_view(), name="import-troubleshoot", ), re_path( r"^import/(?P<job_id>\d+)/review/?$", views.ImportManualReview.as_view(), name="import-review", ), re_path( r"^import/(?P<job_id>\d+)/review/?$", views.ImportManualReview.as_view(), name="import-review", ), re_path( r"^import/(?P<job_id>\d+)/review/(?P<item_id>\d+)/approve/?$", views.approve_import_item, name="import-approve", ), re_path( r"^import/(?P<job_id>\d+)/review/(?P<item_id>\d+)/delete/?$", views.delete_import_item, name="import-delete", ), # users re_path(rf"{USER_PATH}\.json$", views.User.as_view()), re_path(rf"{USER_PATH}/?$", views.User.as_view(), name="user-feed"), re_path(rf"^@(?P<username>{regex.USERNAME})$", views.user_redirect), re_path(rf"{USER_PATH}/rss/?$", views.rss_feed.RssFeed(), name="user-rss"), re_path( rf"{USER_PATH}/rss-reviews/?$", views.rss_feed.RssReviewsOnlyFeed(), name="user-reviews-rss", ), re_path( rf"{USER_PATH}/rss-quotes/?$", views.rss_feed.RssQuotesOnlyFeed(), name="user-quotes-rss", ), re_path( rf"{USER_PATH}/rss-comments/?$", views.rss_feed.RssCommentsOnlyFeed(), name="user-comments-rss", ), re_path( rf"{USER_PATH}/(?P<direction>(followers|following))(.json)?/?$", views.Relationships.as_view(), name="user-relationships", ), re_path(r"^hide-suggestions/?$", views.hide_suggestions, name="hide-suggestions"), re_path( rf"{USER_PATH}/reviews-comments", views.UserReviewsComments.as_view(), name="user-reviews-comments", ), # groups re_path(rf"{USER_PATH}/groups/?$", views.UserGroups.as_view(), name="user-groups"), re_path( r"^group/(?P<group_id>\d+)(.json)?/?$", views.Group.as_view(), name="group" ), re_path( rf"^group/(?P<group_id>\d+){regex.SLUG}/?$", views.Group.as_view(), name="group" ), re_path( r"^group/delete/(?P<group_id>\d+)/?$", views.delete_group, name="delete-group" ), re_path( r"^group/(?P<group_id>\d+)/add-users/?$", views.FindUsers.as_view(), name="group-find-users", ), re_path(r"^add-group-member/?$", views.invite_member, name="invite-group-member"), re_path( r"^remove-group-member/?$", views.remove_member, name="remove-group-member" ), re_path( r"^accept-group-invitation/?$", views.accept_membership, name="accept-group-invitation", ), re_path( r"^reject-group-invitation/?$", views.reject_membership, name="reject-group-invitation", ), # lists re_path(rf"{USER_PATH}/lists/?$", views.UserLists.as_view(), name="user-lists"), re_path(r"^list/?$", views.Lists.as_view(), name="lists"), re_path(r"^list/saved/?$", views.SavedLists.as_view(), name="saved-lists"), re_path(r"^list/(?P<list_id>\d+)(\.json)?/?$", views.List.as_view(), name="list"), re_path( rf"^list/(?P<list_id>\d+){regex.SLUG}/?$", views.List.as_view(), name="list" ), re_path( r"^list/(?P<list_id>\d+)/item/(?P<list_item>\d+)/?$", views.ListItem.as_view(), name="list-item", ), re_path(r"^list/delete/(?P<list_id>\d+)/?$", views.delete_list, name="delete-list"), re_path(r"^list/add-book/?$", views.add_book, name="list-add-book"), re_path( r"^list/(?P<list_id>\d+)/remove/?$", views.remove_book, name="list-remove-book", ), re_path( r"^list-item/(?P<list_item_id>\d+)/set-position$", views.set_book_position, name="list-set-book-position", ), re_path( r"^list/(?P<list_id>\d+)/curate/?$", views.Curate.as_view(), name="list-curate" ), re_path(r"^save-list/(?P<list_id>\d+)/?$", views.save_list, name="list-save"), re_path(r"^unsave-list/(?P<list_id>\d+)/?$", views.unsave_list, name="list-unsave"), re_path( r"^list/(?P<list_id>\d+)/embed/(?P<list_key>[0-9a-f]+)/?$", views.unsafe_embed_list, name="embed-list", ), # User books re_path(rf"{USER_PATH}/books/?$", views.Shelf.as_view(), name="user-shelves"), re_path( rf"^{USER_PATH}/(shelf|books)/(?P<shelf_identifier>[\w-]+)(.json)?/?$", views.Shelf.as_view(), name="shelf", ), re_path( rf"^{LOCAL_USER_PATH}/(books|shelf)/(?P<shelf_identifier>[\w-]+)(.json)?/?$", views.Shelf.as_view(), name="shelf", ), re_path(r"^create-shelf/?$", views.create_shelf, name="shelf-create"), re_path(r"^delete-shelf/(?P<shelf_id>\d+)/?$", views.delete_shelf), re_path(r"^shelve/?$", views.shelve), re_path(r"^unshelve/?$", views.unshelve), # goals re_path( rf"{LOCAL_USER_PATH}/goal/(?P<year>\d+)/?$", views.Goal.as_view(), name="user-goal", ), re_path(r"^hide-goal/?$", views.hide_goal, name="hide-goal"), # preferences re_path(r"^preferences/profile/?$", views.EditUser.as_view(), name="prefs-profile"), re_path( r"^preferences/password/?$", views.ChangePassword.as_view(), name="prefs-password", ), re_path( r"^preferences/2fa/?$", views.Edit2FA.as_view(), name="prefs-2fa", ), re_path( r"^preferences/2fa-backup-codes/?$", views.GenerateBackupCodes.as_view(), name="generate-2fa-backup-codes", ), re_path( r"^preferences/confirm-2fa/?$", views.Confirm2FA.as_view(), name="conf-2fa", ), re_path( r"^preferences/disable-2fa/?$", views.Disable2FA.as_view(), name="disable-2fa", ), re_path( r"^2fa-check/?$", views.LoginWith2FA.as_view(), name="login-with-2fa", ), re_path( r"^2fa-prompt/?$", views.Prompt2FA.as_view(), name="prompt-2fa", ), re_path(r"^preferences/export/?$", views.Export.as_view(), name="prefs-export"), re_path(r"^preferences/delete/?$", views.DeleteUser.as_view(), name="prefs-delete"), re_path( r"^preferences/deactivate/?$", views.DeactivateUser.as_view(), name="prefs-deactivate", ), re_path( r"^preferences/reactivate/?$", views.ReactivateUser.as_view(), name="prefs-reactivate", ), re_path(r"^preferences/block/?$", views.Block.as_view(), name="prefs-block"), re_path(r"^block/(?P<user_id>\d+)/?$", views.Block.as_view()), re_path(r"^unblock/(?P<user_id>\d+)/?$", views.unblock), # statuses re_path(rf"{STATUS_PATH}(.json)?/?$", views.Status.as_view(), name="status"), re_path(rf"{STATUS_PATH}{regex.SLUG}/?$", views.Status.as_view(), name="status"), re_path(rf"{STATUS_PATH}/activity/?$", views.Status.as_view(), name="status"), re_path( rf"{STATUS_PATH}/replies(.json)?/?$", views.Replies.as_view(), name="replies" ), re_path( r"^edit/(?P<status_id>\d+)/?$", views.EditStatus.as_view(), name="edit-status" ), re_path( r"^post/?$", views.CreateStatus.as_view(), name="create-status", ), re_path( r"^post/(?P<status_type>\w+)/?$", views.CreateStatus.as_view(), name="create-status", ), re_path( r"^post/(?P<status_type>\w+)/(?P<existing_status_id>\d+)/?$", views.CreateStatus.as_view(), name="create-status", ), re_path( r"^delete-status/(?P<status_id>\d+)/?(?P<report_id>\d+)?$", views.DeleteStatus.as_view(), name="delete-status", ), # interact re_path(r"^favorite/(?P<status_id>\d+)/?$", views.Favorite.as_view(), name="fav"), re_path( r"^unfavorite/(?P<status_id>\d+)/?$", views.Unfavorite.as_view(), name="unfav" ), re_path(r"^boost/(?P<status_id>\d+)/?$", views.Boost.as_view()), re_path(r"^unboost/(?P<status_id>\d+)/?$", views.Unboost.as_view()), # books re_path(rf"{BOOK_PATH}(.json)?/?$", views.Book.as_view(), name="book"), re_path(rf"{BOOK_PATH}{regex.SLUG}/?$", views.Book.as_view(), name="book"), re_path( r"^series/by/(?P<author_id>\d+)/?$", views.BookSeriesBy.as_view(), name="book-series-by", ), re_path( rf"{BOOK_PATH}/(?P<user_statuses>review|comment|quote)/?$", views.Book.as_view(), name="book-user-statuses", ), re_path(rf"{BOOK_PATH}/edit/?$", views.EditBook.as_view(), name="edit-book"), re_path( rf"{BOOK_PATH}/confirm/?$", views.ConfirmEditBook.as_view(), name="edit-book-confirm", ), re_path( r"^create-book/data/?$", views.create_book_from_data, name="create-book-data" ), re_path(r"^create-book/?$", views.CreateBook.as_view(), name="create-book"), re_path( r"^create-book/confirm/?$", views.ConfirmEditBook.as_view(), name="create-book-confirm", ), re_path(rf"{BOOK_PATH}/editions(.json)?/?$", views.Editions.as_view()), re_path( r"^upload-cover/(?P<book_id>\d+)/?$", views.upload_cover, name="upload-cover" ), re_path( r"^add-description/(?P<book_id>\d+)/?$", views.add_description, name="add-description", ), re_path( rf"{BOOK_PATH}/filelink/?$", views.BookFileLinks.as_view(), name="file-link" ), re_path( rf"{BOOK_PATH}/filelink/(?P<link_id>\d+)/?$", views.BookFileLinks.as_view(), name="file-link", ), re_path( rf"{BOOK_PATH}/filelink/(?P<link_id>\d+)/delete/?$", views.delete_link, name="file-link-delete", ), re_path( rf"{BOOK_PATH}/filelink/add/?$", views.AddFileLink.as_view(), name="file-link-add", ), re_path(r"^resolve-book/?$", views.resolve_book, name="resolve-book"), re_path(r"^switch-edition/?$", views.switch_edition, name="switch-edition"), re_path( rf"{BOOK_PATH}/update/(?P<connector_identifier>[\w\.]+)/?$", views.update_book_from_remote, name="book-update-remote", ), re_path( r"^author/(?P<author_id>\d+)/update/(?P<connector_identifier>[\w\.]+)/?$", views.update_author_from_remote, name="author-update-remote", ), # isbn re_path(r"^isbn/(?P<isbn>[\dxX]+)(.json)?/?$", views.Isbn.as_view()), # author re_path( r"^author/(?P<author_id>\d+)(.json)?/?$", views.Author.as_view(), name="author" ), re_path( rf"^author/(?P<author_id>\d+){regex.SLUG}/?$", views.Author.as_view(), name="author", ), re_path( r"^author/(?P<author_id>\d+)/edit/?$", views.EditAuthor.as_view(), name="edit-author", ), # reading progress re_path(r"^edit-readthrough/?$", views.edit_readthrough, name="edit-readthrough"), re_path(r"^delete-readthrough/?$", views.delete_readthrough), re_path( r"^create-readthrough/?$", views.ReadThrough.as_view(), name="create-readthrough", ), re_path(r"^delete-progressupdate/?$", views.delete_progressupdate), # shelve actions re_path( r"^reading-status/update/(?P<book_id>\d+)/?$", views.update_progress, name="reading-status-update", ), re_path( r"^reading-status/(?P<status>want|start|finish|stop)/(?P<book_id>\d+)/?$", views.ReadingStatus.as_view(), name="reading-status", ), # following re_path(r"^follow/?$", views.follow, name="follow"), re_path(r"^unfollow/?$", views.unfollow, name="unfollow"), re_path(r"^accept-follow-request/?$", views.accept_follow_request), re_path(r"^delete-follow-request/?$", views.delete_follow_request), re_path(r"^ostatus_follow/?$", views.remote_follow, name="remote-follow"), re_path(r"^remote_follow/?$", views.remote_follow_page, name="remote-follow-page"), re_path( r"^ostatus_success/?$", views.ostatus_follow_success, name="ostatus-success" ), # annual summary re_path( r"^my-year-in-the-books/(?P<year>\d+)/?$", views.personal_annual_summary, ), re_path( rf"{LOCAL_USER_PATH}/(?P<year>\d+)-in-the-books/?$", views.AnnualSummary.as_view(), name="annual-summary", ), re_path(r"^summary_add_key/?$", views.summary_add_key, name="summary-add-key"), re_path( r"^summary_revoke_key/?$", views.summary_revoke_key, name="summary-revoke-key" ), path("guided-tour/<tour>", views.toggle_guided_tour), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) # Serves /static when DEBUG is true. urlpatterns.extend(staticfiles_urlpatterns()) # pylint: disable=invalid-name handler500 = "bookwyrm.views.server_error"
webui
webserver_thread
# -*- coding: utf-8 -*- import logging import threading from cheroot import wsgi from cheroot.ssl.builtin import BuiltinSSLAdapter from .app import App # TODO: make configurable to serve API class WebServerThread(threading.Thread): def __init__(self, pycore): super().__init__() self.daemon = True self.pyload = pycore self._ = pycore._ self.develop = self.pyload.config.get("webui", "develop") self.use_ssl = self.pyload.config.get("webui", "use_ssl") self.certfile = self.pyload.config.get("webui", "ssl_certfile") self.keyfile = self.pyload.config.get("webui", "ssl_keyfile") self.certchain = self.pyload.config.get("webui", "ssl_certchain") or None self.host = self.pyload.config.get("webui", "host") self.port = self.pyload.config.get("webui", "port") self.prefix = self.pyload.config.get("webui", "prefix") # NOTE: Is really the right choice pass the pycore obj directly to app?! # Or should we pass just core.api and server.logger instead? self.app = App(self.pyload, self.develop, self.prefix) self.log = self.app.logger def _run_develop(self): # TODO: inject our custom logger in werkzeug code? # NOTE: use_reloader=True -> 'ValueError: signal only works in main thread' self.app.run(self.host, self.port, use_reloader=False) def _run_produc(self): bind_path = "/" bind_addr = (self.host, self.port) wsgi_app = wsgi.PathInfoDispatcher({bind_path: self.app}) self.server = wsgi.Server(bind_addr, wsgi_app, request_queue_size=512) if self.use_ssl: try: self.server.ssl_adapter = BuiltinSSLAdapter( self.certfile, self.keyfile, self.certchain ) except Exception as exc: self.log.error( self._("Cannot use HTTPS: {}").format(exc), exc_info=self.pyload.debug, stack_info=self.pyload.debug > 2, ) self.use_ssl = False #: hack cheroot to use our custom logger self.server.error_log = lambda *args, **kwargs: self.log.log( kwargs.get("level", logging.ERROR), args[0], exc_info=self.pyload.debug ) self.server.start() def stop(self): if not self.develop: self.server.stop() else: pass # TODO: Not implemented def run(self): if self.use_ssl and self.develop: self.log.warning( self._( "Development mode does not support HTTPS, please disable development mode to use HTTPS" ) ) self.use_ssl = False self.log.info( self._("Starting webserver: {scheme}://{host}:{port}").format( scheme="https" if self.use_ssl else "http", host=f"[{self.host}]" if ":" in self.host else self.host, port=self.port, ) ) try: if self.develop: self._run_develop() else: self._run_produc() except OSError as exc: #: Unfortunately, CherryPy raises socket.error without setting errno :( if ( exc.errno in (98, 10013) or isinstance(exc.args[0], str) and ("Errno 98" in exc.args[0] or "WinError 10048" in exc.args[0]) ): self.log.fatal( self._( "** FATAL ERROR ** Could not start web server - Address Already in Use | Exiting pyLoad" ) ) self.pyload.api.kill() else: raise
reader
others_reader
# -------------------------------------------------------------------------- # Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas # Copyright: (C) 2001 Centro de Pesquisas Renato Archer # Homepage: http://www.softwarepublico.gov.br # Contact: invesalius@cti.gov.br # License: GNU - GPL 2 (LICENSE.txt/LICENCA.txt) # -------------------------------------------------------------------------- # Este programa e software livre; voce pode redistribui-lo e/ou # modifica-lo sob os termos da Licenca Publica Geral GNU, conforme # publicada pela Free Software Foundation; de acordo com a versao 2 # da Licenca. # # Este programa eh distribuido na expectativa de ser util, mas SEM # QUALQUER GARANTIA; sem mesmo a garantia implicita de # COMERCIALIZACAO ou de ADEQUACAO A QUALQUER PROPOSITO EM # PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais # detalhes. # -------------------------------------------------------------------------- import os import invesalius.constants as const import nibabel as nib from invesalius import inv_paths from vtkmodules.vtkCommonCore import vtkFileOutputWindow, vtkOutputWindow def ReadOthers(dir_): """ Read the given Analyze, NIfTI, Compressed NIfTI or PAR/REC file, remove singleton image dimensions and convert image orientation to RAS+ canonical coordinate system. Analyze header does not support affine transformation matrix, though cannot be converted automatically to canonical orientation. :param dir_: file path :return: imagedata object """ if not const.VTK_WARNING: log_path = os.path.join(inv_paths.USER_LOG_DIR, "vtkoutput.txt") fow = vtkFileOutputWindow() fow.SetFileName(log_path.encode(const.FS_ENCODE)) ow = vtkOutputWindow() ow.SetInstance(fow) try: imagedata = nib.squeeze_image(nib.load(dir_)) imagedata = nib.as_closest_canonical(imagedata) imagedata.update_header() except nib.filebasedimages.ImageFileError: return False return imagedata