repo_name
stringlengths
7
65
path
stringlengths
5
185
copies
stringlengths
1
4
size
stringlengths
4
6
content
stringlengths
977
990k
license
stringclasses
14 values
hash
stringlengths
32
32
line_mean
float64
7.18
99.4
line_max
int64
31
999
alpha_frac
float64
0.25
0.95
ratio
float64
1.5
7.84
autogenerated
bool
1 class
config_or_test
bool
2 classes
has_no_keywords
bool
2 classes
has_few_assignments
bool
1 class
celery/kombu
kombu/mixins.py
1
9667
"""Mixins.""" from __future__ import annotations import socket from contextlib import contextmanager from functools import partial from itertools import count from time import sleep from .common import ignore_errors from .log import get_logger from .messaging import Consumer, Producer from .utils.compat import nested from .utils.encoding import safe_repr from .utils.limits import TokenBucket from .utils.objects import cached_property __all__ = ('ConsumerMixin', 'ConsumerProducerMixin') logger = get_logger(__name__) debug, info, warn, error = ( logger.debug, logger.info, logger.warning, logger.error ) W_CONN_LOST = """\ Connection to broker lost, trying to re-establish connection...\ """ W_CONN_ERROR = """\ Broker connection error, trying again in %s seconds: %r.\ """ class ConsumerMixin: """Convenience mixin for implementing consumer programs. It can be used outside of threads, with threads, or greenthreads (eventlet/gevent) too. The basic class would need a :attr:`connection` attribute which must be a :class:`~kombu.Connection` instance, and define a :meth:`get_consumers` method that returns a list of :class:`kombu.Consumer` instances to use. Supporting multiple consumers is important so that multiple channels can be used for different QoS requirements. Example: .. code-block:: python class Worker(ConsumerMixin): task_queue = Queue('tasks', Exchange('tasks'), 'tasks') def __init__(self, connection): self.connection = None def get_consumers(self, Consumer, channel): return [Consumer(queues=[self.task_queue], callbacks=[self.on_task])] def on_task(self, body, message): print('Got task: {0!r}'.format(body)) message.ack() Methods: * :meth:`extra_context` Optional extra context manager that will be entered after the connection and consumers have been set up. Takes arguments ``(connection, channel)``. * :meth:`on_connection_error` Handler called if the connection is lost/ or is unavailable. Takes arguments ``(exc, interval)``, where interval is the time in seconds when the connection will be retried. The default handler will log the exception. * :meth:`on_connection_revived` Handler called as soon as the connection is re-established after connection failure. Takes no arguments. * :meth:`on_consume_ready` Handler called when the consumer is ready to accept messages. Takes arguments ``(connection, channel, consumers)``. Also keyword arguments to ``consume`` are forwarded to this handler. * :meth:`on_consume_end` Handler called after the consumers are canceled. Takes arguments ``(connection, channel)``. * :meth:`on_iteration` Handler called for every iteration while draining events. Takes no arguments. * :meth:`on_decode_error` Handler called if a consumer was unable to decode the body of a message. Takes arguments ``(message, exc)`` where message is the original message object. The default handler will log the error and acknowledge the message, so if you override make sure to call super, or perform these steps yourself. """ #: maximum number of retries trying to re-establish the connection, #: if the connection is lost/unavailable. connect_max_retries = None #: When this is set to true the consumer should stop consuming #: and return, so that it can be joined if it is the implementation #: of a thread. should_stop = False def get_consumers(self, Consumer, channel): raise NotImplementedError('Subclass responsibility') def on_connection_revived(self): pass def on_consume_ready(self, connection, channel, consumers, **kwargs): pass def on_consume_end(self, connection, channel): pass def on_iteration(self): pass def on_decode_error(self, message, exc): error("Can't decode message body: %r (type:%r encoding:%r raw:%r')", exc, message.content_type, message.content_encoding, safe_repr(message.body)) message.ack() def on_connection_error(self, exc, interval): warn(W_CONN_ERROR, interval, exc, exc_info=1) @contextmanager def extra_context(self, connection, channel): yield def run(self, _tokens=1, **kwargs): restart_limit = self.restart_limit errors = (self.connection.connection_errors + self.connection.channel_errors) while not self.should_stop: try: if restart_limit.can_consume(_tokens): # pragma: no cover for _ in self.consume(limit=None, **kwargs): pass else: sleep(restart_limit.expected_time(_tokens)) except errors: warn(W_CONN_LOST, exc_info=1) @contextmanager def consumer_context(self, **kwargs): with self.Consumer() as (connection, channel, consumers): with self.extra_context(connection, channel): self.on_consume_ready(connection, channel, consumers, **kwargs) yield connection, channel, consumers def consume(self, limit=None, timeout=None, safety_interval=1, **kwargs): elapsed = 0 with self.consumer_context(**kwargs) as (conn, channel, consumers): for i in limit and range(limit) or count(): if self.should_stop: break self.on_iteration() try: conn.drain_events(timeout=safety_interval) except socket.timeout: conn.heartbeat_check() elapsed += safety_interval if timeout and elapsed >= timeout: raise except OSError: if not self.should_stop: raise else: yield elapsed = 0 debug('consume exiting') def maybe_conn_error(self, fun): """Use :func:`kombu.common.ignore_errors` instead.""" return ignore_errors(self, fun) def create_connection(self): return self.connection.clone() @contextmanager def establish_connection(self): with self.create_connection() as conn: conn.ensure_connection(self.on_connection_error, self.connect_max_retries) yield conn @contextmanager def Consumer(self): with self.establish_connection() as conn: self.on_connection_revived() info('Connected to %s', conn.as_uri()) channel = conn.default_channel cls = partial(Consumer, channel, on_decode_error=self.on_decode_error) with self._consume_from(*self.get_consumers(cls, channel)) as c: yield conn, channel, c debug('Consumers canceled') self.on_consume_end(conn, channel) debug('Connection closed') def _consume_from(self, *consumers): return nested(*consumers) @cached_property def restart_limit(self): return TokenBucket(1) @cached_property def connection_errors(self): return self.connection.connection_errors @cached_property def channel_errors(self): return self.connection.channel_errors class ConsumerProducerMixin(ConsumerMixin): """Consumer and Producer mixin. Version of ConsumerMixin having separate connection for also publishing messages. Example: .. code-block:: python class Worker(ConsumerProducerMixin): def __init__(self, connection): self.connection = connection def get_consumers(self, Consumer, channel): return [Consumer(queues=Queue('foo'), on_message=self.handle_message, accept='application/json', prefetch_count=10)] def handle_message(self, message): self.producer.publish( {'message': 'hello to you'}, exchange='', routing_key=message.properties['reply_to'], correlation_id=message.properties['correlation_id'], retry=True, ) """ _producer_connection = None def on_consume_end(self, connection, channel): if self._producer_connection is not None: self._producer_connection.close() self._producer_connection = None @property def producer(self): return Producer(self.producer_connection) @property def producer_connection(self): if self._producer_connection is None: conn = self.connection.clone() conn.ensure_connection(self.on_connection_error, self.connect_max_retries) self._producer_connection = conn return self._producer_connection
bsd-3-clause
00bbe70854f986aeee064ec31f9d8a89
31.116279
79
0.584049
4.74105
false
false
false
false
celery/kombu
t/unit/asynchronous/aws/sqs/test_queue.py
1
7140
from __future__ import annotations from unittest.mock import Mock import pytest from kombu.asynchronous.aws.sqs.message import AsyncMessage from kombu.asynchronous.aws.sqs.queue import AsyncQueue from t.mocks import PromiseMock from ..case import AWSCase class test_AsyncQueue(AWSCase): def setup(self): self.conn = Mock(name='connection') self.x = AsyncQueue(self.conn, '/url') self.callback = PromiseMock(name='callback') def test_message_class(self): assert issubclass(self.x.message_class, AsyncMessage) def test_get_attributes(self): self.x.get_attributes(attributes='QueueSize', callback=self.callback) self.x.connection.get_queue_attributes.assert_called_with( self.x, 'QueueSize', self.callback, ) def test_set_attribute(self): self.x.set_attribute('key', 'value', callback=self.callback) self.x.connection.set_queue_attribute.assert_called_with( self.x, 'key', 'value', self.callback, ) def test_get_timeout(self): self.x.get_timeout(callback=self.callback) self.x.connection.get_queue_attributes.assert_called() on_ready = self.x.connection.get_queue_attributes.call_args[0][2] self.x.connection.get_queue_attributes.assert_called_with( self.x, 'VisibilityTimeout', on_ready, ) on_ready({'VisibilityTimeout': '303'}) self.callback.assert_called_with(303) def test_set_timeout(self): self.x.set_timeout(808, callback=self.callback) self.x.connection.set_queue_attribute.assert_called() on_ready = self.x.connection.set_queue_attribute.call_args[0][3] self.x.connection.set_queue_attribute.assert_called_with( self.x, 'VisibilityTimeout', 808, on_ready, ) on_ready(808) self.callback.assert_called_with(808) assert self.x.visibility_timeout == 808 on_ready(None) assert self.x.visibility_timeout == 808 def test_add_permission(self): self.x.add_permission( 'label', 'accid', 'action', callback=self.callback, ) self.x.connection.add_permission.assert_called_with( self.x, 'label', 'accid', 'action', self.callback, ) def test_remove_permission(self): self.x.remove_permission('label', callback=self.callback) self.x.connection.remove_permission.assert_called_with( self.x, 'label', self.callback, ) def test_read(self): self.x.read(visibility_timeout=909, callback=self.callback) self.x.connection.receive_message.assert_called() on_ready = self.x.connection.receive_message.call_args[1]['callback'] self.x.connection.receive_message.assert_called_with( self.x, number_messages=1, visibility_timeout=909, attributes=None, wait_time_seconds=None, callback=on_ready, ) messages = [Mock(name='message1')] on_ready(messages) self.callback.assert_called_with(messages[0]) def MockMessage(self, id, md5): m = Mock(name=f'Message-{id}') m.id = id m.md5 = md5 return m def test_write(self): message = self.MockMessage('id1', 'digest1') self.x.write(message, delay_seconds=303, callback=self.callback) self.x.connection.send_message.assert_called() on_ready = self.x.connection.send_message.call_args[1]['callback'] self.x.connection.send_message.assert_called_with( self.x, message.get_body_encoded(), 303, callback=on_ready, ) new_message = self.MockMessage('id2', 'digest2') on_ready(new_message) assert message.id == 'id2' assert message.md5 == 'digest2' def test_write_batch(self): messages = [('id1', 'A', 0), ('id2', 'B', 303)] self.x.write_batch(messages, callback=self.callback) self.x.connection.send_message_batch.assert_called_with( self.x, messages, callback=self.callback, ) def test_delete_message(self): message = self.MockMessage('id1', 'digest1') self.x.delete_message(message, callback=self.callback) self.x.connection.delete_message.assert_called_with( self.x, message, self.callback, ) def test_delete_message_batch(self): messages = [ self.MockMessage('id1', 'r1'), self.MockMessage('id2', 'r2'), ] self.x.delete_message_batch(messages, callback=self.callback) self.x.connection.delete_message_batch.assert_called_with( self.x, messages, callback=self.callback, ) def test_change_message_visibility_batch(self): messages = [ (self.MockMessage('id1', 'r1'), 303), (self.MockMessage('id2', 'r2'), 909), ] self.x.change_message_visibility_batch( messages, callback=self.callback, ) self.x.connection.change_message_visibility_batch.assert_called_with( self.x, messages, callback=self.callback, ) def test_delete(self): self.x.delete(callback=self.callback) self.x.connection.delete_queue.assert_called_with( self.x, callback=self.callback, ) def test_count(self): self.x.count(callback=self.callback) self.x.connection.get_queue_attributes.assert_called() on_ready = self.x.connection.get_queue_attributes.call_args[0][2] self.x.connection.get_queue_attributes.assert_called_with( self.x, 'ApproximateNumberOfMessages', on_ready, ) on_ready({'ApproximateNumberOfMessages': '909'}) self.callback.assert_called_with(909) def test_interface__count_slow(self): with pytest.raises(NotImplementedError): self.x.count_slow() def test_interface__dump(self): with pytest.raises(NotImplementedError): self.x.dump() def test_interface__save_to_file(self): with pytest.raises(NotImplementedError): self.x.save_to_file() def test_interface__save_to_filename(self): with pytest.raises(NotImplementedError): self.x.save_to_filename() def test_interface__save(self): with pytest.raises(NotImplementedError): self.x.save() def test_interface__save_to_s3(self): with pytest.raises(NotImplementedError): self.x.save_to_s3() def test_interface__load_from_s3(self): with pytest.raises(NotImplementedError): self.x.load_from_s3() def test_interface__load_from_file(self): with pytest.raises(NotImplementedError): self.x.load_from_file() def test_interface__load_from_filename(self): with pytest.raises(NotImplementedError): self.x.load_from_filename() def test_interface__load(self): with pytest.raises(NotImplementedError): self.x.load() def test_interface__clear(self): with pytest.raises(NotImplementedError): self.x.clear()
bsd-3-clause
e3cbc7f957ba7b9fb345df5e13589d82
33.829268
77
0.627591
3.688017
false
true
false
false
celery/kombu
kombu/utils/eventio.py
1
10159
"""Selector Utilities.""" from __future__ import annotations import errno import math import select as __select__ import sys from numbers import Integral from . import fileno from .compat import detect_environment __all__ = ('poll',) _selectf = __select__.select _selecterr = __select__.error xpoll = getattr(__select__, 'poll', None) epoll = getattr(__select__, 'epoll', None) kqueue = getattr(__select__, 'kqueue', None) kevent = getattr(__select__, 'kevent', None) KQ_EV_ADD = getattr(__select__, 'KQ_EV_ADD', 1) KQ_EV_DELETE = getattr(__select__, 'KQ_EV_DELETE', 2) KQ_EV_ENABLE = getattr(__select__, 'KQ_EV_ENABLE', 4) KQ_EV_CLEAR = getattr(__select__, 'KQ_EV_CLEAR', 32) KQ_EV_ERROR = getattr(__select__, 'KQ_EV_ERROR', 16384) KQ_EV_EOF = getattr(__select__, 'KQ_EV_EOF', 32768) KQ_FILTER_READ = getattr(__select__, 'KQ_FILTER_READ', -1) KQ_FILTER_WRITE = getattr(__select__, 'KQ_FILTER_WRITE', -2) KQ_FILTER_AIO = getattr(__select__, 'KQ_FILTER_AIO', -3) KQ_FILTER_VNODE = getattr(__select__, 'KQ_FILTER_VNODE', -4) KQ_FILTER_PROC = getattr(__select__, 'KQ_FILTER_PROC', -5) KQ_FILTER_SIGNAL = getattr(__select__, 'KQ_FILTER_SIGNAL', -6) KQ_FILTER_TIMER = getattr(__select__, 'KQ_FILTER_TIMER', -7) KQ_NOTE_LOWAT = getattr(__select__, 'KQ_NOTE_LOWAT', 1) KQ_NOTE_DELETE = getattr(__select__, 'KQ_NOTE_DELETE', 1) KQ_NOTE_WRITE = getattr(__select__, 'KQ_NOTE_WRITE', 2) KQ_NOTE_EXTEND = getattr(__select__, 'KQ_NOTE_EXTEND', 4) KQ_NOTE_ATTRIB = getattr(__select__, 'KQ_NOTE_ATTRIB', 8) KQ_NOTE_LINK = getattr(__select__, 'KQ_NOTE_LINK', 16) KQ_NOTE_RENAME = getattr(__select__, 'KQ_NOTE_RENAME', 32) KQ_NOTE_REVOKE = getattr(__select__, 'KQ_NOTE_REVOKE', 64) POLLIN = getattr(__select__, 'POLLIN', 1) POLLOUT = getattr(__select__, 'POLLOUT', 4) POLLERR = getattr(__select__, 'POLLERR', 8) POLLHUP = getattr(__select__, 'POLLHUP', 16) POLLNVAL = getattr(__select__, 'POLLNVAL', 32) READ = POLL_READ = 0x001 WRITE = POLL_WRITE = 0x004 ERR = POLL_ERR = 0x008 | 0x010 try: SELECT_BAD_FD = {errno.EBADF, errno.WSAENOTSOCK} except AttributeError: SELECT_BAD_FD = {errno.EBADF} class _epoll: def __init__(self): self._epoll = epoll() def register(self, fd, events): try: self._epoll.register(fd, events) except Exception as exc: if getattr(exc, 'errno', None) != errno.EEXIST: raise return fd def unregister(self, fd): try: self._epoll.unregister(fd) except (OSError, ValueError, KeyError, TypeError): pass except OSError as exc: if getattr(exc, 'errno', None) not in (errno.ENOENT, errno.EPERM): raise def poll(self, timeout): try: return self._epoll.poll(timeout if timeout is not None else -1) except Exception as exc: if getattr(exc, 'errno', None) != errno.EINTR: raise def close(self): self._epoll.close() class _kqueue: w_fflags = (KQ_NOTE_WRITE | KQ_NOTE_EXTEND | KQ_NOTE_ATTRIB | KQ_NOTE_DELETE) def __init__(self): self._kqueue = kqueue() self._active = {} self.on_file_change = None self._kcontrol = self._kqueue.control def register(self, fd, events): self._control(fd, events, KQ_EV_ADD) self._active[fd] = events return fd def unregister(self, fd): events = self._active.pop(fd, None) if events: try: self._control(fd, events, KQ_EV_DELETE) except OSError: pass def watch_file(self, fd): ev = kevent(fd, filter=KQ_FILTER_VNODE, flags=KQ_EV_ADD | KQ_EV_ENABLE | KQ_EV_CLEAR, fflags=self.w_fflags) self._kcontrol([ev], 0) def unwatch_file(self, fd): ev = kevent(fd, filter=KQ_FILTER_VNODE, flags=KQ_EV_DELETE, fflags=self.w_fflags) self._kcontrol([ev], 0) def _control(self, fd, events, flags): if not events: return kevents = [] if events & WRITE: kevents.append(kevent(fd, filter=KQ_FILTER_WRITE, flags=flags)) if not kevents or events & READ: kevents.append( kevent(fd, filter=KQ_FILTER_READ, flags=flags), ) control = self._kcontrol for e in kevents: try: control([e], 0) except ValueError: pass def poll(self, timeout): try: kevents = self._kcontrol(None, 1000, timeout) except Exception as exc: if getattr(exc, 'errno', None) == errno.EINTR: return raise events, file_changes = {}, [] for k in kevents: fd = k.ident if k.filter == KQ_FILTER_READ: events[fd] = events.get(fd, 0) | READ elif k.filter == KQ_FILTER_WRITE: if k.flags & KQ_EV_EOF: events[fd] = ERR else: events[fd] = events.get(fd, 0) | WRITE elif k.filter == KQ_EV_ERROR: events[fd] = events.get(fd, 0) | ERR elif k.filter == KQ_FILTER_VNODE: if k.fflags & KQ_NOTE_DELETE: self.unregister(fd) file_changes.append(k) if file_changes: self.on_file_change(file_changes) return list(events.items()) def close(self): self._kqueue.close() class _poll: def __init__(self): self._poller = xpoll() self._quick_poll = self._poller.poll self._quick_register = self._poller.register self._quick_unregister = self._poller.unregister def register(self, fd, events): fd = fileno(fd) poll_flags = 0 if events & ERR: poll_flags |= POLLERR if events & WRITE: poll_flags |= POLLOUT if events & READ: poll_flags |= POLLIN self._quick_register(fd, poll_flags) return fd def unregister(self, fd): try: fd = fileno(fd) except OSError as exc: # we don't know the previous fd of this object # but it will be removed by the next poll iteration. if getattr(exc, 'errno', None) in SELECT_BAD_FD: return fd raise self._quick_unregister(fd) return fd def poll(self, timeout, round=math.ceil, POLLIN=POLLIN, POLLOUT=POLLOUT, POLLERR=POLLERR, READ=READ, WRITE=WRITE, ERR=ERR, Integral=Integral): timeout = 0 if timeout and timeout < 0 else round((timeout or 0) * 1e3) try: event_list = self._quick_poll(timeout) except (_selecterr, OSError) as exc: if getattr(exc, 'errno', None) == errno.EINTR: return raise ready = [] for fd, event in event_list: events = 0 if event & POLLIN: events |= READ if event & POLLOUT: events |= WRITE if event & POLLERR or event & POLLNVAL or event & POLLHUP: events |= ERR assert events if not isinstance(fd, Integral): fd = fd.fileno() ready.append((fd, events)) return ready def close(self): self._poller = None class _select: def __init__(self): self._all = (self._rfd, self._wfd, self._efd) = set(), set(), set() def register(self, fd, events): fd = fileno(fd) if events & ERR: self._efd.add(fd) if events & WRITE: self._wfd.add(fd) if events & READ: self._rfd.add(fd) return fd def _remove_bad(self): for fd in self._rfd | self._wfd | self._efd: try: _selectf([fd], [], [], 0) except (_selecterr, OSError) as exc: if getattr(exc, 'errno', None) in SELECT_BAD_FD: self.unregister(fd) def unregister(self, fd): try: fd = fileno(fd) except OSError as exc: # we don't know the previous fd of this object # but it will be removed by the next poll iteration. if getattr(exc, 'errno', None) in SELECT_BAD_FD: return raise self._rfd.discard(fd) self._wfd.discard(fd) self._efd.discard(fd) def poll(self, timeout): try: read, write, error = _selectf( self._rfd, self._wfd, self._efd, timeout, ) except (_selecterr, OSError) as exc: if getattr(exc, 'errno', None) == errno.EINTR: return elif getattr(exc, 'errno', None) in SELECT_BAD_FD: return self._remove_bad() raise events = {} for fd in read: if not isinstance(fd, Integral): fd = fd.fileno() events[fd] = events.get(fd, 0) | READ for fd in write: if not isinstance(fd, Integral): fd = fd.fileno() events[fd] = events.get(fd, 0) | WRITE for fd in error: if not isinstance(fd, Integral): fd = fd.fileno() events[fd] = events.get(fd, 0) | ERR return list(events.items()) def close(self): self._rfd.clear() self._wfd.clear() self._efd.clear() def _get_poller(): if detect_environment() != 'default': # greenlet return _select elif epoll: # Py2.6+ Linux return _epoll elif kqueue and 'netbsd' in sys.platform: return _kqueue elif xpoll: return _poll else: return _select def poll(*args, **kwargs): """Create new poller instance.""" return _get_poller()(*args, **kwargs)
bsd-3-clause
1475207466ba95520429429d238cbb4c
29.878419
79
0.525642
3.680797
false
false
false
false
celery/kombu
kombu/matcher.py
1
4269
"""Pattern matching registry.""" from __future__ import annotations from fnmatch import fnmatch from re import match as rematch from typing import Callable, cast from .utils.compat import entrypoints from .utils.encoding import bytes_to_str MatcherFunction = Callable[[str, str], bool] class MatcherNotInstalled(Exception): """Matcher not installed/found.""" class MatcherRegistry: """Pattern matching function registry.""" MatcherNotInstalled = MatcherNotInstalled matcher_pattern_first = ["pcre", ] def __init__(self) -> None: self._matchers: dict[str, MatcherFunction] = {} self._default_matcher: MatcherFunction | None = None def register(self, name: str, matcher: MatcherFunction) -> None: """Add matcher by name to the registry.""" self._matchers[name] = matcher def unregister(self, name: str) -> None: """Remove matcher by name from the registry.""" try: self._matchers.pop(name) except KeyError: raise self.MatcherNotInstalled( f'No matcher installed for {name}' ) def _set_default_matcher(self, name: str) -> None: """Set the default matching method. :param name: The name of the registered matching method. For example, `glob` (default), `pcre`, or any custom methods registered using :meth:`register`. :raises MatcherNotInstalled: If the matching method requested is not available. """ try: self._default_matcher = self._matchers[name] except KeyError: raise self.MatcherNotInstalled( f'No matcher installed for {name}' ) def match( self, data: bytes, pattern: bytes, matcher: str | None = None, matcher_kwargs: dict[str, str] | None = None ) -> bool: """Call the matcher.""" if matcher and not self._matchers.get(matcher): raise self.MatcherNotInstalled( f'No matcher installed for {matcher}' ) match_func = self._matchers[matcher or 'glob'] if matcher in self.matcher_pattern_first: first_arg = bytes_to_str(pattern) second_arg = bytes_to_str(data) else: first_arg = bytes_to_str(data) second_arg = bytes_to_str(pattern) return match_func(first_arg, second_arg, **matcher_kwargs or {}) #: Global registry of matchers. registry = MatcherRegistry() """ .. function:: match(data, pattern, matcher=default_matcher, matcher_kwargs=None): Match `data` by `pattern` using `matcher`. :param data: The data that should be matched. Must be string. :param pattern: The pattern that should be applied. Must be string. :keyword matcher: An optional string representing the mathcing method (for example, `glob` or `pcre`). If :const:`None` (default), then `glob` will be used. :keyword matcher_kwargs: Additional keyword arguments that will be passed to the specified `matcher`. :returns: :const:`True` if `data` matches pattern, :const:`False` otherwise. :raises MatcherNotInstalled: If the matching method requested is not available. """ match = registry.match """ .. function:: register(name, matcher): Register a new matching method. :param name: A convenient name for the mathing method. :param matcher: A method that will be passed data and pattern. """ register = registry.register """ .. function:: unregister(name): Unregister registered matching method. :param name: Registered matching method name. """ unregister = registry.unregister def register_glob() -> None: """Register glob into default registry.""" registry.register('glob', fnmatch) def register_pcre() -> None: """Register pcre into default registry.""" registry.register('pcre', cast(MatcherFunction, rematch)) # Register the base matching methods. register_glob() register_pcre() # Default matching method is 'glob' registry._set_default_matcher('glob') # Load entrypoints from installed extensions for ep, args in entrypoints('kombu.matchers'): register(ep.name, *args)
bsd-3-clause
994338b119838dab5a10579e2cb0e779
28.645833
77
0.6409
4.222552
false
false
false
false
dials/dials
tests/algorithms/refinement/test_reflection_manager.py
1
1688
from __future__ import annotations import math import pytest from dxtbx.model.experiment_list import ExperimentListFactory from dials.algorithms.refinement.reflection_manager import ReflectionManager from dials.array_family import flex def test_scan_margin(dials_data): # Use 4 scan data for this test data_dir = dials_data("l_cysteine_dials_output", pathlib=True) experiments = ExperimentListFactory.from_json_file( data_dir / "indexed.expt", check_format=False ) reflections = flex.reflection_table.from_file(data_dir / "indexed.refl") orig_phi = reflections["xyzobs.mm.value"].parts()[2] # Reflection Manager works on predictions, but this dataset has none, so # need to set the predictions flag reflections.set_flags( flex.bool(len(reflections), True), reflections.flags.predicted ) # Create a reflection manager without trimming scan margins refman = ReflectionManager(reflections, experiments) refman.finalise() refs1 = refman.get_matches() phi1 = refs1["xyzobs.mm.value"].parts()[2] # Create a reflection manager with 1 degree width scan margins margin = 1.0 refman2 = ReflectionManager(reflections, experiments, scan_margin=margin) refman2.finalise() refs2 = refman2.get_matches() phi2 = refs2["xyzobs.mm.value"].parts()[2] # Check zero scan margins do not trim assert min(orig_phi) == min(phi1) assert max(orig_phi) == max(phi1) # Check 1 degree scan margin trims approximately 1 degree assert min(phi2) == pytest.approx(min(phi1) + math.radians(margin), abs=1e-3) assert max(phi2) == pytest.approx(max(phi1) - math.radians(margin), abs=1e-3)
bsd-3-clause
7de3f777236a571fef3cc7a6eacb72c0
34.166667
81
0.711493
3.444898
false
true
false
false
dials/dials
src/dials/algorithms/spot_finding/spot_matcher.py
1
4097
from __future__ import annotations from scitbx.array_family import flex class SpotMatcher: """Match the observed with predicted spots.""" def __init__(self, max_separation=2): """ Setup the algorithm :param max_separation: Max pixel dist between predicted and observed spot """ # Set the algorithm parameters self._max_separation = max_separation def __call__(self, observed, predicted): """ Match the observed reflections with the predicted. :param observed: The list of observed reflections. :param predicted: The list of predicted reflections. :returns: The list of matched reflections """ from dials.array_family import flex # Find the nearest neighbours and distances nn, dist = self._find_nearest_neighbours(observed, predicted) # Filter the matches by distance index = self._filter_by_distance(nn, dist) # Filter out duplicates to just leave the closest pairs index = self._filter_duplicates(index, nn, dist) # Copy all of the reflection data for the matched reflections return flex.size_t(index), flex.size_t([nn[i] for i in index]) def _find_nearest_neighbours(self, observed, predicted): """ Find the nearest predicted spot to the observed spot. :param observed: The observed reflections :param predicted: The predicted reflections :returns: (nearest neighbours, distance) """ # Get the predicted coordinates predicted_panel = predicted["panel"] predicted_xyz = predicted["xyzcal.px"] observed_panel = observed["panel"] observed_xyz = observed["xyzobs.px.value"] # Get the number of panels max_panel1 = flex.max(predicted_panel) max_panel2 = flex.max(observed_panel) max_panel = max([max_panel1, max_panel2]) nn_all = flex.size_t() dd_all = flex.double() for panel in range(max_panel + 1): pind = predicted_panel == panel oind = observed_panel == panel pxyz = predicted_xyz.select(pind) oxyz = observed_xyz.select(oind) nn, d = self._find_nearest_neighbours_single(oxyz, pxyz) indices = flex.size_t(range(len(pind))).select(pind) indices = indices.select(flex.size_t(list(nn))) nn_all.extend(indices) dd_all.extend(d) return nn_all, dd_all def _find_nearest_neighbours_single(self, oxyz, pxyz): """ Find the nearest predicted spot to the observed spot. :param observed: The observed reflections :param predicted: The predicted reflections :returns: (nearest neighbours, distance) """ from annlib_ext import AnnAdaptor # Create the KD Tree ann = AnnAdaptor(pxyz.as_double().as_1d(), 3) # Query to find all the nearest neighbours ann.query(oxyz.as_double().as_1d()) # Return the nearest neighbours and distances return ann.nn, flex.sqrt(ann.distances) def _filter_by_distance(self, nn, dist): """ Filter the matches by distance. :param nn: The nearest neighbour list :param dist: The distances :returns: A reduced list of nearest neighbours """ index = range(len(nn)) return flex.int(i for i in index if dist[i] <= self._max_separation) def _filter_duplicates(self, index, nn, dist): """ Filter the matches to remove duplicates :param index: The indices of valid spots :param nn: The nearest neighbour indices :param dist: The distances :returns: A reduced list of nearest neighbours """ seen = {} for i in index: p = nn[i] if p in seen: j = seen[p] if dist[i] < dist[j]: seen[p] = i else: seen[p] = i index = list(seen.values()) return index
bsd-3-clause
77da54849ed5b7aea6ec11696c2db7d3
31.007813
81
0.594337
4.138384
false
false
false
false
douban/dpark
dpark/utils/nested_groupby.py
1
4969
import weakref import sys from collections import deque from dpark.utils.log import get_logger logger = get_logger(__name__) if sys.version_info[0] < 3: def next_func(it): return it.next else: def next_func(it): return it.__next__ def list_value(x): return x[0], list(x[1]) def list_nested_group(it): return list(map(list_value, it)) def list_values(x): return x[0], tuple(map(list, x[1])) def list_nested_cogroup(it): return list(map(list_values, it)) def group_by_simple(it): key = None values = [] i = -1 for i, (k, vs) in enumerate(it): if i == 0: key = k values = list(vs) elif k == key: values.extend(vs) else: yield key, values key = k values = list(vs) if i >= 0: yield key, values class GroupBySubIter(object): def __init__(self, key, next_block_func): self._key = key self._next_block_func = next_block_func self._blocks = None self._finished = False def __iter__(self): next_block_func = self._next_block_func key = self._key while True: if self._blocks is not None: if self._blocks: v = self._blocks.popleft() else: break else: kv = next_block_func(key) if kv is None: break v = kv[1] it = iter(v) try: for i in it: yield i except StopIteration: pass self._finished = True def get_all_blocks(self): if self._finished: return False key = self._key next_block_func = self._next_block_func blocks = self._blocks = deque() while True: kv = next_block_func(key) if kv is None: break blocks.append(kv[1]) self._finished = True return len(blocks) # def __del__(self): # print('(Deleting %s)' % self) class GroupByNestedIter(object): NO_CACHE = False def __init__(self, it, owner_info=None): self._it = iter(it) self._prev_key = None self._prev_sub_it = None self._next_block = None self.owner_info = owner_info self.is_cached = False def _next_block_for_key(self, k): """return None when meet a diff key or the end else return and then update _next_block """ if self._next_block is None: # start/end try: self._next_block = next(self._it) except StopIteration: return k_, v_ = self._next_block if k == k_: try: self._next_block = next(self._it) except StopIteration: self._next_block = None pass return k_, v_ else: return def _next_key(self, key): while self._next_block_for_key(key) is not None: pass def __iter__(self): return self def __next__(self): if self._prev_key is not None: prev_sub_it = self._prev_sub_it() if prev_sub_it is not None: if prev_sub_it.get_all_blocks() and not self.is_cached: self.is_cached = True msg = "GroupByNestedIter caching values. owner: %s" % (self.owner_info,) if GroupByNestedIter.NO_CACHE: # for test raise Exception(msg) else: logger.warning(msg) self._next_key(self._prev_key) if self._next_block is None: raise StopIteration key = self._next_block[0] sub_it = GroupBySubIter(key, self._next_block_for_key) self._prev_key, self._prev_sub_it = key, weakref.ref(sub_it) return key, iter(sub_it) next = __next__ def cogroup_no_dup(iters): iters = list(map(iter, iters)) funcs = [next_func(it) for it in iters] curr = [[[None], i] for i, f in enumerate(funcs)] def _key(x): return x[0][0] n = len(iters) l0 = list([[] for _ in range(n)]) r = 0 while n: if r == 0: min_ = None else: min_ = min(curr, key=_key)[0][0] t = list(l0) for j, (kv, i) in enumerate(curr): if kv[0] == min_: t[i] = kv[1] yield min_, tuple(t) to_del = [] for j, (kv, i) in enumerate(curr): if kv[0] == min_: try: curr[j] = [funcs[i](), i] except StopIteration: to_del.append(j) n -= 1 for j, i in enumerate(to_del): del curr[i - j] r += 1
bsd-3-clause
2f4a43d64a361066b1abb97c81adad15
24.22335
92
0.472731
3.784463
false
false
false
false
douban/dpark
dpark/conf.py
1
4054
from __future__ import absolute_import import os from dpark.utils.log import get_logger # override configs use python file at path given by env var $DPARK_CONF, see the end of this file logger = get_logger(__name__) # workdir used in slaves for internal files # DPARK_WORK_DIR = '/tmp/dpark' if os.path.exists('/dev/shm'): DPARK_WORK_DIR = '/dev/shm,/tmp/dpark' # uri of mesos master, host[:5050] or or zk://... MESOS_MASTER = 'localhost' MESOS_MASTERS = {} # used for mrun, allow it to get all resources quickly, maybe more than a fair share. MESOS_MPI_ROLE = "mpi" # mount points of MooseFS, must be available on all slaves # for example: '/mfs' : 'mfsmaster', MOOSEFS_MOUNT_POINTS = { } # dup log to path lick $LOGHUB/$LOGHUB_PATH_FORMAT/$FRAMEWORK_ID/log # $LOGHUB/$LOGHUB_PATH_FORMAT should exists before run LOGHUB = None LOGHUB_PATH_FORMAT = "%Y/%m/%d/%H" ENABLE_ES_LOGHUB = False ES_HOST = None ES_INDEX = None ES_TYPE = None # consistant dir cache in client, need patched mfsmaster MOOSEFS_DIR_CACHE = False # memory used per task, like -M (--m) option in context. MEM_PER_TASK = 200.0 MAX_OPEN_FILE = 900 LOG_ROTATE = True MULTI_SEGMENT_DUMP = True TIME_TO_SUPPRESS = 60 # sec OP_UDF = "udf" OP_GROUPBY = "groupby" OP_COGROUP = "cogroup" DEFAULT_TASK_TIME = 3600 # 1 hour _named_only_start = object() class RDDConf(object): # use default_rddconf to set default values, do NOT change ATTRS ATTRS = { "disk_merge": False, "sort_merge": False, "iter_group": False, "ordered_group": False, "dump_mem_ratio": 0.9, "op": OP_UDF, "_dummy": _named_only_start, } def __init__(self, _dummy, disk_merge, sort_merge, iter_group, ordered_group, dump_mem_ratio, op): if _dummy != _named_only_start: raise TypeError("DO NOT use RDDConf directly; use dpark.conf.rddconf() instead. ") self.disk_merge = disk_merge self.sort_merge = sort_merge self.iter_group = iter_group self.ordered_group = ordered_group self.dump_mem_ratio = dump_mem_ratio self.op = op def __setattr__(self, name, value): if name not in self.ATTRS: msg = "'RDDConf' object has no attribute '{}'. Valid attrs: {}".format(name, self.to_dict().keys()) raise AttributeError(msg) object.__setattr__(self, name, value) def to_dict(self): d = dict(self.__dict__) return d def __repr__(self): return "RDDConf_%r" % (self.to_dict()) def dup(self, **kwargs): res = RDDConf(_named_only_start, **self.__dict__) for k, v in kwargs.items(): res.__setattr__(k, v) return res @property def is_cogroup(self): return self.op == OP_COGROUP @property def is_groupby(self): return self.op == OP_GROUPBY default_rddconf = RDDConf(**RDDConf.ATTRS) # for user _rdd = default_rddconf # for etc def rddconf(_dummy=_named_only_start, disk_merge=None, sort_merge=None, iter_group=False, ordered_group=None, dump_mem_ratio=None, op=OP_UDF): """ Return new RDDConfig object based on default values. Only takes named arguments. e.g. groupByKey(.., rddconf=dpark.conf.rddconf(...)) """ if _dummy != _named_only_start: raise TypeError("rddconf() only takes named arguments") kwargs = locals() kwargs.pop("_dummy") kwargs = dict([kv for kv in kwargs.items() if kv[1] is not None]) res = default_rddconf.dup(**kwargs) return res def ban(hostname): return False def load_conf(path): if not os.path.exists(path): logger.warning("conf %s do not exists, use default config", path) return try: with open(path) as f: data = f.read() exec(data, globals(), globals()) except Exception as e: logger.error("error while load conf from %s: %s", path, e) raise load_conf(os.environ.get('DPARK_CONF', '/etc/dpark.conf'))
bsd-3-clause
78d6a1f428ecc0a92f3f979d317c6bdc
26.026667
111
0.617662
3.258842
false
false
false
false
dials/dials
src/dials/command_line/find_spots_server.py
1
13148
from __future__ import annotations import http.server as server_base import json import logging import multiprocessing import sys import time import urllib.parse import libtbx.phil from cctbx import uctbx from dxtbx.model.experiment_list import ExperimentListFactory from libtbx.introspection import number_of_processors from dials.algorithms.indexing import indexer from dials.algorithms.integration.integrator import create_integrator from dials.algorithms.profile_model.factory import ProfileModelFactory from dials.algorithms.spot_finding import per_image_analysis from dials.array_family import flex from dials.command_line.find_spots import phil_scope as find_spots_phil_scope from dials.command_line.index import phil_scope as index_phil_scope from dials.command_line.integrate import phil_scope as integrate_phil_scope from dials.util import Sorry, show_mail_handle_errors from dials.util.options import ArgumentParser logger = logging.getLogger("dials.command_line.find_spots_server") help_message = """\ A client/server version of dials.find_spots with additional analysis including estimation of resolution limits. Intended for quick feedback of image quality during grid scans and data collections. On the server machine:: dials.find_spots_server [nproc=8] [port=1234] On the client machine:: dials.find_spots_client [host=hostname] [port=1234] [nproc=8] /path/to/image.cbf The client will return a short xml string indicating the number of spots found and several estimates of the resolution limit. e.g.:: <response> <image>/path/to/image_0001.cbf</image> <spot_count>352</spot_count> <spot_count_no_ice>263</spot_count_no_ice> <d_min>1.46</d_min> <d_min_method_1>1.92</d_min_method_1> <d_min_method_2>1.68</d_min_method_2> <total_intensity>56215</total_intensity> </response> * ``spot_count`` is the total number of spots found in given image * ``spot_count_no_ice`` is the number of spots found excluding those at resolutions where ice rings may be found * ``d_min_method_1`` is equivalent to distl's resolution estimate method 1 * ``d_min_method_2`` is equivalent to distl's resolution estimate method 2 * ``total_intensity`` is the total intensity of all strong spots excluding those at resolutions where ice rings may be found Any valid ``dials.find_spots`` parameter may be passed to ``dials.find_spots_client``, e.g.:: dials.find_spots_client /path/to/image.cbf min_spot_size=2 d_min=2 To stop the server:: dials.find_spots_client stop [host=hostname] [port=1234] """ stop = False def _filter_by_resolution(experiments, reflections, d_min=None, d_max=None): reflections.centroid_px_to_mm(experiments) reflections.map_centroids_to_reciprocal_space(experiments) d_star_sq = flex.pow2(reflections["rlp"].norms()) reflections["d"] = uctbx.d_star_sq_as_d(d_star_sq) # Filter based on resolution if d_min is not None: selection = reflections["d"] >= d_min reflections = reflections.select(selection) logger.debug(f"Selected {len(reflections)} reflections with d >= {d_min:f}") # Filter based on resolution if d_max is not None: selection = reflections["d"] <= d_max reflections = reflections.select(selection) logger.debug(f"Selected {len(reflections)} reflections with d <= {d_max:f}") return reflections def work(filename, cl=None): if cl is None: cl = [] phil_scope = libtbx.phil.parse( """\ ice_rings { filter = True .type = bool width = 0.004 .type = float(value_min=0.0) } index = False .type = bool integrate = False .type = bool indexing_min_spots = 10 .type = int(value_min=1) """ ) interp = phil_scope.command_line_argument_interpreter() params, unhandled = interp.process_and_fetch( cl, custom_processor="collect_remaining" ) filter_ice = params.extract().ice_rings.filter ice_rings_width = params.extract().ice_rings.width index = params.extract().index integrate = params.extract().integrate indexing_min_spots = params.extract().indexing_min_spots interp = find_spots_phil_scope.command_line_argument_interpreter() phil_scope, unhandled = interp.process_and_fetch( unhandled, custom_processor="collect_remaining" ) logger.info("The following spotfinding parameters have been modified:") logger.info(find_spots_phil_scope.fetch_diff(source=phil_scope).as_str()) params = phil_scope.extract() # no need to write the hot mask in the server/client params.spotfinder.write_hot_mask = False experiments = ExperimentListFactory.from_filenames([filename]) if params.spotfinder.scan_range and len(experiments) > 1: # This means we've imported a sequence of still image: select # only the experiment, i.e. image, we're interested in ((start, end),) = params.spotfinder.scan_range experiments = experiments[start - 1 : end] # Avoid overhead of calculating per-pixel resolution masks in spotfinding # and instead perform post-filtering of spot centroids by resolution d_min = params.spotfinder.filter.d_min d_max = params.spotfinder.filter.d_max params.spotfinder.filter.d_min = None params.spotfinder.filter.d_max = None t0 = time.perf_counter() reflections = flex.reflection_table.from_observations(experiments, params) if d_min or d_max: reflections = _filter_by_resolution( experiments, reflections, d_min=d_min, d_max=d_max ) t1 = time.perf_counter() logger.info("Spotfinding took %.2f seconds", t1 - t0) imageset = experiments.imagesets()[0] reflections.centroid_px_to_mm(experiments) reflections.map_centroids_to_reciprocal_space(experiments) stats = per_image_analysis.stats_for_reflection_table( reflections, filter_ice=filter_ice, ice_rings_width=ice_rings_width )._asdict() t2 = time.perf_counter() logger.info("Resolution analysis took %.2f seconds", t2 - t1) if index and stats["n_spots_no_ice"] > indexing_min_spots: logging.basicConfig(stream=sys.stdout, level=logging.INFO) interp = index_phil_scope.command_line_argument_interpreter() phil_scope, unhandled = interp.process_and_fetch( unhandled, custom_processor="collect_remaining" ) logger.info("The following indexing parameters have been modified:") index_phil_scope.fetch_diff(source=phil_scope).show() params = phil_scope.extract() if ( imageset.get_goniometer() is not None and imageset.get_scan() is not None and imageset.get_scan().is_still() ): imageset.set_goniometer(None) imageset.set_scan(None) try: idxr = indexer.Indexer.from_parameters( reflections, experiments, params=params ) indexing_results = [] idxr.index() indexed_sel = idxr.refined_reflections.get_flags( idxr.refined_reflections.flags.indexed ) indexed_sel &= ~( idxr.refined_reflections.get_flags( idxr.refined_reflections.flags.centroid_outlier ) ) for i_expt, expt in enumerate(idxr.refined_experiments): sel = idxr.refined_reflections["id"] == i_expt sel &= indexed_sel indexing_results.append( { "crystal": expt.crystal.to_dict(), "n_indexed": sel.count(True), "fraction_indexed": sel.count(True) / sel.size(), } ) stats["lattices"] = indexing_results stats["n_indexed"] = indexed_sel.count(True) stats["fraction_indexed"] = indexed_sel.count(True) / len(reflections) except Exception as e: logger.error(e) stats["error"] = str(e) finally: t3 = time.perf_counter() logger.info("Indexing took %.2f seconds", t3 - t2) if integrate and "lattices" in stats: interp = integrate_phil_scope.command_line_argument_interpreter() phil_scope, unhandled = interp.process_and_fetch( unhandled, custom_processor="collect_remaining" ) logger.error("The following integration parameters have been modified:") integrate_phil_scope.fetch_diff(source=phil_scope).show() params = phil_scope.extract() try: params.profile.gaussian_rs.min_spots = 0 experiments = idxr.refined_experiments reference = idxr.refined_reflections predicted = flex.reflection_table.from_predictions_multi( experiments, dmin=params.prediction.d_min, dmax=params.prediction.d_max, margin=params.prediction.margin, force_static=params.prediction.force_static, ) matched, reference, unmatched = predicted.match_with_reference( reference ) assert len(matched) == len(predicted) assert matched.count(True) <= len(reference) if matched.count(True) == 0: raise Sorry( """ Invalid input for reference reflections. Zero reference spots were matched to predictions """ ) elif matched.count(True) != len(reference): logger.info("") logger.info("*" * 80) logger.info( "Warning: %d reference spots were not matched to predictions", len(reference) - matched.count(True), ) logger.info("*" * 80) logger.info("") # Compute the profile model experiments = ProfileModelFactory.create(params, experiments, reference) # Compute the bounding box predicted.compute_bbox(experiments) # Create the integrator integrator = create_integrator(params, experiments, predicted) # Integrate the reflections reflections = integrator.integrate() # print len(reflections) stats["integrated_intensity"] = flex.sum( reflections["intensity.sum.value"] ) except Exception as e: logger.error(e) stats["error"] = str(e) finally: t4 = time.perf_counter() logger.info("Integration took %.2f seconds", t4 - t3) return stats class handler(server_base.BaseHTTPRequestHandler): def do_GET(self): """Respond to a GET request.""" if self.path == "/Ctrl-C": self.send_response(200) self.end_headers() global stop stop = True return filename = self.path.split(";")[0] params = self.path.split(";")[1:] # If we're passing a url through, then unquote and ignore leading / if "%3A//" in filename: filename = urllib.parse.unquote(filename[1:]) d = {"image": filename} try: stats = work(filename, params) d.update(stats) response = 200 except Exception as e: d["error"] = str(e) response = 500 self.send_response(response) self.send_header("Content-type", "application/json") self.end_headers() response = json.dumps(d).encode() self.wfile.write(response) def serve(httpd): try: while not stop: httpd.handle_request() except KeyboardInterrupt: pass phil_scope = libtbx.phil.parse( """\ nproc = Auto .type = int(value_min=1) port = 1701 .type = int(value_min=1) """ ) def main(nproc, port): server_class = server_base.HTTPServer httpd = server_class(("", port), handler) print(time.asctime(), "Serving %d processes on port %d" % (nproc, port)) for j in range(nproc - 1): proc = multiprocessing.Process(target=serve, args=(httpd,)) proc.daemon = True proc.start() serve(httpd) httpd.server_close() print(time.asctime(), "done") @show_mail_handle_errors() def run(args=None): usage = "dials.find_spots_server [options]" # Python 3.8 on macOS... needs fork if sys.hexversion >= 0x3080000 and sys.platform == "darwin": multiprocessing.set_start_method("fork") parser = ArgumentParser(usage=usage, phil=phil_scope, epilog=help_message) params, options = parser.parse_args(args, show_diff_phil=True) if params.nproc is libtbx.Auto: params.nproc = number_of_processors(return_value_if_unknown=-1) main(params.nproc, params.port) if __name__ == "__main__": run()
bsd-3-clause
7b160682d9a70730caa694165689cd8b
33.691293
88
0.620322
3.817654
false
false
false
false
dials/dials
src/dials/algorithms/refinement/weighting_strategies.py
1
3665
"""Contains classes used to provide weighting schemes as strategies for ReflectionManagers.""" from __future__ import annotations from dials.algorithms.refinement import DialsRefineConfigError from dials.array_family import flex class StatisticalWeightingStrategy: """Defines a single method that provides a ReflectionManager with a strategy for calculating weights for refinement""" @staticmethod def calculate_weights(reflections): """set 'statistical weights', that is w(x) = 1/var(x)""" weights = (reflections["xyzobs.mm.variance"]).deep_copy() parts = weights.parts() for w in parts: sel = w > 0.0 w.set_selected(sel, 1.0 / w.select(sel)) reflections["xyzobs.mm.weights"] = flex.vec3_double(*parts) indexed = reflections.select(reflections.get_flags(reflections.flags.indexed)) if any(indexed["xyzobs.mm.weights"].norms() == 0.0): raise DialsRefineConfigError( "Cannot set statistical weights as some indexed reflections have observed variances equal to zero" ) return reflections class StillsWeightingStrategy(StatisticalWeightingStrategy): """Defines a single method that provides a ReflectionManager with a strategy for calculating weights for refinement. This version uses statistical weights for X and Y and a fixed constant for the delta Psi part, defaulting to 1000000""" def __init__(self, delpsi_constant=1000000): self._delpsi_constant = delpsi_constant def calculate_weights(self, reflections): """Include weights for DeltaPsi""" # call parent class method to set X and Y weights reflections = super().calculate_weights(reflections) reflections["delpsical.weights"] = flex.double( len(reflections), self._delpsi_constant ) return reflections class ExternalDelPsiWeightingStrategy(StatisticalWeightingStrategy): """Defines a single method that provides a ReflectionManager with a strategy for calculating weights for stills refinement. This version uses statistical weights for X and Y and assume that the Delta Psi part is already provided in the reflection table""" def calculate_weights(self, reflections): """Statistical weights for X, Y. Weights for DeltaPsi must be already provided in the reflection table""" # call parent class method to set X and Y weights reflections = super().calculate_weights(reflections) if "delpsical.weights" not in reflections: raise DialsRefineConfigError( 'The key "delpsical.weights" is expected within the input reflections' ) return reflections class ConstantWeightingStrategy: def __init__(self, wx, wy, wz, stills=False): self._wx = wx self._wy = wy self._wz = wz self._stills = stills def calculate_weights(self, reflections): """Set weights to constant terms. If stills, the z weights are the 'delpsical.weights' attribute of the reflection table. Otherwise, use the usual 'xyzobs.mm.weights'""" wx = flex.double(len(reflections), self._wx) wy = flex.double(len(reflections), self._wy) wz = flex.double(len(reflections), self._wz) if self._stills: null = flex.double(len(reflections), 0) reflections["xyzobs.mm.weights"] = flex.vec3_double(wx, wy, null) reflections["delpsical.weights"] = wz else: reflections["xyzobs.mm.weights"] = flex.vec3_double(wx, wy, wz) return reflections
bsd-3-clause
ec7cc8500b82896d2d010b811ab7c3b4
36.397959
114
0.670668
4.081292
false
false
false
false
dials/dials
src/dials/algorithms/symmetry/cosym/engine.py
1
4472
"""LBFGS refinement engine for cosym analysis.""" from __future__ import annotations import logging import scipy.optimize import scitbx.lbfgs from scitbx.array_family import flex logger = logging.getLogger(__name__) class lbfgs_with_curvs: """Minimise a target function using the LBFGS minimiser. Implementation of an LBFGS minimiser using curvature information, according to the interface defined by :mod:`scitbx.lbfgs`. """ def __init__(self, target, coords, use_curvatures=True, termination_params=None): """Initialise an lbfgs_with_curvs object. Args: target (dials.algorithms.target.Target): The target function to minimise. coords (np.ndarray): The starting coordinates for minimisation. use_curvatures (bool): Whether or not to use curvature information in the minimisation. Defaults to True. termination_params (scitbx.lbfgs.termination_parameters): Override the default termination parameters for the minimisation. """ self.target = target self.x = flex.double(coords) self.f = None self.g = None if use_curvatures: self.diag_mode = "always" else: self.diag_mode = None self.minimizer = scitbx.lbfgs.run( target_evaluator=self, termination_params=termination_params ) self.coords = self.x.as_numpy_array() def compute_functional_gradients_diag(self): """Compute the functional, gradients and diagonal. Returns: tuple: A tuple of the functional, gradients and diagonal, where the diagonal is the reciprocal of the curvatures. """ f, g, curvs = self.compute_functional_gradients_and_curvatures() # Curvatures of zero will cause a crash, because their inverse is taken. assert curvs.all_gt(0.0) diags = 1.0 / curvs return f, g, diags def compute_functional_gradients_and_curvatures(self): """Compute the functional, gradients and curvatures. Returns: tuple: A tuple of the functional, gradients and curvatures. """ x = self.x.as_numpy_array() self.f = self.target.compute_functional(x) self.g = self.target.compute_gradients(x) self.c = self.target.curvatures(x) return self.f, flex.double(self.g), flex.double(self.c) def compute_functional_and_gradients(self): """Compute the functional and gradients. Returns: tuple: A tuple of the functional and gradients. """ x = self.x.as_numpy_array() self.f = self.target.compute_functional(x) self.g = self.target.compute_gradients(x) return self.f, flex.double(self.g) def callback_after_step(self, minimizer): """Log progress after each successful step of the minimisation.""" logger.debug("minimization step: f, iter, nfun:") logger.debug(f"{self.f} {minimizer.iter()} {minimizer.nfun()}") def minimize_scitbx_lbfgs( target, coords, use_curvatures=True, max_iterations=100, max_calls=None ): termination_params = scitbx.lbfgs.termination_parameters( max_iterations=max_iterations, max_calls=max_calls, traditional_convergence_test=True, traditional_convergence_test_eps=1, drop_convergence_test_n_test_points=5, drop_convergence_test_max_drop_eps=1.0e-5, drop_convergence_test_iteration_coefficient=2, ) result = lbfgs_with_curvs( target, coords, use_curvatures=use_curvatures, termination_params=termination_params, ) return scipy.optimize.OptimizeResult( fun=result.f, jac=result.g, x=result.coords, nfev=result.minimizer.nfun() ) def minimize_scipy( target, coords, method="L-BFGS-B", max_iterations=None, max_calls=None ): """Thin wrapper around scipy.optimize.minimize. Args: target (dials.algorithms.target.Target): The target function to minimise. coords (np.array): The starting coordinates for minimisation. """ options = {} if max_iterations: options.update(maxiter=max_iterations) if max_calls: options.update(maxfun=max_calls) return scipy.optimize.minimize( fun=target.compute_functional, x0=coords, jac=target.compute_gradients, method=method, options=options, )
bsd-3-clause
39007c3a871061f086f5c17b0d964eea
31.642336
85
0.647585
3.79949
false
false
false
false
douban/dpark
examples/cos_c.py
1
1184
from __future__ import absolute_import from __future__ import print_function import logging from context import SparkContext import gc gc.disable() spark = SparkContext() name = 'rating.txt' name = 'rating.txt.medium' name = 'rating.txt.large' def parse(line): try: sid, uid, r, f = line.split('\t') defaults = {'F': 4.5, 'P': 3.7, 'N': 4.0} if r == 'None': r = defaults.get(f, 0) return (int(sid), (int(uid), float(r))) except Exception: return (int(sid), (int(uid), 0)) rating = spark.textFile(name, numSplits=32).map(parse).groupByKey(16).filter(lambda x_y: len(x_y[1]) > 10) # .cache() # print 'us', rating.first() def convert(it): s = {} for k, us in it: for u, r in us: s.setdefault(k, {})[u] = r return s def cos(l1_l2): (l1, l2) = l1_l2 import map_sim r = map_sim.map_sim([], convert(l1), convert(l2), 10) for k in r: yield k, r[k] final = rating.glom().cartesion(rating.glom()).flatMap(cos) # print 'sim', final.first() final = final.reduceByKey(lambda x, y: x + y).mapValue(lambda x: sorted(x, reverse=True)[:5]) print('final', final.count())
bsd-3-clause
2037ba0c0311e073de89cd51108a7ef7
22.215686
118
0.583615
2.832536
false
false
false
false
llazzaro/django-scheduler
schedule/migrations/0003_auto_20160715_0028.py
2
1591
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("schedule", "0002_event_color_event")] operations = [ migrations.AlterField( model_name="event", name="end", field=models.DateTimeField( help_text="The end time must be later than the start time.", verbose_name="end", db_index=True, ), ), migrations.AlterField( model_name="event", name="end_recurring_period", field=models.DateTimeField( help_text="This date is ignored for one time only events.", null=True, verbose_name="end recurring period", db_index=True, blank=True, ), ), migrations.AlterField( model_name="event", name="start", field=models.DateTimeField(verbose_name="start", db_index=True), ), migrations.AlterField( model_name="occurrence", name="end", field=models.DateTimeField(verbose_name="end", db_index=True), ), migrations.AlterField( model_name="occurrence", name="start", field=models.DateTimeField(verbose_name="start", db_index=True), ), migrations.AlterIndexTogether(name="event", index_together={("start", "end")}), migrations.AlterIndexTogether( name="occurrence", index_together={("start", "end")} ), ]
bsd-3-clause
a5ab3572f92fab619243407298965dba
32.145833
87
0.529227
4.707101
false
false
false
false
divio/cmsplugin-filer
cmsplugin_filer_folder/cms_plugins.py
3
2503
from cms.plugin_pool import plugin_pool from cms.plugin_base import CMSPluginBase from django.template.loader import select_template from django.utils.translation import ugettext_lazy as _ from . import models from .conf import settings from filer.models.filemodels import File from filer.models.foldermodels import Folder from filer.models.abstract import BaseImage class FilerFolderPlugin(CMSPluginBase): module = 'Filer' model = models.FilerFolder name = _("Folder") TEMPLATE_NAME = 'cmsplugin_filer_folder/plugins/folder/%s.html' render_template = TEMPLATE_NAME % 'default' text_enabled = False admin_preview = False fieldsets = ( (None, {'fields': ['title', 'folder']}), ) if settings.CMSPLUGIN_FILER_FOLDER_STYLE_CHOICES: fieldsets[0][1]['fields'].append('style') def get_folder_files(self, folder, user): qs_files = folder.files.not_instance_of(BaseImage) if user.is_staff: return qs_files else: return qs_files.filter(is_public=True) def get_folder_images(self, folder, user): qs_files = folder.files.instance_of(BaseImage) if user.is_staff: return qs_files else: return qs_files.filter(is_public=True) def get_children(self, folder): return folder.get_children() def render(self, context, instance, placeholder): user = context['request'].user if instance.folder_id: folder_files = self.get_folder_files(instance.folder, user) folder_images = self.get_folder_images(instance.folder, user) folder_folders = self.get_children(instance.folder) else: folder_files = File.objects.none() folder_images = BaseImage.objects.none() folder_folders = Folder.objects.none() context.update({ 'object': instance, 'folder_files': sorted(folder_files), 'folder_images': sorted(folder_images), 'folder_folders': folder_folders, 'placeholder': placeholder }) return context def get_render_template(self, context, instance, placeholder): template = select_template(( 'cmsplugin_filer_folder/folder.html', # backwards compatibility. deprecated! self.TEMPLATE_NAME % instance.style, self.TEMPLATE_NAME % 'default', )) return template plugin_pool.register_plugin(FilerFolderPlugin)
bsd-3-clause
cd7a00012afb5533451e6912b0b556b7
32.373333
89
0.642429
4.056726
false
false
false
false
divio/cmsplugin-filer
cmsplugin_filer_image/models.py
3
5557
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext_lazy as _ from filer.fields.file import FilerFileField from filer.fields.image import FilerImageField from filer.models import ThumbnailOption # NOQA from filer.utils.compatibility import python_2_unicode_compatible from cms.models import CMSPlugin from cms.models.fields import PageField from cmsplugin_filer_utils import FilerPluginManager from djangocms_attributes_field.fields import AttributesField from .conf import settings @python_2_unicode_compatible class FilerImage(CMSPlugin): LEFT = "left" RIGHT = "right" CENTER = "center" FLOAT_CHOICES = ((LEFT, _("left")), (RIGHT, _("right")), (CENTER, _("center")), ) STYLE_CHOICES = settings.CMSPLUGIN_FILER_IMAGE_STYLE_CHOICES DEFAULT_STYLE = settings.CMSPLUGIN_FILER_IMAGE_DEFAULT_STYLE EXCLUDED_KEYS = ['class', 'href', 'target', ] style = models.CharField( _('Style'), choices=STYLE_CHOICES, default=DEFAULT_STYLE, max_length=50, blank=True) caption_text = models.CharField(_("caption text"), null=True, blank=True, max_length=255) image = FilerImageField( null=True, blank=True, default=None, verbose_name=_("image"), on_delete=models.SET_NULL, ) image_url = models.URLField(_("alternative image url"), null=True, blank=True, default=None) alt_text = models.CharField(_("alt text"), null=True, blank=True, max_length=255) use_original_image = models.BooleanField( _("use the original image"), default=False, help_text=_('do not resize the image. use the original image instead.')) thumbnail_option = models.ForeignKey( 'filer.ThumbnailOption', null=True, blank=True, verbose_name=_("thumbnail option"), help_text=_('overrides width, height, crop and upscale with values from the selected thumbnail option')) use_autoscale = models.BooleanField(_("use automatic scaling"), default=False, help_text=_('tries to auto scale the image based on the placeholder context')) width = models.PositiveIntegerField(_("width"), null=True, blank=True) height = models.PositiveIntegerField(_("height"), null=True, blank=True) crop = models.BooleanField(_("crop"), default=True) upscale = models.BooleanField(_("upscale"), default=True) alignment = models.CharField(_("image alignment"), max_length=10, blank=True, null=True, choices=FLOAT_CHOICES) free_link = models.CharField(_("link"), max_length=2000, blank=True, null=True, help_text=_("if present image will be clickable")) page_link = PageField(null=True, blank=True, help_text=_("if present image will be clickable"), verbose_name=_("page link")) file_link = FilerFileField( null=True, blank=True, default=None, verbose_name=_("file link"), help_text=_("if present image will be clickable"), related_name='+', on_delete=models.SET_NULL, ) original_link = models.BooleanField(_("link original image"), default=False, help_text=_("if present image will be clickable")) description = models.TextField(_("description"), blank=True, null=True) target_blank = models.BooleanField(_('Open link in new window'), default=False) link_attributes = AttributesField(excluded_keys=EXCLUDED_KEYS, blank=True, help_text=_('Optional. Adds HTML attributes to the rendered link.')) cmsplugin_ptr = models.OneToOneField( to=CMSPlugin, related_name='%(app_label)s_%(class)s', parent_link=True, ) # we only add the image to select_related. page_link and file_link are FKs # as well, but they are not used often enough to warrant the impact of two # additional LEFT OUTER JOINs. objects = FilerPluginManager(select_related=('image',)) class Meta: verbose_name = _("filer image") verbose_name_plural = _("filer images") def clean(self): from django.core.exceptions import ValidationError # Make sure that either image or image_url is set if (not self.image and not self.image_url) or (self.image and self.image_url): raise ValidationError(_('Either an image or an image url must be selected.')) def __str__(self): if self.image: return self.image.label else: return _("Image Publication %(caption)s") % {'caption': self.caption or self.alt} return '' @property def caption(self): if self.image: return self.caption_text or self.image.default_caption else: return self.caption_text @property def alt(self): if self.image: return self.alt_text or self.image.default_alt_text or self.image.label else: return self.alt_text @property def link(self): if self.free_link: return self.free_link elif self.page_link: return self.page_link.get_absolute_url() elif self.file_link: return self.file_link.url elif self.original_link: if self.image: return self.image.url else: return self.image_url else: return ''
bsd-3-clause
3273cecf537ec7f226c823c63317de0d
40.162963
118
0.627497
4.222644
false
false
false
false
divio/cmsplugin-filer
cmsplugin_filer_link/cms_plugins.py
3
1842
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.templatetags.static import static from django.utils.translation import ugettext as _ from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from .forms import FilerLinkForm from .models import FilerLinkPlugin as FilerLinkPluginModel class FilerLinkPlugin(CMSPluginBase): form = FilerLinkForm model = FilerLinkPluginModel module = 'Filer' name = _("Link") raw_id_fields = ('page_link', ) render_template = "cmsplugin_filer_link/link.html" text_enabled = True fieldsets = ( (None, { 'fields': [ 'name', 'url', 'page_link', 'mailto', 'file', 'link_style', 'new_window', ] }), (_('Advanced'), { 'classes': ['collapse', ], 'fields': [ 'link_attributes', ] }) ) def render(self, context, instance, placeholder): context = super(FilerLinkPlugin, self).render(context, instance, placeholder) if instance.file: link = instance.file.url elif instance.mailto: link = "mailto:%s" % _(instance.mailto) elif instance.url: link = _(instance.url) elif instance.page_link: link = instance.page_link.get_absolute_url() else: link = "" context.update({ 'link': link, 'style': instance.link_style, 'name': instance.name, 'new_window': instance.new_window, }) return context def icon_src(self, instance): return static("cms/img/icons/plugins/link.png") plugin_pool.register_plugin(FilerLinkPlugin)
bsd-3-clause
3b6bb9e5086fa46e195937cafe05be8d
26.492537
85
0.549403
4.148649
false
false
false
false
chromium/gyp
tools/pretty_gyp.py
9
4771
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Pretty-prints the contents of a GYP file.""" from __future__ import print_function import sys import re # Regex to remove comments when we're counting braces. COMMENT_RE = re.compile(r'\s*#.*') # Regex to remove quoted strings when we're counting braces. # It takes into account quoted quotes, and makes sure that the quotes match. # NOTE: It does not handle quotes that span more than one line, or # cases where an escaped quote is preceeded by an escaped backslash. QUOTE_RE_STR = r'(?P<q>[\'"])(.*?)(?<![^\\][\\])(?P=q)' QUOTE_RE = re.compile(QUOTE_RE_STR) def comment_replace(matchobj): return matchobj.group(1) + matchobj.group(2) + '#' * len(matchobj.group(3)) def mask_comments(input): """Mask the quoted strings so we skip braces inside quoted strings.""" search_re = re.compile(r'(.*?)(#)(.*)') return [search_re.sub(comment_replace, line) for line in input] def quote_replace(matchobj): return "%s%s%s%s" % (matchobj.group(1), matchobj.group(2), 'x'*len(matchobj.group(3)), matchobj.group(2)) def mask_quotes(input): """Mask the quoted strings so we skip braces inside quoted strings.""" search_re = re.compile(r'(.*?)' + QUOTE_RE_STR) return [search_re.sub(quote_replace, line) for line in input] def do_split(input, masked_input, search_re): output = [] mask_output = [] for (line, masked_line) in zip(input, masked_input): m = search_re.match(masked_line) while m: split = len(m.group(1)) line = line[:split] + r'\n' + line[split:] masked_line = masked_line[:split] + r'\n' + masked_line[split:] m = search_re.match(masked_line) output.extend(line.split(r'\n')) mask_output.extend(masked_line.split(r'\n')) return (output, mask_output) def split_double_braces(input): """Masks out the quotes and comments, and then splits appropriate lines (lines that matche the double_*_brace re's above) before indenting them below. These are used to split lines which have multiple braces on them, so that the indentation looks prettier when all laid out (e.g. closing braces make a nice diagonal line). """ double_open_brace_re = re.compile(r'(.*?[\[\{\(,])(\s*)([\[\{\(])') double_close_brace_re = re.compile(r'(.*?[\]\}\)],?)(\s*)([\]\}\)])') masked_input = mask_quotes(input) masked_input = mask_comments(masked_input) (output, mask_output) = do_split(input, masked_input, double_open_brace_re) (output, mask_output) = do_split(output, mask_output, double_close_brace_re) return output def count_braces(line): """keeps track of the number of braces on a given line and returns the result. It starts at zero and subtracts for closed braces, and adds for open braces. """ open_braces = ['[', '(', '{'] close_braces = [']', ')', '}'] closing_prefix_re = re.compile(r'(.*?[^\s\]\}\)]+.*?)([\]\}\)],?)\s*$') cnt = 0 stripline = COMMENT_RE.sub(r'', line) stripline = QUOTE_RE.sub(r"''", stripline) for char in stripline: for brace in open_braces: if char == brace: cnt += 1 for brace in close_braces: if char == brace: cnt -= 1 after = False if cnt > 0: after = True # This catches the special case of a closing brace having something # other than just whitespace ahead of it -- we don't want to # unindent that until after this line is printed so it stays with # the previous indentation level. if cnt < 0 and closing_prefix_re.match(stripline): after = True return (cnt, after) def prettyprint_input(lines): """Does the main work of indenting the input based on the brace counts.""" indent = 0 basic_offset = 2 last_line = "" for line in lines: line = line.strip('\r\n\t ') # Otherwise doesn't strip \r on Unix. if len(line) > 0: brace_diff = 0 if not COMMENT_RE.match(line): (brace_diff, after) = count_braces(line) if brace_diff != 0: if after: print(" " * (basic_offset * indent) + line) indent += brace_diff else: indent += brace_diff print(" " * (basic_offset * indent) + line) else: print(" " * (basic_offset * indent) + line) else: print("") last_line = line def main(): if len(sys.argv) > 1: data = open(sys.argv[1]).read().splitlines() else: data = sys.stdin.read().splitlines() # Split up the double braces. lines = split_double_braces(data) # Indent and print the output. prettyprint_input(lines) return 0 if __name__ == '__main__': sys.exit(main())
bsd-3-clause
314fe47b4c43199d9748315762060da6
29.583333
80
0.627751
3.359859
false
false
false
false
chromium/gyp
pylib/gyp/__init__.py
9
22291
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import print_function import copy import gyp.input import optparse import os.path import re import shlex import sys import traceback from gyp.common import GypError try: # basestring was removed in python3. basestring except NameError: basestring = str # Default debug modes for GYP debug = {} # List of "official" debug modes, but you can use anything you like. DEBUG_GENERAL = 'general' DEBUG_VARIABLES = 'variables' DEBUG_INCLUDES = 'includes' def DebugOutput(mode, message, *args): if 'all' in gyp.debug or mode in gyp.debug: ctx = ('unknown', 0, 'unknown') try: f = traceback.extract_stack(limit=2) if f: ctx = f[0][:3] except: pass if args: message %= args print('%s:%s:%d:%s %s' % (mode.upper(), os.path.basename(ctx[0]), ctx[1], ctx[2], message)) def FindBuildFiles(): extension = '.gyp' files = os.listdir(os.getcwd()) build_files = [] for file in files: if file.endswith(extension): build_files.append(file) return build_files def Load(build_files, format, default_variables={}, includes=[], depth='.', params=None, check=False, circular_check=True, duplicate_basename_check=True): """ Loads one or more specified build files. default_variables and includes will be copied before use. Returns the generator for the specified format and the data returned by loading the specified build files. """ if params is None: params = {} if '-' in format: format, params['flavor'] = format.split('-', 1) default_variables = copy.copy(default_variables) # Default variables provided by this program and its modules should be # named WITH_CAPITAL_LETTERS to provide a distinct "best practice" namespace, # avoiding collisions with user and automatic variables. default_variables['GENERATOR'] = format default_variables['GENERATOR_FLAVOR'] = params.get('flavor', '') # Format can be a custom python file, or by default the name of a module # within gyp.generator. if format.endswith('.py'): generator_name = os.path.splitext(format)[0] path, generator_name = os.path.split(generator_name) # Make sure the path to the custom generator is in sys.path # Don't worry about removing it once we are done. Keeping the path # to each generator that is used in sys.path is likely harmless and # arguably a good idea. path = os.path.abspath(path) if path not in sys.path: sys.path.insert(0, path) else: generator_name = 'gyp.generator.' + format # These parameters are passed in order (as opposed to by key) # because ActivePython cannot handle key parameters to __import__. generator = __import__(generator_name, globals(), locals(), generator_name) for (key, val) in generator.generator_default_variables.items(): default_variables.setdefault(key, val) # Give the generator the opportunity to set additional variables based on # the params it will receive in the output phase. if getattr(generator, 'CalculateVariables', None): generator.CalculateVariables(default_variables, params) # Give the generator the opportunity to set generator_input_info based on # the params it will receive in the output phase. if getattr(generator, 'CalculateGeneratorInputInfo', None): generator.CalculateGeneratorInputInfo(params) # Fetch the generator specific info that gets fed to input, we use getattr # so we can default things and the generators only have to provide what # they need. generator_input_info = { 'non_configuration_keys': getattr(generator, 'generator_additional_non_configuration_keys', []), 'path_sections': getattr(generator, 'generator_additional_path_sections', []), 'extra_sources_for_rules': getattr(generator, 'generator_extra_sources_for_rules', []), 'generator_supports_multiple_toolsets': getattr(generator, 'generator_supports_multiple_toolsets', False), 'generator_wants_static_library_dependencies_adjusted': getattr(generator, 'generator_wants_static_library_dependencies_adjusted', True), 'generator_wants_sorted_dependencies': getattr(generator, 'generator_wants_sorted_dependencies', False), 'generator_filelist_paths': getattr(generator, 'generator_filelist_paths', None), } # Process the input specific to this generator. result = gyp.input.Load(build_files, default_variables, includes[:], depth, generator_input_info, check, circular_check, duplicate_basename_check, params['parallel'], params['root_targets']) return [generator] + result def NameValueListToDict(name_value_list): """ Takes an array of strings of the form 'NAME=VALUE' and creates a dictionary of the pairs. If a string is simply NAME, then the value in the dictionary is set to True. If VALUE can be converted to an integer, it is. """ result = { } for item in name_value_list: tokens = item.split('=', 1) if len(tokens) == 2: # If we can make it an int, use that, otherwise, use the string. try: token_value = int(tokens[1]) except ValueError: token_value = tokens[1] # Set the variable to the supplied value. result[tokens[0]] = token_value else: # No value supplied, treat it as a boolean and set it. result[tokens[0]] = True return result def ShlexEnv(env_name): flags = os.environ.get(env_name, []) if flags: flags = shlex.split(flags) return flags def FormatOpt(opt, value): if opt.startswith('--'): return '%s=%s' % (opt, value) return opt + value def RegenerateAppendFlag(flag, values, predicate, env_name, options): """Regenerate a list of command line flags, for an option of action='append'. The |env_name|, if given, is checked in the environment and used to generate an initial list of options, then the options that were specified on the command line (given in |values|) are appended. This matches the handling of environment variables and command line flags where command line flags override the environment, while not requiring the environment to be set when the flags are used again. """ flags = [] if options.use_environment and env_name: for flag_value in ShlexEnv(env_name): value = FormatOpt(flag, predicate(flag_value)) if value in flags: flags.remove(value) flags.append(value) if values: for flag_value in values: flags.append(FormatOpt(flag, predicate(flag_value))) return flags def RegenerateFlags(options): """Given a parsed options object, and taking the environment variables into account, returns a list of flags that should regenerate an equivalent options object (even in the absence of the environment variables.) Any path options will be normalized relative to depth. The format flag is not included, as it is assumed the calling generator will set that as appropriate. """ def FixPath(path): path = gyp.common.FixIfRelativePath(path, options.depth) if not path: return os.path.curdir return path def Noop(value): return value # We always want to ignore the environment when regenerating, to avoid # duplicate or changed flags in the environment at the time of regeneration. flags = ['--ignore-environment'] for name, metadata in options._regeneration_metadata.items(): opt = metadata['opt'] value = getattr(options, name) value_predicate = metadata['type'] == 'path' and FixPath or Noop action = metadata['action'] env_name = metadata['env_name'] if action == 'append': flags.extend(RegenerateAppendFlag(opt, value, value_predicate, env_name, options)) elif action in ('store', None): # None is a synonym for 'store'. if value: flags.append(FormatOpt(opt, value_predicate(value))) elif options.use_environment and env_name and os.environ.get(env_name): flags.append(FormatOpt(opt, value_predicate(os.environ.get(env_name)))) elif action in ('store_true', 'store_false'): if ((action == 'store_true' and value) or (action == 'store_false' and not value)): flags.append(opt) elif options.use_environment and env_name: print(('Warning: environment regeneration unimplemented ' 'for %s flag %r env_name %r' % (action, opt, env_name)), file=sys.stderr) else: print(('Warning: regeneration unimplemented for action %r ' 'flag %r' % (action, opt)), file=sys.stderr) return flags class RegeneratableOptionParser(optparse.OptionParser): def __init__(self): self.__regeneratable_options = {} optparse.OptionParser.__init__(self) def add_option(self, *args, **kw): """Add an option to the parser. This accepts the same arguments as OptionParser.add_option, plus the following: regenerate: can be set to False to prevent this option from being included in regeneration. env_name: name of environment variable that additional values for this option come from. type: adds type='path', to tell the regenerator that the values of this option need to be made relative to options.depth """ env_name = kw.pop('env_name', None) if 'dest' in kw and kw.pop('regenerate', True): dest = kw['dest'] # The path type is needed for regenerating, for optparse we can just treat # it as a string. type = kw.get('type') if type == 'path': kw['type'] = 'string' self.__regeneratable_options[dest] = { 'action': kw.get('action'), 'type': type, 'env_name': env_name, 'opt': args[0], } optparse.OptionParser.add_option(self, *args, **kw) def parse_args(self, *args): values, args = optparse.OptionParser.parse_args(self, *args) values._regeneration_metadata = self.__regeneratable_options return values, args def gyp_main(args): my_name = os.path.basename(sys.argv[0]) parser = RegeneratableOptionParser() usage = 'usage: %s [options ...] [build_file ...]' parser.set_usage(usage.replace('%s', '%prog')) parser.add_option('--build', dest='configs', action='append', help='configuration for build after project generation') parser.add_option('--check', dest='check', action='store_true', help='check format of gyp files') parser.add_option('--config-dir', dest='config_dir', action='store', env_name='GYP_CONFIG_DIR', default=None, help='The location for configuration files like ' 'include.gypi.') parser.add_option('-d', '--debug', dest='debug', metavar='DEBUGMODE', action='append', default=[], help='turn on a debugging ' 'mode for debugging GYP. Supported modes are "variables", ' '"includes" and "general" or "all" for all of them.') parser.add_option('-D', dest='defines', action='append', metavar='VAR=VAL', env_name='GYP_DEFINES', help='sets variable VAR to value VAL') parser.add_option('--depth', dest='depth', metavar='PATH', type='path', help='set DEPTH gyp variable to a relative path to PATH') parser.add_option('-f', '--format', dest='formats', action='append', env_name='GYP_GENERATORS', regenerate=False, help='output formats to generate') parser.add_option('-G', dest='generator_flags', action='append', default=[], metavar='FLAG=VAL', env_name='GYP_GENERATOR_FLAGS', help='sets generator flag FLAG to VAL') parser.add_option('--generator-output', dest='generator_output', action='store', default=None, metavar='DIR', type='path', env_name='GYP_GENERATOR_OUTPUT', help='puts generated build files under DIR') parser.add_option('--ignore-environment', dest='use_environment', action='store_false', default=True, regenerate=False, help='do not read options from environment variables') parser.add_option('-I', '--include', dest='includes', action='append', metavar='INCLUDE', type='path', help='files to include in all loaded .gyp files') # --no-circular-check disables the check for circular relationships between # .gyp files. These relationships should not exist, but they've only been # observed to be harmful with the Xcode generator. Chromium's .gyp files # currently have some circular relationships on non-Mac platforms, so this # option allows the strict behavior to be used on Macs and the lenient # behavior to be used elsewhere. # TODO(mark): Remove this option when http://crbug.com/35878 is fixed. parser.add_option('--no-circular-check', dest='circular_check', action='store_false', default=True, regenerate=False, help="don't check for circular relationships between files") # --no-duplicate-basename-check disables the check for duplicate basenames # in a static_library/shared_library project. Visual C++ 2008 generator # doesn't support this configuration. Libtool on Mac also generates warnings # when duplicate basenames are passed into Make generator on Mac. # TODO(yukawa): Remove this option when these legacy generators are # deprecated. parser.add_option('--no-duplicate-basename-check', dest='duplicate_basename_check', action='store_false', default=True, regenerate=False, help="don't check for duplicate basenames") parser.add_option('--no-parallel', action='store_true', default=False, help='Disable multiprocessing') parser.add_option('-S', '--suffix', dest='suffix', default='', help='suffix to add to generated files') parser.add_option('--toplevel-dir', dest='toplevel_dir', action='store', default=None, metavar='DIR', type='path', help='directory to use as the root of the source tree') parser.add_option('-R', '--root-target', dest='root_targets', action='append', metavar='TARGET', help='include only TARGET and its deep dependencies') options, build_files_arg = parser.parse_args(args) build_files = build_files_arg # Set up the configuration directory (defaults to ~/.gyp) if not options.config_dir: home = None home_dot_gyp = None if options.use_environment: home_dot_gyp = os.environ.get('GYP_CONFIG_DIR', None) if home_dot_gyp: home_dot_gyp = os.path.expanduser(home_dot_gyp) if not home_dot_gyp: home_vars = ['HOME'] if sys.platform in ('cygwin', 'win32'): home_vars.append('USERPROFILE') for home_var in home_vars: home = os.getenv(home_var) if home != None: home_dot_gyp = os.path.join(home, '.gyp') if not os.path.exists(home_dot_gyp): home_dot_gyp = None else: break else: home_dot_gyp = os.path.expanduser(options.config_dir) if home_dot_gyp and not os.path.exists(home_dot_gyp): home_dot_gyp = None if not options.formats: # If no format was given on the command line, then check the env variable. generate_formats = [] if options.use_environment: generate_formats = os.environ.get('GYP_GENERATORS', []) if generate_formats: generate_formats = re.split(r'[\s,]', generate_formats) if generate_formats: options.formats = generate_formats else: # Nothing in the variable, default based on platform. if sys.platform == 'darwin': options.formats = ['xcode'] elif sys.platform in ('win32', 'cygwin'): options.formats = ['msvs'] else: options.formats = ['make'] if not options.generator_output and options.use_environment: g_o = os.environ.get('GYP_GENERATOR_OUTPUT') if g_o: options.generator_output = g_o options.parallel = not options.no_parallel for mode in options.debug: gyp.debug[mode] = 1 # Do an extra check to avoid work when we're not debugging. if DEBUG_GENERAL in gyp.debug: DebugOutput(DEBUG_GENERAL, 'running with these options:') for option, value in sorted(options.__dict__.items()): if option[0] == '_': continue if isinstance(value, basestring): DebugOutput(DEBUG_GENERAL, " %s: '%s'", option, value) else: DebugOutput(DEBUG_GENERAL, " %s: %s", option, value) if not build_files: build_files = FindBuildFiles() if not build_files: raise GypError((usage + '\n\n%s: error: no build_file') % (my_name, my_name)) # TODO(mark): Chromium-specific hack! # For Chromium, the gyp "depth" variable should always be a relative path # to Chromium's top-level "src" directory. If no depth variable was set # on the command line, try to find a "src" directory by looking at the # absolute path to each build file's directory. The first "src" component # found will be treated as though it were the path used for --depth. if not options.depth: for build_file in build_files: build_file_dir = os.path.abspath(os.path.dirname(build_file)) build_file_dir_components = build_file_dir.split(os.path.sep) for component in reversed(build_file_dir_components): if component == 'src': options.depth = os.path.sep.join(build_file_dir_components) break del build_file_dir_components[-1] # If the inner loop found something, break without advancing to another # build file. if options.depth: break if not options.depth: raise GypError('Could not automatically locate src directory. This is' 'a temporary Chromium feature that will be removed. Use' '--depth as a workaround.') # If toplevel-dir is not set, we assume that depth is the root of our source # tree. if not options.toplevel_dir: options.toplevel_dir = options.depth # -D on the command line sets variable defaults - D isn't just for define, # it's for default. Perhaps there should be a way to force (-F?) a # variable's value so that it can't be overridden by anything else. cmdline_default_variables = {} defines = [] if options.use_environment: defines += ShlexEnv('GYP_DEFINES') if options.defines: defines += options.defines cmdline_default_variables = NameValueListToDict(defines) if DEBUG_GENERAL in gyp.debug: DebugOutput(DEBUG_GENERAL, "cmdline_default_variables: %s", cmdline_default_variables) # Set up includes. includes = [] # If ~/.gyp/include.gypi exists, it'll be forcibly included into every # .gyp file that's loaded, before anything else is included. if home_dot_gyp != None: default_include = os.path.join(home_dot_gyp, 'include.gypi') if os.path.exists(default_include): print('Using overrides found in ' + default_include) includes.append(default_include) # Command-line --include files come after the default include. if options.includes: includes.extend(options.includes) # Generator flags should be prefixed with the target generator since they # are global across all generator runs. gen_flags = [] if options.use_environment: gen_flags += ShlexEnv('GYP_GENERATOR_FLAGS') if options.generator_flags: gen_flags += options.generator_flags generator_flags = NameValueListToDict(gen_flags) if DEBUG_GENERAL in gyp.debug: DebugOutput(DEBUG_GENERAL, "generator_flags: %s", generator_flags) # Generate all requested formats (use a set in case we got one format request # twice) for format in set(options.formats): params = {'options': options, 'build_files': build_files, 'generator_flags': generator_flags, 'cwd': os.getcwd(), 'build_files_arg': build_files_arg, 'gyp_binary': sys.argv[0], 'home_dot_gyp': home_dot_gyp, 'parallel': options.parallel, 'root_targets': options.root_targets, 'target_arch': cmdline_default_variables.get('target_arch', '')} # Start with the default variables from the command line. [generator, flat_list, targets, data] = Load( build_files, format, cmdline_default_variables, includes, options.depth, params, options.check, options.circular_check, options.duplicate_basename_check) # TODO(mark): Pass |data| for now because the generator needs a list of # build files that came in. In the future, maybe it should just accept # a list, and not the whole data dict. # NOTE: flat_list is the flattened dependency graph specifying the order # that targets may be built. Build systems that operate serially or that # need to have dependencies defined before dependents reference them should # generate targets in the order specified in flat_list. generator.GenerateOutput(flat_list, targets, data, params) if options.configs: valid_configs = targets[flat_list[0]]['configurations'] for conf in options.configs: if conf not in valid_configs: raise GypError('Invalid config specified via --build: %s' % conf) generator.PerformBuild(data, options.configs, params) # Done return 0 def main(args): try: return gyp_main(args) except GypError as e: sys.stderr.write("gyp: %s\n" % e) return 1 # NOTE: setuptools generated console_scripts calls function with no arguments def script_main(): return main(sys.argv[1:]) if __name__ == '__main__': sys.exit(script_main())
bsd-3-clause
068f299dccfba25cd641d765162df52b
39.163964
80
0.652281
4.058813
false
false
false
false
chromium/gyp
pylib/gyp/flock_tool.py
23
1749
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """These functions are executed via gyp-flock-tool when using the Makefile generator. Used on systems that don't have a built-in flock.""" import fcntl import os import struct import subprocess import sys def main(args): executor = FlockTool() executor.Dispatch(args) class FlockTool(object): """This class emulates the 'flock' command.""" def Dispatch(self, args): """Dispatches a string command to a method.""" if len(args) < 1: raise Exception("Not enough arguments") method = "Exec%s" % self._CommandifyName(args[0]) getattr(self, method)(*args[1:]) def _CommandifyName(self, name_string): """Transforms a tool name like copy-info-plist to CopyInfoPlist""" return name_string.title().replace('-', '') def ExecFlock(self, lockfile, *cmd_list): """Emulates the most basic behavior of Linux's flock(1).""" # Rely on exception handling to report errors. # Note that the stock python on SunOS has a bug # where fcntl.flock(fd, LOCK_EX) always fails # with EBADF, that's why we use this F_SETLK # hack instead. fd = os.open(lockfile, os.O_WRONLY|os.O_NOCTTY|os.O_CREAT, 0o666) if sys.platform.startswith('aix'): # Python on AIX is compiled with LARGEFILE support, which changes the # struct size. op = struct.pack('hhIllqq', fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) else: op = struct.pack('hhllhhl', fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) fcntl.fcntl(fd, fcntl.F_SETLK, op) return subprocess.call(cmd_list) if __name__ == '__main__': sys.exit(main(sys.argv[1:]))
bsd-3-clause
d28ee842fbeaf9f00f203ed136b55792
31.388889
75
0.671241
3.287594
false
false
false
false
chromium/gyp
pylib/gyp/generator/ninja.py
3
104214
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import print_function import collections import copy import hashlib import json import multiprocessing import os.path import re import signal import subprocess import sys import six import gyp import gyp.common from gyp.common import OrderedSet import gyp.msvs_emulation import gyp.MSVSUtil as MSVSUtil import gyp.xcode_emulation try: from cStringIO import StringIO except ImportError: from io import StringIO from gyp.common import GetEnvironFallback import gyp.ninja_syntax as ninja_syntax generator_default_variables = { 'EXECUTABLE_PREFIX': '', 'EXECUTABLE_SUFFIX': '', 'STATIC_LIB_PREFIX': 'lib', 'STATIC_LIB_SUFFIX': '.a', 'SHARED_LIB_PREFIX': 'lib', # Gyp expects the following variables to be expandable by the build # system to the appropriate locations. Ninja prefers paths to be # known at gyp time. To resolve this, introduce special # variables starting with $! and $| (which begin with a $ so gyp knows it # should be treated specially, but is otherwise an invalid # ninja/shell variable) that are passed to gyp here but expanded # before writing out into the target .ninja files; see # ExpandSpecial. # $! is used for variables that represent a path and that can only appear at # the start of a string, while $| is used for variables that can appear # anywhere in a string. 'INTERMEDIATE_DIR': '$!INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR': '$!PRODUCT_DIR/gen', 'PRODUCT_DIR': '$!PRODUCT_DIR', 'CONFIGURATION_NAME': '$|CONFIGURATION_NAME', # Special variables that may be used by gyp 'rule' targets. # We generate definitions for these variables on the fly when processing a # rule. 'RULE_INPUT_ROOT': '${root}', 'RULE_INPUT_DIRNAME': '${dirname}', 'RULE_INPUT_PATH': '${source}', 'RULE_INPUT_EXT': '${ext}', 'RULE_INPUT_NAME': '${name}', } # Placates pylint. generator_additional_non_configuration_keys = [] generator_additional_path_sections = [] generator_extra_sources_for_rules = [] generator_filelist_paths = None generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested() def StripPrefix(arg, prefix): if arg.startswith(prefix): return arg[len(prefix):] return arg def QuoteShellArgument(arg, flavor): """Quote a string such that it will be interpreted as a single argument by the shell.""" # Rather than attempting to enumerate the bad shell characters, just # whitelist common OK ones and quote anything else. if re.match(r'^[a-zA-Z0-9_=.\\/-]+$', arg): return arg # No quoting necessary. if flavor == 'win': return gyp.msvs_emulation.QuoteForRspFile(arg) return "'" + arg.replace("'", "'" + '"\'"' + "'") + "'" def Define(d, flavor): """Takes a preprocessor define and returns a -D parameter that's ninja- and shell-escaped.""" if flavor == 'win': # cl.exe replaces literal # characters with = in preprocesor definitions for # some reason. Octal-encode to work around that. d = d.replace('#', '\\%03o' % ord('#')) return QuoteShellArgument(ninja_syntax.escape('-D' + d), flavor) def AddArch(output, arch): """Adds an arch string to an output path.""" output, extension = os.path.splitext(output) return '%s.%s%s' % (output, arch, extension) class Target(object): """Target represents the paths used within a single gyp target. Conceptually, building a single target A is a series of steps: 1) actions/rules/copies generates source/resources/etc. 2) compiles generates .o files 3) link generates a binary (library/executable) 4) bundle merges the above in a mac bundle (Any of these steps can be optional.) From a build ordering perspective, a dependent target B could just depend on the last output of this series of steps. But some dependent commands sometimes need to reach inside the box. For example, when linking B it needs to get the path to the static library generated by A. This object stores those paths. To keep things simple, member variables only store concrete paths to single files, while methods compute derived values like "the last output of the target". """ def __init__(self, type): # Gyp type ("static_library", etc.) of this target. self.type = type # File representing whether any input dependencies necessary for # dependent actions have completed. self.preaction_stamp = None # File representing whether any input dependencies necessary for # dependent compiles have completed. self.precompile_stamp = None # File representing the completion of actions/rules/copies, if any. self.actions_stamp = None # Path to the output of the link step, if any. self.binary = None # Path to the file representing the completion of building the bundle, # if any. self.bundle = None # On Windows, incremental linking requires linking against all the .objs # that compose a .lib (rather than the .lib itself). That list is stored # here. In this case, we also need to save the compile_deps for the target, # so that the the target that directly depends on the .objs can also depend # on those. self.component_objs = None self.compile_deps = None # Windows only. The import .lib is the output of a build step, but # because dependents only link against the lib (not both the lib and the # dll) we keep track of the import library here. self.import_lib = None # Track if this target contains any C++ files, to decide if gcc or g++ # should be used for linking. self.uses_cpp = False def Linkable(self): """Return true if this is a target that can be linked against.""" return self.type in ('static_library', 'shared_library') def UsesToc(self, flavor): """Return true if the target should produce a restat rule based on a TOC file.""" # For bundles, the .TOC should be produced for the binary, not for # FinalOutput(). But the naive approach would put the TOC file into the # bundle, so don't do this for bundles for now. if flavor == 'win' or self.bundle: return False return self.type in ('shared_library', 'loadable_module') def PreActionInput(self, flavor): """Return the path, if any, that should be used as a dependency of any dependent action step.""" if self.UsesToc(flavor): return self.FinalOutput() + '.TOC' return self.FinalOutput() or self.preaction_stamp def PreCompileInput(self): """Return the path, if any, that should be used as a dependency of any dependent compile step.""" return self.actions_stamp or self.precompile_stamp def FinalOutput(self): """Return the last output of the target, which depends on all prior steps.""" return self.bundle or self.binary or self.actions_stamp # A small discourse on paths as used within the Ninja build: # All files we produce (both at gyp and at build time) appear in the # build directory (e.g. out/Debug). # # Paths within a given .gyp file are always relative to the directory # containing the .gyp file. Call these "gyp paths". This includes # sources as well as the starting directory a given gyp rule/action # expects to be run from. We call the path from the source root to # the gyp file the "base directory" within the per-.gyp-file # NinjaWriter code. # # All paths as written into the .ninja files are relative to the build # directory. Call these paths "ninja paths". # # We translate between these two notions of paths with two helper # functions: # # - GypPathToNinja translates a gyp path (i.e. relative to the .gyp file) # into the equivalent ninja path. # # - GypPathToUniqueOutput translates a gyp path into a ninja path to write # an output file; the result can be namespaced such that it is unique # to the input file name as well as the output target name. class NinjaWriter(object): def __init__(self, hash_for_rules, target_outputs, base_dir, build_dir, output_file, toplevel_build, output_file_name, flavor, toplevel_dir=None): """ base_dir: path from source root to directory containing this gyp file, by gyp semantics, all input paths are relative to this build_dir: path from source root to build output toplevel_dir: path to the toplevel directory """ self.hash_for_rules = hash_for_rules self.target_outputs = target_outputs self.base_dir = base_dir self.build_dir = build_dir self.ninja = ninja_syntax.Writer(output_file) self.toplevel_build = toplevel_build self.output_file_name = output_file_name self.flavor = flavor self.abs_build_dir = None if toplevel_dir is not None: self.abs_build_dir = os.path.abspath(os.path.join(toplevel_dir, build_dir)) self.obj_ext = '.obj' if flavor == 'win' else '.o' if flavor == 'win': # See docstring of msvs_emulation.GenerateEnvironmentFiles(). self.win_env = {} for arch in ('x86', 'x64'): self.win_env[arch] = 'environment.' + arch # Relative path from build output dir to base dir. build_to_top = gyp.common.InvertRelativePath(build_dir, toplevel_dir) self.build_to_base = os.path.join(build_to_top, base_dir) # Relative path from base dir to build dir. base_to_top = gyp.common.InvertRelativePath(base_dir, toplevel_dir) self.base_to_build = os.path.join(base_to_top, build_dir) def ExpandSpecial(self, path, product_dir=None): """Expand specials like $!PRODUCT_DIR in |path|. If |product_dir| is None, assumes the cwd is already the product dir. Otherwise, |product_dir| is the relative path to the product dir. """ PRODUCT_DIR = '$!PRODUCT_DIR' if PRODUCT_DIR in path: if product_dir: path = path.replace(PRODUCT_DIR, product_dir) else: path = path.replace(PRODUCT_DIR + '/', '') path = path.replace(PRODUCT_DIR + '\\', '') path = path.replace(PRODUCT_DIR, '.') INTERMEDIATE_DIR = '$!INTERMEDIATE_DIR' if INTERMEDIATE_DIR in path: int_dir = self.GypPathToUniqueOutput('gen') # GypPathToUniqueOutput generates a path relative to the product dir, # so insert product_dir in front if it is provided. path = path.replace(INTERMEDIATE_DIR, os.path.join(product_dir or '', int_dir)) CONFIGURATION_NAME = '$|CONFIGURATION_NAME' path = path.replace(CONFIGURATION_NAME, self.config_name) return path def ExpandRuleVariables(self, path, root, dirname, source, ext, name): if self.flavor == 'win': path = self.msvs_settings.ConvertVSMacros( path, config=self.config_name) path = path.replace(generator_default_variables['RULE_INPUT_ROOT'], root) path = path.replace(generator_default_variables['RULE_INPUT_DIRNAME'], dirname) path = path.replace(generator_default_variables['RULE_INPUT_PATH'], source) path = path.replace(generator_default_variables['RULE_INPUT_EXT'], ext) path = path.replace(generator_default_variables['RULE_INPUT_NAME'], name) return path def GypPathToNinja(self, path, env=None): """Translate a gyp path to a ninja path, optionally expanding environment variable references in |path| with |env|. See the above discourse on path conversions.""" if env: if self.flavor == 'mac': path = gyp.xcode_emulation.ExpandEnvVars(path, env) elif self.flavor == 'win': path = gyp.msvs_emulation.ExpandMacros(path, env) if path.startswith('$!'): expanded = self.ExpandSpecial(path) if self.flavor == 'win': expanded = os.path.normpath(expanded) return expanded if '$|' in path: path = self.ExpandSpecial(path) assert '$' not in path, path return os.path.normpath(os.path.join(self.build_to_base, path)) def GypPathToUniqueOutput(self, path, qualified=True): """Translate a gyp path to a ninja path for writing output. If qualified is True, qualify the resulting filename with the name of the target. This is necessary when e.g. compiling the same path twice for two separate output targets. See the above discourse on path conversions.""" path = self.ExpandSpecial(path) assert not path.startswith('$'), path # Translate the path following this scheme: # Input: foo/bar.gyp, target targ, references baz/out.o # Output: obj/foo/baz/targ.out.o (if qualified) # obj/foo/baz/out.o (otherwise) # (and obj.host instead of obj for cross-compiles) # # Why this scheme and not some other one? # 1) for a given input, you can compute all derived outputs by matching # its path, even if the input is brought via a gyp file with '..'. # 2) simple files like libraries and stamps have a simple filename. obj = 'obj' if self.toolset != 'target': obj += '.' + self.toolset path_dir, path_basename = os.path.split(path) assert not os.path.isabs(path_dir), ( "'%s' can not be absolute path (see crbug.com/462153)." % path_dir) if qualified: path_basename = self.name + '.' + path_basename return os.path.normpath(os.path.join(obj, self.base_dir, path_dir, path_basename)) def WriteCollapsedDependencies(self, name, targets, order_only=None): """Given a list of targets, return a path for a single file representing the result of building all the targets or None. Uses a stamp file if necessary.""" assert targets == [t for t in targets if t], targets if len(targets) == 0: assert not order_only return None if len(targets) > 1 or order_only: stamp = self.GypPathToUniqueOutput(name + '.stamp') targets = self.ninja.build(stamp, 'stamp', targets, order_only=order_only) self.ninja.newline() return targets[0] def _SubninjaNameForArch(self, arch): output_file_base = os.path.splitext(self.output_file_name)[0] return '%s.%s.ninja' % (output_file_base, arch) def WriteSpec(self, spec, config_name, generator_flags): """The main entry point for NinjaWriter: write the build rules for a spec. Returns a Target object, which represents the output paths for this spec. Returns None if there are no outputs (e.g. a settings-only 'none' type target).""" self.config_name = config_name self.name = spec['target_name'] self.toolset = spec['toolset'] config = spec['configurations'][config_name] self.target = Target(spec['type']) self.is_standalone_static_library = bool( spec.get('standalone_static_library', 0)) self.target_rpath = generator_flags.get('target_rpath', r'\$$ORIGIN/lib/') self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec) self.xcode_settings = self.msvs_settings = None if self.flavor == 'mac': self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) mac_toolchain_dir = generator_flags.get('mac_toolchain_dir', None) if mac_toolchain_dir: self.xcode_settings.mac_toolchain_dir = mac_toolchain_dir if self.flavor == 'win': self.msvs_settings = gyp.msvs_emulation.MsvsSettings(spec, generator_flags) arch = self.msvs_settings.GetArch(config_name) self.ninja.variable('arch', self.win_env[arch]) self.ninja.variable('cc', '$cl_' + arch) self.ninja.variable('cxx', '$cl_' + arch) self.ninja.variable('cc_host', '$cl_' + arch) self.ninja.variable('cxx_host', '$cl_' + arch) self.ninja.variable('asm', '$ml_' + arch) if self.flavor == 'mac': self.archs = self.xcode_settings.GetActiveArchs(config_name) if len(self.archs) > 1: self.arch_subninjas = dict( (arch, ninja_syntax.Writer( OpenOutput(os.path.join(self.toplevel_build, self._SubninjaNameForArch(arch)), 'w'))) for arch in self.archs) # Compute predepends for all rules. # actions_depends is the dependencies this target depends on before running # any of its action/rule/copy steps. # compile_depends is the dependencies this target depends on before running # any of its compile steps. actions_depends = [] compile_depends = [] # TODO(evan): it is rather confusing which things are lists and which # are strings. Fix these. if 'dependencies' in spec: for dep in spec['dependencies']: if dep in self.target_outputs: target = self.target_outputs[dep] actions_depends.append(target.PreActionInput(self.flavor)) compile_depends.append(target.PreCompileInput()) if target.uses_cpp: self.target.uses_cpp = True actions_depends = [d for d in actions_depends if d] compile_depends = [d for d in compile_depends if d] actions_depends = self.WriteCollapsedDependencies('actions_depends', actions_depends) compile_depends = self.WriteCollapsedDependencies('compile_depends', compile_depends) self.target.preaction_stamp = actions_depends self.target.precompile_stamp = compile_depends # Write out actions, rules, and copies. These must happen before we # compile any sources, so compute a list of predependencies for sources # while we do it. extra_sources = [] mac_bundle_depends = [] self.target.actions_stamp = self.WriteActionsRulesCopies( spec, extra_sources, actions_depends, mac_bundle_depends) # If we have actions/rules/copies, we depend directly on those, but # otherwise we depend on dependent target's actions/rules/copies etc. # We never need to explicitly depend on previous target's link steps, # because no compile ever depends on them. compile_depends_stamp = (self.target.actions_stamp or compile_depends) # Write out the compilation steps, if any. link_deps = [] try: sources = extra_sources + spec.get('sources', []) except TypeError: print('extra_sources: ', str(extra_sources)) print('spec.get("sources"): ', str(spec.get('sources'))) raise if sources: if self.flavor == 'mac' and len(self.archs) > 1: # Write subninja file containing compile and link commands scoped to # a single arch if a fat binary is being built. for arch in self.archs: self.ninja.subninja(self._SubninjaNameForArch(arch)) pch = None if self.flavor == 'win': gyp.msvs_emulation.VerifyMissingSources( sources, self.abs_build_dir, generator_flags, self.GypPathToNinja) pch = gyp.msvs_emulation.PrecompiledHeader( self.msvs_settings, config_name, self.GypPathToNinja, self.GypPathToUniqueOutput, self.obj_ext) else: pch = gyp.xcode_emulation.MacPrefixHeader( self.xcode_settings, self.GypPathToNinja, lambda path, lang: self.GypPathToUniqueOutput(path + '-' + lang)) link_deps = self.WriteSources( self.ninja, config_name, config, sources, compile_depends_stamp, pch, spec) # Some actions/rules output 'sources' that are already object files. obj_outputs = [f for f in sources if f.endswith(self.obj_ext)] if obj_outputs: if self.flavor != 'mac' or len(self.archs) == 1: link_deps += [self.GypPathToNinja(o) for o in obj_outputs] else: print("Warning: Actions/rules writing object files don't work with " \ "multiarch targets, dropping. (target %s)" % spec['target_name']) elif self.flavor == 'mac' and len(self.archs) > 1: link_deps = collections.defaultdict(list) compile_deps = self.target.actions_stamp or actions_depends if self.flavor == 'win' and self.target.type == 'static_library': self.target.component_objs = link_deps self.target.compile_deps = compile_deps # Write out a link step, if needed. output = None is_empty_bundle = not link_deps and not mac_bundle_depends if link_deps or self.target.actions_stamp or actions_depends: output = self.WriteTarget(spec, config_name, config, link_deps, compile_deps) if self.is_mac_bundle: mac_bundle_depends.append(output) # Bundle all of the above together, if needed. if self.is_mac_bundle: output = self.WriteMacBundle(spec, mac_bundle_depends, is_empty_bundle) if not output: return None assert self.target.FinalOutput(), output return self.target def _WinIdlRule(self, source, prebuild, outputs): """Handle the implicit VS .idl rule for one source file. Fills |outputs| with files that are generated.""" outdir, output, vars, flags = self.msvs_settings.GetIdlBuildData( source, self.config_name) outdir = self.GypPathToNinja(outdir) def fix_path(path, rel=None): path = os.path.join(outdir, path) dirname, basename = os.path.split(source) root, ext = os.path.splitext(basename) path = self.ExpandRuleVariables( path, root, dirname, source, ext, basename) if rel: path = os.path.relpath(path, rel) return path vars = [(name, fix_path(value, outdir)) for name, value in vars] output = [fix_path(p) for p in output] vars.append(('outdir', outdir)) vars.append(('idlflags', flags)) input = self.GypPathToNinja(source) self.ninja.build(output, 'idl', input, variables=vars, order_only=prebuild) outputs.extend(output) def WriteWinIdlFiles(self, spec, prebuild): """Writes rules to match MSVS's implicit idl handling.""" assert self.flavor == 'win' if self.msvs_settings.HasExplicitIdlRulesOrActions(spec): return [] outputs = [] for source in filter(lambda x: x.endswith('.idl'), spec['sources']): self._WinIdlRule(source, prebuild, outputs) return outputs def WriteActionsRulesCopies(self, spec, extra_sources, prebuild, mac_bundle_depends): """Write out the Actions, Rules, and Copies steps. Return a path representing the outputs of these steps.""" outputs = [] if self.is_mac_bundle: mac_bundle_resources = spec.get('mac_bundle_resources', [])[:] else: mac_bundle_resources = [] extra_mac_bundle_resources = [] if 'actions' in spec: outputs += self.WriteActions(spec['actions'], extra_sources, prebuild, extra_mac_bundle_resources) if 'rules' in spec: outputs += self.WriteRules(spec['rules'], extra_sources, prebuild, mac_bundle_resources, extra_mac_bundle_resources) if 'copies' in spec: outputs += self.WriteCopies(spec['copies'], prebuild, mac_bundle_depends) if 'sources' in spec and self.flavor == 'win': outputs += self.WriteWinIdlFiles(spec, prebuild) if self.xcode_settings and self.xcode_settings.IsIosFramework(): self.WriteiOSFrameworkHeaders(spec, outputs, prebuild) stamp = self.WriteCollapsedDependencies('actions_rules_copies', outputs) if self.is_mac_bundle: xcassets = self.WriteMacBundleResources( extra_mac_bundle_resources + mac_bundle_resources, mac_bundle_depends) partial_info_plist = self.WriteMacXCassets(xcassets, mac_bundle_depends) self.WriteMacInfoPlist(partial_info_plist, mac_bundle_depends) return stamp def GenerateDescription(self, verb, message, fallback): """Generate and return a description of a build step. |verb| is the short summary, e.g. ACTION or RULE. |message| is a hand-written description, or None if not available. |fallback| is the gyp-level name of the step, usable as a fallback. """ if self.toolset != 'target': verb += '(%s)' % self.toolset if message: return '%s %s' % (verb, self.ExpandSpecial(message)) else: return '%s %s: %s' % (verb, self.name, fallback) def WriteActions(self, actions, extra_sources, prebuild, extra_mac_bundle_resources): # Actions cd into the base directory. env = self.GetToolchainEnv() all_outputs = [] for action in actions: # First write out a rule for the action. name = '%s_%s' % (action['action_name'], self.hash_for_rules) description = self.GenerateDescription('ACTION', action.get('message', None), name) is_cygwin = (self.msvs_settings.IsRuleRunUnderCygwin(action) if self.flavor == 'win' else False) args = action['action'] depfile = action.get('depfile', None) if depfile: depfile = self.ExpandSpecial(depfile) pool = 'console' if int(action.get('ninja_use_console', 0)) else None rule_name, _ = self.WriteNewNinjaRule(name, args, description, is_cygwin, env, pool, depfile=depfile) inputs = [self.GypPathToNinja(i, env) for i in action['inputs']] if int(action.get('process_outputs_as_sources', False)): extra_sources += action['outputs'] if int(action.get('process_outputs_as_mac_bundle_resources', False)): extra_mac_bundle_resources += action['outputs'] outputs = [self.GypPathToNinja(o, env) for o in action['outputs']] # Then write out an edge using the rule. self.ninja.build(outputs, rule_name, inputs, order_only=prebuild) all_outputs += outputs self.ninja.newline() return all_outputs def WriteRules(self, rules, extra_sources, prebuild, mac_bundle_resources, extra_mac_bundle_resources): env = self.GetToolchainEnv() all_outputs = [] for rule in rules: # Skip a rule with no action and no inputs. if 'action' not in rule and not rule.get('rule_sources', []): continue # First write out a rule for the rule action. name = '%s_%s' % (rule['rule_name'], self.hash_for_rules) args = rule['action'] description = self.GenerateDescription( 'RULE', rule.get('message', None), ('%s ' + generator_default_variables['RULE_INPUT_PATH']) % name) is_cygwin = (self.msvs_settings.IsRuleRunUnderCygwin(rule) if self.flavor == 'win' else False) pool = 'console' if int(rule.get('ninja_use_console', 0)) else None rule_name, args = self.WriteNewNinjaRule( name, args, description, is_cygwin, env, pool) # TODO: if the command references the outputs directly, we should # simplify it to just use $out. # Rules can potentially make use of some special variables which # must vary per source file. # Compute the list of variables we'll need to provide. special_locals = ('source', 'root', 'dirname', 'ext', 'name') needed_variables = set(['source']) for argument in args: for var in special_locals: if '${%s}' % var in argument: needed_variables.add(var) needed_variables = sorted(needed_variables) def cygwin_munge(path): # pylint: disable=cell-var-from-loop if is_cygwin: return path.replace('\\', '/') return path inputs = [self.GypPathToNinja(i, env) for i in rule.get('inputs', [])] # If there are n source files matching the rule, and m additional rule # inputs, then adding 'inputs' to each build edge written below will # write m * n inputs. Collapsing reduces this to m + n. sources = rule.get('rule_sources', []) num_inputs = len(inputs) if prebuild: num_inputs += 1 if num_inputs > 2 and len(sources) > 2: inputs = [self.WriteCollapsedDependencies( rule['rule_name'], inputs, order_only=prebuild)] prebuild = [] # For each source file, write an edge that generates all the outputs. for source in sources: source = os.path.normpath(source) dirname, basename = os.path.split(source) root, ext = os.path.splitext(basename) # Gather the list of inputs and outputs, expanding $vars if possible. outputs = [self.ExpandRuleVariables(o, root, dirname, source, ext, basename) for o in rule['outputs']] if int(rule.get('process_outputs_as_sources', False)): extra_sources += outputs was_mac_bundle_resource = source in mac_bundle_resources if was_mac_bundle_resource or \ int(rule.get('process_outputs_as_mac_bundle_resources', False)): extra_mac_bundle_resources += outputs # Note: This is n_resources * n_outputs_in_rule. Put to-be-removed # items in a set and remove them all in a single pass if this becomes # a performance issue. if was_mac_bundle_resource: mac_bundle_resources.remove(source) extra_bindings = [] for var in needed_variables: if var == 'root': extra_bindings.append(('root', cygwin_munge(root))) elif var == 'dirname': # '$dirname' is a parameter to the rule action, which means # it shouldn't be converted to a Ninja path. But we don't # want $!PRODUCT_DIR in there either. dirname_expanded = self.ExpandSpecial(dirname, self.base_to_build) extra_bindings.append(('dirname', cygwin_munge(dirname_expanded))) elif var == 'source': # '$source' is a parameter to the rule action, which means # it shouldn't be converted to a Ninja path. But we don't # want $!PRODUCT_DIR in there either. source_expanded = self.ExpandSpecial(source, self.base_to_build) extra_bindings.append(('source', cygwin_munge(source_expanded))) elif var == 'ext': extra_bindings.append(('ext', ext)) elif var == 'name': extra_bindings.append(('name', cygwin_munge(basename))) else: assert var == None, repr(var) outputs = [self.GypPathToNinja(o, env) for o in outputs] if self.flavor == 'win': # WriteNewNinjaRule uses unique_name for creating an rsp file on win. extra_bindings.append(('unique_name', hashlib.md5(six.ensure_binary(outputs[0])).hexdigest())) self.ninja.build(outputs, rule_name, self.GypPathToNinja(source), implicit=inputs, order_only=prebuild, variables=extra_bindings) all_outputs.extend(outputs) return all_outputs def WriteCopies(self, copies, prebuild, mac_bundle_depends): outputs = [] if self.xcode_settings: extra_env = self.xcode_settings.GetPerTargetSettings() env = self.GetToolchainEnv(additional_settings=extra_env) else: env = self.GetToolchainEnv() for copy in copies: for path in copy['files']: # Normalize the path so trailing slashes don't confuse us. path = os.path.normpath(path) basename = os.path.split(path)[1] src = self.GypPathToNinja(path, env) dst = self.GypPathToNinja(os.path.join(copy['destination'], basename), env) outputs += self.ninja.build(dst, 'copy', src, order_only=prebuild) if self.is_mac_bundle: # gyp has mac_bundle_resources to copy things into a bundle's # Resources folder, but there's no built-in way to copy files to other # places in the bundle. Hence, some targets use copies for this. Check # if this file is copied into the current bundle, and if so add it to # the bundle depends so that dependent targets get rebuilt if the copy # input changes. if dst.startswith(self.xcode_settings.GetBundleContentsFolderPath()): mac_bundle_depends.append(dst) return outputs def WriteiOSFrameworkHeaders(self, spec, outputs, prebuild): """Prebuild steps to generate hmap files and copy headers to destination.""" framework = self.ComputeMacBundleOutput() all_sources = spec['sources'] copy_headers = spec['mac_framework_headers'] output = self.GypPathToUniqueOutput('headers.hmap') self.xcode_settings.header_map_path = output all_headers = map(self.GypPathToNinja, filter(lambda x:x.endswith(('.h')), all_sources)) variables = [('framework', framework), ('copy_headers', map(self.GypPathToNinja, copy_headers))] outputs.extend(self.ninja.build( output, 'compile_ios_framework_headers', all_headers, variables=variables, order_only=prebuild)) def WriteMacBundleResources(self, resources, bundle_depends): """Writes ninja edges for 'mac_bundle_resources'.""" xcassets = [] extra_env = self.xcode_settings.GetPerTargetSettings() env = self.GetSortedXcodeEnv(additional_settings=extra_env) env = self.ComputeExportEnvString(env) isBinary = self.xcode_settings.IsBinaryOutputFormat(self.config_name) for output, res in gyp.xcode_emulation.GetMacBundleResources( generator_default_variables['PRODUCT_DIR'], self.xcode_settings, map(self.GypPathToNinja, resources)): output = self.ExpandSpecial(output) if os.path.splitext(output)[-1] != '.xcassets': self.ninja.build(output, 'mac_tool', res, variables=[('mactool_cmd', 'copy-bundle-resource'), \ ('env', env), ('binary', isBinary)]) bundle_depends.append(output) else: xcassets.append(res) return xcassets def WriteMacXCassets(self, xcassets, bundle_depends): """Writes ninja edges for 'mac_bundle_resources' .xcassets files. This add an invocation of 'actool' via the 'mac_tool.py' helper script. It assumes that the assets catalogs define at least one imageset and thus an Assets.car file will be generated in the application resources directory. If this is not the case, then the build will probably be done at each invocation of ninja.""" if not xcassets: return extra_arguments = {} settings_to_arg = { 'XCASSETS_APP_ICON': 'app-icon', 'XCASSETS_LAUNCH_IMAGE': 'launch-image', } settings = self.xcode_settings.xcode_settings[self.config_name] for settings_key, arg_name in settings_to_arg.items(): value = settings.get(settings_key) if value: extra_arguments[arg_name] = value partial_info_plist = None if extra_arguments: partial_info_plist = self.GypPathToUniqueOutput( 'assetcatalog_generated_info.plist') extra_arguments['output-partial-info-plist'] = partial_info_plist outputs = [] outputs.append( os.path.join( self.xcode_settings.GetBundleResourceFolder(), 'Assets.car')) if partial_info_plist: outputs.append(partial_info_plist) keys = QuoteShellArgument(json.dumps(extra_arguments), self.flavor) extra_env = self.xcode_settings.GetPerTargetSettings() env = self.GetSortedXcodeEnv(additional_settings=extra_env) env = self.ComputeExportEnvString(env) bundle_depends.extend(self.ninja.build( outputs, 'compile_xcassets', xcassets, variables=[('env', env), ('keys', keys)])) return partial_info_plist def WriteMacInfoPlist(self, partial_info_plist, bundle_depends): """Write build rules for bundle Info.plist files.""" info_plist, out, defines, extra_env = gyp.xcode_emulation.GetMacInfoPlist( generator_default_variables['PRODUCT_DIR'], self.xcode_settings, self.GypPathToNinja) if not info_plist: return out = self.ExpandSpecial(out) if defines: # Create an intermediate file to store preprocessed results. intermediate_plist = self.GypPathToUniqueOutput( os.path.basename(info_plist)) defines = ' '.join([Define(d, self.flavor) for d in defines]) info_plist = self.ninja.build( intermediate_plist, 'preprocess_infoplist', info_plist, variables=[('defines',defines)]) env = self.GetSortedXcodeEnv(additional_settings=extra_env) env = self.ComputeExportEnvString(env) if partial_info_plist: intermediate_plist = self.GypPathToUniqueOutput('merged_info.plist') info_plist = self.ninja.build( intermediate_plist, 'merge_infoplist', [partial_info_plist, info_plist]) keys = self.xcode_settings.GetExtraPlistItems(self.config_name) keys = QuoteShellArgument(json.dumps(keys), self.flavor) isBinary = self.xcode_settings.IsBinaryOutputFormat(self.config_name) self.ninja.build(out, 'copy_infoplist', info_plist, variables=[('env', env), ('keys', keys), ('binary', isBinary)]) bundle_depends.append(out) def WriteSources(self, ninja_file, config_name, config, sources, predepends, precompiled_header, spec): """Write build rules to compile all of |sources|.""" if self.toolset == 'host': self.ninja.variable('ar', '$ar_host') self.ninja.variable('cc', '$cc_host') self.ninja.variable('cxx', '$cxx_host') self.ninja.variable('ld', '$ld_host') self.ninja.variable('ldxx', '$ldxx_host') self.ninja.variable('nm', '$nm_host') self.ninja.variable('readelf', '$readelf_host') if self.flavor != 'mac' or len(self.archs) == 1: return self.WriteSourcesForArch( self.ninja, config_name, config, sources, predepends, precompiled_header, spec) else: return dict((arch, self.WriteSourcesForArch( self.arch_subninjas[arch], config_name, config, sources, predepends, precompiled_header, spec, arch=arch)) for arch in self.archs) def WriteSourcesForArch(self, ninja_file, config_name, config, sources, predepends, precompiled_header, spec, arch=None): """Write build rules to compile all of |sources|.""" extra_defines = [] if self.flavor == 'mac': cflags = self.xcode_settings.GetCflags(config_name, arch=arch) cflags_c = self.xcode_settings.GetCflagsC(config_name) cflags_cc = self.xcode_settings.GetCflagsCC(config_name) cflags_objc = ['$cflags_c'] + \ self.xcode_settings.GetCflagsObjC(config_name) cflags_objcc = ['$cflags_cc'] + \ self.xcode_settings.GetCflagsObjCC(config_name) elif self.flavor == 'win': asmflags = self.msvs_settings.GetAsmflags(config_name) cflags = self.msvs_settings.GetCflags(config_name) cflags_c = self.msvs_settings.GetCflagsC(config_name) cflags_cc = self.msvs_settings.GetCflagsCC(config_name) extra_defines = self.msvs_settings.GetComputedDefines(config_name) # See comment at cc_command for why there's two .pdb files. pdbpath_c = pdbpath_cc = self.msvs_settings.GetCompilerPdbName( config_name, self.ExpandSpecial) if not pdbpath_c: obj = 'obj' if self.toolset != 'target': obj += '.' + self.toolset pdbpath = os.path.normpath(os.path.join(obj, self.base_dir, self.name)) pdbpath_c = pdbpath + '.c.pdb' pdbpath_cc = pdbpath + '.cc.pdb' self.WriteVariableList(ninja_file, 'pdbname_c', [pdbpath_c]) self.WriteVariableList(ninja_file, 'pdbname_cc', [pdbpath_cc]) self.WriteVariableList(ninja_file, 'pchprefix', [self.name]) else: cflags = config.get('cflags', []) cflags_c = config.get('cflags_c', []) cflags_cc = config.get('cflags_cc', []) # Respect environment variables related to build, but target-specific # flags can still override them. if self.toolset == 'target': cflags_c = (os.environ.get('CPPFLAGS', '').split() + os.environ.get('CFLAGS', '').split() + cflags_c) cflags_cc = (os.environ.get('CPPFLAGS', '').split() + os.environ.get('CXXFLAGS', '').split() + cflags_cc) elif self.toolset == 'host': cflags_c = (os.environ.get('CPPFLAGS_host', '').split() + os.environ.get('CFLAGS_host', '').split() + cflags_c) cflags_cc = (os.environ.get('CPPFLAGS_host', '').split() + os.environ.get('CXXFLAGS_host', '').split() + cflags_cc) defines = config.get('defines', []) + extra_defines self.WriteVariableList(ninja_file, 'defines', [Define(d, self.flavor) for d in defines]) if self.flavor == 'win': self.WriteVariableList(ninja_file, 'asmflags', map(self.ExpandSpecial, asmflags)) self.WriteVariableList(ninja_file, 'rcflags', [QuoteShellArgument(self.ExpandSpecial(f), self.flavor) for f in self.msvs_settings.GetRcflags(config_name, self.GypPathToNinja)]) include_dirs = config.get('include_dirs', []) env = self.GetToolchainEnv() if self.flavor == 'win': include_dirs = self.msvs_settings.AdjustIncludeDirs(include_dirs, config_name) self.WriteVariableList(ninja_file, 'includes', [QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor) for i in include_dirs]) if self.flavor == 'win': midl_include_dirs = config.get('midl_include_dirs', []) midl_include_dirs = self.msvs_settings.AdjustMidlIncludeDirs( midl_include_dirs, config_name) self.WriteVariableList(ninja_file, 'midl_includes', [QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor) for i in midl_include_dirs]) pch_commands = precompiled_header.GetPchBuildCommands(arch) if self.flavor == 'mac': # Most targets use no precompiled headers, so only write these if needed. for ext, var in [('c', 'cflags_pch_c'), ('cc', 'cflags_pch_cc'), ('m', 'cflags_pch_objc'), ('mm', 'cflags_pch_objcc')]: include = precompiled_header.GetInclude(ext, arch) if include: ninja_file.variable(var, include) arflags = config.get('arflags', []) self.WriteVariableList(ninja_file, 'cflags', map(self.ExpandSpecial, cflags)) self.WriteVariableList(ninja_file, 'cflags_c', map(self.ExpandSpecial, cflags_c)) self.WriteVariableList(ninja_file, 'cflags_cc', map(self.ExpandSpecial, cflags_cc)) if self.flavor == 'mac': self.WriteVariableList(ninja_file, 'cflags_objc', map(self.ExpandSpecial, cflags_objc)) self.WriteVariableList(ninja_file, 'cflags_objcc', map(self.ExpandSpecial, cflags_objcc)) self.WriteVariableList(ninja_file, 'arflags', map(self.ExpandSpecial, arflags)) ninja_file.newline() outputs = [] has_rc_source = False for source in sources: filename, ext = os.path.splitext(source) ext = ext[1:] obj_ext = self.obj_ext if ext in ('cc', 'cpp', 'cxx'): command = 'cxx' self.target.uses_cpp = True elif ext == 'c' or (ext == 'S' and self.flavor != 'win'): command = 'cc' elif ext == 's' and self.flavor != 'win': # Doesn't generate .o.d files. command = 'cc_s' elif (self.flavor == 'win' and ext == 'asm' and not self.msvs_settings.HasExplicitAsmRules(spec)): command = 'asm' # Add the _asm suffix as msvs is capable of handling .cc and # .asm files of the same name without collision. obj_ext = '_asm.obj' elif self.flavor == 'mac' and ext == 'm': command = 'objc' elif self.flavor == 'mac' and ext == 'mm': command = 'objcxx' self.target.uses_cpp = True elif self.flavor == 'win' and ext == 'rc': command = 'rc' obj_ext = '.res' has_rc_source = True else: # Ignore unhandled extensions. continue input = self.GypPathToNinja(source) output = self.GypPathToUniqueOutput(filename + obj_ext) if arch is not None: output = AddArch(output, arch) implicit = precompiled_header.GetObjDependencies([input], [output], arch) variables = [] if self.flavor == 'win': variables, output, implicit = precompiled_header.GetFlagsModifications( input, output, implicit, command, cflags_c, cflags_cc, self.ExpandSpecial) ninja_file.build(output, command, input, implicit=[gch for _, _, gch in implicit], order_only=predepends, variables=variables) outputs.append(output) if has_rc_source: resource_include_dirs = config.get('resource_include_dirs', include_dirs) self.WriteVariableList(ninja_file, 'resource_includes', [QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor) for i in resource_include_dirs]) self.WritePchTargets(ninja_file, pch_commands) ninja_file.newline() return outputs def WritePchTargets(self, ninja_file, pch_commands): """Writes ninja rules to compile prefix headers.""" if not pch_commands: return for gch, lang_flag, lang, input in pch_commands: var_name = { 'c': 'cflags_pch_c', 'cc': 'cflags_pch_cc', 'm': 'cflags_pch_objc', 'mm': 'cflags_pch_objcc', }[lang] map = { 'c': 'cc', 'cc': 'cxx', 'm': 'objc', 'mm': 'objcxx', } cmd = map.get(lang) ninja_file.build(gch, cmd, input, variables=[(var_name, lang_flag)]) def WriteLink(self, spec, config_name, config, link_deps, compile_deps): """Write out a link step. Fills out target.binary. """ if self.flavor != 'mac' or len(self.archs) == 1: return self.WriteLinkForArch( self.ninja, spec, config_name, config, link_deps, compile_deps) else: output = self.ComputeOutput(spec) inputs = [self.WriteLinkForArch(self.arch_subninjas[arch], spec, config_name, config, link_deps[arch], compile_deps, arch=arch) for arch in self.archs] extra_bindings = [] build_output = output if not self.is_mac_bundle: self.AppendPostbuildVariable(extra_bindings, spec, output, output) # TODO(yyanagisawa): more work needed to fix: # https://code.google.com/p/gyp/issues/detail?id=411 if (spec['type'] in ('shared_library', 'loadable_module') and not self.is_mac_bundle): extra_bindings.append(('lib', output)) self.ninja.build([output, output + '.TOC'], 'solipo', inputs, variables=extra_bindings) else: self.ninja.build(build_output, 'lipo', inputs, variables=extra_bindings) return output def WriteLinkForArch(self, ninja_file, spec, config_name, config, link_deps, compile_deps, arch=None): """Write out a link step. Fills out target.binary. """ command = { 'executable': 'link', 'loadable_module': 'solink_module', 'shared_library': 'solink', }[spec['type']] command_suffix = '' implicit_deps = set() solibs = set() order_deps = set() if compile_deps: # Normally, the compiles of the target already depend on compile_deps, # but a shared_library target might have no sources and only link together # a few static_library deps, so the link step also needs to depend # on compile_deps to make sure actions in the shared_library target # get run before the link. order_deps.add(compile_deps) if 'dependencies' in spec: # Two kinds of dependencies: # - Linkable dependencies (like a .a or a .so): add them to the link line. # - Non-linkable dependencies (like a rule that generates a file # and writes a stamp file): add them to implicit_deps extra_link_deps = set() for dep in spec['dependencies']: target = self.target_outputs.get(dep) if not target: continue linkable = target.Linkable() if linkable: new_deps = [] if (self.flavor == 'win' and target.component_objs and self.msvs_settings.IsUseLibraryDependencyInputs(config_name)): new_deps = target.component_objs if target.compile_deps: order_deps.add(target.compile_deps) elif self.flavor == 'win' and target.import_lib: new_deps = [target.import_lib] elif target.UsesToc(self.flavor): solibs.add(target.binary) implicit_deps.add(target.binary + '.TOC') else: new_deps = [target.binary] for new_dep in new_deps: if new_dep not in extra_link_deps: extra_link_deps.add(new_dep) link_deps.append(new_dep) final_output = target.FinalOutput() if not linkable or final_output != target.binary: implicit_deps.add(final_output) extra_bindings = [] if self.target.uses_cpp and self.flavor != 'win': extra_bindings.append(('ld', '$ldxx')) output = self.ComputeOutput(spec, arch) if arch is None and not self.is_mac_bundle: self.AppendPostbuildVariable(extra_bindings, spec, output, output) is_executable = spec['type'] == 'executable' # The ldflags config key is not used on mac or win. On those platforms # linker flags are set via xcode_settings and msvs_settings, respectively. if self.toolset == 'target': env_ldflags = os.environ.get('LDFLAGS', '').split() elif self.toolset == 'host': env_ldflags = os.environ.get('LDFLAGS_host', '').split() if self.flavor == 'mac': ldflags = self.xcode_settings.GetLdflags(config_name, self.ExpandSpecial(generator_default_variables['PRODUCT_DIR']), self.GypPathToNinja, arch) ldflags = env_ldflags + ldflags elif self.flavor == 'win': manifest_base_name = self.GypPathToUniqueOutput( self.ComputeOutputFileName(spec)) ldflags, intermediate_manifest, manifest_files = \ self.msvs_settings.GetLdflags(config_name, self.GypPathToNinja, self.ExpandSpecial, manifest_base_name, output, is_executable, self.toplevel_build) ldflags = env_ldflags + ldflags self.WriteVariableList(ninja_file, 'manifests', manifest_files) implicit_deps = implicit_deps.union(manifest_files) if intermediate_manifest: self.WriteVariableList( ninja_file, 'intermediatemanifest', [intermediate_manifest]) command_suffix = _GetWinLinkRuleNameSuffix( self.msvs_settings.IsEmbedManifest(config_name)) def_file = self.msvs_settings.GetDefFile(self.GypPathToNinja) if def_file: implicit_deps.add(def_file) else: # Respect environment variables related to build, but target-specific # flags can still override them. ldflags = env_ldflags + config.get('ldflags', []) if is_executable and len(solibs): rpath = 'lib/' if self.toolset != 'target': rpath += self.toolset ldflags.append(r'-Wl,-rpath=\$$ORIGIN/%s' % rpath) else: ldflags.append('-Wl,-rpath=%s' % self.target_rpath) ldflags.append('-Wl,-rpath-link=%s' % rpath) self.WriteVariableList(ninja_file, 'ldflags', map(self.ExpandSpecial, ldflags)) library_dirs = config.get('library_dirs', []) if self.flavor == 'win': library_dirs = [self.msvs_settings.ConvertVSMacros(l, config_name) for l in library_dirs] library_dirs = ['/LIBPATH:' + QuoteShellArgument(self.GypPathToNinja(l), self.flavor) for l in library_dirs] else: library_dirs = [QuoteShellArgument('-L' + self.GypPathToNinja(l), self.flavor) for l in library_dirs] libraries = gyp.common.uniquer(map(self.ExpandSpecial, spec.get('libraries', []))) if self.flavor == 'mac': libraries = self.xcode_settings.AdjustLibraries(libraries, config_name) elif self.flavor == 'win': libraries = self.msvs_settings.AdjustLibraries(libraries) self.WriteVariableList(ninja_file, 'libs', library_dirs + libraries) linked_binary = output if command in ('solink', 'solink_module'): extra_bindings.append(('soname', os.path.split(output)[1])) extra_bindings.append(('lib', gyp.common.EncodePOSIXShellArgument(output))) if self.flavor != 'win': link_file_list = output if self.is_mac_bundle: # 'Dependency Framework.framework/Versions/A/Dependency Framework' -> # 'Dependency Framework.framework.rsp' link_file_list = self.xcode_settings.GetWrapperName() if arch: link_file_list += '.' + arch link_file_list += '.rsp' # If an rspfile contains spaces, ninja surrounds the filename with # quotes around it and then passes it to open(), creating a file with # quotes in its name (and when looking for the rsp file, the name # makes it through bash which strips the quotes) :-/ link_file_list = link_file_list.replace(' ', '_') extra_bindings.append( ('link_file_list', gyp.common.EncodePOSIXShellArgument(link_file_list))) if self.flavor == 'win': extra_bindings.append(('binary', output)) if ('/NOENTRY' not in ldflags and not self.msvs_settings.GetNoImportLibrary(config_name)): self.target.import_lib = output + '.lib' extra_bindings.append(('implibflag', '/IMPLIB:%s' % self.target.import_lib)) pdbname = self.msvs_settings.GetPDBName( config_name, self.ExpandSpecial, output + '.pdb') output = [output, self.target.import_lib] if pdbname: output.append(pdbname) elif not self.is_mac_bundle: output = [output, output + '.TOC'] else: command = command + '_notoc' elif self.flavor == 'win': extra_bindings.append(('binary', output)) pdbname = self.msvs_settings.GetPDBName( config_name, self.ExpandSpecial, output + '.pdb') if pdbname: output = [output, pdbname] if len(solibs): extra_bindings.append(('solibs', gyp.common.EncodePOSIXShellList(sorted(solibs)))) ninja_file.build(output, command + command_suffix, link_deps, implicit=sorted(implicit_deps), order_only=list(order_deps), variables=extra_bindings) return linked_binary def WriteTarget(self, spec, config_name, config, link_deps, compile_deps): extra_link_deps = any(self.target_outputs.get(dep).Linkable() for dep in spec.get('dependencies', []) if dep in self.target_outputs) if spec['type'] == 'none' or (not link_deps and not extra_link_deps): # TODO(evan): don't call this function for 'none' target types, as # it doesn't do anything, and we fake out a 'binary' with a stamp file. self.target.binary = compile_deps self.target.type = 'none' elif spec['type'] == 'static_library': self.target.binary = self.ComputeOutput(spec) if (self.flavor not in ('mac', 'openbsd', 'netbsd', 'win') and not self.is_standalone_static_library): self.ninja.build(self.target.binary, 'alink_thin', link_deps, order_only=compile_deps) else: variables = [] if self.xcode_settings: libtool_flags = self.xcode_settings.GetLibtoolflags(config_name) if libtool_flags: variables.append(('libtool_flags', libtool_flags)) if self.msvs_settings: libflags = self.msvs_settings.GetLibFlags(config_name, self.GypPathToNinja) variables.append(('libflags', libflags)) if self.flavor != 'mac' or len(self.archs) == 1: self.AppendPostbuildVariable(variables, spec, self.target.binary, self.target.binary) self.ninja.build(self.target.binary, 'alink', link_deps, order_only=compile_deps, variables=variables) else: inputs = [] for arch in self.archs: output = self.ComputeOutput(spec, arch) self.arch_subninjas[arch].build(output, 'alink', link_deps[arch], order_only=compile_deps, variables=variables) inputs.append(output) # TODO: It's not clear if libtool_flags should be passed to the alink # call that combines single-arch .a files into a fat .a file. self.AppendPostbuildVariable(variables, spec, self.target.binary, self.target.binary) self.ninja.build(self.target.binary, 'alink', inputs, # FIXME: test proving order_only=compile_deps isn't # needed. variables=variables) else: self.target.binary = self.WriteLink(spec, config_name, config, link_deps, compile_deps) return self.target.binary def WriteMacBundle(self, spec, mac_bundle_depends, is_empty): assert self.is_mac_bundle package_framework = spec['type'] in ('shared_library', 'loadable_module') output = self.ComputeMacBundleOutput() if is_empty: output += '.stamp' variables = [] self.AppendPostbuildVariable(variables, spec, output, self.target.binary, is_command_start=not package_framework) if package_framework and not is_empty: if spec['type'] == 'shared_library' and self.xcode_settings.isIOS: self.ninja.build(output, 'package_ios_framework', mac_bundle_depends, variables=variables) else: variables.append(('version', self.xcode_settings.GetFrameworkVersion())) self.ninja.build(output, 'package_framework', mac_bundle_depends, variables=variables) else: self.ninja.build(output, 'stamp', mac_bundle_depends, variables=variables) self.target.bundle = output return output def GetToolchainEnv(self, additional_settings=None): """Returns the variables toolchain would set for build steps.""" env = self.GetSortedXcodeEnv(additional_settings=additional_settings) if self.flavor == 'win': env = self.GetMsvsToolchainEnv( additional_settings=additional_settings) return env def GetMsvsToolchainEnv(self, additional_settings=None): """Returns the variables Visual Studio would set for build steps.""" return self.msvs_settings.GetVSMacroEnv('$!PRODUCT_DIR', config=self.config_name) def GetSortedXcodeEnv(self, additional_settings=None): """Returns the variables Xcode would set for build steps.""" assert self.abs_build_dir abs_build_dir = self.abs_build_dir return gyp.xcode_emulation.GetSortedXcodeEnv( self.xcode_settings, abs_build_dir, os.path.join(abs_build_dir, self.build_to_base), self.config_name, additional_settings) def GetSortedXcodePostbuildEnv(self): """Returns the variables Xcode would set for postbuild steps.""" postbuild_settings = {} # CHROMIUM_STRIP_SAVE_FILE is a chromium-specific hack. # TODO(thakis): It would be nice to have some general mechanism instead. strip_save_file = self.xcode_settings.GetPerTargetSetting( 'CHROMIUM_STRIP_SAVE_FILE') if strip_save_file: postbuild_settings['CHROMIUM_STRIP_SAVE_FILE'] = strip_save_file return self.GetSortedXcodeEnv(additional_settings=postbuild_settings) def AppendPostbuildVariable(self, variables, spec, output, binary, is_command_start=False): """Adds a 'postbuild' variable if there is a postbuild for |output|.""" postbuild = self.GetPostbuildCommand(spec, output, binary, is_command_start) if postbuild: variables.append(('postbuilds', postbuild)) def GetPostbuildCommand(self, spec, output, output_binary, is_command_start): """Returns a shell command that runs all the postbuilds, and removes |output| if any of them fails. If |is_command_start| is False, then the returned string will start with ' && '.""" if not self.xcode_settings or spec['type'] == 'none' or not output: return '' output = QuoteShellArgument(output, self.flavor) postbuilds = gyp.xcode_emulation.GetSpecPostbuildCommands(spec, quiet=True) if output_binary is not None: postbuilds = self.xcode_settings.AddImplicitPostbuilds( self.config_name, os.path.normpath(os.path.join(self.base_to_build, output)), QuoteShellArgument( os.path.normpath(os.path.join(self.base_to_build, output_binary)), self.flavor), postbuilds, quiet=True) if not postbuilds: return '' # Postbuilds expect to be run in the gyp file's directory, so insert an # implicit postbuild to cd to there. postbuilds.insert(0, gyp.common.EncodePOSIXShellList( ['cd', self.build_to_base])) env = self.ComputeExportEnvString(self.GetSortedXcodePostbuildEnv()) # G will be non-null if any postbuild fails. Run all postbuilds in a # subshell. commands = env + ' (' + \ ' && '.join([ninja_syntax.escape(command) for command in postbuilds]) command_string = (commands + '); G=$$?; ' # Remove the final output if any postbuild failed. '((exit $$G) || rm -rf %s) ' % output + '&& exit $$G)') if is_command_start: return '(' + command_string + ' && ' else: return '$ && (' + command_string def ComputeExportEnvString(self, env): """Given an environment, returns a string looking like 'export FOO=foo; export BAR="${FOO} bar;' that exports |env| to the shell.""" export_str = [] for k, v in env: export_str.append('export %s=%s;' % (k, ninja_syntax.escape(gyp.common.EncodePOSIXShellArgument(v)))) return ' '.join(export_str) def ComputeMacBundleOutput(self): """Return the 'output' (full output path) to a bundle output directory.""" assert self.is_mac_bundle path = generator_default_variables['PRODUCT_DIR'] return self.ExpandSpecial( os.path.join(path, self.xcode_settings.GetWrapperName())) def ComputeOutputFileName(self, spec, type=None): """Compute the filename of the final output for the current target.""" if not type: type = spec['type'] default_variables = copy.copy(generator_default_variables) CalculateVariables(default_variables, {'flavor': self.flavor}) # Compute filename prefix: the product prefix, or a default for # the product type. DEFAULT_PREFIX = { 'loadable_module': default_variables['SHARED_LIB_PREFIX'], 'shared_library': default_variables['SHARED_LIB_PREFIX'], 'static_library': default_variables['STATIC_LIB_PREFIX'], 'executable': default_variables['EXECUTABLE_PREFIX'], } prefix = spec.get('product_prefix', DEFAULT_PREFIX.get(type, '')) # Compute filename extension: the product extension, or a default # for the product type. DEFAULT_EXTENSION = { 'loadable_module': default_variables['SHARED_LIB_SUFFIX'], 'shared_library': default_variables['SHARED_LIB_SUFFIX'], 'static_library': default_variables['STATIC_LIB_SUFFIX'], 'executable': default_variables['EXECUTABLE_SUFFIX'], } extension = spec.get('product_extension') if extension: extension = '.' + extension else: extension = DEFAULT_EXTENSION.get(type, '') if 'product_name' in spec: # If we were given an explicit name, use that. target = spec['product_name'] else: # Otherwise, derive a name from the target name. target = spec['target_name'] if prefix == 'lib': # Snip out an extra 'lib' from libs if appropriate. target = StripPrefix(target, 'lib') if type in ('static_library', 'loadable_module', 'shared_library', 'executable'): return '%s%s%s' % (prefix, target, extension) elif type == 'none': return '%s.stamp' % target else: raise Exception('Unhandled output type %s' % type) def ComputeOutput(self, spec, arch=None): """Compute the path for the final output of the spec.""" type = spec['type'] if self.flavor == 'win': override = self.msvs_settings.GetOutputName(self.config_name, self.ExpandSpecial) if override: return override if arch is None and self.flavor == 'mac' and type in ( 'static_library', 'executable', 'shared_library', 'loadable_module'): filename = self.xcode_settings.GetExecutablePath() else: filename = self.ComputeOutputFileName(spec, type) if arch is None and 'product_dir' in spec: path = os.path.join(spec['product_dir'], filename) return self.ExpandSpecial(path) # Some products go into the output root, libraries go into shared library # dir, and everything else goes into the normal place. type_in_output_root = ['executable', 'loadable_module'] if self.flavor == 'mac' and self.toolset == 'target': type_in_output_root += ['shared_library', 'static_library'] elif self.flavor == 'win' and self.toolset == 'target': type_in_output_root += ['shared_library'] if arch is not None: # Make sure partial executables don't end up in a bundle or the regular # output directory. archdir = 'arch' if self.toolset != 'target': archdir = os.path.join('arch', '%s' % self.toolset) return os.path.join(archdir, AddArch(filename, arch)) elif type in type_in_output_root or self.is_standalone_static_library: return filename elif type == 'shared_library': libdir = 'lib' if self.toolset != 'target': libdir = os.path.join('lib', '%s' % self.toolset) return os.path.join(libdir, filename) else: return self.GypPathToUniqueOutput(filename, qualified=False) def WriteVariableList(self, ninja_file, var, values): assert not isinstance(values, str) if values is None: values = [] ninja_file.variable(var, ' '.join(values)) def WriteNewNinjaRule(self, name, args, description, is_cygwin, env, pool, depfile=None): """Write out a new ninja "rule" statement for a given command. Returns the name of the new rule, and a copy of |args| with variables expanded.""" if self.flavor == 'win': args = [self.msvs_settings.ConvertVSMacros( arg, self.base_to_build, config=self.config_name) for arg in args] description = self.msvs_settings.ConvertVSMacros( description, config=self.config_name) elif self.flavor == 'mac': # |env| is an empty list on non-mac. args = [gyp.xcode_emulation.ExpandEnvVars(arg, env) for arg in args] description = gyp.xcode_emulation.ExpandEnvVars(description, env) # TODO: we shouldn't need to qualify names; we do it because # currently the ninja rule namespace is global, but it really # should be scoped to the subninja. rule_name = self.name if self.toolset == 'target': rule_name += '.' + self.toolset rule_name += '.' + name rule_name = re.sub('[^a-zA-Z0-9_]', '_', rule_name) # Remove variable references, but not if they refer to the magic rule # variables. This is not quite right, as it also protects these for # actions, not just for rules where they are valid. Good enough. protect = [ '${root}', '${dirname}', '${source}', '${ext}', '${name}' ] protect = '(?!' + '|'.join(map(re.escape, protect)) + ')' description = re.sub(protect + r'\$', '_', description) # gyp dictates that commands are run from the base directory. # cd into the directory before running, and adjust paths in # the arguments to point to the proper locations. rspfile = None rspfile_content = None args = [self.ExpandSpecial(arg, self.base_to_build) for arg in args] if self.flavor == 'win': rspfile = rule_name + '.$unique_name.rsp' # The cygwin case handles this inside the bash sub-shell. run_in = '' if is_cygwin else ' ' + self.build_to_base if is_cygwin: rspfile_content = self.msvs_settings.BuildCygwinBashCommandLine( args, self.build_to_base) else: rspfile_content = gyp.msvs_emulation.EncodeRspFileList(args) command = ('%s gyp-win-tool action-wrapper $arch ' % sys.executable + rspfile + run_in) else: env = self.ComputeExportEnvString(env) command = gyp.common.EncodePOSIXShellList(args) command = 'cd %s; ' % self.build_to_base + env + command # GYP rules/actions express being no-ops by not touching their outputs. # Avoid executing downstream dependencies in this case by specifying # restat=1 to ninja. self.ninja.rule(rule_name, command, description, depfile=depfile, restat=True, pool=pool, rspfile=rspfile, rspfile_content=rspfile_content) self.ninja.newline() return rule_name, args def CalculateVariables(default_variables, params): """Calculate additional variables for use in the build (called by gyp).""" global generator_additional_non_configuration_keys global generator_additional_path_sections flavor = gyp.common.GetFlavor(params) if flavor == 'mac': default_variables.setdefault('OS', 'mac') default_variables.setdefault('SHARED_LIB_SUFFIX', '.dylib') default_variables.setdefault('SHARED_LIB_DIR', generator_default_variables['PRODUCT_DIR']) default_variables.setdefault('LIB_DIR', generator_default_variables['PRODUCT_DIR']) # Copy additional generator configuration data from Xcode, which is shared # by the Mac Ninja generator. import gyp.generator.xcode as xcode_generator generator_additional_non_configuration_keys = getattr(xcode_generator, 'generator_additional_non_configuration_keys', []) generator_additional_path_sections = getattr(xcode_generator, 'generator_additional_path_sections', []) global generator_extra_sources_for_rules generator_extra_sources_for_rules = getattr(xcode_generator, 'generator_extra_sources_for_rules', []) elif flavor == 'win': exts = gyp.MSVSUtil.TARGET_TYPE_EXT default_variables.setdefault('OS', 'win') default_variables['EXECUTABLE_SUFFIX'] = '.' + exts['executable'] default_variables['STATIC_LIB_PREFIX'] = '' default_variables['STATIC_LIB_SUFFIX'] = '.' + exts['static_library'] default_variables['SHARED_LIB_PREFIX'] = '' default_variables['SHARED_LIB_SUFFIX'] = '.' + exts['shared_library'] # Copy additional generator configuration data from VS, which is shared # by the Windows Ninja generator. import gyp.generator.msvs as msvs_generator generator_additional_non_configuration_keys = getattr(msvs_generator, 'generator_additional_non_configuration_keys', []) generator_additional_path_sections = getattr(msvs_generator, 'generator_additional_path_sections', []) gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) else: operating_system = flavor if flavor == 'android': operating_system = 'linux' # Keep this legacy behavior for now. default_variables.setdefault('OS', operating_system) default_variables.setdefault('SHARED_LIB_SUFFIX', '.so') default_variables.setdefault('SHARED_LIB_DIR', os.path.join('$!PRODUCT_DIR', 'lib')) default_variables.setdefault('LIB_DIR', os.path.join('$!PRODUCT_DIR', 'obj')) def ComputeOutputDir(params): """Returns the path from the toplevel_dir to the build output directory.""" # generator_dir: relative path from pwd to where make puts build files. # Makes migrating from make to ninja easier, ninja doesn't put anything here. generator_dir = os.path.relpath(params['options'].generator_output or '.') # output_dir: relative path from generator_dir to the build directory. output_dir = params.get('generator_flags', {}).get('output_dir', 'out') # Relative path from source root to our output files. e.g. "out" return os.path.normpath(os.path.join(generator_dir, output_dir)) def CalculateGeneratorInputInfo(params): """Called by __init__ to initialize generator values based on params.""" # E.g. "out/gypfiles" toplevel = params['options'].toplevel_dir qualified_out_dir = os.path.normpath(os.path.join( toplevel, ComputeOutputDir(params), 'gypfiles')) global generator_filelist_paths generator_filelist_paths = { 'toplevel': toplevel, 'qualified_out_dir': qualified_out_dir, } def OpenOutput(path, mode='w'): """Open |path| for writing, creating directories if necessary.""" gyp.common.EnsureDirExists(path) return open(path, mode) def CommandWithWrapper(cmd, wrappers, prog): wrapper = wrappers.get(cmd, '') if wrapper: return wrapper + ' ' + prog return prog def GetDefaultConcurrentLinks(): """Returns a best-guess for a number of concurrent links.""" pool_size = int(os.environ.get('GYP_LINK_CONCURRENCY', 0)) if pool_size: return pool_size if sys.platform in ('win32', 'cygwin'): import ctypes class MEMORYSTATUSEX(ctypes.Structure): _fields_ = [ ("dwLength", ctypes.c_ulong), ("dwMemoryLoad", ctypes.c_ulong), ("ullTotalPhys", ctypes.c_ulonglong), ("ullAvailPhys", ctypes.c_ulonglong), ("ullTotalPageFile", ctypes.c_ulonglong), ("ullAvailPageFile", ctypes.c_ulonglong), ("ullTotalVirtual", ctypes.c_ulonglong), ("ullAvailVirtual", ctypes.c_ulonglong), ("sullAvailExtendedVirtual", ctypes.c_ulonglong), ] stat = MEMORYSTATUSEX() stat.dwLength = ctypes.sizeof(stat) ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat)) # VS 2015 uses 20% more working set than VS 2013 and can consume all RAM # on a 64 GB machine. mem_limit = max(1, stat.ullTotalPhys // (5 * (2 ** 30))) # total / 5GB hard_cap = max(1, int(os.environ.get('GYP_LINK_CONCURRENCY_MAX', 2**32))) return min(mem_limit, hard_cap) elif sys.platform.startswith('linux'): if os.path.exists("/proc/meminfo"): with open("/proc/meminfo") as meminfo: memtotal_re = re.compile(r'^MemTotal:\s*(\d*)\s*kB') for line in meminfo: match = memtotal_re.match(line) if not match: continue # Allow 8Gb per link on Linux because Gold is quite memory hungry return max(1, int(match.group(1)) // (8 * (2 ** 20))) return 1 elif sys.platform == 'darwin': try: avail_bytes = int(subprocess.check_output(['sysctl', '-n', 'hw.memsize'])) # A static library debug build of Chromium's unit_tests takes ~2.7GB, so # 4GB per ld process allows for some more bloat. return max(1, avail_bytes // (4 * (2 ** 30))) # total / 4GB except: return 1 else: # TODO(scottmg): Implement this for other platforms. return 1 def _GetWinLinkRuleNameSuffix(embed_manifest): """Returns the suffix used to select an appropriate linking rule depending on whether the manifest embedding is enabled.""" return '_embed' if embed_manifest else '' def _AddWinLinkRules(master_ninja, embed_manifest): """Adds link rules for Windows platform to |master_ninja|.""" def FullLinkCommand(ldcmd, out, binary_type): resource_name = { 'exe': '1', 'dll': '2', }[binary_type] return '%(python)s gyp-win-tool link-with-manifests $arch %(embed)s ' \ '%(out)s "%(ldcmd)s" %(resname)s $mt $rc "$intermediatemanifest" ' \ '$manifests' % { 'python': sys.executable, 'out': out, 'ldcmd': ldcmd, 'resname': resource_name, 'embed': embed_manifest } rule_name_suffix = _GetWinLinkRuleNameSuffix(embed_manifest) use_separate_mspdbsrv = ( int(os.environ.get('GYP_USE_SEPARATE_MSPDBSRV', '0')) != 0) dlldesc = 'LINK%s(DLL) $binary' % rule_name_suffix.upper() dllcmd = ('%s gyp-win-tool link-wrapper $arch %s ' '$ld /nologo $implibflag /DLL /OUT:$binary ' '@$binary.rsp' % (sys.executable, use_separate_mspdbsrv)) dllcmd = FullLinkCommand(dllcmd, '$binary', 'dll') master_ninja.rule('solink' + rule_name_suffix, description=dlldesc, command=dllcmd, rspfile='$binary.rsp', rspfile_content='$libs $in_newline $ldflags', restat=True, pool='link_pool') master_ninja.rule('solink_module' + rule_name_suffix, description=dlldesc, command=dllcmd, rspfile='$binary.rsp', rspfile_content='$libs $in_newline $ldflags', restat=True, pool='link_pool') # Note that ldflags goes at the end so that it has the option of # overriding default settings earlier in the command line. exe_cmd = ('%s gyp-win-tool link-wrapper $arch %s ' '$ld /nologo /OUT:$binary @$binary.rsp' % (sys.executable, use_separate_mspdbsrv)) exe_cmd = FullLinkCommand(exe_cmd, '$binary', 'exe') master_ninja.rule('link' + rule_name_suffix, description='LINK%s $binary' % rule_name_suffix.upper(), command=exe_cmd, rspfile='$binary.rsp', rspfile_content='$in_newline $libs $ldflags', pool='link_pool') def GenerateOutputForConfig(target_list, target_dicts, data, params, config_name): options = params['options'] flavor = gyp.common.GetFlavor(params) generator_flags = params.get('generator_flags', {}) # build_dir: relative path from source root to our output files. # e.g. "out/Debug" build_dir = os.path.normpath( os.path.join(ComputeOutputDir(params), config_name)) toplevel_build = os.path.join(options.toplevel_dir, build_dir) master_ninja_file = OpenOutput(os.path.join(toplevel_build, 'build.ninja')) master_ninja = ninja_syntax.Writer(master_ninja_file, width=120) # Put build-time support tools in out/{config_name}. gyp.common.CopyTool(flavor, toplevel_build, generator_flags) # Grab make settings for CC/CXX. # The rules are # - The priority from low to high is gcc/g++, the 'make_global_settings' in # gyp, the environment variable. # - If there is no 'make_global_settings' for CC.host/CXX.host or # 'CC_host'/'CXX_host' enviroment variable, cc_host/cxx_host should be set # to cc/cxx. if flavor == 'win': ar = 'lib.exe' # cc and cxx must be set to the correct architecture by overriding with one # of cl_x86 or cl_x64 below. cc = 'UNSET' cxx = 'UNSET' ld = 'link.exe' ld_host = '$ld' else: ar = 'ar' cc = 'cc' cxx = 'c++' ld = '$cc' ldxx = '$cxx' ld_host = '$cc_host' ldxx_host = '$cxx_host' ar_host = ar cc_host = None cxx_host = None cc_host_global_setting = None cxx_host_global_setting = None clang_cl = None nm = 'nm' nm_host = 'nm' readelf = 'readelf' readelf_host = 'readelf' build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) make_global_settings = data[build_file].get('make_global_settings', []) build_to_root = gyp.common.InvertRelativePath(build_dir, options.toplevel_dir) wrappers = {} for key, value in make_global_settings: if key == 'AR': ar = os.path.join(build_to_root, value) if key == 'AR.host': ar_host = os.path.join(build_to_root, value) if key == 'CC': cc = os.path.join(build_to_root, value) if cc.endswith('clang-cl'): clang_cl = cc if key == 'CXX': cxx = os.path.join(build_to_root, value) if key == 'CC.host': cc_host = os.path.join(build_to_root, value) cc_host_global_setting = value if key == 'CXX.host': cxx_host = os.path.join(build_to_root, value) cxx_host_global_setting = value if key == 'LD': ld = os.path.join(build_to_root, value) if key == 'LD.host': ld_host = os.path.join(build_to_root, value) if key == 'NM': nm = os.path.join(build_to_root, value) if key == 'NM.host': nm_host = os.path.join(build_to_root, value) if key == 'READELF': readelf = os.path.join(build_to_root, value) if key == 'READELF.host': readelf_host = os.path.join(build_to_root, value) if key.endswith('_wrapper'): wrappers[key[:-len('_wrapper')]] = os.path.join(build_to_root, value) # Support wrappers from environment variables too. for key, value in os.environ.items(): if key.lower().endswith('_wrapper'): key_prefix = key[:-len('_wrapper')] key_prefix = re.sub(r'\.HOST$', '.host', key_prefix) wrappers[key_prefix] = os.path.join(build_to_root, value) mac_toolchain_dir = generator_flags.get('mac_toolchain_dir', None) if mac_toolchain_dir: wrappers['LINK'] = "export DEVELOPER_DIR='%s' &&" % mac_toolchain_dir if flavor == 'win': configs = [target_dicts[qualified_target]['configurations'][config_name] for qualified_target in target_list] shared_system_includes = None if not generator_flags.get('ninja_use_custom_environment_files', 0): shared_system_includes = \ gyp.msvs_emulation.ExtractSharedMSVSSystemIncludes( configs, generator_flags) cl_paths = gyp.msvs_emulation.GenerateEnvironmentFiles( toplevel_build, generator_flags, shared_system_includes, OpenOutput) for arch, path in sorted(cl_paths.items()): if clang_cl: # If we have selected clang-cl, use that instead. path = clang_cl command = CommandWithWrapper('CC', wrappers, QuoteShellArgument(path, 'win')) if clang_cl: # Use clang-cl to cross-compile for x86 or x86_64. command += (' -m32' if arch == 'x86' else ' -m64') master_ninja.variable('cl_' + arch, command) cc = GetEnvironFallback(['CC_target', 'CC'], cc) master_ninja.variable('cc', CommandWithWrapper('CC', wrappers, cc)) cxx = GetEnvironFallback(['CXX_target', 'CXX'], cxx) master_ninja.variable('cxx', CommandWithWrapper('CXX', wrappers, cxx)) if flavor == 'win': master_ninja.variable('ld', ld) master_ninja.variable('idl', 'midl.exe') master_ninja.variable('ar', ar) master_ninja.variable('rc', 'rc.exe') master_ninja.variable('ml_x86', 'ml.exe') master_ninja.variable('ml_x64', 'ml64.exe') master_ninja.variable('mt', 'mt.exe') else: master_ninja.variable('ld', CommandWithWrapper('LINK', wrappers, ld)) master_ninja.variable('ldxx', CommandWithWrapper('LINK', wrappers, ldxx)) master_ninja.variable('ar', GetEnvironFallback(['AR_target', 'AR'], ar)) if flavor != 'mac': # Mac does not use readelf/nm for .TOC generation, so avoiding polluting # the master ninja with extra unused variables. master_ninja.variable( 'nm', GetEnvironFallback(['NM_target', 'NM'], nm)) master_ninja.variable( 'readelf', GetEnvironFallback(['READELF_target', 'READELF'], readelf)) if generator_supports_multiple_toolsets: if not cc_host: cc_host = cc if not cxx_host: cxx_host = cxx master_ninja.variable('ar_host', GetEnvironFallback(['AR_host'], ar_host)) master_ninja.variable('nm_host', GetEnvironFallback(['NM_host'], nm_host)) master_ninja.variable('readelf_host', GetEnvironFallback(['READELF_host'], readelf_host)) cc_host = GetEnvironFallback(['CC_host'], cc_host) cxx_host = GetEnvironFallback(['CXX_host'], cxx_host) # The environment variable could be used in 'make_global_settings', like # ['CC.host', '$(CC)'] or ['CXX.host', '$(CXX)'], transform them here. if '$(CC)' in cc_host and cc_host_global_setting: cc_host = cc_host_global_setting.replace('$(CC)', cc) if '$(CXX)' in cxx_host and cxx_host_global_setting: cxx_host = cxx_host_global_setting.replace('$(CXX)', cxx) master_ninja.variable('cc_host', CommandWithWrapper('CC.host', wrappers, cc_host)) master_ninja.variable('cxx_host', CommandWithWrapper('CXX.host', wrappers, cxx_host)) if flavor == 'win': master_ninja.variable('ld_host', ld_host) else: master_ninja.variable('ld_host', CommandWithWrapper( 'LINK', wrappers, ld_host)) master_ninja.variable('ldxx_host', CommandWithWrapper( 'LINK', wrappers, ldxx_host)) master_ninja.newline() master_ninja.pool('link_pool', depth=GetDefaultConcurrentLinks()) master_ninja.newline() deps = 'msvc' if flavor == 'win' else 'gcc' if flavor != 'win': master_ninja.rule( 'cc', description='CC $out', command=('$cc -MMD -MF $out.d $defines $includes $cflags $cflags_c ' '$cflags_pch_c -c $in -o $out'), depfile='$out.d', deps=deps) master_ninja.rule( 'cc_s', description='CC $out', command=('$cc $defines $includes $cflags $cflags_c ' '$cflags_pch_c -c $in -o $out')) master_ninja.rule( 'cxx', description='CXX $out', command=('$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_cc ' '$cflags_pch_cc -c $in -o $out'), depfile='$out.d', deps=deps) else: # TODO(scottmg) Separate pdb names is a test to see if it works around # http://crbug.com/142362. It seems there's a race between the creation of # the .pdb by the precompiled header step for .cc and the compilation of # .c files. This should be handled by mspdbsrv, but rarely errors out with # c1xx : fatal error C1033: cannot open program database # By making the rules target separate pdb files this might be avoided. cc_command = ('ninja -t msvc -e $arch ' + '-- ' '$cc /nologo /showIncludes /FC ' '@$out.rsp /c $in /Fo$out /Fd$pdbname_c ') cxx_command = ('ninja -t msvc -e $arch ' + '-- ' '$cxx /nologo /showIncludes /FC ' '@$out.rsp /c $in /Fo$out /Fd$pdbname_cc ') master_ninja.rule( 'cc', description='CC $out', command=cc_command, rspfile='$out.rsp', rspfile_content='$defines $includes $cflags $cflags_c', deps=deps) master_ninja.rule( 'cxx', description='CXX $out', command=cxx_command, rspfile='$out.rsp', rspfile_content='$defines $includes $cflags $cflags_cc', deps=deps) master_ninja.rule( 'idl', description='IDL $in', command=('%s gyp-win-tool midl-wrapper $arch $outdir ' '$tlb $h $dlldata $iid $proxy $in ' '$midl_includes $idlflags' % sys.executable)) master_ninja.rule( 'rc', description='RC $in', # Note: $in must be last otherwise rc.exe complains. command=('%s gyp-win-tool rc-wrapper ' '$arch $rc $defines $resource_includes $rcflags /fo$out $in' % sys.executable)) master_ninja.rule( 'asm', description='ASM $out', command=('%s gyp-win-tool asm-wrapper ' '$arch $asm $defines $includes $asmflags /c /Fo $out $in' % sys.executable)) if flavor != 'mac' and flavor != 'win': master_ninja.rule( 'alink', description='AR $out', command='rm -f $out && $ar rcs $arflags $out $in') master_ninja.rule( 'alink_thin', description='AR $out', command='rm -f $out && $ar rcsT $arflags $out $in') # This allows targets that only need to depend on $lib's API to declare an # order-only dependency on $lib.TOC and avoid relinking such downstream # dependencies when $lib changes only in non-public ways. # The resulting string leaves an uninterpolated %{suffix} which # is used in the final substitution below. mtime_preserving_solink_base = ( 'if [ ! -e $lib -o ! -e $lib.TOC ]; then ' '%(solink)s && %(extract_toc)s > $lib.TOC; else ' '%(solink)s && %(extract_toc)s > $lib.tmp && ' 'if ! cmp -s $lib.tmp $lib.TOC; then mv $lib.tmp $lib.TOC ; ' 'fi; fi' % { 'solink': '$ld -shared $ldflags -o $lib -Wl,-soname=$soname %(suffix)s', 'extract_toc': ('{ $readelf -d $lib | grep SONAME ; ' '$nm -gD -f p $lib | cut -f1-2 -d\' \'; }')}) master_ninja.rule( 'solink', description='SOLINK $lib', restat=True, command=mtime_preserving_solink_base % {'suffix': '@$link_file_list'}, rspfile='$link_file_list', rspfile_content= '-Wl,--whole-archive $in $solibs -Wl,--no-whole-archive $libs', pool='link_pool') master_ninja.rule( 'solink_module', description='SOLINK(module) $lib', restat=True, command=mtime_preserving_solink_base % {'suffix': '@$link_file_list'}, rspfile='$link_file_list', rspfile_content='-Wl,--start-group $in -Wl,--end-group $solibs $libs', pool='link_pool') master_ninja.rule( 'link', description='LINK $out', command=('$ld $ldflags -o $out ' '-Wl,--start-group $in -Wl,--end-group $solibs $libs'), pool='link_pool') elif flavor == 'win': master_ninja.rule( 'alink', description='LIB $out', command=('%s gyp-win-tool link-wrapper $arch False ' '$ar /nologo /ignore:4221 /OUT:$out @$out.rsp' % sys.executable), rspfile='$out.rsp', rspfile_content='$in_newline $libflags') _AddWinLinkRules(master_ninja, embed_manifest=True) _AddWinLinkRules(master_ninja, embed_manifest=False) else: master_ninja.rule( 'objc', description='OBJC $out', command=('$cc -MMD -MF $out.d $defines $includes $cflags $cflags_objc ' '$cflags_pch_objc -c $in -o $out'), depfile='$out.d', deps=deps) master_ninja.rule( 'objcxx', description='OBJCXX $out', command=('$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_objcc ' '$cflags_pch_objcc -c $in -o $out'), depfile='$out.d', deps=deps) master_ninja.rule( 'alink', description='LIBTOOL-STATIC $out, POSTBUILDS', command='rm -f $out && ' './gyp-mac-tool filter-libtool libtool $libtool_flags ' '-static -o $out $in' '$postbuilds') master_ninja.rule( 'lipo', description='LIPO $out, POSTBUILDS', command='rm -f $out && lipo -create $in -output $out$postbuilds') master_ninja.rule( 'solipo', description='SOLIPO $out, POSTBUILDS', command=( 'rm -f $lib $lib.TOC && lipo -create $in -output $lib$postbuilds &&' '%(extract_toc)s > $lib.TOC' % { 'extract_toc': '{ otool -l $lib | grep LC_ID_DYLIB -A 5; ' 'nm -gP $lib | cut -f1-2 -d\' \' | grep -v U$$; true; }'})) # Record the public interface of $lib in $lib.TOC. See the corresponding # comment in the posix section above for details. solink_base = '$ld %(type)s $ldflags -o $lib %(suffix)s' mtime_preserving_solink_base = ( 'if [ ! -e $lib -o ! -e $lib.TOC ] || ' # Always force dependent targets to relink if this library # reexports something. Handling this correctly would require # recursive TOC dumping but this is rare in practice, so punt. 'otool -l $lib | grep -q LC_REEXPORT_DYLIB ; then ' '%(solink)s && %(extract_toc)s > $lib.TOC; ' 'else ' '%(solink)s && %(extract_toc)s > $lib.tmp && ' 'if ! cmp -s $lib.tmp $lib.TOC; then ' 'mv $lib.tmp $lib.TOC ; ' 'fi; ' 'fi' % { 'solink': solink_base, 'extract_toc': '{ otool -l $lib | grep LC_ID_DYLIB -A 5; ' 'nm -gP $lib | cut -f1-2 -d\' \' | grep -v U$$; true; }'}) solink_suffix = '@$link_file_list$postbuilds' master_ninja.rule( 'solink', description='SOLINK $lib, POSTBUILDS', restat=True, command=mtime_preserving_solink_base % {'suffix': solink_suffix, 'type': '-shared'}, rspfile='$link_file_list', rspfile_content='$in $solibs $libs', pool='link_pool') master_ninja.rule( 'solink_notoc', description='SOLINK $lib, POSTBUILDS', restat=True, command=solink_base % {'suffix':solink_suffix, 'type': '-shared'}, rspfile='$link_file_list', rspfile_content='$in $solibs $libs', pool='link_pool') master_ninja.rule( 'solink_module', description='SOLINK(module) $lib, POSTBUILDS', restat=True, command=mtime_preserving_solink_base % {'suffix': solink_suffix, 'type': '-bundle'}, rspfile='$link_file_list', rspfile_content='$in $solibs $libs', pool='link_pool') master_ninja.rule( 'solink_module_notoc', description='SOLINK(module) $lib, POSTBUILDS', restat=True, command=solink_base % {'suffix': solink_suffix, 'type': '-bundle'}, rspfile='$link_file_list', rspfile_content='$in $solibs $libs', pool='link_pool') master_ninja.rule( 'link', description='LINK $out, POSTBUILDS', command=('$ld $ldflags -o $out ' '$in $solibs $libs$postbuilds'), pool='link_pool') master_ninja.rule( 'preprocess_infoplist', description='PREPROCESS INFOPLIST $out', command=('$cc -E -P -Wno-trigraphs -x c $defines $in -o $out && ' 'plutil -convert xml1 $out $out')) master_ninja.rule( 'copy_infoplist', description='COPY INFOPLIST $in', command='$env ./gyp-mac-tool copy-info-plist $in $out $binary $keys') master_ninja.rule( 'merge_infoplist', description='MERGE INFOPLISTS $in', command='$env ./gyp-mac-tool merge-info-plist $out $in') master_ninja.rule( 'compile_xcassets', description='COMPILE XCASSETS $in', command='$env ./gyp-mac-tool compile-xcassets $keys $in') master_ninja.rule( 'compile_ios_framework_headers', description='COMPILE HEADER MAPS AND COPY FRAMEWORK HEADERS $in', command='$env ./gyp-mac-tool compile-ios-framework-header-map $out ' '$framework $in && $env ./gyp-mac-tool ' 'copy-ios-framework-headers $framework $copy_headers') master_ninja.rule( 'mac_tool', description='MACTOOL $mactool_cmd $in', command='$env ./gyp-mac-tool $mactool_cmd $in $out $binary') master_ninja.rule( 'package_framework', description='PACKAGE FRAMEWORK $out, POSTBUILDS', command='./gyp-mac-tool package-framework $out $version$postbuilds ' '&& touch $out') master_ninja.rule( 'package_ios_framework', description='PACKAGE IOS FRAMEWORK $out, POSTBUILDS', command='./gyp-mac-tool package-ios-framework $out $postbuilds ' '&& touch $out') if flavor == 'win': master_ninja.rule( 'stamp', description='STAMP $out', command='%s gyp-win-tool stamp $out' % sys.executable) else: master_ninja.rule( 'stamp', description='STAMP $out', command='${postbuilds}touch $out') if flavor == 'win': master_ninja.rule( 'copy', description='COPY $in $out', command='%s gyp-win-tool recursive-mirror $in $out' % sys.executable) elif flavor == 'zos': master_ninja.rule( 'copy', description='COPY $in $out', command='rm -rf $out && cp -fRP $in $out') else: master_ninja.rule( 'copy', description='COPY $in $out', command='ln -f $in $out 2>/dev/null || (rm -rf $out && cp -af $in $out)') master_ninja.newline() all_targets = set() for build_file in params['build_files']: for target in gyp.common.AllTargets(target_list, target_dicts, os.path.normpath(build_file)): all_targets.add(target) all_outputs = set() # target_outputs is a map from qualified target name to a Target object. target_outputs = {} # target_short_names is a map from target short name to a list of Target # objects. target_short_names = {} # short name of targets that were skipped because they didn't contain anything # interesting. # NOTE: there may be overlap between this an non_empty_target_names. empty_target_names = set() # Set of non-empty short target names. # NOTE: there may be overlap between this an empty_target_names. non_empty_target_names = set() for qualified_target in target_list: # qualified_target is like: third_party/icu/icu.gyp:icui18n#target build_file, name, toolset = \ gyp.common.ParseQualifiedTarget(qualified_target) this_make_global_settings = data[build_file].get('make_global_settings', []) assert make_global_settings == this_make_global_settings, ( "make_global_settings needs to be the same for all targets. %s vs. %s" % (this_make_global_settings, make_global_settings)) spec = target_dicts[qualified_target] if flavor == 'mac': gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec) # If build_file is a symlink, we must not follow it because there's a chance # it could point to a path above toplevel_dir, and we cannot correctly deal # with that case at the moment. build_file = gyp.common.RelativePath(build_file, options.toplevel_dir, False) qualified_target_for_hash = gyp.common.QualifiedTarget(build_file, name, toolset) qualified_target_for_hash = qualified_target_for_hash.encode('utf-8') hash_for_rules = hashlib.md5(qualified_target_for_hash).hexdigest() base_path = os.path.dirname(build_file) obj = 'obj' if toolset != 'target': obj += '.' + toolset output_file = os.path.join(obj, base_path, name + '.ninja') ninja_output = StringIO() writer = NinjaWriter(hash_for_rules, target_outputs, base_path, build_dir, ninja_output, toplevel_build, output_file, flavor, toplevel_dir=options.toplevel_dir) target = writer.WriteSpec(spec, config_name, generator_flags) if ninja_output.tell() > 0: # Only create files for ninja files that actually have contents. with OpenOutput(os.path.join(toplevel_build, output_file)) as ninja_file: ninja_file.write(ninja_output.getvalue()) ninja_output.close() master_ninja.subninja(output_file) if target: if name != target.FinalOutput() and spec['toolset'] == 'target': target_short_names.setdefault(name, []).append(target) target_outputs[qualified_target] = target if qualified_target in all_targets: all_outputs.add(target.FinalOutput()) non_empty_target_names.add(name) else: empty_target_names.add(name) if target_short_names: # Write a short name to build this target. This benefits both the # "build chrome" case as well as the gyp tests, which expect to be # able to run actions and build libraries by their short name. master_ninja.newline() master_ninja.comment('Short names for targets.') for short_name in sorted(target_short_names): master_ninja.build(short_name, 'phony', [x.FinalOutput() for x in target_short_names[short_name]]) # Write phony targets for any empty targets that weren't written yet. As # short names are not necessarily unique only do this for short names that # haven't already been output for another target. empty_target_names = empty_target_names - non_empty_target_names if empty_target_names: master_ninja.newline() master_ninja.comment('Empty targets (output for completeness).') for name in sorted(empty_target_names): master_ninja.build(name, 'phony') if all_outputs: master_ninja.newline() master_ninja.build('all', 'phony', sorted(all_outputs)) master_ninja.default(generator_flags.get('default_target', 'all')) master_ninja_file.close() def PerformBuild(data, configurations, params): options = params['options'] for config in configurations: builddir = os.path.join(options.toplevel_dir, 'out', config) arguments = ['ninja', '-C', builddir] print('Building [%s]: %s' % (config, arguments)) subprocess.check_call(arguments) def CallGenerateOutputForConfig(arglist): # Ignore the interrupt signal so that the parent process catches it and # kills all multiprocessing children. signal.signal(signal.SIGINT, signal.SIG_IGN) (target_list, target_dicts, data, params, config_name) = arglist GenerateOutputForConfig(target_list, target_dicts, data, params, config_name) def GenerateOutput(target_list, target_dicts, data, params): # Update target_dicts for iOS device builds. target_dicts = gyp.xcode_emulation.CloneConfigurationForDeviceAndEmulator( target_dicts) user_config = params.get('generator_flags', {}).get('config', None) if gyp.common.GetFlavor(params) == 'win': target_list, target_dicts = MSVSUtil.ShardTargets(target_list, target_dicts) target_list, target_dicts = MSVSUtil.InsertLargePdbShims( target_list, target_dicts, generator_default_variables) if user_config: GenerateOutputForConfig(target_list, target_dicts, data, params, user_config) else: config_names = target_dicts[target_list[0]]['configurations'] if params['parallel']: try: pool = multiprocessing.Pool(len(config_names)) arglists = [] for config_name in config_names: arglists.append( (target_list, target_dicts, data, params, config_name)) pool.map(CallGenerateOutputForConfig, arglists) except KeyboardInterrupt as e: pool.terminate() raise e else: for config_name in config_names: GenerateOutputForConfig(target_list, target_dicts, data, params, config_name)
bsd-3-clause
69aed084ece73982bc21fbf483b6b426
40.668932
80
0.625482
3.842983
false
true
false
false
rapidsms/rapidsms-core-dev
lib/rapidsms/djangoproject/urls.py
2
2330
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 import os from django.conf.urls.defaults import * from rapidsms.utils.modules import try_import from ..conf import settings # this list will be populated with the urls from the urls.urlpatterns of # each installed app, then found by django as if we'd listed them here. urlpatterns = [] for module_name in settings.INSTALLED_APPS: # leave django contrib apps alone. (many of them include urlpatterns # which shouldn't be auto-mapped.) this is a hack, but i like the # automatic per-app mapping enough to keep it. (for now.) if module_name.startswith("django."): continue # attempt to import this app's urls module = try_import("%s.urls" % (module_name)) if not hasattr(module, "urlpatterns"): continue # add the explicitly defined urlpatterns urlpatterns += module.urlpatterns # if the MEDIA_URL does not contain a hostname (ie, it's just an # http path), and we are running in DEBUG mode, we will also serve # the media for this app via this development server. in production, # these files should be served directly if settings.DEBUG: if not settings.MEDIA_URL.startswith("http://"): media_prefix = settings.MEDIA_URL.strip("/") module_suffix = module_name.split(".")[-1] # does urls.py have a sibling "static" dir? (media is always # served from "static", regardless of what MEDIA_URL says) module_path = os.path.dirname(module.__file__) static_dir = "%s/static" % (module_path) if os.path.exists(static_dir): # map to {{ MEDIA_URL }}/appname urlpatterns += patterns("", url( "^%s/%s/(?P<path>.*)$" % ( media_prefix, module_suffix), "django.views.static.serve", {"document_root": static_dir} )) # examine all of the urlpatterns to see if there is a pattern # defined for the root url / dashboard has_dash = False for pat in urlpatterns: if pat.regex.pattern == '^$': has_dash = True # if there is no dashboard url, add the default if not has_dash: from ..views import dashboard urlpatterns += patterns('', url(r'^$', dashboard),)
bsd-3-clause
9633b036541cb0e9ce8586a8a70d769d
34.30303
72
0.620172
4.183124
false
false
false
false
biorack/metatlas
metatlas/datastructures/id_types.py
1
1162
""" types for use with MetatlasDataset """ from typing import List, NewType, Optional, TypedDict from traitlets import HasTraits, TraitType import metatlas.datastructures.metatlas_objects as metob GroupList = Optional[List[metob.Group]] LcmsRunsList = Optional[List[metob.LcmsRun]] FileMatchList = List[str] GroupMatchList = List[str] Polarity = NewType("Polarity", str) ShortPolarity = NewType("ShortPolarity", str) Experiment = NewType("Experiment", str) OutputType = NewType("OutputType", str) IterationNumber = NewType("IterationNumber", int) PathString = NewType("PathString", str) POLARITIES = [Polarity("positive"), Polarity("negative"), Polarity("fast-polarity-switching")] SHORT_POLARITIES = { Polarity("positive"): ShortPolarity("POS"), Polarity("negative"): ShortPolarity("NEG"), Polarity("fast-polarity-switching"): ShortPolarity("FPS"), } class Proposal(TypedDict): """for use with traitlets.validate""" owner: HasTraits value: object trait: TraitType class LcmsRunDict(TypedDict): """part of return type for AnalysisIdentifiers._files_dict""" object: metob.LcmsRun group: str short_name: str
bsd-3-clause
9dc96d05da89acef8a8a5a26c37c01e3
26.666667
94
0.73494
3.427729
false
false
false
false
biorack/metatlas
metatlas/scripts/yaml_validation.py
1
1367
#!/usr/bin/env python """YAML validation with extra check for issues with key""" import itertools import sys from typing import Any, List import numpy as np import yaml def flatten(list_of_lists: List[Any]) -> List[Any]: """flatten nested lists of arbitrary depth""" return list(itertools.chain.from_iterable(list_of_lists)) def get_keys(in_data: Any) -> List: """Recursively get all keys used within a data structure""" if np.isscalar(in_data) or in_data is None: return [] try: return list(in_data.keys()) + flatten([get_keys(v) for v in in_data.values()]) except AttributeError: # some sort of list like iterable return flatten([get_keys(x) for x in in_data]) def check_for_colon(in_keys: List[str]) -> None: """die with error if any of in_keys contains a ':'""" all_valid = True for k in in_keys: if ":" in k: print( f"ERROR: Bad key '{k}'. Either quote the key or add a space after the ':'.", file=sys.stderr ) all_valid = False if not all_valid: sys.exit(128) if __name__ == "__main__": try: data = yaml.safe_load(sys.stdin) except yaml.parser.ParserError: print("ERROR: Could not parse YAML.", file=sys.stderr) sys.exit(128) keys = get_keys(data) check_for_colon(keys)
bsd-3-clause
a309545e8fff9af1c82c494018c35dba
26.897959
108
0.609364
3.569191
false
false
false
false
biorack/metatlas
metatlas/io/system_utils.py
1
1138
"""system utility functions""" import getpass import re import subprocess from typing import Optional, Sequence, Union EMAIL_RE = re.compile(r"[^@\s]+@[^@\s]+\.[a-zA-Z0-9]+$") def is_bad_email_address(address: str) -> bool: """ Returns True only if address is obviously bad. Makes sure a command line switch ('-foo') isn't passed of as an email address """ clean = address.strip() return clean.startswith("-") or not EMAIL_RE.match(clean) def send_mail( subject: str, recipients: Union[str, Sequence[str]], body: str, sender: Optional[str] = None ) -> None: """Sends an email using the mailx command""" sender = getpass.getuser() if sender is None else sender recipients = [recipients] if isinstance(recipients, str) else recipients if recipients is None or len(recipients) == 0: raise ValueError("No recipients supplied") for address in recipients: if is_bad_email_address(address): raise ValueError(f"'{address}' does not appear to be an email address") subprocess.run(["mailx", "-s", subject] + list(recipients), text=True, input=body, check=True)
bsd-3-clause
09b6aa136c1e1b1e9d146693db84e7ec
34.5625
98
0.672232
3.780731
false
false
false
false
biorack/metatlas
tests/system/test_targeted.py
1
7993
# pylint: disable=missing-function-docstring, missing-module-docstring, line-too-long, duplicate-code from . import utils def test_targeted_by_line01_with_remove(tmp_path): image = "registry.spin.nersc.gov/metatlas_test/metatlas_ci:1.1.0" expected = {} expected[ str( tmp_path / "505892_OakGall_final/Test-HILIC/0/0/Targeted/Test-HILIC/EMA-POS/POS_data_sheets/POS_peak_height.tab" ) ] = """group 20201106_JGI-AK_PS-KM_505892_OakGall_final_QE-HF_HILICZ_USHXG01583_POS_MSMS_root_0_0_Cone-S1 20201106_JGI-AK_PS-KM_505892_OakGall_final_QE-HF_HILICZ_USHXG01583_POS_MSMS_root_0_0_Cone-S2 20201106_JGI-AK_PS-KM_505892_OakGall_final_QE-HF_HILICZ_USHXG01583_POS_MSMS_root_0_0_Cone-S3 20201106_JGI-AK_PS-KM_505892_OakGall_final_QE-HF_HILICZ_USHXG01583_POS_MSMS_root_0_0_Cone-S4 file 20201106_JGI-AK_PS-KM_505892_OakGall_final_QE-HF_HILICZ_USHXG01583_POS_MSMS_49_Cone-S1_1_Rg70to1050-CE102040-QlobataAkingi-S1_Run34.h5 20201106_JGI-AK_PS-KM_505892_OakGall_final_QE-HF_HILICZ_USHXG01583_POS_MSMS_57_Cone-S2_1_Rg70to1050-CE102040-QlobataAkingi-S1_Run40.h5 20201106_JGI-AK_PS-KM_505892_OakGall_final_QE-HF_HILICZ_USHXG01583_POS_MSMS_65_Cone-S3_1_Rg70to1050-CE102040-QlobataAkingi-S1_Run16.h5 20201106_JGI-AK_PS-KM_505892_OakGall_final_QE-HF_HILICZ_USHXG01583_POS_MSMS_73_Cone-S4_1_Rg70to1050-CE102040-QlobataAkingi-S1_Run31.h5 short groupname POS_Cone-S1 POS_Cone-S2 POS_Cone-S3 POS_Cone-S4 sample treatment Cone-S1 Cone-S2 Cone-S3 Cone-S4 short filename 20201106_PS-KM_OakGall_final_HILICZ_POS_Rg70to1050-CE102040-QlobataAkingi-S1 20201106_PS-KM_OakGall_final_HILICZ_POS_Rg70to1050-CE102040-QlobataAkingi-S1 20201106_PS-KM_OakGall_final_HILICZ_POS_Rg70to1050-CE102040-QlobataAkingi-S1 20201106_PS-KM_OakGall_final_HILICZ_POS_Rg70to1050-CE102040-QlobataAkingi-S1 short samplename POS_Cone-S1_1_Rg70to1050-CE102040-QlobataAkingi-S1 POS_Cone-S2_1_Rg70to1050-CE102040-QlobataAkingi-S1 POS_Cone-S3_1_Rg70to1050-CE102040-QlobataAkingi-S1 POS_Cone-S4_1_Rg70to1050-CE102040-QlobataAkingi-S1 0000_2deoxyadenosine_positive_M+H252p1091_2p20 3.047619062e+05 4.167880312e+05 8.376620625e+05 2.359861250e+06 0001_adenine_positive_M+H136p0618_2p52 1.594753875e+06 1.209648500e+07 5.177495600e+07 9.195548800e+07 0002_adenosine_positive_M+H268p1041_3p02 2.661186800e+07 1.197741840e+08 2.677188800e+08 4.739050240e+08 0003_sucrose_positive_M+Na365p1054_13p41 1.215929500e+07 5.998378500e+06 5.243578125e+05 3.552174750e+06""" expected[ str( tmp_path / "505892_OakGall_final/Test-HILIC/0/0/Targeted/Test-HILIC/EMA-POS/POS_data_sheets/POS_rt_peak.tab" ) ] = """group 20201106_JGI-AK_PS-KM_505892_OakGall_final_QE-HF_HILICZ_USHXG01583_POS_MSMS_root_0_0_Cone-S1 20201106_JGI-AK_PS-KM_505892_OakGall_final_QE-HF_HILICZ_USHXG01583_POS_MSMS_root_0_0_Cone-S2 20201106_JGI-AK_PS-KM_505892_OakGall_final_QE-HF_HILICZ_USHXG01583_POS_MSMS_root_0_0_Cone-S3 20201106_JGI-AK_PS-KM_505892_OakGall_final_QE-HF_HILICZ_USHXG01583_POS_MSMS_root_0_0_Cone-S4 file 20201106_JGI-AK_PS-KM_505892_OakGall_final_QE-HF_HILICZ_USHXG01583_POS_MSMS_49_Cone-S1_1_Rg70to1050-CE102040-QlobataAkingi-S1_Run34.h5 20201106_JGI-AK_PS-KM_505892_OakGall_final_QE-HF_HILICZ_USHXG01583_POS_MSMS_57_Cone-S2_1_Rg70to1050-CE102040-QlobataAkingi-S1_Run40.h5 20201106_JGI-AK_PS-KM_505892_OakGall_final_QE-HF_HILICZ_USHXG01583_POS_MSMS_65_Cone-S3_1_Rg70to1050-CE102040-QlobataAkingi-S1_Run16.h5 20201106_JGI-AK_PS-KM_505892_OakGall_final_QE-HF_HILICZ_USHXG01583_POS_MSMS_73_Cone-S4_1_Rg70to1050-CE102040-QlobataAkingi-S1_Run31.h5 short groupname POS_Cone-S1 POS_Cone-S2 POS_Cone-S3 POS_Cone-S4 sample treatment Cone-S1 Cone-S2 Cone-S3 Cone-S4 short filename 20201106_PS-KM_OakGall_final_HILICZ_POS_Rg70to1050-CE102040-QlobataAkingi-S1 20201106_PS-KM_OakGall_final_HILICZ_POS_Rg70to1050-CE102040-QlobataAkingi-S1 20201106_PS-KM_OakGall_final_HILICZ_POS_Rg70to1050-CE102040-QlobataAkingi-S1 20201106_PS-KM_OakGall_final_HILICZ_POS_Rg70to1050-CE102040-QlobataAkingi-S1 short samplename POS_Cone-S1_1_Rg70to1050-CE102040-QlobataAkingi-S1 POS_Cone-S2_1_Rg70to1050-CE102040-QlobataAkingi-S1 POS_Cone-S3_1_Rg70to1050-CE102040-QlobataAkingi-S1 POS_Cone-S4_1_Rg70to1050-CE102040-QlobataAkingi-S1 0000_2deoxyadenosine_positive_M+H252p1091_2p20 2.277504444e+00 2.280636311e+00 2.283326864e+00 2.292241573e+00 0001_adenine_positive_M+H136p0618_2p52 2.616474867e+00 2.639369249e+00 2.618291378e+00 2.657374620e+00 0002_adenosine_positive_M+H268p1041_3p02 3.098848820e+00 3.125092983e+00 3.117606878e+00 3.139331818e+00 0003_sucrose_positive_M+Na365p1054_13p41 1.339970875e+01 1.339875221e+01 1.342395210e+01 1.340112782e+01""" # remvoing compounds at index 0, 4, 6 is not because the peaks are bad or incorrect, # but strictly to make the test results match to before these compounds were added # to the test atlas. command = """\ jq -M '(.cells[] | select(.source[] | contains("compound_idx=0")).source) \ += ["\\n", \ "agui.compound_idx = 0\\n", \ "agui.set_msms_flag(\\"1, co-isolated precursor but all reference ions are in sample spectrum\\")\\n", \ "agui.data.set_rt(0, \\"rt_min\\", 2.1245)\\n", \ "agui.data.set_rt(0, \\"rt_max\\", 2.4439)\\n", \ "agui.compound_idx = 1\\n", \ "agui.set_msms_flag(\\"1, perfect match to internal reference library\\")\\n", \ "agui.data.set_rt(1, \\"rt_min\\", 2.4361)\\n", \ "agui.data.set_rt(1, \\"rt_max\\", 2.8608)\\n", \ "agui.compound_idx = 2\\n", \ "agui.set_peak_flag(\\"remove\\")\\n", \ "agui.compound_idx = 3\\n", \ "agui.set_msms_flag(\\"1, perfect match to internal reference library\\")\\n", \ "agui.data.set_rt(3, \\"rt_min\\", 2.8428)\\n", \ "agui.data.set_rt(3, \\"rt_max\\", 3.3081)\\n", \ "agui.compound_idx = 4\\n", \ "agui.set_peak_flag(\\"remove\\")\\n", \ "agui.compound_idx = 5\\n", \ "agui.data.set_rt(5, \\"rt_min\\", 13.319)\\n", \ "agui.data.set_rt(5, \\"rt_max\\", 13.520)\\n" \ ]' /src/notebooks/reference/Targeted.ipynb > /out/Remove.ipynb && \ papermill -k papermill \ -p source_atlas_name HILICz150_ANT20190824_PRD_EMA_Unlab_POS_20201106_505892_root0 \ -p source_atlas_unique_id 4b05837a53494dd8b680e6b5059e1934 \ -p experiment 20201106_JGI-AK_PS-KM_505892_OakGall_final_QE-HF_HILICZ_USHXG01583 \ -p project_directory /out \ -p max_cpus 2 \ -p config_file_name /src/test_config.yaml \ -p workflow_name Test-HILIC\ -p analysis_name EMA-POS \ -p rt_alignment_number 0 \ -p analysis_number 0 \ -y "exclude_lcmsruns: {"always": ['20201106_JGI-AK_PS-KM_505892_OakGall_final_QE-HF_HILICZ_USHXG01583_POS_MSMS_53_Cone-S1_5_Rg70to1050-CE102040-QlobataAkingi-S1_Run187', '20201106_JGI-AK_PS-KM_505892_OakGall_final_QE-HF_HILICZ_USHXG01583_POS_MSMS_54_Cone-S1_6_Rg70to1050-CE102040-QlobataAkingi-S1_Run221']}" \ /out/Remove.ipynb \ /out/Remove-done.ipynb """ utils.exec_docker(image, command, tmp_path, {}) utils.assert_files_match(expected) assert utils.num_files_in(tmp_path) == 65
bsd-3-clause
3b6d67c5f966bfceae712ab0731c512d
96.47561
544
0.648693
2.232682
false
true
false
false
biorack/metatlas
metatlas/plots/chromatograms_mp_plots.py
2
5507
from __future__ import absolute_import import matplotlib #matplotlib.use('Agg') import sys #import yaml import os #import multiprocessing as mp from matplotlib import pyplot as plt import numpy as np import warnings from textwrap import wrap #warnings.filterwarnings("ignore") from metatlas.io import metatlas_get_data_helper_fun as ma_data def plot_chromatogram(d,file_name, ax=None): """ """ if ax is None: ax = plt.gca() rt_min = d['identification'].rt_references[0].rt_min rt_max = d['identification'].rt_references[0].rt_max rt_peak = d['identification'].rt_references[0].rt_peak if len(d['data']['eic']['rt']) > 1: x = np.asarray(d['data']['eic']['rt']) y = np.asarray(d['data']['eic']['intensity']) ax.plot(x,y,'k-',linewidth=2.0,alpha=1.0) myWhere = np.logical_and(x>=rt_min, x<=rt_max ) ax.fill_between(x,0,y,myWhere, facecolor='c', alpha=0.3) ax.axvline(rt_min, color='k',linewidth=2.0) ax.axvline(rt_max, color='k',linewidth=2.0) ax.axvline(rt_peak, color='r',linewidth=2.0) ax.set_title("\n".join(wrap(file_name,54)),fontsize=12,weight='bold') def plot_compounds_and_files_mp(kwargs): #print(mp.current_process()) my_data= kwargs['data'] # data for all compounds for one file file_name = kwargs['file_name'] # full path of output file name nRows, nCols = kwargs['rowscols'] names = kwargs['names'] share_y = kwargs['share_y'] # plt.ioff() f,ax = plt.subplots(nRows, nCols, sharey=share_y,figsize=(8*nCols,nRows*6)) ax = ax.flatten() plt.rcParams['pdf.fonttype']=42 plt.rcParams['pdf.use14corefonts'] = True # matplotlib.rc('font', family='sans-serif') # matplotlib.rc('font', serif='Helvetica') plt.rcParams['text.usetex'] = False plt.rcParams.update({'font.size': 12}) plt.rcParams.update({'font.weight': 'bold'}) plt.rcParams['axes.linewidth'] = 2 # set the value globally for i,name in enumerate(names): plot_chromatogram(my_data[i], name, ax=ax[i]) f.savefig(file_name) plt.close(f) def plot_compounds_and_files(output_dir, data, nCols = 8, share_y = False, pool=None, plot_types='both'): ''' Parameters ---------- output_dir location of saved pdf plots nCols number of columns per pdf file share_y subplots share/not share they y axis processes number of cores to use plot_types compounds per file or files per compound or both Returns ------- nothing ''' file_names = ma_data.get_file_names(data) compound_names = ma_data.get_compound_names(data)[0] # create directory if necessary if not os.path.exists(output_dir): os.makedirs(output_dir) # setup the parameters according to the request if 'files' in plot_types.lower(): nRows = int(np.ceil(len(compound_names)/float(nCols))) args_list = [] for file_idx, my_file in enumerate(file_names): kwargs = {'data': data[file_idx], 'file_name': os.path.join(output_dir, my_file +'.pdf'), 'rowscols': (nRows, nCols), 'share_y': share_y, 'names': compound_names} args_list.append(kwargs) if 'compounds' in plot_types.lower(): nRows = int(np.ceil(len(file_names)/float(nCols))) args_list = [] for compound_idx, my_compound in enumerate(compound_names): my_data = list() for file_idx, my_file in enumerate(file_names): my_data.append(data[file_idx][compound_idx]) kwargs = {'data': my_data, 'file_name': os.path.join(output_dir, my_compound+'.pdf'), 'rowscols': (nRows, nCols), 'share_y': share_y, 'names': file_names} args_list.append(kwargs) pool.map(plot_compounds_and_files_mp, args_list) #if __name__ == '__main__': # #sys.path.insert(0, '/global/homes/j/jtouma/metatlas') # import pickle # # # load pickled data # info = pickle.load(open(sys.argv[1], "rb")) # sys.path.insert(info['path_idx'], info['path']) # from metatlas.helpers import metatlas_get_data_helper_fun as ma_data # data = ma_data.get_dill_data(info['pkl_file']) # file_names = ma_data.get_file_names(data) # compound_names = ma_data.get_compound_names(data)[0] # # print("\n") # print(50*'-') # print("Number of file: " + str(len(file_names))) # print("Number of compounds: " + str(len(compound_names))) # if info['plot_types'].lower() == 'both': # print("Processing both files and compounds") # else: # print("processing " + info['plot_types'].lower() + " only") # print("Using " + str(info['processes']) + " out of " + str(mp.cpu_count()) + " available cores") # print(50*'-') # print("\n") # plot_compounds_and_files(output_dir=info['output_dir'], # data=data, # compound_names=compound_names, # file_names=file_names, # nCols=info['nCols'], # share_y=info['share_y'], # processes=info['processes'], # plot_types=info['plot_types']) #
bsd-3-clause
089a0cfcff3a04a95e250764e270d98a
34.076433
101
0.565825
3.380602
false
false
false
false
biorack/metatlas
tests/system/utils.py
1
2880
# pylint: disable=missing-function-docstring, missing-module-docstring, duplicate-code import os import subprocess import unicodedata from typing import Any, Dict import pandas as pd PAPERMILL_ENV = {"PAPERMILL_EXECUTION": "True"} def num_files_in(path: os.PathLike) -> int: """Returns number of files in path. Does not count directories""" return int(subprocess.check_output(f"find {str(path)} -type f | wc -l", shell=True, text=True).strip()) def compare_strs(s_1: str, s_2: str) -> bool: """String comparision with unicode normalization""" def norm_str(in_str: str) -> str: """Unicode string normalization""" return unicodedata.normalize("NFD", in_str) return norm_str(s_1) == norm_str(s_2) def assert_files_match(expected: Dict[os.PathLike, str]) -> None: """ Throw assertion error if expected does not contain the same data as files on disk inputs: expected: dict with Path objects as keys and strings representing file contents as values returns None """ for path, contents in expected.items(): with open(path, "r", encoding="utf8") as handle: expected_lines = contents.split("\n") num = None for num, line in enumerate(handle.readlines()): assert num < len(expected_lines), "File has more lines than expected." clean_line = line.rstrip("\n") assert compare_strs(expected_lines[num], clean_line), ( "Expected line differss from actual:\n" f'Expected: "{expected_lines[num]}"\n' f'Actual: "{clean_line}"' ) if num is None and contents == "": continue assert len(expected_lines) == num + 1, "File has fewer lines than expected." def assert_dfs_match(expected: Dict[os.PathLike, Dict[str, Dict[int, Any]]]) -> None: """ Throw assertion error if expected does not contain the same data as dataframes on disk inputs: expected: dict with Path objects as keys and dicts as values returns None """ for path, data_dict in expected.items(): disk_df = pd.read_csv(path) expected_df = pd.DataFrame(data_dict) pd.testing.assert_frame_equal(disk_df, expected_df) def exec_docker(image: str, command: str, out_path: os.PathLike, env: Dict) -> None: """execute command in image with out_path mounted at /out""" env_flags = [x for key, value in env.items() for x in ("--env", f"{key}={value}")] subprocess.run( [ "docker", "run", "--rm", "-v", f"{os.getcwd()}:/src", "-v", f"{out_path}:/out", *env_flags, image, "/bin/bash", "-c", command, ], check=True, )
bsd-3-clause
1f279b9bbb43bffcbf509d854a29406c
32.882353
107
0.582639
3.876178
false
false
false
false
biorack/metatlas
metatlas/io/targeted_output.py
1
20820
"""Generate standarized outputs for targeted analysis""" # pylint: disable=too-many-arguments import logging import math import os from collections import namedtuple from typing import List import matplotlib.pyplot as plt import matplotlib.ticker as mticker import numpy as np import pandas as pd from matplotlib import gridspec from matplotlib.axis import Axis from tqdm.notebook import tqdm from metatlas.datastructures.metatlas_dataset import MetatlasDataset from metatlas.io.write_utils import export_dataframe_die_on_diff from metatlas.plots import dill2plots as dp from metatlas.tools import fastanalysis as fa from metatlas.tools.config import Analysis, Workflow from metatlas.tools.notebook import in_papermill from metatlas.plots.tic import save_sample_tic_pdf logger = logging.getLogger(__name__) def write_atlas_to_csv(metatlas_dataset, overwrite=False): """Save atlas as csv file. Will not overwrite existing file unless overwrite is True""" out_file_name = os.path.join(metatlas_dataset.ids.output_dir, f"{metatlas_dataset.atlas.name}_export.csv") out_df = dp.export_atlas_to_spreadsheet(metatlas_dataset.atlas) export_dataframe_die_on_diff(out_df, out_file_name, "atlas", overwrite=overwrite, float_format="%.6e") def write_identifications_spreadsheet( metatlas_dataset, analysis_parameters, min_intensity=1e4, rt_tolerance=0.5, mz_tolerance=20, min_msms_score=0.6, min_num_frag_matches=1, min_relative_frag_intensity=0.001, allow_no_msms=True, overwrite=False, ): """ inputs: metatlas_dataset: a MetatlasDataset instance min_intensity: intensity threshold; 1e5 is strict, 1e3 is loose rt_tolerance: RT tolerance threshold shift of median RT across all files for given compound to reference mz_tolerance: MZ tolerance threshold ppm of median mz across all files for given compound relative to reference 5 is strict, 25 is loose min_msms_score: score threshold max dot-product score across all files for given compound relative to reference Score values in [0-1]; 0.6 is strict, 0.3 is loose min_num_frag_matches: threshold of number of frag matches between sample and reference min_relative_frag_intensity: threshold ratio of second highest to first highest intensity of matching sample mzs allow_no_msms: if True evaluate only on MS1 thresholds if no MSMS data is found, if False filter out row if MSMS thresholds are not passing overwrite: if True, will write over existing files """ ids = metatlas_dataset.ids ids.set_output_state(analysis_parameters, "ids_spreadsheet") prefix = f"{ids.short_polarity}_" scores_path = os.path.join(ids.output_dir, f"{prefix}stats_tables", f"{prefix}compound_scores.csv") _ = metatlas_dataset.hits # regenerate hits if needed before logging about scores logger.info("Calculating scores and exporting them to %s.", scores_path) scores_df = fa.make_scores_df(metatlas_dataset, metatlas_dataset.hits) scores_df["passing"] = fa.test_scores_df( scores_df, min_intensity, rt_tolerance, mz_tolerance, min_msms_score, allow_no_msms, min_num_frag_matches, min_relative_frag_intensity, ) export_dataframe_die_on_diff(scores_df, scores_path, "scores", overwrite=overwrite, float_format="%.8e") fa.make_stats_table( input_dataset=metatlas_dataset, msms_hits=metatlas_dataset.hits, output_loc=ids.output_dir, output_sheetname=f"{ids.project}_{ids.workflow}_{ids.analysis}_Identifications.xlsx", min_peak_height=1e5, use_labels=True, min_msms_score=0.01, min_num_frag_matches=1, polarity=ids.short_polarity, overwrite=overwrite, data_sheets=False, # eliminates output of the legacy 'data_sheets' dir but not '{POL}_data_sheets' ) def write_chromatograms(metatlas_dataset, analysis_parameters, overwrite=False, max_cpus=1): """ inputs: metatlas_dataset: a MetatlasDataset instance group_by: 'index', 'page', or None for grouping of plots overwrite: if False raise error if file already exists """ # overwrite checks done within dp.make_chromatograms metatlas_dataset.ids.set_output_state(analysis_parameters, "chromatograms") logger.info("Exporting chromatograms with shared Y-axis.") params = { "input_dataset": metatlas_dataset, "share_y": True, "output_loc": metatlas_dataset.ids.output_dir, "polarity": metatlas_dataset.ids.short_polarity, "overwrite": overwrite, "max_cpus": max_cpus, "suffix": "_sharedY", } dp.make_chromatograms(**params) logger.info("Exporting chromatograms with independent Y-axis.") params["share_y"] = False params["suffix"] = "_independentY" dp.make_chromatograms(**params) def write_tics(metatlas_dataset, x_min=None, x_max=None, y_min=0, overwrite=False): """ Create PDF files with TIC plot for each sample One file with shared Y-axes, one file with independent Y-axes """ prefix = f"{metatlas_dataset.ids.short_polarity}_" for suffix, sharey in [("_independentY", False), ("_sharedY", True)]: file_name = os.path.join(metatlas_dataset.ids.output_dir, f"{prefix}TICs{suffix}.pdf") save_sample_tic_pdf( metatlas_dataset, metatlas_dataset.ids.polarity, file_name, overwrite, x_min=x_min, x_max=x_max, y_min=y_min, sharey=sharey, ) def write_identification_figure(metatlas_dataset, analysis_parameters, overwrite=False): """Save identification figure. Will not overwrite existing file unless overwrite is True""" # overwrite checks done within dp.make_identification_figure_v2 ids = metatlas_dataset.ids logger.info("Exporting indentification figures to %s", ids.output_dir) ids.set_output_state(analysis_parameters, "chromatograms") dp.make_identification_figure_v2( input_dataset=metatlas_dataset, msms_hits=metatlas_dataset.hits, use_labels=True, output_loc=metatlas_dataset.ids.output_dir, short_names_df=metatlas_dataset.ids.lcmsruns_short_names, polarity=metatlas_dataset.ids.short_polarity, overwrite=overwrite, ) def write_metrics_and_boxplots(metatlas_dataset, analysis_parameters, overwrite=False, max_cpus=1): """ Save metrics dataframes as csv and boxplots as PDF. Will not overwrite existing file unless overwrite is True """ config = [ {"name": "peak_height", "label": "Peak Height"}, {"name": "peak_area", "label": None}, {"name": "mz_peak", "label": None}, {"name": "rt_peak", "label": "RT Peak"}, {"name": "mz_centroid", "label": "MZ Centroid"}, {"name": "rt_centroid", "label": None}, ] ids = metatlas_dataset.ids prefix = f"{metatlas_dataset.ids.short_polarity}_" ids.set_output_state(analysis_parameters, "data_sheets") for fields in config: df_dir = os.path.join(ids.output_dir, f"{prefix}data_sheets") dataframe = dp.make_output_dataframe( fieldname=fields["name"], input_dataset=metatlas_dataset, output_loc=df_dir, short_names_df=ids.lcmsruns_short_names, polarity=ids.short_polarity, use_labels=True, overwrite=overwrite, ) ids.set_output_state(analysis_parameters, "box_plots") for fields in config: if fields["label"] is not None: for logy in [False, True]: plot_dir = os.path.join( ids.output_dir, f"{prefix}boxplot_{fields['name']}{'_log' if logy else ''}", ) dp.make_boxplot_plots( dataframe, output_loc=plot_dir, use_shortnames=True, ylabel=fields["label"], overwrite=overwrite, max_cpus=max_cpus, logy=logy, ) Max = namedtuple("Max", ["file_idx", "pre_intensity_idx", "pre_intensity", "precursor_mz"]) def write_msms_fragment_ions( data, intensity_fraction=0.01, min_mz=450, max_mz_offset=5, scale_intensity=1e5, overwrite=False ): """ inputs: data: metatlas_datset intensity_fraction: intensity threshold as fraction of max_msms_intensity (0-1] min_mz: minimum threshold MSMS mz value max_mz: maximum threshold MSMS mz value. Relative to precursor mz with highest intensity scale_intensity: If not None, normalize output intensity to maximum of scale_intensity """ out = [] for compound_idx, _ in enumerate(data[0]): max_vars = get_max_precursor_intensity(data, compound_idx) out.append( get_spectra_strings( data[max_vars.file_idx][compound_idx], max_vars.pre_intensity, min_mz, max_mz_offset + max_vars.precursor_mz, intensity_fraction, scale_intensity, ) ) out_df = pd.DataFrame(out) path = os.path.join(data.ids.output_dir, f"spectra_{intensity_fraction:.2f}pct_{int(min_mz)}cut.csv") export_dataframe_die_on_diff(out_df, path, "MSMS fragment ions", overwrite=overwrite, float_format="%.8e") return out_df def get_max_precursor_intensity(data, compound_idx): """ inputs: data: metatlas_dataset compound_idx: index of compound to search over returns Max object with file index of highest precursor intensity, associated intensity value, and mz """ max_pre_intensity = max_precursor_mz = 0 max_file_idx = max_pre_intensity_idx = None for file_idx, _ in enumerate(data): try: msms = data[file_idx][compound_idx]["data"]["msms"]["data"] if len(msms["precursor_intensity"]) == 0: continue pre_intensity_idx = msms["precursor_intensity"].argmax() pre_intensity = msms["precursor_intensity"][pre_intensity_idx] precursor_mz = msms["precursor_MZ"][pre_intensity_idx] rts = msms["rt"][pre_intensity_idx] rt_ref = data[file_idx][compound_idx]["identification"].rt_references[-1] if pre_intensity > max_pre_intensity and rt_ref.rt_min < rts < rt_ref.rt_max: max_file_idx = file_idx max_pre_intensity_idx = pre_intensity_idx max_pre_intensity = pre_intensity max_precursor_mz = precursor_mz except (AttributeError, IndexError): pass return Max(max_file_idx, max_pre_intensity_idx, max_pre_intensity, max_precursor_mz) def get_spectra_strings(data, max_pre_intensity, min_mz, max_mz, intensity_fraction, scale_intensity): """ inputs: data: metatlas_dataset[x][y] sample_idx: first index into data compound_idx: second into into data max_pre_intensity: highest msms precursor intensity for this compound across all samples min_mz: minimum threshold MSMS mz value max_mz: maximum threshold MSMS mz value intensity_fraction: intensity threshold as fraction of max_msms_intensity (0-1] scale_intensity: If not None, normalize output intensity to maximum of scale_intensity returns a dict containing compound name and string representations of the spectra """ mz_list, intensity_list = get_spectra( data, max_pre_intensity, min_mz, max_mz, intensity_fraction, scale_intensity ) mz_str = str([f"{x:.2f}" for x in mz_list]).replace("'", "") intensity_str = str([int(x) for x in intensity_list]).replace("'", "") spectra_str = str([mz_str, intensity_str]).replace("'", "") name = data["identification"].name return {"name": name, "spectrum": spectra_str, "mz": mz_str, "intensity": intensity_str} def get_spectra(data, max_pre_intensity, min_mz, max_mz, intensity_fraction, scale_intensity): """ inputs: data: metatlas_dataset[i][j] max_pre_intensity: highest msms precursor intensity for this compound across all samples min_mz: minimum threshold MSMS mz value max_mz: maximum threshold MSMS mz value intensity_fraction: intensity threshold as fraction of max_msms_intensity (0-1] scale_intensity: If not None, normalize output intensity to maximum of scale_intensity returns a tuple containing a list of mz values and a list intensity values that make a spectra returns None, None if no spectra meet the filtering thresholds """ if max_pre_intensity != 0: msms = data["data"]["msms"]["data"] idx = np.argwhere(msms["precursor_intensity"] == max_pre_intensity).flatten() msms_mz = msms["mz"][idx] intensity = msms["i"][idx] max_msms_intensity = intensity.max() cutoff = intensity_fraction * max_msms_intensity conditions = (intensity > cutoff) & (min_mz < msms_mz) & (msms_mz < max_mz) if any(conditions): keep_idx = np.argwhere(conditions).flatten() if scale_intensity is not None: intensity = (intensity / max_msms_intensity * scale_intensity).astype(int) return msms_mz[keep_idx], intensity[keep_idx] return None, None def generate_standard_outputs( data: MetatlasDataset, workflow: Workflow, analysis: Analysis, overwrite: bool = False, ) -> None: """Generates the default set of outputs for a targeted experiment""" params = analysis.parameters data.ids.set_output_state(params, "gui") write_atlas_to_csv(data, overwrite=overwrite) write_tics(data, overwrite=overwrite, x_min=1.5) write_identifications_spreadsheet(data, params, overwrite=overwrite) write_chromatograms(data, params, overwrite=overwrite, max_cpus=data.max_cpus) write_identification_figure(data, params, overwrite=overwrite) write_metrics_and_boxplots(data, params, overwrite=overwrite, max_cpus=data.max_cpus) logger.info("Generation of standard output files completed sucessfully.") def generate_qc_plots(data: MetatlasDataset) -> None: """Write plots that can be used to QC the experiment""" rts_df = get_rts(data) compound_atlas_rts_file_name = os.path.join( data.ids.output_dir, f"{data.ids.short_polarity}_Compound_Atlas_RTs.pdf" ) plot_compound_atlas_rts(len(data), rts_df, compound_atlas_rts_file_name) peak_heights_df = get_peak_heights(data) peak_heights_plot_file_name = os.path.join( data.ids.output_dir, f"{data.ids.short_polarity}_Compound_Atlas_peak_heights.pdf" ) plot_compound_atlas_peak_heights(len(data), peak_heights_df, peak_heights_plot_file_name) def generate_qc_outputs(data: MetatlasDataset, analysis: Analysis) -> None: """Write outputs that can be used to QC the experiment""" ids = data.ids ids.set_output_state(analysis.parameters, "ids_spreadsheet") save_rt_peak(data, os.path.join(ids.output_dir, f"{ids.short_polarity}_rt_peak.tab")) save_measured_rts(data, os.path.join(ids.output_dir, f"{ids.short_polarity}_QC_Measured_RTs.csv")) generate_qc_plots(data) def save_measured_rts(data: MetatlasDataset, file_name: str) -> None: """Save RT values in csv format file""" rts_df = get_rts(data, include_atlas_rt_peak=False) export_dataframe_die_on_diff(rts_df, file_name, "measured RT values", float_format="%.6e") def save_rt_peak(data: MetatlasDataset, file_name: str) -> None: """Save peak RT values in tsv format file""" rts_df = dp.make_output_dataframe(input_dataset=data, fieldname="rt_peak", use_labels=True) export_dataframe_die_on_diff(rts_df, file_name, "peak RT values", sep="\t", float_format="%.6e") def get_rts(data: MetatlasDataset, include_atlas_rt_peak: bool = True) -> pd.DataFrame: """Returns RT values in DataFrame format""" rts_df = dp.make_output_dataframe( input_dataset=data, fieldname="rt_peak", use_labels=True, summarize=True, ) if include_atlas_rt_peak: rts_df["atlas RT peak"] = [ compound["identification"].rt_references[0].rt_peak for compound in data[0] ] return order_df_columns_by_run(rts_df) def get_peak_heights(data: MetatlasDataset) -> pd.DataFrame: """Returns peak heights in DataFrame format""" peak_height_df = dp.make_output_dataframe( input_dataset=data, fieldname="peak_height", use_labels=True, summarize=True, ) return order_df_columns_by_run(peak_height_df) def order_df_columns_by_run(dataframe: pd.DataFrame) -> pd.DataFrame: """ Returns a dataframe with re-ordered columns such that second column up to column 'mean' are ordered by run number from low to high """ cols = dataframe.columns.tolist() stats_start_idx = cols.index("mean") to_sort = cols[:stats_start_idx] no_sort = cols[stats_start_idx:] to_sort.sort( key=lambda x: int( x.split(".")[0].split("_")[-1].lower().replace("run", "").replace("seq", "").replace("s", "") ) ) new_cols = to_sort + no_sort return dataframe[new_cols] def plot_per_compound( field_name: str, num_files: int, data: pd.DataFrame, file_name: str, fontsize: float = 2, pad: float = 0.1, cols: int = 8, ) -> None: """ Writes plot of RT peak for vs file for each compound inputs: field_name: one of rt_peak or peak_height num_files: number of files in data set, ie len(data) data: Dataframe with RTs values file_name: where to save plot fontsize: size of text pad: padding size cols: number of columns in plot grid """ logger.info("Plotting %s vs file for each compound", field_name) plot_df = ( data.sort_values(by="standard deviation", ascending=False, na_position="last") .drop(["#NaNs"], axis=1) .dropna(axis=0, how="all", subset=data.columns[:num_files]) ) rows = int(math.ceil((data.shape[0] + 1) / cols)) fig = plt.figure() grid = gridspec.GridSpec(rows, cols, figure=fig, wspace=0.2, hspace=0.4) for i, (_, row) in tqdm( enumerate(plot_df.iterrows()), total=len(plot_df), unit="plot", disable=in_papermill() ): a_x = fig.add_subplot(grid[i]) range_columns = list(plot_df.columns[:num_files]) file_vs_value_plot(a_x, field_name, row, range_columns, fontsize, pad) plt.savefig(file_name, bbox_inches="tight") plt.close() def file_vs_value_plot( a_x: Axis, field_name: str, row: pd.DataFrame, range_columns: List[str], fontsize: float, pad: float ) -> None: """Create a dot plot with one point per file""" assert field_name in ["rt_peak", "peak_height"] a_x.tick_params(direction="in", length=1, pad=pad, width=0.1, labelsize=fontsize) num_files = len(range_columns) a_x.scatter(range(num_files), row[:num_files], s=0.2) if field_name == "rt_peak": a_x.axhline(y=row["atlas RT peak"], color="r", linestyle="-", linewidth=0.2) range_columns += ["atlas RT peak"] a_x.set_ylim(np.nanmin(row.loc[range_columns]) - 0.12, np.nanmax(row.loc[range_columns]) + 0.12) else: a_x.set_yscale("log") a_x.set_ylim(bottom=1e4, top=1e10) a_x.set_xlim(-0.5, num_files + 0.5) a_x.xaxis.set_major_locator(mticker.FixedLocator(np.arange(0, num_files, 1.0))) _ = [s.set_linewidth(0.1) for s in a_x.spines.values()] # truncate name so it fits above a single subplot a_x.set_title(row.name[:33], pad=pad, fontsize=fontsize) a_x.set_xlabel("Files", labelpad=pad, fontsize=fontsize) ylabel = "Actual RTs" if field_name == "rt_peak" else "Peak Height" a_x.set_ylabel(ylabel, labelpad=pad, fontsize=fontsize) def plot_compound_atlas_rts( num_files: int, rts_df: pd.DataFrame, file_name: str, fontsize: float = 2, pad: float = 0.1, cols: int = 8 ) -> None: """Plot filenames vs peak RT for each compound""" plot_per_compound("rt_peak", num_files, rts_df, file_name, fontsize, pad, cols) def plot_compound_atlas_peak_heights( num_files: int, peak_heights_df: pd.DataFrame, file_name: str, fontsize: float = 2, pad: float = 0.1, cols: int = 8, ) -> None: """Plot filenames vs peak height for each compound""" plot_per_compound("peak_height", num_files, peak_heights_df, file_name, fontsize, pad, cols)
bsd-3-clause
eb990e30895452a784d87199dc0ff46e
40.556886
110
0.645965
3.526423
false
false
false
false
biorack/metatlas
metatlas/io/feature_tools.py
1
16532
from __future__ import absolute_import from __future__ import print_function import os import numpy as np import pandas as pd from scipy import interpolate import time #pandas columns that are "objects", but you are 100% sure contain strings # will through this warning. There is no way to set them as strings. # pandas will permanently keep a reference to the object even if you # set it as a string. Bottom line: make it a string and ignore the error. # it prints to hdf5 just fine. import warnings from six.moves import range from six.moves import zip warnings.simplefilter(action='ignore', category=pd.errors.PerformanceWarning) """ """ # SUMMARY OF TIMING AND MEMORY TESTING AT NERSC # 10 threads # on denovo, about 30 seconds each, a little over 9 minutes # on denovo using scratchb, 20 seconds each, 7.43 minutes # on cori, about 20 seconds each, 6.52 minutes staging all files to $SCRATCG=6.6 minutes # 20 threads # on denovo, about 30 seconds each, a little over 6 minutes # on denovo scratch, 5.1 minutes # on cori, didn't run on jupyter-dev, on cori withscratch = 5.4 minutes, 5.5 using realtime scratch, burst-buffer 5.23 minutes # 30 threads # on denovo, about 35 seconds each, the job never finished # on cori, burst buffer: 4.1962 minutes repeated: 4.157 minutes # on cori, scratch: 4.31 minutes def setup_file_slicing_parameters(atlas,filenames,extra_time=0.1,ppm_tolerance=20,polarity='positive',project_dir=False,base_dir = '/project/projectdirs/metatlas/projects/',overwrite=True): """ Make parameters that have to be setup to run the fast feature finding process. This function is called first when doing feature selection. It standardizes all necessary inputs and files so downstream functions get a consistent place to work. Args: atlas (pandas dataframe): with [label,mz,rt_min,rt_max,rt_peak]. optional parameters are fine too. filenames (list): full paths to hdf5 files extra_time (float): default=0.1 Time to get in addition to rt-min/max window (for making nice EICs) custom is to store metatlas hdf5 files in minutes, but always double check ppm_tolerance (float): default=20 Calibration is sometimes a problem. 20 is safe. polarity (str): default='positive' or 'negative' project_dir (bool/str): default=False if user doesn't want to save their results or "path to output files" only relevant if project_dir is not False base_dir (str): '/project/projectdirs/metatlas/projects/' other paths that have been tried, but only a few percent faster than project: scratch_dir = os.environ['SCRATCH'] scratch_dir = os.environ['DW_JOB_STRIPED'] Returns: input_data list(dict): a list of python dictionaries with the following attributes for each lcmsrun to process: outfile (str): path to output hdf5 file of feature signals lcmsrun (str): lcmsrun to process atlas (pandas dataframe): atlas with necessary attributes for feature slicing, polarity (str): passthrough of input polarity string """ """ setup atlas table and define extra_time and ppm_tolerance in the atlas for compound atlases, label isn't stritly necessary add it if not provided """ if not 'label' in atlas.columns: atlas['label'] = list(range(atlas.shape[0])) atlas['extra_time'] = extra_time atlas['ppm_tolerance'] = ppm_tolerance """ Group together m/z values that are within ppm_tolerance. This gives an index to acknowledge that there are multiple features with nearly equal m/z. Assigning it here speeds up the file slicing and feature selection down the road. """ atlas['group_index'] = group_consecutive(atlas['mz'].values[:], stepsize=ppm_tolerance, do_ppm=True) """ define output directory """ if project_dir is not False: #user doesn't want to save their results output_dir = os.path.join(base_dir,project_dir) if not os.path.isdir(output_dir): os.mkdir(output_dir) """ get lcmsruns to process and build fullpath to output files """ """ setup input dictionary that will be the get_data input for each file """ input_data = [] for i,f in enumerate(filenames): #strip off the path and extension from the filename file_frag = ''.join(os.path.basename(f).split('.')[:-1]) if len(file_frag)>0: output_filename = '%s_features.h5'%file_frag if project_dir is not False: #user doesn't want to save their results outfile = os.path.join(output_dir,output_filename) else: outfile = None input_data.append({'outfile':outfile,'lcmsrun':f,'atlas':atlas,'polarity':polarity}) # 'ppm_tolerance':ppm_tolerance,'extra_time':extra_time,,'start_time':time.time() 'file_index':i, """ wipe out all the files and put the atlas in each one """ if overwrite==True: for i in input_data: if i['outfile'] is not None: #user doesn't want to save their results with pd.HDFStore(i['outfile'],mode='w',complib='zlib',complevel=9) as f: f.put('atlas',atlas,data_columns=True) return input_data def group_consecutive(data,stepsize=10.0,do_ppm=True): """ split a numpy array where consecutive elements are greater than stepsize can be ppm or value if idx is not None then returns indices of elements otherwise returns values The main use case is an unsorted list of m/zs as "data" and optionally their numerical index as "idx". Typically a user would want to retrieve the group indices in the original order that they provided their list of m/zs. usage: """ if type(data) is np.ndarray: # cool way to sort and unsort array: idx_sorted = data.argsort() sort_w_unsort = np.column_stack((np.arange(idx_sorted.size),idx_sorted)) # sort_w_unsort[:,0] are the original indices of data # sort_w_unsort[:,1] are the sorted indices of data data_sorted = data[sort_w_unsort[:,1]] # np.argsort(sort_w_unsort[:,1]) returns the indices to map the sorted data back to the original # data_unsorted = data_sorted[np.argsort(sort_w_unsort[:,1])] if do_ppm: d = np.diff(data_sorted) / data_sorted[:-1] * 1e6 else: d = np.diff(data_sorted) # make groups of the array data_groups = np.split(data_sorted, np.where(d > 2.0*stepsize)[0]+1) # replace each group of values with group index for i,data_slice in enumerate(data_groups): data_groups[i] = data_groups[i]*0 + i group_indices = np.concatenate(data_groups) # reorder the group indices group_indices = group_indices[np.argsort(sort_w_unsort[:,1])] return group_indices.astype(int)# else: print('not a numpy array. convert it and sort it first') def map_mzgroups_to_data(mz_atlas,mz_group_indices,mz_data): """ mz_atlas: m/z values from atlas mz_group_indices: integer index from "group_consecutive" mz_data: m/z values from raw data """ from scipy import interpolate f = interpolate.interp1d(mz_atlas,np.arange(mz_atlas.size),kind='nearest',bounds_error=False,fill_value='extrapolate') #get indices of all mz values in the atlas idx = f(mz_data) # iterpolate to find the nearest mz in the data for each mz in an atlas idx = idx.astype('int') # d = 1e6#np.abs(mz_data - mz_atlas[idx]) / mz_data * 1.0e6 # output_mat = np.column_stack((d,)) return mz_group_indices[idx]#output_mat def df_container_from_metatlas_file(filename,desired_key=None): """ """ # data_df = pd.DataFrame() pd_h5_file = pd.HDFStore(filename, 'r') keys = list(pd_h5_file.keys()) pd_h5_file.close() df_container = {} if desired_key is not None: return pd.read_hdf(filename,desired_key) else: for k in keys: if ('ms' in k) and not ('_mz' in k): new_df = pd.read_hdf(filename,k) df_container[k[1:]] = new_df return df_container def group_duplicates(df,group_col,make_string=False,precision={'i':0,'mz':4,'rt':2}): """ takes in a list of grouping columns and turns the rest into arrays """ all_cols = np.asarray(df.columns) #get the index of the grouping term as array idx_group = np.argwhere(all_cols == group_col).flatten() #get the indices of all other terms as array idx_list = np.argwhere(all_cols != group_col).flatten() cols = all_cols[idx_list] # create a sorted numpy array (sorted by column=group_col) a = df.sort_values(group_col).values.T #get the indices of the first instance of each unique identifier ukeys, index = np.unique(a[idx_group,:],return_index=True) #split the other rows of the array into separate arrays using the #unique index arrays = np.split(a[idx_list,:],index[1:],axis=1) #make a list of dicts with column headings as keys #if there are not multiple items then return value #If there are multiple items then return list # ucpds = [dict([(c,aa) if len(aa)>1 else (c,aa[0]) for c,aa in zip(cols,a)]) for a in arrays ] ucpds = [dict([(c,aa) for c,aa in zip(cols,a)]) for a in arrays ] #make a dataframe from the list of dicts df2 = pd.DataFrame(ucpds,index=ukeys) #make strings of array columns if you want to save it in anything useful if make_string==True: for c in cols: # df2[c] = df2[c].apply(lambda x: np.array2string(x, precision=5, separator=',')) if c in list(precision.keys()): pre_str = '{:.%df}'%precision[c] else: pre_str = '{:.4f}' df2[c] = df2[c].apply(lambda x: [pre_str.format(n) for n in x.tolist()]) # df2[c] = df2[c].apply(lambda x: str(x.tolist())) df2.index = df2.index.set_names(group_col) df2.reset_index(inplace=True) #return dataframe return df2 def get_atlas_data_from_file(filename,atlas,desired_key='ms1_pos'):#,bundle=True,make_string=False): msdata = df_container_from_metatlas_file(filename,desired_key=desired_key) if 'ms2' in desired_key: # throw away all the intensity duplication here to make merging faster # this has the expense of having to remerge it later. msdata = msdata[['rt','precursor_MZ']].drop_duplicates('rt') msdata = msdata.rename(columns={'precursor_MZ':'mz'}) g = map_mzgroups_to_data(atlas['mz'].values[:], atlas['group_index'].values[:], msdata['mz'].values[:]) msdata['group_index'] = g#[:,1] # msdata['group_index_ppm'] = g[:,0] df = pd.merge(atlas,msdata,left_on='group_index',right_on='group_index',how='outer',suffixes=('_atlas','_data')) #grab all datapoints including "extra" mz_condition = abs(df['mz_data']-df['mz_atlas'])/df['mz_atlas']*1e6<df['ppm_tolerance'] rt_min_condition = df['rt']>=(df['rt_min']-df['extra_time']) rt_max_condition = df['rt']<=(df['rt_max']+df['extra_time']) df = df[(mz_condition) & (rt_min_condition) & (rt_max_condition)] #label datapoints that are within the bounds of the feature vs "extra" df['in_feature'] = True if df['extra_time'].max()>0.0: cond_rt = (df['rt']<df['rt_min']) | (df['rt']>df['rt_max']) df.loc[cond_rt,'in_feature'] = False #above, the df has mz_data and mz_atlas. we don't need to differentiate anymore so: df = df.rename(columns={'mz_data':'mz'}) if 'ms2' in desired_key: # keep in mind we don't have intensity or scan attributes df = df[['label','rt','in_feature']] # you've got to add it back in; so reload original file msdata = df_container_from_metatlas_file(filename,desired_key=desired_key) # This will merge back into the MSMS data # the missing intensity and scan attributes mcols = ['rt','i','mz','precursor_MZ','precursor_intensity','collision_energy'] df = pd.merge(df,msdata[mcols],left_on='rt',right_on='rt',how='left') return df.reset_index(drop=True) else: df = df[['label','rt','mz','i','in_feature']] return df.reset_index(drop=True) def calculate_ms1_summary(row): """ Calculate summary properties for features from data """ d = {} #Before doing this make sure "in_feature"==True has already occured d['num_datapoints'] = row['i'].count() d['peak_area'] = row['i'].sum() idx = row['i'].idxmax() d['peak_height'] = row.loc[idx,'i'] d['mz_centroid'] = sum(row['i']*row['mz'])/d['peak_area'] d['rt_peak'] = row.loc[idx,'rt'] return pd.Series(d) # def calculate_ms1_summary(df): # a = df[['label','rt','mz','i','in_feature']].values # labels, row_pos = np.unique(a[:, 0], return_inverse=True) #these are feature labels # rt, col_pos = np.unique(a[:, 1], return_inverse=True) #these are rt values # pivot_table = np.zeros((len(labels), len(rt),3), dtype=float) # pivot_table[row_pos, col_pos] = a[:, [2,3,4]] # eic = pd.DataFrame(index=labels,data=pivot_table[:,:,1],columns=rt) # emzc = pd.DataFrame(index=labels,data=pivot_table[:,:,0],columns=rt) # efeaturec = pd.DataFrame(index=labels,data=pivot_table[:,:,2],columns=rt) # in_feature = efeaturec.values.astype(int) # intensity = np.multiply(eic.values,in_feature) # mz = np.multiply(emzc.values,in_feature) # rt = np.asarray(eic.columns) # labels = eic.index.tolist() # idx_max = np.argmax(intensity,axis=1) # df = pd.DataFrame(index=labels) # df['num_datapoints']=in_feature.sum(axis=1) # df['peak_area']=intensity.sum(axis=1) # df['peak_height']=np.diag(intensity[:,idx_max]) #I shouldn't have to do this and must be doing numpy slicing wrong! # df['mz_centroid']=np.divide(np.sum(np.multiply(mz,intensity),axis=1),intensity.sum(axis=1)) # df['rt_peak']=rt[idx_max] # return df def get_data(input_data,return_data=False,save_file=True): """ Required Inputs a Dict that has these attributes: {'file_index':i, #a numerical index that helps with bookkeeping 'outfile':outfile, #the hdf5 container to store the results 'lcmsrun':new_file, #the hdf5 file corresponding to an lcms run 'atlas':atlas, #the atlas dataframe containing minimally: [mz, rt_min,rt_max,rt_peak)] 'ppm_tolerance':ppm_tolerance, #ppm tolerance in m/z 'extra_time':extra_time} #time to add to the collected data beyond rt_min and rt_max The goal is to write to a file, ms1_data: ms1_summary: ms2_data: Returns a dictionary """ out_data = {} #setup a container to store any data to return to the user otherwise save it to file polarity_short_string = input_data['polarity'][:3] d = get_atlas_data_from_file(input_data['lcmsrun'],input_data['atlas'],desired_key='ms1_%s'%polarity_short_string)#,bundle=True,make_string=True) if return_data is True: out_data['atlas'] = input_data['atlas'] out_data['ms1_data'] = d if save_file is True: with pd.HDFStore(input_data['outfile'],mode='a',complib='zlib',complevel=9) as f: f.put('ms1_data',d,data_columns=True) d = d[d['in_feature']==True].groupby('label').apply(calculate_ms1_summary).reset_index() if d.shape[0]==0: #there isn't any data! for c in ['num_datapoints','peak_area','peak_height','mz_centroid','rt_peak']: d[c] = 0 if return_data is True: out_data['ms1_summary'] = d if save_file is True: with pd.HDFStore(input_data['outfile'],mode='a',complib='zlib',complevel=9) as f: f.put('ms1_summary',d,data_columns=True) # input_data['atlas']['extra_time'] = 0.0 # set extratime here to be zero for msms getting d = get_atlas_data_from_file(input_data['lcmsrun'],input_data['atlas'],desired_key='ms2_%s'%polarity_short_string)#,bundle=True,make_string=True) if return_data is True: out_data['ms2_data'] = d if save_file is True: with pd.HDFStore(input_data['outfile'],mode='a',complib='zlib',complevel=9) as f: f.put('ms2_data',d,data_columns=True) if return_data is True: return out_data
bsd-3-clause
697235422c1244526a42537c452ea7cc
39.819753
194
0.639729
3.391875
false
false
false
false
geopandas/geopandas
geopandas/io/tests/generate_legacy_storage_files.py
2
2734
""" Script to create the data and write legacy storage (pickle) files. Based on pandas' generate_legacy_storage_files.py script. To use this script, create an environment for which you want to generate pickles, activate the environment, and run this script as: $ python geopandas/geopandas/io/tests/generate_legacy_storage_files.py \ geopandas/geopandas/io/tests/data/pickle/ pickle This script generates a storage file for the current arch, system, The idea here is you are using the *current* version of the generate_legacy_storage_files with an *older* version of geopandas to generate a pickle file. We will then check this file into a current branch, and test using test_pickle.py. This will load the *older* pickles and test versus the current data that is generated (with master). These are then compared. """ import os import pickle import platform import sys import pandas as pd import geopandas from shapely.geometry import Point def create_pickle_data(): """create the pickle data""" # custom geometry column name gdf_the_geom = geopandas.GeoDataFrame( {"a": [1, 2, 3], "the_geom": [Point(1, 1), Point(2, 2), Point(3, 3)]}, geometry="the_geom", ) # with crs gdf_crs = geopandas.GeoDataFrame( {"a": [0.1, 0.2, 0.3], "geometry": [Point(1, 1), Point(2, 2), Point(3, 3)]}, crs="EPSG:4326", ) return dict(gdf_the_geom=gdf_the_geom, gdf_crs=gdf_crs) def platform_name(): return "_".join( [ str(geopandas.__version__), "pd-" + str(pd.__version__), "py-" + str(platform.python_version()), str(platform.machine()), str(platform.system().lower()), ] ) def write_legacy_pickles(output_dir): print( "This script generates a storage file for the current arch, system, " "and python version" ) print("geopandas version: {}").format(geopandas.__version__) print(" output dir : {}".format(output_dir)) print(" storage format: pickle") pth = "{}.pickle".format(platform_name()) fh = open(os.path.join(output_dir, pth), "wb") pickle.dump(create_pickle_data(), fh, pickle.DEFAULT_PROTOCOL) fh.close() print("created pickle file: {}".format(pth)) def main(): if len(sys.argv) != 3: exit( "Specify output directory and storage type: generate_legacy_" "storage_files.py <output_dir> <storage_type> " ) output_dir = str(sys.argv[1]) storage_type = str(sys.argv[2]) if storage_type == "pickle": write_legacy_pickles(output_dir=output_dir) else: exit("storage_type must be one of {'pickle'}") if __name__ == "__main__": main()
bsd-3-clause
eaced56eb6fdc4f3c6bfac91a7da2880
26.897959
84
0.635333
3.518662
false
true
false
false
geopandas/geopandas
doc/nyc_boros.py
1
2363
""" Visualizing NYC Boroughs ------------------------ Visualize the Boroughs of New York City with Geopandas. This example generates many images that are used in the documentation. See the `Geometric Manipulations <geometric_manipulations>` example for more details. First we'll import a dataset containing each borough in New York City. We'll use the ``datasets`` module to handle this quickly. """ import numpy as np import matplotlib.pyplot as plt from shapely.geometry import Point from geopandas import GeoSeries, GeoDataFrame import geopandas as gpd np.random.seed(1) DPI = 100 path_nybb = gpd.datasets.get_path("nybb") boros = GeoDataFrame.from_file(path_nybb) boros = boros.set_index("BoroCode") boros ############################################################################## # Next, we'll plot the raw data ax = boros.plot() plt.xticks(rotation=90) plt.savefig("nyc.png", dpi=DPI, bbox_inches="tight") ############################################################################## # We can easily retrieve the convex hull of each shape. This corresponds to # the outer edge of the shapes. boros.geometry.convex_hull.plot() plt.xticks(rotation=90) # Grab the limits which we'll use later xmin, xmax = plt.gca().get_xlim() ymin, ymax = plt.gca().get_ylim() plt.savefig("nyc_hull.png", dpi=DPI, bbox_inches="tight") ############################################################################## # We'll generate some random dots scattered throughout our data, and will # use them to perform some set operations with our boroughs. We can use # GeoPandas to perform unions, intersections, etc. N = 2000 # number of random points R = 2000 # radius of buffer in feet # xmin, xmax, ymin, ymax = 900000, 1080000, 120000, 280000 xc = (xmax - xmin) * np.random.random(N) + xmin yc = (ymax - ymin) * np.random.random(N) + ymin pts = GeoSeries([Point(x, y) for x, y in zip(xc, yc)]) mp = pts.buffer(R).unary_union boros_with_holes = boros.geometry - mp boros_with_holes.plot() plt.xticks(rotation=90) plt.savefig("boros_with_holes.png", dpi=DPI, bbox_inches="tight") ############################################################################## # Finally, we'll show the holes that were taken out of our boroughs. holes = boros.geometry & mp holes.plot() plt.xticks(rotation=90) plt.savefig("holes.png", dpi=DPI, bbox_inches="tight") plt.show()
bsd-3-clause
caf5713f1a63a8a206c535bd9273e62c
32.28169
78
0.631824
3.41474
false
false
false
false
geopandas/geopandas
geopandas/tools/tests/test_clip.py
1
17865
"""Tests for the clip module.""" import warnings from packaging.version import Version import numpy as np import pandas as pd import shapely from shapely.geometry import ( Polygon, Point, LineString, LinearRing, GeometryCollection, MultiPoint, box, ) import geopandas from geopandas import GeoDataFrame, GeoSeries, clip from geopandas.testing import assert_geodataframe_equal, assert_geoseries_equal import pytest from geopandas.tools.clip import _mask_is_list_like_rectangle pytestmark = pytest.mark.skip_no_sindex pandas_133 = Version(pd.__version__) == Version("1.3.3") mask_variants_single_rectangle = [ "single_rectangle_gdf", "single_rectangle_gdf_list_bounds", "single_rectangle_gdf_tuple_bounds", "single_rectangle_gdf_array_bounds", ] mask_variants_large_rectangle = [ "larger_single_rectangle_gdf", "larger_single_rectangle_gdf_bounds", ] @pytest.fixture def point_gdf(): """Create a point GeoDataFrame.""" pts = np.array([[2, 2], [3, 4], [9, 8], [-12, -15]]) gdf = GeoDataFrame([Point(xy) for xy in pts], columns=["geometry"], crs="EPSG:3857") return gdf @pytest.fixture def pointsoutside_nooverlap_gdf(): """Create a point GeoDataFrame. Its points are all outside the single rectangle, and its bounds are outside the single rectangle's.""" pts = np.array([[5, 15], [15, 15], [15, 20]]) gdf = GeoDataFrame([Point(xy) for xy in pts], columns=["geometry"], crs="EPSG:3857") return gdf @pytest.fixture def pointsoutside_overlap_gdf(): """Create a point GeoDataFrame. Its points are all outside the single rectangle, and its bounds are overlapping the single rectangle's.""" pts = np.array([[5, 15], [15, 15], [15, 5]]) gdf = GeoDataFrame([Point(xy) for xy in pts], columns=["geometry"], crs="EPSG:3857") return gdf @pytest.fixture def single_rectangle_gdf(): """Create a single rectangle for clipping.""" poly_inters = Polygon([(0, 0), (0, 10), (10, 10), (10, 0), (0, 0)]) gdf = GeoDataFrame([1], geometry=[poly_inters], crs="EPSG:3857") gdf["attr2"] = "site-boundary" return gdf @pytest.fixture def single_rectangle_gdf_tuple_bounds(single_rectangle_gdf): """Bounds of the created single rectangle""" return tuple(single_rectangle_gdf.total_bounds) @pytest.fixture def single_rectangle_gdf_list_bounds(single_rectangle_gdf): """Bounds of the created single rectangle""" return list(single_rectangle_gdf.total_bounds) @pytest.fixture def single_rectangle_gdf_array_bounds(single_rectangle_gdf): """Bounds of the created single rectangle""" return single_rectangle_gdf.total_bounds @pytest.fixture def larger_single_rectangle_gdf(): """Create a slightly larger rectangle for clipping. The smaller single rectangle is used to test the edge case where slivers are returned when you clip polygons. This fixture is larger which eliminates the slivers in the clip return. """ poly_inters = Polygon([(-5, -5), (-5, 15), (15, 15), (15, -5), (-5, -5)]) gdf = GeoDataFrame([1], geometry=[poly_inters], crs="EPSG:3857") gdf["attr2"] = ["study area"] return gdf @pytest.fixture def larger_single_rectangle_gdf_bounds(larger_single_rectangle_gdf): """Bounds of the created single rectangle""" return tuple(larger_single_rectangle_gdf.total_bounds) @pytest.fixture def buffered_locations(point_gdf): """Buffer points to create a multi-polygon.""" buffered_locs = point_gdf buffered_locs["geometry"] = buffered_locs.buffer(4) buffered_locs["type"] = "plot" return buffered_locs @pytest.fixture def donut_geometry(buffered_locations, single_rectangle_gdf): """Make a geometry with a hole in the middle (a donut).""" donut = geopandas.overlay( buffered_locations, single_rectangle_gdf, how="symmetric_difference" ) return donut @pytest.fixture def two_line_gdf(): """Create Line Objects For Testing""" linea = LineString([(1, 1), (2, 2), (3, 2), (5, 3)]) lineb = LineString([(3, 4), (5, 7), (12, 2), (10, 5), (9, 7.5)]) gdf = GeoDataFrame([1, 2], geometry=[linea, lineb], crs="EPSG:3857") return gdf @pytest.fixture def multi_poly_gdf(donut_geometry): """Create a multi-polygon GeoDataFrame.""" multi_poly = donut_geometry.unary_union out_df = GeoDataFrame(geometry=GeoSeries(multi_poly), crs="EPSG:3857") out_df["attr"] = ["pool"] return out_df @pytest.fixture def multi_line(two_line_gdf): """Create a multi-line GeoDataFrame. This GDF has one multiline and one regular line.""" # Create a single and multi line object multiline_feat = two_line_gdf.unary_union linec = LineString([(2, 1), (3, 1), (4, 1), (5, 2)]) out_df = GeoDataFrame(geometry=GeoSeries([multiline_feat, linec]), crs="EPSG:3857") out_df["attr"] = ["road", "stream"] return out_df @pytest.fixture def multi_point(point_gdf): """Create a multi-point GeoDataFrame.""" multi_point = point_gdf.unary_union out_df = GeoDataFrame( geometry=GeoSeries( [multi_point, Point(2, 5), Point(-11, -14), Point(-10, -12)] ), crs="EPSG:3857", ) out_df["attr"] = ["tree", "another tree", "shrub", "berries"] return out_df @pytest.fixture def mixed_gdf(): """Create a Mixed Polygon and LineString For Testing""" point = Point(2, 3) line = LineString([(1, 1), (2, 2), (3, 2), (5, 3), (12, 1)]) poly = Polygon([(3, 4), (5, 2), (12, 2), (10, 5), (9, 7.5)]) ring = LinearRing([(1, 1), (2, 2), (3, 2), (5, 3), (12, 1)]) gdf = GeoDataFrame( [1, 2, 3, 4], geometry=[point, poly, line, ring], crs="EPSG:3857" ) return gdf @pytest.fixture def geomcol_gdf(): """Create a Mixed Polygon and LineString For Testing""" point = Point(2, 3) poly = Polygon([(3, 4), (5, 2), (12, 2), (10, 5), (9, 7.5)]) coll = GeometryCollection([point, poly]) gdf = GeoDataFrame([1], geometry=[coll], crs="EPSG:3857") return gdf @pytest.fixture def sliver_line(): """Create a line that will create a point when clipped.""" linea = LineString([(10, 5), (13, 5), (15, 5)]) lineb = LineString([(1, 1), (2, 2), (3, 2), (5, 3), (12, 1)]) gdf = GeoDataFrame([1, 2], geometry=[linea, lineb], crs="EPSG:3857") return gdf def test_not_gdf(single_rectangle_gdf): """Non-GeoDataFrame inputs raise attribute errors.""" with pytest.raises(TypeError): clip((2, 3), single_rectangle_gdf) with pytest.raises(TypeError): clip(single_rectangle_gdf, "foobar") with pytest.raises(TypeError): clip(single_rectangle_gdf, (1, 2, 3)) with pytest.raises(TypeError): clip(single_rectangle_gdf, (1, 2, 3, 4, 5)) def test_non_overlapping_geoms(): """Test that a bounding box returns empty if the extents don't overlap""" unit_box = Polygon([(0, 0), (0, 1), (1, 1), (1, 0), (0, 0)]) unit_gdf = GeoDataFrame([1], geometry=[unit_box], crs="EPSG:3857") non_overlapping_gdf = unit_gdf.copy() non_overlapping_gdf = non_overlapping_gdf.geometry.apply( lambda x: shapely.affinity.translate(x, xoff=20) ) out = clip(unit_gdf, non_overlapping_gdf) assert_geodataframe_equal(out, unit_gdf.iloc[:0]) out2 = clip(unit_gdf.geometry, non_overlapping_gdf) assert_geoseries_equal(out2, GeoSeries(crs=unit_gdf.crs)) @pytest.mark.parametrize("mask_fixture_name", mask_variants_single_rectangle) class TestClipWithSingleRectangleGdf: @pytest.fixture def mask(self, mask_fixture_name, request): return request.getfixturevalue(mask_fixture_name) def test_returns_gdf(self, point_gdf, mask): """Test that function returns a GeoDataFrame (or GDF-like) object.""" out = clip(point_gdf, mask) assert isinstance(out, GeoDataFrame) def test_returns_series(self, point_gdf, mask): """Test that function returns a GeoSeries if GeoSeries is passed.""" out = clip(point_gdf.geometry, mask) assert isinstance(out, GeoSeries) def test_clip_points(self, point_gdf, mask): """Test clipping a points GDF with a generic polygon geometry.""" clip_pts = clip(point_gdf, mask) pts = np.array([[2, 2], [3, 4], [9, 8]]) exp = GeoDataFrame( [Point(xy) for xy in pts], columns=["geometry"], crs="EPSG:3857" ) assert_geodataframe_equal(clip_pts, exp) def test_clip_points_geom_col_rename(self, point_gdf, mask): """Test clipping a points GDF with a generic polygon geometry.""" point_gdf_geom_col_rename = point_gdf.rename_geometry("geometry2") clip_pts = clip(point_gdf_geom_col_rename, mask) pts = np.array([[2, 2], [3, 4], [9, 8]]) exp = GeoDataFrame( [Point(xy) for xy in pts], columns=["geometry2"], crs="EPSG:3857", geometry="geometry2", ) assert_geodataframe_equal(clip_pts, exp) def test_clip_poly(self, buffered_locations, mask): """Test clipping a polygon GDF with a generic polygon geometry.""" clipped_poly = clip(buffered_locations, mask) assert len(clipped_poly.geometry) == 3 assert all(clipped_poly.geom_type == "Polygon") def test_clip_poly_geom_col_rename(self, buffered_locations, mask): """Test clipping a polygon GDF with a generic polygon geometry.""" poly_gdf_geom_col_rename = buffered_locations.rename_geometry("geometry2") clipped_poly = clip(poly_gdf_geom_col_rename, mask) assert len(clipped_poly.geometry) == 3 assert "geometry" not in clipped_poly.keys() assert "geometry2" in clipped_poly.keys() def test_clip_poly_series(self, buffered_locations, mask): """Test clipping a polygon GDF with a generic polygon geometry.""" clipped_poly = clip(buffered_locations.geometry, mask) assert len(clipped_poly) == 3 assert all(clipped_poly.geom_type == "Polygon") @pytest.mark.xfail(pandas_133, reason="Regression in pandas 1.3.3 (GH #2101)") def test_clip_multipoly_keep_geom_type(self, multi_poly_gdf, mask): """Test a multi poly object where the return includes a sliver. Also the bounds of the object should == the bounds of the clip object if they fully overlap (as they do in these fixtures).""" clipped = clip(multi_poly_gdf, mask, keep_geom_type=True) expected_bounds = ( mask if _mask_is_list_like_rectangle(mask) else mask.total_bounds ) assert np.array_equal(clipped.total_bounds, expected_bounds) # Assert returned data is a not geometry collection assert (clipped.geom_type.isin(["Polygon", "MultiPolygon"])).all() def test_clip_multiline(self, multi_line, mask): """Test that clipping a multiline feature with a poly returns expected output.""" clipped = clip(multi_line, mask) assert clipped.geom_type[0] == "MultiLineString" def test_clip_multipoint(self, multi_point, mask): """Clipping a multipoint feature with a polygon works as expected. should return a geodataframe with a single multi point feature""" clipped = clip(multi_point, mask) assert clipped.geom_type[0] == "MultiPoint" assert hasattr(clipped, "attr") # All points should intersect the clip geom assert len(clipped) == 2 clipped_mutltipoint = MultiPoint( [ Point(2, 2), Point(3, 4), Point(9, 8), ] ) assert clipped.iloc[0].geometry.wkt == clipped_mutltipoint.wkt shape_for_points = ( box(*mask) if _mask_is_list_like_rectangle(mask) else mask.unary_union ) assert all(clipped.intersects(shape_for_points)) def test_clip_lines(self, two_line_gdf, mask): """Test what happens when you give the clip_extent a line GDF.""" clip_line = clip(two_line_gdf, mask) assert len(clip_line.geometry) == 2 def test_mixed_geom(self, mixed_gdf, mask): """Test clipping a mixed GeoDataFrame""" clipped = clip(mixed_gdf, mask) assert ( clipped.geom_type[0] == "Point" and clipped.geom_type[1] == "Polygon" and clipped.geom_type[2] == "LineString" ) def test_mixed_series(self, mixed_gdf, mask): """Test clipping a mixed GeoSeries""" clipped = clip(mixed_gdf.geometry, mask) assert ( clipped.geom_type[0] == "Point" and clipped.geom_type[1] == "Polygon" and clipped.geom_type[2] == "LineString" ) def test_clip_warning_no_extra_geoms(self, buffered_locations, mask): """Test a user warning is provided if no new geometry types are found.""" with pytest.warns(UserWarning): clip(buffered_locations, mask, True) warnings.warn( "keep_geom_type was called when no extra geometry types existed.", UserWarning, ) def test_clip_with_line_extra_geom(self, sliver_line, mask): """When the output of a clipped line returns a geom collection, and keep_geom_type is True, no geometry collections should be returned.""" clipped = clip(sliver_line, mask, keep_geom_type=True) assert len(clipped.geometry) == 1 # Assert returned data is a not geometry collection assert not (clipped.geom_type == "GeometryCollection").any() def test_clip_no_box_overlap(self, pointsoutside_nooverlap_gdf, mask): """Test clip when intersection is empty and boxes do not overlap.""" clipped = clip(pointsoutside_nooverlap_gdf, mask) assert len(clipped) == 0 def test_clip_box_overlap(self, pointsoutside_overlap_gdf, mask): """Test clip when intersection is empty and boxes do overlap.""" clipped = clip(pointsoutside_overlap_gdf, mask) assert len(clipped) == 0 def test_warning_extra_geoms_mixed(self, mixed_gdf, mask): """Test the correct warnings are raised if keep_geom_type is called on a mixed GDF""" with pytest.warns(UserWarning): clip(mixed_gdf, mask, keep_geom_type=True) def test_warning_geomcoll(self, geomcol_gdf, mask): """Test the correct warnings are raised if keep_geom_type is called on a GDF with GeometryCollection""" with pytest.warns(UserWarning): clip(geomcol_gdf, mask, keep_geom_type=True) def test_clip_line_keep_slivers(sliver_line, single_rectangle_gdf): """Test the correct output if a point is returned from a line only geometry type.""" clipped = clip(sliver_line, single_rectangle_gdf) # Assert returned data is a geometry collection given sliver geoms assert "Point" == clipped.geom_type[0] assert "LineString" == clipped.geom_type[1] @pytest.mark.xfail(pandas_133, reason="Regression in pandas 1.3.3 (GH #2101)") def test_clip_multipoly_keep_slivers(multi_poly_gdf, single_rectangle_gdf): """Test a multi poly object where the return includes a sliver. Also the bounds of the object should == the bounds of the clip object if they fully overlap (as they do in these fixtures).""" clipped = clip(multi_poly_gdf, single_rectangle_gdf) assert np.array_equal(clipped.total_bounds, single_rectangle_gdf.total_bounds) # Assert returned data is a geometry collection given sliver geoms assert "GeometryCollection" in clipped.geom_type[0] def test_warning_crs_mismatch(point_gdf, single_rectangle_gdf): with pytest.warns(UserWarning, match="CRS mismatch between the CRS"): clip(point_gdf, single_rectangle_gdf.to_crs(4326)) def test_clip_with_polygon(single_rectangle_gdf): """Test clip when using a shapely object""" polygon = Polygon([(0, 0), (5, 12), (10, 0), (0, 0)]) clipped = clip(single_rectangle_gdf, polygon) exp_poly = polygon.intersection( Polygon([(0, 0), (0, 10), (10, 10), (10, 0), (0, 0)]) ) exp = GeoDataFrame([1], geometry=[exp_poly], crs="EPSG:3857") exp["attr2"] = "site-boundary" assert_geodataframe_equal(clipped, exp) def test_clip_with_multipolygon(buffered_locations, single_rectangle_gdf): """Test clipping a polygon with a multipolygon.""" multi = buffered_locations.dissolve(by="type").reset_index() clipped = clip(single_rectangle_gdf, multi) assert clipped.geom_type[0] == "Polygon" @pytest.mark.parametrize( "mask_fixture_name", mask_variants_large_rectangle, ) def test_clip_single_multipoly_no_extra_geoms( buffered_locations, mask_fixture_name, request ): """When clipping a multi-polygon feature, no additional geom types should be returned.""" masks = request.getfixturevalue(mask_fixture_name) multi = buffered_locations.dissolve(by="type").reset_index() clipped = clip(multi, masks) assert clipped.geom_type[0] == "Polygon" @pytest.mark.filterwarnings("ignore:All-NaN slice encountered") @pytest.mark.parametrize( "mask", [ Polygon(), (np.nan,) * 4, (np.nan, 0, np.nan, 1), GeoSeries([Polygon(), Polygon()], crs="EPSG:3857"), GeoSeries([Polygon(), Polygon()], crs="EPSG:3857").to_frame(), GeoSeries([], crs="EPSG:3857"), GeoSeries([], crs="EPSG:3857").to_frame(), ], ) def test_clip_empty_mask(buffered_locations, mask): """Test that clipping with empty mask returns an empty result.""" clipped = clip(buffered_locations, mask) assert_geodataframe_equal( clipped, GeoDataFrame([], columns=["geometry", "type"], crs="EPSG:3857"), check_index_type=False, ) clipped = clip(buffered_locations.geometry, mask) assert_geoseries_equal(clipped, GeoSeries([], crs="EPSG:3857"))
bsd-3-clause
3f9d98fe86b2ea597ecb182d25b9ea1f
36.45283
88
0.64534
3.468932
false
true
false
false
ipython/ipython
IPython/core/splitinput.py
3
4787
# encoding: utf-8 """ Simple utility for splitting user input. This is used by both inputsplitter and prefilter. Authors: * Brian Granger * Fernando Perez """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software. #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- import re import sys from IPython.utils import py3compat from IPython.utils.encoding import get_stream_enc #----------------------------------------------------------------------------- # Main function #----------------------------------------------------------------------------- # RegExp for splitting line contents into pre-char//first word-method//rest. # For clarity, each group in on one line. # WARNING: update the regexp if the escapes in interactiveshell are changed, as # they are hardwired in. # Although it's not solely driven by the regex, note that: # ,;/% only trigger if they are the first character on the line # ! and !! trigger if they are first char(s) *or* follow an indent # ? triggers as first or last char. line_split = re.compile(r""" ^(\s*) # any leading space ([,;/%]|!!?|\?\??)? # escape character or characters \s*(%{0,2}[\w\.\*]*) # function/method, possibly with leading % # to correctly treat things like '?%magic' (.*?$|$) # rest of line """, re.VERBOSE) def split_user_input(line, pattern=None): """Split user input into initial whitespace, escape character, function part and the rest. """ # We need to ensure that the rest of this routine deals only with unicode encoding = get_stream_enc(sys.stdin, 'utf-8') line = py3compat.cast_unicode(line, encoding) if pattern is None: pattern = line_split match = pattern.match(line) if not match: # print "match failed for line '%s'" % line try: ifun, the_rest = line.split(None,1) except ValueError: # print "split failed for line '%s'" % line ifun, the_rest = line, u'' pre = re.match(r'^(\s*)(.*)',line).groups()[0] esc = "" else: pre, esc, ifun, the_rest = match.groups() #print 'line:<%s>' % line # dbg #print 'pre <%s> ifun <%s> rest <%s>' % (pre,ifun.strip(),the_rest) # dbg return pre, esc or '', ifun.strip(), the_rest.lstrip() class LineInfo(object): """A single line of input and associated info. Includes the following as properties: line The original, raw line continue_prompt Is this line a continuation in a sequence of multiline input? pre Any leading whitespace. esc The escape character(s) in pre or the empty string if there isn't one. Note that '!!' and '??' are possible values for esc. Otherwise it will always be a single character. ifun The 'function part', which is basically the maximal initial sequence of valid python identifiers and the '.' character. This is what is checked for alias and magic transformations, used for auto-calling, etc. In contrast to Python identifiers, it may start with "%" and contain "*". the_rest Everything else on the line. """ def __init__(self, line, continue_prompt=False): self.line = line self.continue_prompt = continue_prompt self.pre, self.esc, self.ifun, self.the_rest = split_user_input(line) self.pre_char = self.pre.strip() if self.pre_char: self.pre_whitespace = '' # No whitespace allowed before esc chars else: self.pre_whitespace = self.pre def ofind(self, ip): """Do a full, attribute-walking lookup of the ifun in the various namespaces for the given IPython InteractiveShell instance. Return a dict with keys: {found, obj, ospace, ismagic} Note: can cause state changes because of calling getattr, but should only be run if autocall is on and if the line hasn't matched any other, less dangerous handlers. Does cache the results of the call, so can be called multiple times without worrying about *further* damaging state. """ return ip._ofind(self.ifun) def __str__(self): return "LineInfo [%s|%s|%s|%s]" %(self.pre, self.esc, self.ifun, self.the_rest)
bsd-3-clause
282084b37c101c0861ea6ce1d4a4a36e
33.941606
87
0.563819
4.240035
false
false
false
false
ipython/ipython
IPython/utils/PyColorize.py
3
10875
# -*- coding: utf-8 -*- """ Class and program to colorize python source code for ANSI terminals. Based on an HTML code highlighter by Jurgen Hermann found at: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52298 Modifications by Fernando Perez (fperez@colorado.edu). Information on the original HTML highlighter follows: MoinMoin - Python Source Parser Title: Colorize Python source using the built-in tokenizer Submitter: Jurgen Hermann Last Updated:2001/04/06 Version no:1.2 Description: This code is part of MoinMoin (http://moin.sourceforge.net/) and converts Python source code to HTML markup, rendering comments, keywords, operators, numeric and string literals in different colors. It shows how to use the built-in keyword, token and tokenize modules to scan Python source code and re-emit it with no changes to its original formatting (which is the hard part). """ __all__ = ['ANSICodeColors', 'Parser'] _scheme_default = 'Linux' # Imports import keyword import os import sys import token import tokenize generate_tokens = tokenize.generate_tokens from IPython.utils.coloransi import TermColors, InputTermColors,ColorScheme, ColorSchemeTable from .colorable import Colorable from io import StringIO ############################################################################# ### Python Source Parser (does Highlighting) ############################################################################# _KEYWORD = token.NT_OFFSET + 1 _TEXT = token.NT_OFFSET + 2 #**************************************************************************** # Builtin color schemes Colors = TermColors # just a shorthand # Build a few color schemes NoColor = ColorScheme( 'NoColor',{ 'header' : Colors.NoColor, token.NUMBER : Colors.NoColor, token.OP : Colors.NoColor, token.STRING : Colors.NoColor, tokenize.COMMENT : Colors.NoColor, token.NAME : Colors.NoColor, token.ERRORTOKEN : Colors.NoColor, _KEYWORD : Colors.NoColor, _TEXT : Colors.NoColor, 'in_prompt' : InputTermColors.NoColor, # Input prompt 'in_number' : InputTermColors.NoColor, # Input prompt number 'in_prompt2' : InputTermColors.NoColor, # Continuation prompt 'in_normal' : InputTermColors.NoColor, # color off (usu. Colors.Normal) 'out_prompt' : Colors.NoColor, # Output prompt 'out_number' : Colors.NoColor, # Output prompt number 'normal' : Colors.NoColor # color off (usu. Colors.Normal) } ) LinuxColors = ColorScheme( 'Linux',{ 'header' : Colors.LightRed, token.NUMBER : Colors.LightCyan, token.OP : Colors.Yellow, token.STRING : Colors.LightBlue, tokenize.COMMENT : Colors.LightRed, token.NAME : Colors.Normal, token.ERRORTOKEN : Colors.Red, _KEYWORD : Colors.LightGreen, _TEXT : Colors.Yellow, 'in_prompt' : InputTermColors.Green, 'in_number' : InputTermColors.LightGreen, 'in_prompt2' : InputTermColors.Green, 'in_normal' : InputTermColors.Normal, # color off (usu. Colors.Normal) 'out_prompt' : Colors.Red, 'out_number' : Colors.LightRed, 'normal' : Colors.Normal # color off (usu. Colors.Normal) } ) NeutralColors = ColorScheme( 'Neutral',{ 'header' : Colors.Red, token.NUMBER : Colors.Cyan, token.OP : Colors.Blue, token.STRING : Colors.Blue, tokenize.COMMENT : Colors.Red, token.NAME : Colors.Normal, token.ERRORTOKEN : Colors.Red, _KEYWORD : Colors.Green, _TEXT : Colors.Blue, 'in_prompt' : InputTermColors.Blue, 'in_number' : InputTermColors.LightBlue, 'in_prompt2' : InputTermColors.Blue, 'in_normal' : InputTermColors.Normal, # color off (usu. Colors.Normal) 'out_prompt' : Colors.Red, 'out_number' : Colors.LightRed, 'normal' : Colors.Normal # color off (usu. Colors.Normal) } ) # Hack: the 'neutral' colours are not very visible on a dark background on # Windows. Since Windows command prompts have a dark background by default, and # relatively few users are likely to alter that, we will use the 'Linux' colours, # designed for a dark background, as the default on Windows. Changing it here # avoids affecting the prompt colours rendered by prompt_toolkit, where the # neutral defaults do work OK. if os.name == 'nt': NeutralColors = LinuxColors.copy(name='Neutral') LightBGColors = ColorScheme( 'LightBG',{ 'header' : Colors.Red, token.NUMBER : Colors.Cyan, token.OP : Colors.Blue, token.STRING : Colors.Blue, tokenize.COMMENT : Colors.Red, token.NAME : Colors.Normal, token.ERRORTOKEN : Colors.Red, _KEYWORD : Colors.Green, _TEXT : Colors.Blue, 'in_prompt' : InputTermColors.Blue, 'in_number' : InputTermColors.LightBlue, 'in_prompt2' : InputTermColors.Blue, 'in_normal' : InputTermColors.Normal, # color off (usu. Colors.Normal) 'out_prompt' : Colors.Red, 'out_number' : Colors.LightRed, 'normal' : Colors.Normal # color off (usu. Colors.Normal) } ) # Build table of color schemes (needed by the parser) ANSICodeColors = ColorSchemeTable([NoColor,LinuxColors,LightBGColors, NeutralColors], _scheme_default) Undefined = object() class Parser(Colorable): """ Format colored Python source. """ def __init__(self, color_table=None, out = sys.stdout, parent=None, style=None): """ Create a parser with a specified color table and output channel. Call format() to process code. """ super(Parser, self).__init__(parent=parent) self.color_table = color_table if color_table else ANSICodeColors self.out = out self.pos = None self.lines = None self.raw = None if not style: self.style = self.default_style else: self.style = style def format(self, raw, out=None, scheme=Undefined): import warnings if scheme is not Undefined: warnings.warn('The `scheme` argument of IPython.utils.PyColorize:Parser.format is deprecated since IPython 6.0.' 'It will have no effect. Set the parser `style` directly.', stacklevel=2) return self.format2(raw, out)[0] def format2(self, raw, out = None): """ Parse and send the colored source. If out and scheme are not specified, the defaults (given to constructor) are used. out should be a file-type object. Optionally, out can be given as the string 'str' and the parser will automatically return the output in a string.""" string_output = 0 if out == 'str' or self.out == 'str' or \ isinstance(self.out, StringIO): # XXX - I don't really like this state handling logic, but at this # point I don't want to make major changes, so adding the # isinstance() check is the simplest I can do to ensure correct # behavior. out_old = self.out self.out = StringIO() string_output = 1 elif out is not None: self.out = out else: raise ValueError('`out` or `self.out` should be file-like or the value `"str"`') # Fast return of the unmodified input for NoColor scheme if self.style == 'NoColor': error = False self.out.write(raw) if string_output: return raw, error return None, error # local shorthands colors = self.color_table[self.style].colors self.colors = colors # put in object so __call__ sees it # Remove trailing whitespace and normalize tabs self.raw = raw.expandtabs().rstrip() # store line offsets in self.lines self.lines = [0, 0] pos = 0 raw_find = self.raw.find lines_append = self.lines.append while True: pos = raw_find('\n', pos) + 1 if not pos: break lines_append(pos) lines_append(len(self.raw)) # parse the source and write it self.pos = 0 text = StringIO(self.raw) error = False try: for atoken in generate_tokens(text.readline): self(*atoken) except tokenize.TokenError as ex: msg = ex.args[0] line = ex.args[1][0] self.out.write("%s\n\n*** ERROR: %s%s%s\n" % (colors[token.ERRORTOKEN], msg, self.raw[self.lines[line]:], colors.normal) ) error = True self.out.write(colors.normal+'\n') if string_output: output = self.out.getvalue() self.out = out_old return (output, error) return (None, error) def _inner_call_(self, toktype, toktext, start_pos): """like call but write to a temporary buffer""" buff = StringIO() srow, scol = start_pos colors = self.colors owrite = buff.write # line separator, so this works across platforms linesep = os.linesep # calculate new positions oldpos = self.pos newpos = self.lines[srow] + scol self.pos = newpos + len(toktext) # send the original whitespace, if needed if newpos > oldpos: owrite(self.raw[oldpos:newpos]) # skip indenting tokens if toktype in [token.INDENT, token.DEDENT]: self.pos = newpos buff.seek(0) return buff.read() # map token type to a color group if token.LPAR <= toktype <= token.OP: toktype = token.OP elif toktype == token.NAME and keyword.iskeyword(toktext): toktype = _KEYWORD color = colors.get(toktype, colors[_TEXT]) # Triple quoted strings must be handled carefully so that backtracking # in pagers works correctly. We need color terminators on _each_ line. if linesep in toktext: toktext = toktext.replace(linesep, '%s%s%s' % (colors.normal,linesep,color)) # send text owrite('%s%s%s' % (color,toktext,colors.normal)) buff.seek(0) return buff.read() def __call__(self, toktype, toktext, start_pos, end_pos, line): """ Token handler, with syntax highlighting.""" self.out.write( self._inner_call_(toktype, toktext, start_pos))
bsd-3-clause
bb930a3efc66e6ebee24d6a505c9edc1
31.854985
124
0.58869
3.844115
false
false
false
false
mozilla/mozillians
mozillians/users/tests/test_models.py
2
36148
# -*- coding: utf-8 -*- import unittest from datetime import datetime from uuid import uuid4 from django.conf import settings from django.contrib.auth.models import User from django.db.models.query import QuerySet from django.test import override_settings from django.utils.timezone import make_aware, now import pytz from mock import Mock, patch from nose.tools import eq_, ok_ from mozillians.common.tests import TestCase from mozillians.groups.models import Group, Skill from mozillians.groups.tests import (GroupAliasFactory, GroupFactory, SkillAliasFactory, SkillFactory) from mozillians.users.managers import (EMPLOYEES, MOZILLIANS, PUBLIC, PUBLIC_INDEXABLE_FIELDS) from mozillians.users.models import (ExternalAccount, IdpProfile, UserProfile, _calculate_photo_filename, Vouch) from mozillians.users.tests import UserFactory class SignaledFunctionsTests(TestCase): def test_auto_create_userprofile(self): user = User.objects.create(email='foo@example.com', username='foobar') ok_(user.userprofile) @patch('mozillians.users.signals.subscribe_user_to_basket.delay') @override_settings(BASKET_VOUCHED_NEWSLETTER='foo') def test_subscribe_to_basket_post_save(self, subscribe_user_mock): user = UserFactory.create() subscribe_user_mock.assert_called_with(user.userprofile.id, ['foo']) def test_delete_user_obj_on_profile_delete(self): user = UserFactory.create() profile = user.userprofile profile.delete() ok_(not User.objects.filter(pk=user.pk).exists()) @override_settings(CAN_VOUCH_THRESHOLD=1) def test_voucher_set_null_on_user_delete(self): voucher = UserFactory.create() vouchee = UserFactory.create(vouched=False) vouchee.userprofile.vouch(voucher.userprofile) voucher.delete() vouch = Vouch.objects.get(vouchee=vouchee.userprofile) eq_(vouch.voucher, None) @patch('mozillians.users.signals.subscribe_user_to_basket.delay') @override_settings(BASKET_VOUCHED_NEWSLETTER='foo') @override_settings(CAN_VOUCH_THRESHOLD=1) def test_vouch_is_vouched_gets_updated(self, subscribe_user_mock): voucher = UserFactory.create() unvouched = UserFactory.create(vouched=False) eq_(unvouched.userprofile.is_vouched, False) unvouched.userprofile.vouch(voucher.userprofile) # Reload from database unvouched = User.objects.get(pk=unvouched.id) eq_(unvouched.userprofile.is_vouched, True) ok_(subscribe_user_mock.called_with(unvouched.userprofile.id, ['foo'])) @patch('mozillians.users.signals.unsubscribe_from_basket_task.delay') @override_settings(BASKET_VOUCHED_NEWSLETTER='foo') def test_unvouch_is_vouched_gets_updated(self, unsubscribe_from_basket_mock): vouched = UserFactory.create() eq_(vouched.userprofile.is_vouched, True) vouched.userprofile.vouches_received.all().delete() # Reload from database vouched = User.objects.get(pk=vouched.id) eq_(vouched.userprofile.is_vouched, False) ok_(unsubscribe_from_basket_mock.called_with(vouched.userprofile.email, ['foo'])) @override_settings(CAN_VOUCH_THRESHOLD=5) def test_vouch_can_vouch_gets_updated(self): unvouched = UserFactory.create(vouched=False) # Give four vouches, should not allow to vouch. for i in range(4): unvouched.userprofile.vouch(None, 'Reason #{0}'.format(i)) # Reload from database unvouched = User.objects.get(pk=unvouched.id) eq_(unvouched.userprofile.can_vouch, False) # Give the fifth vouch unvouched.userprofile.vouch(None) # Reload from database unvouched = User.objects.get(pk=unvouched.id) eq_(unvouched.userprofile.can_vouch, True) def test_vouch_multiple_mozilla_alternate_emails(self): user = UserFactory.create(vouched=False) IdpProfile.objects.create( profile=user.userprofile, auth0_user_id='github|test1@mozilla.com', email='test1@mozilla.com', primary=True, ) IdpProfile.objects.create( profile=user.userprofile, auth0_user_id='github|test2@mozilla.com', email='test2@mozilla.com', ) vouch_query = Vouch.objects.filter(vouchee=user.userprofile, autovouch=True, description=settings.AUTO_VOUCH_REASON) eq_(vouch_query.count(), 0) eq_(user.userprofile.is_vouched, False) def test_vouch_non_mozilla_alternate_email(self): user = UserFactory.create(vouched=False) IdpProfile.objects.create( profile=user.userprofile, auth0_user_id='github|test@example.com', email='test@example.com', primary=True, ) eq_(Vouch.objects.filter(vouchee=user.userprofile).count(), 0) eq_(user.userprofile.is_vouched, False) class UserProfileTests(TestCase): @patch('mozillians.users.models.UserProfile.privacy_fields') def test_get_attribute_without_privacy_level(self, mock_privacy_fields): mock_privacy_fields.return_value = {'full_name': ''} user = UserFactory.create(userprofile={'full_name': 'foobar'}) eq_(user.userprofile.full_name, 'foobar') @patch('mozillians.users.models.UserProfile.privacy_fields') def test_get_attribute_with_public_level(self, mock_privacy_fields): mock_privacy_fields.return_value = {'full_name': ''} user = UserFactory.create(userprofile={'full_name': 'foobar'}) profile = user.userprofile profile.set_instance_privacy_level(PUBLIC) eq_(profile.full_name, '') @patch('mozillians.users.models.UserProfile.privacy_fields') def test_get_attribute_with_employee_level(self, mock_privacy_fields): mock_privacy_fields.return_value = {'full_name': ''} user = UserFactory.create(userprofile={'full_name': 'foobar'}) profile = user.userprofile profile.set_instance_privacy_level(EMPLOYEES) eq_(profile.full_name, 'foobar') def test_accounts_access(self): user = UserFactory.create() user.userprofile.externalaccount_set.create(type=ExternalAccount.TYPE_SUMO, identifier='test') ok_(isinstance(user.userprofile.accounts, QuerySet)) eq_(user.userprofile.accounts.filter(identifier='test')[0].identifier, 'test') def test_accounts_public_mozillians(self): profile = UserFactory.create().userprofile profile.set_instance_privacy_level(PUBLIC) profile.externalaccount_set.create(type=ExternalAccount.TYPE_SUMO, identifier='test', privacy=MOZILLIANS) eq_(profile.accounts.count(), 0) profile.set_instance_privacy_level(MOZILLIANS) eq_(profile.accounts.count(), 1) def test_websites(self): profile = UserFactory.create().userprofile profile.set_instance_privacy_level(MOZILLIANS) profile.externalaccount_set.create(type=ExternalAccount.TYPE_SUMO, identifier='test', privacy=MOZILLIANS) profile.externalaccount_set.create(type=ExternalAccount.TYPE_WEBSITE, identifier='http://google.com', privacy=MOZILLIANS) eq_(profile.accounts.count(), 1) eq_(profile.websites.count(), 1) profile.set_instance_privacy_level(PUBLIC) eq_(profile.websites.count(), 0) def test_annotated_tags_not_public(self): # Group member who wants their groups kept semi-private profile = UserFactory.create(userprofile={'privacy_groups': MOZILLIANS}).userprofile group = GroupFactory.create(name='group') group.add_member(profile) # Being accessed by a member of the general public profile.set_instance_privacy_level(PUBLIC) # no groups seen eq_(len(profile.get_annotated_tags()), 0) def test_annotated_access_groups_not_public(self): # Group member who wants their groups kept semi-private profile = UserFactory.create(userprofile={'privacy_groups': MOZILLIANS}).userprofile group = GroupFactory.create(name='group') group.add_member(profile) # Being accessed by a member of the general public profile.set_instance_privacy_level(PUBLIC) # no groups seen eq_(len(profile.get_annotated_access_groups()), 0) def test_get_annotated_tags_limit_to_current_user(self): """Test that get_annotated_tags() limits query to current user. To regression test against 969920: We didn't limit GroupMembership queryset to current user which resulted server timeouts because we iterated over all groups. """ group_1 = GroupFactory.create() user_1 = UserFactory.create() user_2 = UserFactory.create() group_1.add_member(user_1.userprofile) group_1.add_member(user_2.userprofile) user_groups = user_1.userprofile.get_annotated_tags() eq_([group_1], user_groups) def test_get_annotated_tags_only_visible(self): """ Test that get_annotated_tags() only returns visible groups """ group_1 = GroupFactory.create(visible=True) group_2 = GroupFactory.create(visible=False) profile = UserFactory.create().userprofile group_1.add_member(profile) group_2.add_member(profile) user_groups = profile.get_annotated_tags() eq_([group_1], user_groups) def test_get_annotated_access_groups_only_visible(self): """ Test that get_annotated_access_groups() only returns visible groups """ group_1 = GroupFactory.create(visible=True, is_access_group=True) group_2 = GroupFactory.create(visible=False, is_access_group=True) profile = UserFactory.create().userprofile group_1.add_member(profile) group_2.add_member(profile) user_groups = profile.get_annotated_access_groups() eq_([group_1], user_groups) @patch('mozillians.users.models.send_mail') def test_email_now_vouched(self, send_mail_mock): user = UserFactory.create() user.userprofile._email_now_vouched(None) ok_(send_mail_mock.called) eq_(send_mail_mock.call_args[0][3], [user.email]) @override_settings(CAN_VOUCH_THRESHOLD=1) @patch('mozillians.users.models.send_mail') def test_email_now_vouched_with_voucher(self, send_mail_mock): voucher = UserFactory.create() user = UserFactory.create(vouched=False) user.userprofile._email_now_vouched(voucher.userprofile) ok_(send_mail_mock.called) eq_(send_mail_mock.call_args[0][3], [user.email]) ok_(voucher.userprofile.full_name in send_mail_mock.call_args[0][1]) @patch('mozillians.users.models.send_mail') @patch('mozillians.users.models.get_template') def test_email_now_vouched_first_vouch(self, get_template_mock, send_mail_mock): user = UserFactory.create() user.userprofile._email_now_vouched(None) eq_(get_template_mock().render.call_args[0][0]['first_vouch'], True) @patch('mozillians.users.models.send_mail') @patch('mozillians.users.models.get_template') @override_settings(CAN_VOUCH_THRESHOLD=2) def test_email_now_vouched_can_vouch(self, get_template_mock, send_mail_mock): user = UserFactory.create() user.userprofile._email_now_vouched(None) eq_(get_template_mock().render.call_args_list[0][0][0]['can_vouch_threshold'], False) Vouch.objects.create(voucher=None, vouchee=user.userprofile, date=now()) user.userprofile._email_now_vouched(None) eq_(get_template_mock().render.call_args_list[1][0][0]['can_vouch_threshold'], True) def test_set_privacy_level_with_save(self): user = UserFactory.create() user.userprofile.set_privacy_level(9) user = User.objects.get(id=user.id) for field in UserProfile.privacy_fields(): eq_(getattr(user.userprofile, 'privacy_{0}'.format(field)), 9, 'Field {0} not set'.format(field)) def test_set_privacy_level_without_save(self): user = UserFactory.create() user.userprofile.set_privacy_level(9, save=False) for field in UserProfile.privacy_fields(): eq_(getattr(user.userprofile, 'privacy_{0}'.format(field)), 9, 'Field {0} not set'.format(field)) user = User.objects.get(id=user.id) for field in UserProfile.privacy_fields(): # Compare to default privacy setting for each field. f = UserProfile._meta.get_field('privacy_{0}'.format(field)) eq_(getattr(user.userprofile, 'privacy_{0}'.format(field)), f.default, 'Field {0} not set'.format(field)) def test_set_instance_privacy_level(self): user = UserFactory.create() user.userprofile.set_instance_privacy_level(9) eq_(user.userprofile._privacy_level, 9) def test_email_no_privacy(self): user = UserFactory.create() eq_(user.userprofile.email, user.email) def test_email_private(self): user = UserFactory.create() public_profile = user.userprofile public_profile.set_instance_privacy_level(PUBLIC) eq_(public_profile.email, UserProfile.privacy_fields()['email']) def test_email_public(self): user = UserFactory.create(userprofile={'privacy_email': PUBLIC}) public_profile = user.userprofile public_profile.set_instance_privacy_level(PUBLIC) eq_(public_profile.email, user.email) def test_tshirt_public(self): user = UserFactory.create(userprofile={'tshirt': 9}) public_profile = user.userprofile public_profile.set_instance_privacy_level(PUBLIC) eq_(public_profile.tshirt, UserProfile.privacy_fields()['tshirt']) def test_privacy_level_employee(self): user = UserFactory.create() group, _ = Group.objects.get_or_create(name='staff') group.add_member(user.userprofile) eq_(user.userprofile.privacy_level, EMPLOYEES) def test_privacy_level_vouched(self): user = UserFactory.create() eq_(user.userprofile.privacy_level, MOZILLIANS) def test_privacy_level_unvouched(self): user = UserFactory.create(vouched=False) eq_(user.userprofile.privacy_level, PUBLIC) def test_is_complete(self): user = UserFactory.create(userprofile={'full_name': 'foo bar'}) ok_(user.userprofile.is_complete) def test_is_not_complete(self): user = UserFactory.create(userprofile={'full_name': ''}) ok_(not user.userprofile.is_complete) def test_is_public(self): for field in UserProfile.privacy_fields(): user = UserFactory.create( userprofile={'privacy_{0}'.format(field): PUBLIC}) ok_(user.userprofile.is_public, 'Field {0} did not set profile to public'.format(field)) def test_is_not_public(self): user = UserFactory.create() ok_(not user.userprofile.is_public) def test_is_public_indexable(self): for field in PUBLIC_INDEXABLE_FIELDS: user = UserFactory.create( userprofile={'privacy_{0}'.format(field): PUBLIC, 'ircname': 'bar'}) ok_(user.userprofile.is_public_indexable, 'Field {0} did not set profile to public index'.format(field)) def test_set_membership_group_matches_alias(self): group_1 = GroupFactory.create(name='foo') group_2 = GroupFactory.create(name='lo') GroupAliasFactory.create(alias=group_2, name='bar') user = UserFactory.create() user.userprofile.set_membership(Group, ['foo', 'bar']) eq_(set(user.userprofile.groups.all()), set([group_1, group_2])) def test_set_membership_group_new_group(self): user = UserFactory.create() user.userprofile.set_membership(Group, ['foo', 'bar']) ok_(user.userprofile.groups.filter(name='foo').exists()) ok_(user.userprofile.groups.filter(name='bar').exists()) def test_set_membership_system_group(self): # a "system" group is invisible and cannot be joined or left group_1 = GroupFactory.create(visible=False, members_can_leave=False, accepting_new_members='no') user = UserFactory.create() user.userprofile.set_membership(Group, [group_1.name, 'bar']) ok_(user.userprofile.groups.filter(name='bar').exists()) eq_(user.userprofile.groups.count(), 1) def test_set_membership_skill_matches_alias(self): group_1 = SkillFactory.create(name='foo') group_2 = SkillFactory.create(name='lo') SkillAliasFactory.create(alias=group_2, name='bar') user = UserFactory.create() user.userprofile.set_membership(Skill, ['foo', 'bar']) eq_(set(user.userprofile.skills.all()), set([group_1, group_2])) def test_set_membership_skill_new_group(self): user = UserFactory.create() user.userprofile.set_membership(Skill, ['foo', 'bar']) ok_(user.userprofile.skills.filter(name='foo').exists()) ok_(user.userprofile.skills.filter(name='bar').exists()) @patch('mozillians.users.models.default_storage') @patch('mozillians.users.models.Image') @patch('mozillians.users.models.get_thumbnail') def test_get_photo_thumbnail_with_photo(self, get_thumbnail_mock, mock_image, mock_storage): mock_image_obj = Mock() mock_image_obj.mode = 'RGB' mock_image.open.return_value = mock_image_obj mock_storage.exists.return_value = True user = UserFactory.create(userprofile={'photo': 'foo'}) user.userprofile.get_photo_thumbnail(geometry='geo', crop='crop') get_thumbnail_mock.assert_called_with('foo', 'geo', crop='crop') @override_settings(DEFAULT_AVATAR_PATH='bar') @patch('mozillians.users.models.get_thumbnail') def test_get_photo_thumbnail_without_photo(self, get_thumbnail_mock): user = UserFactory.create() user.userprofile.get_photo_thumbnail(geometry='geo', crop='crop') get_thumbnail_mock.assert_called_with('bar', 'geo', crop='crop') @patch('mozillians.users.models.UserProfile.get_photo_thumbnail') def test_get_photo_url_with_photo(self, get_photo_thumbnail_mock): user = UserFactory.create(userprofile={'photo': 'foo'}) user.userprofile.get_photo_url('80x80', firefox='rocks') get_photo_thumbnail_mock.assert_called_with('80x80', firefox='rocks') @patch('mozillians.users.models.gravatar') def test_get_photo_url_without_photo(self, gravatar_mock): user = UserFactory.create() user.userprofile.get_photo_url('80x80', firefox='rocks') gravatar_mock.assert_called_with(user.email, size='80x80') def test_is_not_public_indexable(self): user = UserFactory.create() ok_(not user.userprofile.is_public_indexable) def test_get_absolute_url(self): user = UserFactory.create() ok_(user.userprofile.get_absolute_url()) def test_language_privacy_public(self): """Test that instance with level PUBLIC cannot access languages.""" profile = UserFactory.create().userprofile profile.language_set.create(code='en') profile.privacy_language = MOZILLIANS profile.save() profile.set_instance_privacy_level(PUBLIC) eq_(profile.languages.count(), 0) def test_language_privacy_mozillians(self): """Test that instance with level MOZILLIANS can access languages.""" profile = UserFactory.create().userprofile profile.language_set.create(code='en') profile.privacy_language = MOZILLIANS profile.save() profile.set_instance_privacy_level(MOZILLIANS) eq_(profile.languages.count(), 1) def test_is_manager_when_manager(self): user = UserFactory.create(manager=True) ok_(user.userprofile.is_manager) def test_is_manager_when_not_manager(self): user = UserFactory.create() ok_(not user.userprofile.is_manager) def test_is_manager_when_superuser(self): user = UserFactory.create(is_superuser=True) ok_(user.userprofile.is_manager) @override_settings(NDA_GROUP='foobar') def test_is_nda_when_member(self): user = UserFactory.create() group = GroupFactory.create(name='foobar') group.add_member(user.userprofile) ok_(user.userprofile.is_nda) @override_settings(NDA_GROUP='foobar') def test_is_nda_when_pending(self): user = UserFactory.create() group = GroupFactory.create(name='foobar') group.add_member(user.userprofile, status='PENDING') ok_(not user.userprofile.is_nda) @override_settings(NDA_GROUP='foobar') def test_is_nda_when_not_member(self): user = UserFactory.create() GroupFactory.create(name='foobar') ok_(not user.userprofile.is_nda) class VouchTests(TestCase): """Tests related to the vouching functionality.""" @override_settings(CAN_VOUCH_THRESHOLD=1) @patch('mozillians.users.models.UserProfile._email_now_vouched') @patch('mozillians.users.models.now') def test_vouch(self, datetime_mock, email_vouched_mock): dt = make_aware(datetime(2012, 1, 1, 00, 10), pytz.UTC) datetime_mock.return_value = dt user_1 = UserFactory.create() user_2 = UserFactory.create(vouched=False) user_2.userprofile.vouch(user_1.userprofile) user_2 = User.objects.get(id=user_2.id) ok_(user_2.userprofile.is_vouched) eq_(user_2.userprofile.vouched_by, user_1.userprofile) eq_(user_2.userprofile.vouches_received.all()[0].date, dt) ok_(email_vouched_mock.called) @override_settings(CAN_VOUCH_THRESHOLD=1) def test_vouch_autovouchset(self): # autovouch=False user = UserFactory.create(vouched=False) user.userprofile.vouch(None, autovouch=False) user = User.objects.get(id=user.id) ok_(user.userprofile.is_vouched) eq_(user.userprofile.vouches_received.all()[0].autovouch, False) # autovouch=True user = UserFactory.create(vouched=False) user.userprofile.vouch(None, autovouch=True) user = User.objects.get(id=user.id) ok_(user.userprofile.is_vouched) eq_(user.userprofile.vouches_received.all()[0].autovouch, True) @override_settings(CAN_VOUCH_THRESHOLD=1) def test_voucher_public(self): voucher = UserFactory.create() user = UserFactory.create(vouched=False) user.userprofile.vouch(voucher.userprofile) voucher_profile = voucher.userprofile voucher_profile.privacy_full_name = PUBLIC voucher_profile.save() user_profile = user.userprofile user_profile.set_instance_privacy_level(PUBLIC) eq_(user_profile.vouched_by, voucher.userprofile) def test_voucher_nonpublic(self): voucher = UserFactory.create() user = UserFactory.create() user.userprofile.vouch(voucher.userprofile) user_profile = user.userprofile user_profile.set_instance_privacy_level(PUBLIC) eq_(user_profile.vouched_by, None) def test_vouchee_privacy(self): voucher = UserFactory.create() vouchee_1 = UserFactory.create(userprofile={'privacy_full_name': PUBLIC}) vouchee_2 = UserFactory.create(userprofile={'privacy_full_name': MOZILLIANS}) vouchee_1.userprofile.vouch(voucher.userprofile) vouchee_2.userprofile.vouch(voucher.userprofile) user_profile = voucher.userprofile user_profile.set_instance_privacy_level(PUBLIC) eq_(set(user_profile.vouches_made.all()), set(vouchee_1.userprofile.vouches_received.filter(voucher=user_profile))) user_profile.set_instance_privacy_level(MOZILLIANS) eq_(set(user_profile.vouches_made.all()), set(Vouch.objects.filter(voucher=user_profile))) def test_vouch_reset(self): voucher = UserFactory.create() user = UserFactory.create() user.userprofile.vouch(voucher.userprofile) profile = user.userprofile profile.vouches_received.all().delete() profile.is_vouched = False profile.save() profile = UserProfile.objects.get(pk=profile.id) ok_(not profile.vouches_received.all()) @override_settings(CAN_VOUCH_THRESHOLD=1) def test_vouch_once_per_voucher(self): voucher = UserFactory.create() user = UserFactory.create(vouched=False) user.userprofile.vouch(voucher.userprofile) user.userprofile.vouch(voucher.userprofile) eq_(user.userprofile.vouches_received.all().count(), 1) @override_settings(CAN_VOUCH_THRESHOLD=1) @override_settings(VOUCH_COUNT_LIMIT=2) def test_multiple_vouches(self): user = UserFactory.create(vouched=False) # 9 vouches, only 2 should stick. for i in range(1, 10): user.userprofile.vouch(UserFactory.create().userprofile) eq_(user.userprofile.vouches_received.all().count(), 2) class CalculatePhotoFilenameTests(TestCase): @patch('mozillians.users.models.uuid.uuid4', wraps=uuid4) def test_base(self, uuid4_mock): result = _calculate_photo_filename(None, '') ok_(result.endswith('.jpg')) ok_(result.startswith(settings.USER_AVATAR_DIR)) ok_(uuid4_mock.called) class ExternalAccountTests(TestCase): def test_get_url(self): profile = UserFactory.create().userprofile account = profile.externalaccount_set.create(type=ExternalAccount.TYPE_MDN, identifier='sammy') ok_('sammy' in account.get_identifier_url()) def test_get_url_unicode(self): profile = UserFactory.create().userprofile account = profile.externalaccount_set.create(type=ExternalAccount.TYPE_MDN, identifier=u'sammyウ') ok_('%E3%82%A6' in account.get_identifier_url()) def test_urls_contain_identifiers(self): for value, account in ExternalAccount.ACCOUNT_TYPES.iteritems(): if account['url']: ok_('{identifier}' in account['url']) class EmailAttributeTests(TestCase): def test_existing_idp_privacy_unaware(self): profile = UserFactory.create(email='foo@foo.com').userprofile IdpProfile.objects.create( profile=profile, auth0_user_id='github|foo@bar.com', email='foo@bar.com', primary=True, primary_contact_identity=True, privacy=PUBLIC ) eq_(profile.email, 'foo@bar.com') def test_existing_idp_privacy_allowed(self): profile = UserFactory.create(email='foo@foo.com').userprofile profile.set_instance_privacy_level(MOZILLIANS) IdpProfile.objects.create( profile=profile, auth0_user_id='github|foo@bar.com', email='foo@bar.com', primary=True, primary_contact_identity=True, privacy=PUBLIC ) eq_(profile.email, 'foo@bar.com') def test_existing_idp_privacy_not_allowed(self): profile = UserFactory.create(email='foo@foo.com').userprofile IdpProfile.objects.create( profile=profile, auth0_user_id='github|foo@bar.com', email='foo@bar.com', primary=True, primary_contact_identity=True, privacy=MOZILLIANS ) profile.set_instance_privacy_level(PUBLIC) eq_(profile.email, '') def test_not_existing_idp_privacy_unaware(self): profile = UserFactory.create(email='foo@foo.com').userprofile eq_(profile.email, 'foo@foo.com') def test_not_existing_idp_privacy_allowed(self): userprofile_args = { 'privacy_email': PUBLIC } profile = UserFactory.create(email='foo@foo.com', userprofile=userprofile_args).userprofile profile.set_instance_privacy_level(MOZILLIANS) eq_(profile.email, 'foo@foo.com') def test_not_existing_idp_privacy_not_allowed(self): userprofile_args = { 'privacy_email': MOZILLIANS } profile = UserFactory.create(email='foo@foo.com', userprofile=userprofile_args).userprofile profile.set_instance_privacy_level(PUBLIC) eq_(profile.email, '') class PrivacyModelTests(unittest.TestCase): def setUp(self): UserProfile.clear_privacy_fields_cache() def test_profile_model(self): fields = UserProfile.privacy_fields() eq_('', fields['ircname']) eq_('', fields['email']) ok_('is_vouched' not in fields) ok_('date_vouched' not in fields) ok_(fields['tshirt'] is None) def test_caching(self): # It would be better if this test didn't need to know how the # caching worked. # To compute the privacy fields, the code has to get all the # field names. Use mock so we can tell if that gets called. with patch.object(UserProfile._meta, 'get_field') as mock_get_field: UserProfile.privacy_fields() ok_(mock_get_field.called) # If we call privacy_fields() again, it shouldn't need to compute it all again with patch.object(UserProfile._meta, 'get_field') as mock_get_field: UserProfile.privacy_fields() ok_(not mock_get_field.called) class CISHelperMethodsTests(unittest.TestCase): def tearDown(self): Group.objects.all().delete() IdpProfile.objects.all().delete() def test_cis_emails_without_primary_identity(self): profile = UserFactory.create(email='foo@bar.com').userprofile expected_result = [ { 'value': 'foo@bar.com', 'verified': True, 'primary': True, 'name': 'mozillians-primary-{0}'.format(profile.id) }, ] eq_(profile.get_cis_emails(), expected_result) def test_cis_emails_with_primary_identity(self): profile = UserFactory.create(email='foo@bar.com').userprofile IdpProfile.objects.create( profile=profile, auth0_user_id='github|1', email='foo@bar.com', primary=True, ) expected_result = [ { 'value': u'foo@bar.com', 'verified': True, 'primary': True, 'name': u'Github Provider' } ] eq_(profile.get_cis_emails(), expected_result) def test_cis_groups_highest(self): user = UserFactory.create() group1 = GroupFactory.create(name='nda', is_access_group=True) group2 = GroupFactory.create(name='cis_whitelist', is_access_group=True) group3 = GroupFactory.create(name='open innovation + reps council', is_access_group=True) group4 = GroupFactory.create(name='group4') group1.add_member(user.userprofile) group2.add_member(user.userprofile) group3.add_member(user.userprofile) group4.add_member(user.userprofile, status='PENDING') IdpProfile.objects.create( profile=user.userprofile, auth0_user_id='github|foo@bar.com', primary=False, email='foo@bar.com' ) idp = IdpProfile.objects.create( profile=user.userprofile, auth0_user_id='ad|foo@bar.com', primary=True, email='foo@bar.com' ) eq_(set(user.userprofile.get_cis_groups(idp)), set(['mozilliansorg_nda', 'mozilliansorg_cis_whitelist', 'mozilliansorg_open-innovation-reps-council'])) def test_cis_groups_not_highest(self): user = UserFactory.create() group1 = GroupFactory.create(name='nda') group2 = GroupFactory.create(name='cis_whitelist') group3 = GroupFactory.create(name='group3') group1.add_member(user.userprofile) group2.add_member(user.userprofile) group3.add_member(user.userprofile, status='PENDING') idp = IdpProfile.objects.create( profile=user.userprofile, auth0_user_id='github|foo@bar.com', primary=False, email='foo@bar.com' ) IdpProfile.objects.create( profile=user.userprofile, auth0_user_id='ad|foo@bar.com', primary=True, email='foo@bar.com' ) eq_(user.userprofile.get_cis_groups(idp), []) def test_cis_groups_not_mfa(self): user = UserFactory.create() group1 = GroupFactory.create(name='nda') group2 = GroupFactory.create(name='cis_whitelist') group3 = GroupFactory.create(name='group3') group1.add_member(user.userprofile) group2.add_member(user.userprofile) group3.add_member(user.userprofile, status='PENDING') idp = IdpProfile.objects.create( profile=user.userprofile, auth0_user_id='email|foo@bar.com', email='foo@bar.com', primary=False, ) IdpProfile.objects.create( profile=user.userprofile, auth0_user_id='email|bar@bar.com', email='bar@bar.com', primary=True, ) eq_(user.userprofile.get_cis_groups(idp), []) def test_cis_groups_without_idp_profile(self): user = UserFactory.create() user1 = UserFactory.create() group1 = GroupFactory.create(name='nda') group2 = GroupFactory.create(name='cis_whitelist') group3 = GroupFactory.create(name='group3') group1.add_member(user.userprofile) group2.add_member(user.userprofile) group3.add_member(user.userprofile, status='PENDING') idp = IdpProfile.objects.create( profile=user1.userprofile, auth0_user_id='github|foo@bar.com', primary=False, email='foo@bar.com' ) eq_(user.userprofile.get_cis_groups(idp), []) def test_cis_tags(self): user = UserFactory.create() group1 = GroupFactory.create(name='foo', is_access_group=False) group2 = GroupFactory.create(name='bar', is_access_group=False) group3 = GroupFactory.create(name='baz', is_access_group=False) group1.add_member(user.userprofile) group2.add_member(user.userprofile) group3.add_member(user.userprofile, status='PENDING') IdpProfile.objects.create( profile=user.userprofile, auth0_user_id='ad|foo@bar.com', primary=True, email='foo@bar.com' ) eq_(set(user.userprofile.get_cis_tags()), set(['foo', 'bar'])) def test_cis_uris(self): user = UserFactory.create() sumo_uri = user.userprofile.externalaccount_set.create( type=ExternalAccount.TYPE_SUMO, identifier='test' ) expected_result = [ { 'value': 'https://support.mozilla.org/user/test', 'primary': False, 'verified': False, 'name': 'mozillians-Mozilla Support-{}'.format(sumo_uri.pk) } ] eq_(user.userprofile.get_cis_uris(), expected_result)
bsd-3-clause
f017d1e695f00bcdd119aa3bf35bebf8
39.842938
99
0.631965
3.750363
false
true
false
false
mozilla/mozillians
mozillians/phonebook/urls.py
2
3409
from django.conf.urls import url from django.contrib.auth.decorators import login_required from django.views.generic import TemplateView from mozillians.common.decorators import allow_public, allow_unvouched from mozillians.phonebook import views as phonebook_views app_name = 'mozillians' urlpatterns = [ url(r'^$', phonebook_views.home, name='home'), url(r'^login/$', phonebook_views.login, name='login'), url(r'^logout/$', phonebook_views.logout, name='logout'), url(r'^register/$', phonebook_views.register, name='register'), url(r'^user/edit/$', phonebook_views.edit_profile, name='profile_edit'), url(r'^u/(?P<username>[\w.@+-]+)/$', phonebook_views.view_profile, name='profile_view'), # Use Auth0 to verify an identity url(r'^verify/identity/$', allow_unvouched( login_required(phonebook_views.VerifyIdentityView.as_view()) ), name='verify_identity'), url(r'^verify/identity/callback/$', allow_unvouched( login_required(phonebook_views.VerifyIdentityCallbackView.as_view()) ), name='verify_identity_callback'), url(r'^user/delete/identity/(?P<identity_pk>\d+)/$', phonebook_views.delete_identity, name='delete_identity'), url(r'^user/primary/contact/identity/(?P<identity_pk>\d+)/$', phonebook_views.change_primary_contact_identity, name='change_primary_contact_identity'), url(r'^u/(?P<username>[\w.@+-]+)/vouch/$', phonebook_views.vouch, name='profile_vouch'), url(r'^u/(?P<username>[\w.@+-]+)/unvouch/$', phonebook_views.unvouch, name='profile_unvouch'), url(r'^confirm-delete/$', phonebook_views.confirm_delete, name='profile_confirm_delete'), url(r'^delete/$', phonebook_views.delete, name='profile_delete'), url(r'^user/delete_idp_profiles/$', phonebook_views.delete_idp_profiles, name='delete_idp_profiles'), url(r'^invite/$', phonebook_views.invite, name='invite'), url(r'^invite/(?P<invite_pk>\d+)/delete/$', phonebook_views.delete_invite, name='delete_invite'), url(r'^apikeys/$', phonebook_views.apikeys, name='apikeys'), url(r'^apikey/(?P<api_pk>\d+)/delete/$', phonebook_views.delete_apikey, name='apikey_delete'), # Haystack search url(r'^search/$', allow_public(phonebook_views.PhonebookSearchView.as_view()), name='haystack_search'), url(r'^country/(?P<country>[A-Za-z0-9 \.\,]+)/$', phonebook_views.PhonebookSearchView.as_view(), name='list_country'), url(r'^country/(?P<country>[A-Za-z0-9 \.\,]+)/city/(?P<city>.+)/$', phonebook_views.PhonebookSearchView.as_view(), name='list_city'), url((r'^country/(?P<country>[A-Za-z0-9 \.\,]+)/' 'region/(?P<region>.+)/city/(?P<city>.+)/$'), phonebook_views.PhonebookSearchView.as_view(), name='list_region_city'), url(r'^country/(?P<country>[A-Za-z0-9 \.]+)/region/(?P<region>.+)/$', phonebook_views.PhonebookSearchView.as_view(), name='list_region'), # Static pages need csrf for post to work url(r'^about/$', allow_public(TemplateView.as_view(template_name='phonebook/about.html')), name='about'), url(r'^about/dinomcvouch$', allow_public(TemplateView.as_view(template_name='phonebook/about-dinomcvouch.html')), name='about-dinomcvouch'), # CSP violation URL url(r'^capture-csp-violation$', phonebook_views.capture_csp_violation, name='capture-csp-violation') ]
bsd-3-clause
3941b9340bc045d59fc92cb32f1f4404
53.111111
98
0.660604
3.274736
false
false
false
false
mozilla/mozillians
scripts/update/update.py
3
8516
""" Deployment for Mozillians in production. Requires commander (https://github.com/oremj/commander) which is installed on the systems that need it. """ import os import random import re import sys import urllib import urllib2 sys.path.append(os.path.dirname(os.path.abspath(__file__))) from commander.deploy import task, hostgroups # noqa import commander_settings as settings # noqa # Setup venv path. venv_bin_path = os.path.join(settings.SRC_DIR, '..', 'venv', 'bin') os.environ['PATH'] = venv_bin_path + os.pathsep + os.environ['PATH'] NEW_RELIC_URL = 'https://rpm.newrelic.com/deployments.xml' GITHUB_URL = 'https://github.com/mozilla/mozillians/compare/{oldrev}...{newrev}' @task def update_code(ctx, tag): with ctx.lcd(settings.SRC_DIR): ctx.local('git fetch') ctx.local('git checkout -f %s' % tag) ctx.local("find . -type f -name '.gitignore' -or -name '*.pyc' -delete") @task def update_locales(ctx): with ctx.lcd(os.path.join(settings.SRC_DIR, 'locale')): ctx.local('find . -name "*.mo" -delete') ctx.local('git pull') ctx.local('./compile.sh .') @task def update_assets(ctx): with ctx.lcd(settings.SRC_DIR): ctx.local('which python') ctx.local('LANG=en_US.UTF-8 python manage.py collectstatic --noinput --no-default-ignore -i .git') # noqa ctx.local('LANG=en_US.UTF-8 python manage.py compress --engine jinja2') ctx.local('LANG=en_US.UTF-8 python manage.py update_product_details') @task def database(ctx): with ctx.lcd(settings.SRC_DIR): ctx.local('python manage.py migrate --noinput') # Debug migrations issue print('Dry-run makemigrations for debugging purposes') ctx.local('python manage.py makemigrations --dry-run --verbosity 3') # # Update DB for django-cities-light # ctx.local('LANG=en_US.UTF-8 python manage.py cities_light_fixtures load --base-url=lib/django_cities_light/fixtures/') # noqa @task def update_revision_files(ctx): with ctx.lcd(settings.SRC_DIR): global OLDREV, NEWREV NEWREV = ctx.local('git rev-parse HEAD').out.strip() OLDREV = ctx.local('cat media/revision.txt').out.strip() ctx.local('mv media/revision.txt media/prev-revision.txt') ctx.local("echo '%s' > media/revision.txt" % NEWREV) @task def ping_newrelic(ctx): if settings.NEW_RELIC_API_KEY and settings.NEW_RELIC_APP_ID: with ctx.lcd(settings.SRC_DIR): log_cmd = 'git log --oneline {0}..{1}'.format(OLDREV, NEWREV) changelog = ctx.local(log_cmd).out.strip() print('Post deployment to New Relic') desc = generate_desc(OLDREV, NEWREV, changelog) if changelog: github_url = GITHUB_URL.format(oldrev=OLDREV, newrev=NEWREV) changelog = '{0}\n\n{1}'.format(changelog, github_url) data = urllib.urlencode({ 'deployment[description]': desc, 'deployment[revision]': NEWREV, 'deployment[app_id]': settings.NEW_RELIC_APP_ID, 'deployment[changelog]': changelog, }) headers = {'x-api-key': settings.NEW_RELIC_API_KEY} try: request = urllib2.Request(NEW_RELIC_URL, data, headers) urllib2.urlopen(request) except urllib.URLError as exp: print('Error notifying New Relic: {0}'.format(exp)) @task def update_es_indexes(ctx): with ctx.lcd(settings.SRC_DIR): ctx.local('python manage.py rebuild_index --noinput') @task def validate_fun_facts(ctx): with ctx.lcd(settings.SRC_DIR): ctx.local('python manage.py cron validate_fun_facts') @task def generate_humanstxt(ctx): with ctx.lcd(settings.SRC_DIR): ctx.local('python manage.py cron generate_humanstxt &') # @task # def install_cron(ctx): # with ctx.lcd(settings.SRC_DIR): # ctx.local("python ./scripts/crontab/gen-crons.py -k %s -u apache > /etc/cron.d/.%s" % # (settings.WWW_DIR, settings.CRON_NAME)) # ctx.local("mv /etc/cron.d/.%s /etc/cron.d/%s" % (settings.CRON_NAME, settings.CRON_NAME)) @task def checkin_changes(ctx): ctx.local(settings.DEPLOY_SCRIPT) @hostgroups(settings.WEB_HOSTGROUP, remote_kwargs={'ssh_key': settings.SSH_KEY}) def deploy_app(ctx): ctx.remote(settings.REMOTE_UPDATE_SCRIPT) ctx.remote('/bin/touch %s' % settings.REMOTE_WSGI) @hostgroups(settings.WEB_HOSTGROUP, remote_kwargs={'ssh_key': settings.SSH_KEY}) def prime_app(ctx): for http_port in range(80, 82): ctx.remote("for i in {1..10}; do curl -so /dev/null -H 'Host: %s' -I http://localhost:%s/ & sleep 1; done" % (settings.REMOTE_HOSTNAME, http_port)) # noqa @hostgroups(settings.CELERY_HOSTGROUP, remote_kwargs={'ssh_key': settings.SSH_KEY}) def update_celery(ctx): ctx.remote(settings.REMOTE_UPDATE_SCRIPT) ctx.remote('/sbin/service %s restart' % settings.CELERY_SERVICE) ctx.remote('/sbin/service %s restart' % settings.CELERYBEAT_SERVICE) @task def update_info(ctx, tag): with ctx.lcd(settings.SRC_DIR): ctx.local('date') ctx.local('git branch') ctx.local('git log -3') ctx.local('git status') ctx.local('which python') ctx.local('python manage.py migrate --list') with ctx.lcd('locale'): ctx.local('git remote -v') ctx.local('git log -1') ctx.local('git status') @task def setup_dependencies(ctx): with ctx.lcd(settings.SRC_DIR): # Creating a venv tries to open virtualenv/bin/python for # writing, but because venv is using it, it fails. # So we delete it and let virtualenv create a new one. ctx.local('rm -f venv/bin/python venv/bin/python2.7') ctx.local('virtualenv-2.7 --no-site-packages venv') # Activate venv to append to the correct path to $PATH. activate_env = os.path.join(venv_bin_path, 'activate_this.py') execfile(activate_env, dict(__file__=activate_env)) # noqa # Make sure pip >= 8.x is installed ctx.local('python scripts/pipstrap.py') ctx.local('pip --version') ctx.local('pip install --require-hashes --no-deps -r requirements/prod.txt') # Make the venv relocatable ctx.local('virtualenv-2.7 --relocatable venv') # Fix lib64 symlink to be relative instead of absolute. ctx.local('rm -f venv/lib64') with ctx.lcd('venv'): ctx.local('ln -s lib lib64') @task def pre_update(ctx, ref=settings.UPDATE_REF): update_code(ref) setup_dependencies() update_info(ref) @task def update(ctx): update_assets() update_locales() database() @task def deploy(ctx): # install_cron() update_revision_files() checkin_changes() deploy_app() prime_app() update_celery() # Things run below here should not break the deployment if they fail. if OLDREV != NEWREV: # On dev, this script runs every 15 minutes. If we're pushing the same # revision we don't need to churn the index, ping new relic, or any of this. ping_newrelic() # update_es_indexes() validate_fun_facts() generate_humanstxt() @task def update_mozillians(ctx, tag): """Do typical mozillians update""" pre_update(tag) update() # utility functions # # shamelessly stolen from https://github.com/mythmon/chief-james/ def get_random_desc(): return random.choice([ 'No bugfixes--must be adding infinite loops.', 'No bugfixes--must be rot13ing function names for code security.', 'No bugfixes--must be demonstrating our elite push technology.', 'No bugfixes--must be testing james.', ]) def extract_bugs(changelog): """Takes output from git log --oneline and extracts bug numbers.""" bug_regexp = re.compile(r'\bbug (\d+)\b', re.I) bugs = set() for line in changelog: for bug in bug_regexp.findall(line): bugs.add(bug) return sorted(list(bugs)) def generate_desc(from_commit, to_commit, changelog): """Figures out a good description based on what we're pushing out.""" if from_commit.startswith(to_commit): desc = 'Pushing {0} again'.format(to_commit) else: bugs = extract_bugs(changelog.split('\n')) if bugs: bugs = ['bug #{0}'.format(bug) for bug in bugs] desc = 'Fixing: {0}'.format(', '.join(bugs)) else: desc = get_random_desc() return desc
bsd-3-clause
775d10782c327f83f9896d3cb80eb683
30.776119
163
0.635862
3.351436
false
false
false
false
mozilla/mozillians
mozillians/common/search.py
1
1384
import boto3 import os from botocore.auth import SigV4Auth from requests_aws4auth import AWS4Auth from elasticsearch import RequestsHttpConnection class AWS4AuthEncoded(AWS4Auth): def __call__(self, request): request = super(AWS4AuthEncoded, self).__call__(request) for header_name in request.headers: self._encode_header_to_utf8(request, header_name) return request def _encode_header_to_utf8(self, request, header_name): value = request.headers[header_name] if isinstance(value, unicode): value = value.encode('utf-8') if isinstance(header_name, unicode): del request.headers[header_name] header_name = header_name.encode('utf-8') request.headers[header_name] = value class AWSRequestsHttpConnection(RequestsHttpConnection): def perform_request(self, *args, **kwargs): credentials = boto3.session.Session().get_credentials() signed_creds = SigV4Auth(credentials, 'es', os.environ['AWS_ES_REGION']) secure_auth = AWS4AuthEncoded( credentials.access_key, credentials.secret_key, os.environ['AWS_ES_REGION'], 'es', session_token=signed_creds.credentials.token ) self.session.auth = secure_auth return super(AWSRequestsHttpConnection, self).perform_request(*args, **kwargs)
bsd-3-clause
f2d0adde0f93569c9c6a912f98e74191
31.952381
86
0.666908
3.988473
false
false
false
false
mozilla/mozillians
mozillians/common/authbackend.py
2
7781
import base64 import hashlib import json import re from django.conf import settings from django.contrib.auth.models import User from django.contrib import messages from cities_light.models import Country from mozilla_django_oidc.auth import OIDCAuthenticationBackend from waffle import switch_is_active from mozillians.dino_park.utils import _dino_park_get_profile_by_userid from mozillians.users.models import IdpProfile from mozillians.users.tasks import send_userprofile_to_cis SSO_AAL_SCOPE = 'https://sso.mozilla.com/claim/AAL' def calculate_username(email): """Calculate username from email address.""" email = email.split('@')[0] username = re.sub(r'[^\w.@+-]', '-', email) username = username[:settings.USERNAME_MAX_LENGTH] suggested_username = username count = 0 while User.objects.filter(username=suggested_username).exists(): count += 1 suggested_username = '%s%d' % (username, count) if len(suggested_username) > settings.USERNAME_MAX_LENGTH: # We failed to calculate a name for you, default to a # email digest. return base64.urlsafe_b64encode(hashlib.sha1(email).digest()).rstrip('=') return suggested_username class MozilliansAuthBackend(OIDCAuthenticationBackend): """Override OIDCAuthenticationBackend to provide custom functionality.""" def create_mozillians_profile(self, user_id, idp): # A new mozillians.org profile will be provisioned if there is not one, # we need the self-view of profile which mean a private scope # Because we are using OIDC proxy, we assume always ldap. This functionality # will be deprecated with the launch of DinoPark profile = idp.profile v2_profile_data = _dino_park_get_profile_by_userid(user_id) if not v2_profile_data: full_name = 'Anonymous Mozillian' else: try: data = json.loads(v2_profile_data) except (TypeError, ValueError): data = v2_profile_data # Escape the middleware first_name = data.get('first_name', {}).get('value') last_name = data.get('last_name', {}).get('value') full_name = first_name + ' ' + last_name # TODO: Update this. It's wrong to create entries like this. We need to populate # the Country table and match the incoming location. It's only for M1 beta. location = data.get('location_preference', {}).get('value') if location: country, _ = Country.objects.get_or_create(name=location) profile.country = country timezone = data.get('timezone', {}).get('value') if timezone: profile.timezone = timezone profile.title = data.get('fun_title', {}).get('value', '') is_staff = data.get('staff_information', {}).get('staff', {}).get('value') if is_staff: profile.is_staff = is_staff profile.full_name = full_name profile.auth0_user_id = user_id profile.save() if profile.is_staff: profile.auto_vouch() def get_or_create_user(self, *args, **kwargs): user = super(MozilliansAuthBackend, self).get_or_create_user(*args, **kwargs) if switch_is_active('dino-park-autologin') and user: self.request.session['oidc_login_next'] = '/beta' return user def get_username(self, claims): """This method is mostly useful when it is used in DinoPark. If we are creating a user and the Search Service already has a username, we will use that. Otherwise, we will get the username derived from username_algo. """ username = super(MozilliansAuthBackend, self).get_username(claims) if switch_is_active('dino-park-autologin'): auth0_user_id = claims.get('user_id') or claims.get('sub') v2_username = _dino_park_get_profile_by_userid(auth0_user_id, return_username=True) if v2_username and username != v2_username: return v2_username return username def create_user(self, claims): user = super(MozilliansAuthBackend, self).create_user(claims) # Ensure compatibility with OIDC conformant mode auth0_user_id = claims.get('user_id') or claims.get('sub') idp = IdpProfile.objects.create( profile=user.userprofile, auth0_user_id=auth0_user_id, email=claims.get('email'), primary=True ) # This is temporary for the beta version of DinoPark. # and will be removed after that. if switch_is_active('dino-park-autologin'): self.create_mozillians_profile(auth0_user_id, idp) return user def filter_users_by_claims(self, claims): """Override default method to store claims.""" self.claims = claims users = super(MozilliansAuthBackend, self).filter_users_by_claims(claims) # Checking the primary email returned 0 users, # before creating a new user we should check if the identity returned exists if not users: # Ensure compatibility with OIDC conformant mode auth0_user_id = claims.get('user_id') or claims.get('sub') idps = IdpProfile.objects.filter(auth0_user_id=auth0_user_id) user_ids = idps.values_list('profile__user__id', flat=True).distinct() return self.UserModel.objects.filter(id__in=user_ids) return users def check_authentication_method(self, user): """Check which Identity is used to login. This method, depending on the current status of the IdpProfile of a user, enforces MFA logins and creates the IdpProfiles. Returns the object (user) it was passed unchanged. """ if not user: return None profile = user.userprofile # Ensure compatibility with OIDC conformant mode auth0_user_id = self.claims.get('user_id') or self.claims.get('sub') email = self.claims.get('email') aal_scope = self.claims.get(SSO_AAL_SCOPE) is_mfa = True if not aal_scope or aal_scope != 'MEDIUM': is_mfa = False # Grant an employee vouch if the user has the 'hris_is_staff' group groups = self.claims.get('https://sso.mozilla.com/claim/groups') if groups and 'hris_is_staff' in groups: profile.auto_vouch() # Get or create new `user_id` obj, _ = IdpProfile.objects.get_or_create( profile=profile, email=email, auth0_user_id=auth0_user_id) if profile.groups.filter(is_access_group=True).exists() and not is_mfa: msg = ('Members and Curators of Access Groups need to use a 2FA' ' authentication method to login.') messages.error(self.request, msg) return None # With account deracheting we will always get the same Auth0 user id. Mark it as primary if not obj.primary: obj.primary = True IdpProfile.objects.filter(profile=profile).exclude(id=obj.id).update(primary=False) # Update/Save the Github username if 'github|' in auth0_user_id: obj.username = self.claims.get('nickname', '') # Save once obj.save() # Update CIS send_userprofile_to_cis.delay(profile.pk) return user def authenticate(self, **kwargs): """Override default method to add multiple Identity Profiles in an account.""" user = super(MozilliansAuthBackend, self).authenticate(**kwargs) return self.check_authentication_method(user)
bsd-3-clause
24a5c65092c14d9e04d11e79c37466fa
39.108247
96
0.627297
3.878863
false
false
false
false
mozilla/mozillians
mozillians/common/urlresolvers.py
4
4148
from threading import local from django.conf import settings from django.core.urlresolvers import reverse as django_reverse from django.utils.encoding import iri_to_uri from django.utils.functional import lazy from django.utils.translation.trans_real import parse_accept_lang_header # Thread-local storage for URL prefixes. Access with (get|set)_url_prefix. _local = local() def set_url_prefix(prefix): """Set the ``prefix`` for the current thread.""" _local.prefix = prefix def get_url_prefix(): """Get the prefix for the current thread, or None.""" return getattr(_local, 'prefix', None) def reverse(viewname, urlconf=None, args=None, kwargs=None, prefix=None): """Wraps Django's reverse to prepend the correct locale.""" prefixer = get_url_prefix() if prefixer: prefix = prefix or '/' url = django_reverse(viewname, urlconf, args, kwargs, prefix) if prefixer: url = prefixer.fix(url) # Ensure any unicode characters in the URL are escaped. return iri_to_uri(url) reverse_lazy = lazy(reverse, str) def find_supported(test): return [settings.LANGUAGE_URL_MAP[x] for x in settings.LANGUAGE_URL_MAP if x.split('-', 1)[0] == test.lower().split('-', 1)[0]] def split_path(path_): """ Split the requested path into (locale, path). locale will be empty if it isn't found. """ path = path_.lstrip('/') # Use partitition instead of split since it always returns 3 parts first, _, rest = path.partition('/') lang = first.lower() if lang in settings.LANGUAGE_URL_MAP: return settings.LANGUAGE_URL_MAP[lang], rest else: supported = find_supported(first) if len(supported): return supported[0], rest else: return '', path class Prefixer(object): def __init__(self, request): self.request = request split = split_path(request.path_info) self.locale, self.shortened_path = split def get_language(self): """ Return a locale code we support on the site using the user's Accept-Language header to determine which is best. This mostly follows the RFCs but read bug 439568 for details. """ if 'lang' in self.request.GET: lang = self.request.GET['lang'].lower() if lang in settings.LANGUAGE_URL_MAP: return settings.LANGUAGE_URL_MAP[lang] if self.request.META.get('HTTP_ACCEPT_LANGUAGE'): best = self.get_best_language( self.request.META['HTTP_ACCEPT_LANGUAGE']) if best: return best return settings.LANGUAGE_CODE def get_best_language(self, accept_lang): """Given an Accept-Language header, return the best-matching language.""" lum = settings.LANGUAGE_URL_MAP langs = dict(lum.items() + settings.CANONICAL_LOCALES.items()) # Add missing short locales to the list. This will automatically map # en to en-GB (not en-US), es to es-AR (not es-ES), etc. in alphabetical # order. To override this behavior, explicitly define a preferred locale # map with the CANONICAL_LOCALES setting. langs.update((k.split('-')[0], v) for k, v in lum.items() if k.split('-')[0] not in langs) try: ranked = parse_accept_lang_header(accept_lang) except ValueError: # see https://code.djangoproject.com/ticket/21078 return else: for lang, _ in ranked: lang = lang.lower() if lang in langs: return langs[lang] pre = lang.split('-')[0] if pre in langs: return langs[pre] def fix(self, path): path = path.lstrip('/') url_parts = [self.request.META['SCRIPT_NAME']] if path.partition('/')[0] not in settings.SUPPORTED_NONLOCALES: locale = self.locale if self.locale else self.get_language() url_parts.append(locale) url_parts.append(path) return '/'.join(url_parts)
bsd-3-clause
b1c1db3ed45df83461c8d0b5713da533
31.661417
81
0.610656
4.031098
false
false
false
false
mozilla/mozillians
mozillians/groups/tasks.py
3
12390
from datetime import datetime, timedelta from django.conf import settings from django.contrib.auth.models import User from django.core.mail import send_mail from django.db.models import Count, Max from django.template.loader import get_template, render_to_string from django.utils.timezone import now from django.utils.translation import activate, ungettext from django.utils.translation import ugettext as _ from waffle import switch_is_active from mozillians.celery import app from mozillians.common.templatetags.helpers import get_object_or_none DAYS_BEFORE_INVALIDATION = 2 * 7 # 14 days @app.task(ignore_result=True) def remove_empty_groups(): """Remove empty groups.""" from mozillians.groups.models import Group, Skill for model in [Group, Skill]: model.objects.annotate(mcount=Count('members')).filter(mcount=0).delete() # TODO: Schedule this task nightly @app.task(ignore_result=True) def send_pending_membership_emails(): """ For each curated group that has pending memberships that the curators have not yet been emailed about, send to all the curators an email with the count of all pending memberships and a link to view and manage the requests. """ from mozillians.groups.models import Group, GroupMembership # Curated groups that have pending membership requests groups = (Group.objects.exclude(curators__isnull=True) .exclude(accepting_new_members=Group.CLOSED)) groups = groups.filter(groupmembership__status=GroupMembership.PENDING).distinct() for group in groups: # what's the max pk of pending memberships? pending_memberships = group.groupmembership_set.filter(status=GroupMembership.PENDING) max_pk = pending_memberships.aggregate(max_pk=Max('pk'))['max_pk'] curators = group.curators.all() # Only send reminder if there are newer requests than we'd previously reminded about if max_pk > group.max_reminder and curators: # TODO: Switch locale to curator's preferred language so translation will occur # Using English for now activate('en-us') count = pending_memberships.count() subject = ungettext( '%(count)d outstanding request to join Mozillians group "%(name)s"', '%(count)d outstanding requests to join Mozillians group "%(name)s"', count ) % { 'count': count, 'name': group.name } body = render_to_string('groups/email/memberships_pending.txt', { 'group': group, 'count': count, }) send_mail(subject, body, settings.FROM_NOREPLY, [profile.email for profile in curators], fail_silently=False) group.max_reminder = max_pk group.save() @app.task(ignore_result=True) def email_membership_change(group_pk, user_pk, old_status, new_status): """ Email user that their group membership status has changed. old_status and new_status can either be a valid value for GroupMembership.status, or None if we're going from or to a state where there is no GroupMembership record (e.g. if they're being removed from a group). This is queued from Group.add_member() and Group.remove_member(). """ from mozillians.groups.models import Group, GroupMembership group = Group.objects.get(pk=group_pk) user = User.objects.get(pk=user_pk) # TODO: Switch locale to user's preferred language so translation will occur # Using English for now activate('en-us') if old_status in [GroupMembership.PENDING, GroupMembership.PENDING_TERMS]: if new_status == GroupMembership.MEMBER: subject = _('Accepted to Mozillians group "%s"') % group.name template_name = 'groups/email/accepted.txt' elif new_status is None: subject = _('Not accepted to Mozillians group "%s"') % group.name template_name = 'groups/email/rejected.txt' else: # Odd things happen in some of our tests. Don't worry about it. raise ValueError('BAD ARGS TO email_membership_change') else: if new_status in [GroupMembership.PENDING_TERMS, GroupMembership.PENDING]: subject = _('Status changed for Mozillians group "%s"') % group.name template_name = 'groups/email/membership_status_changed.txt' else: # The user is a member that was removed from the group. subject = _('Removed from Mozillians group "%s"') % group.name template_name = 'groups/email/member_removed.txt' context = { 'group': group, 'user': user, } template = get_template(template_name) body = template.render(context) send_mail(subject, body, settings.FROM_NOREPLY, [user.userprofile.email], fail_silently=False) @app.task def invalidate_group_membership(): """ For groups with defined `invalidation_days` we need to invalidate user membership after timedelta. """ from mozillians.groups.models import Group, GroupMembership groups = Group.objects.filter(invalidation_days__isnull=False) for group in groups: curator_ids = group.curators.all().values_list('id', flat=True) last_update = now() - timedelta(days=group.invalidation_days) memberships = (group.groupmembership_set.filter(updated_on__lte=last_update) .exclude(userprofile__id__in=curator_ids)) for member in memberships: status = None if group.accepting_new_members != Group.OPEN: status = GroupMembership.PENDING group.remove_member(member.userprofile, status=status) @app.task def notify_membership_renewal(): """ For groups with defined `invalidation_days` we need to notify users 2 weeks prior invalidation that the membership is expiring. """ from mozillians.groups.models import Group, GroupMembership, Invite groups = (Group.objects.filter(invalidation_days__isnull=False, invalidation_days__gte=DAYS_BEFORE_INVALIDATION) .exclude(accepting_new_members=Group.OPEN).distinct()) for group in groups: curator_ids = group.curators.all().values_list('id', flat=True) memberships = (group.groupmembership_set.filter(status=GroupMembership.MEMBER) .exclude(userprofile__id__in=curator_ids)) # Filter memberships to be notified # Switch is being used only for testing mail notifications # It disables membership filtering based on date if not switch_is_active('test_membership_renewal_notification'): last_update_days = group.invalidation_days - DAYS_BEFORE_INVALIDATION last_update = now() - timedelta(days=last_update_days) query_start = datetime.combine(last_update.date(), datetime.min.time()) query_end = datetime.combine(last_update.date(), datetime.max.time()) query = { 'updated_on__range': [query_start, query_end], 'needs_renewal': False, } memberships = memberships.filter(**query) member_template = get_template('groups/email/notify_member_renewal.txt') curator_template = get_template('groups/email/notify_curator_renewal.txt') for membership in memberships: ctx = { 'member_full_name': membership.userprofile.full_name, 'group_name': membership.group.name, 'group_url': membership.group.get_absolute_url(), 'member_profile_url': membership.userprofile.get_absolute_url(), 'inviter': None } invite = get_object_or_none(Invite, group=group, redeemer=membership.userprofile) if invite: ctx['inviter'] = invite.inviter subject_msg = unicode('[Mozillians] Your membership to Mozilla group "{0}" ' 'is about to expire') subject = _(subject_msg.format(membership.group.name)) message = member_template.render(ctx) send_mail(subject, message, settings.FROM_NOREPLY, [membership.userprofile.email]) subject_msg = unicode('[Mozillians][{0}] Membership of "{1}" is about to expire') format_args = [membership.group.name, membership.userprofile.full_name] subject = _(subject_msg.format(*format_args)) # In case the membership was created after an invitation we notify inviters only # Else we fallback to all group curators curators = group.curators.all() inviter = ctx['inviter'] if inviter and curators.filter(pk=inviter.id).exists(): curators = [inviter] for curator in curators: ctx['curator_full_name'] = curator.full_name message = curator_template.render(ctx) send_mail(subject, message, settings.FROM_NOREPLY, [curator.email]) # Mark these memberships ready for an early renewal memberships.update(needs_renewal=True) @app.task(ignore_result=True) def notify_redeemer_invitation(pk, custom_text=''): from mozillians.groups.models import Invite invite = Invite.objects.get(pk=pk) subject_msg = unicode('[Mozillians] You have been invited to join group "{0}"') subject = _(subject_msg.format(invite.group.name)) template = get_template('groups/email/invite_email.txt') ctx = { 'inviter_full_name': invite.inviter.full_name, 'redeemer_full_name': invite.redeemer.full_name, 'group_name': invite.group.name, 'group_url': invite.group.get_absolute_url(), 'custom_text': custom_text } message = template.render(ctx) send_mail(subject, message, settings.FROM_NOREPLY, [invite.redeemer.email]) @app.task(ignore_result=True) def notify_curators_invitation_accepted(pk): from mozillians.groups.models import Invite invite = Invite.objects.get(pk=pk) subject_msg = unicode('[Mozillians] {0} has accepted your invitation to join group "{1}"') subject = _(subject_msg.format(invite.redeemer.full_name, invite.group.name)) template = get_template('groups/email/invite_accepted_email.txt') ctx = { 'inviter_full_name': invite.inviter.full_name, 'redeemer_full_name': invite.redeemer.full_name, 'group_name': invite.group.name, 'group_url': invite.group.get_absolute_url() } message = template.render(ctx) send_mail(subject, message, settings.FROM_NOREPLY, [invite.inviter.email]) @app.task(ignore_result=True) def notify_curators_invitation_rejected(redeemer_pk, inviter_pk, group_pk): from mozillians.groups.models import Group from mozillians.users.models import UserProfile inviter = UserProfile.objects.get(pk=inviter_pk) redeemer = UserProfile.objects.get(pk=redeemer_pk) group = Group.objects.get(pk=group_pk) subject_msg = unicode('[Mozillians] {0} has rejected your invitation to join group "{1}"') subject = _(subject_msg.format(redeemer.full_name, group.name)) template = get_template('groups/email/invite_rejected_email.txt') ctx = { 'redeemer_full_name': redeemer.full_name, 'inviter_full_name': inviter.full_name, 'group_name': group.name } message = template.render(ctx) send_mail(subject, message, settings.FROM_NOREPLY, [inviter.email]) @app.task(ignore_result=True) def notify_redeemer_invitation_invalid(redeemer_pk, group_pk): from mozillians.groups.models import Group from mozillians.users.models import UserProfile group = Group.objects.get(pk=group_pk) redeemer = UserProfile.objects.get(pk=redeemer_pk) subject_msg = '[Mozillians] Invitation to group "{0}" is no longer valid' subject = _(subject_msg.format(group.name)) template = get_template('groups/email/invite_invalid_email.txt') ctx = { 'group_name': group.name, 'redeemer_full_name': redeemer.full_name } message = template.render(ctx) send_mail(subject, message, settings.FROM_NOREPLY, [redeemer.email])
bsd-3-clause
9337d299a630ee3212a8abffc3b0f301
39.490196
98
0.652623
3.867041
false
false
false
false
mozilla/mozillians
mozillians/groups/middleware.py
2
1149
import re from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from mozillians.common.middleware import safe_query_string from mozillians.groups.models import Group class OldGroupRedirectionMiddleware(object): """ Redirect requests for groups from /group/<id>-<url> to /group/<url> to avoid breaking group urls with the new url schema. """ def __init__(self, get_response): self.get_response = get_response def __call__(self, request): response = self.get_response(request) group_url = re.match(r'^/group/(?P<id>\d+)-(?P<url>[-\w]+)/$', request.path_info) if (response.status_code == 404 and group_url and Group.objects.filter(url=group_url.group('url')).exists()): newurl = reverse('groups:show_group', kwargs={'url': group_url.group('url')}) if request.GET: with safe_query_string(request): newurl += '?' + request.META['QUERY_STRING'] return HttpResponseRedirect(newurl) return response
bsd-3-clause
b59bfd4253a024d5a536cfe16833512c
32.794118
93
0.603133
4.178182
false
false
false
false
lisa-lab/pylearn2
pylearn2/utils/exc.py
37
3029
"""Exceptions used by basic support utilities.""" __author__ = "Ian Goodfellow" import sys from pylearn2.utils.common_strings import environment_variable_essay from theano.compat import six class EnvironmentVariableError(Exception): """ An exception raised when a required environment variable is not defined Parameters ---------- *args: list Arguments passed to Exception() """ def __init__(self, *args): super(EnvironmentVariableError, self).__init__(*args) # This exception is here as string_utils need it and setting it in # datasets.exc would create a circular import. class NoDataPathError(EnvironmentVariableError): """ Exception raised when PYLEARN2_DATA_PATH is required but has not been defined. """ def __init__(self): super(NoDataPathError, self).__init__(data_path_essay + environment_variable_essay) data_path_essay = """\ You need to define your PYLEARN2_DATA_PATH environment variable. If you are using a computer at LISA, this should be set to /data/lisa/data. """ def reraise_as(new_exc): """ Re-raise current exception as a new exception. Parameters ---------- new_exc : Exception isinstance The new error to be raised e.g. (ValueError("New message")) or a string that will be prepended to the original exception message Notes ----- Note that when reraising exceptions, the arguments of the original exception are cast to strings and appended to the error message. If you want to retain the original exception arguments, please use: >>> except Exception as e: ... reraise_as(NewException("Extra information", *e.args)) Examples -------- >>> try: ... do_something_crazy() ... except Exception: ... reraise_as(UnhandledException("Informative message")) """ orig_exc_type, orig_exc_value, orig_exc_traceback = sys.exc_info() if isinstance(new_exc, six.string_types): new_exc = orig_exc_type(new_exc) if hasattr(new_exc, 'args'): if len(new_exc.args) > 0: # We add all the arguments to the message, to make sure that this # information isn't lost if this exception is reraised again new_message = ', '.join(str(arg) for arg in new_exc.args) else: new_message = "" new_message += '\n\nOriginal exception:\n\t' + orig_exc_type.__name__ if hasattr(orig_exc_value, 'args') and len(orig_exc_value.args) > 0: if getattr(orig_exc_value, 'reraised', False): new_message += ': ' + str(orig_exc_value.args[0]) else: new_message += ': ' + ', '.join(str(arg) for arg in orig_exc_value.args) new_exc.args = (new_message,) + new_exc.args[1:] new_exc.__cause__ = orig_exc_value new_exc.reraised = True six.reraise(type(new_exc), new_exc, orig_exc_traceback)
bsd-3-clause
cabed38099a599dc348867008b525e96
32.655556
79
0.615385
3.980289
false
false
false
false
lisa-lab/pylearn2
pylearn2/scripts/datasets/make_cifar100_patches_8x8.py
41
2282
""" This script makes a dataset of two million approximately whitened patches, extracted at random uniformly from the CIFAR-100 train dataset. This script is intended to reproduce the preprocessing used by Adam Coates et. al. in their work from the first half of 2011 on the CIFAR-10 and STL-10 datasets. """ from __future__ import print_function from pylearn2.utils import serial from pylearn2.datasets import preprocessing from pylearn2.datasets.cifar100 import CIFAR100 from pylearn2.utils import string data_dir = string.preprocess('${PYLEARN2_DATA_PATH}') print('Loading CIFAR-100 train dataset...') data = CIFAR100(which_set='train') print("Preparing output directory...") patch_dir = data_dir + '/cifar100/cifar100_patches_8x8' serial.mkdir(patch_dir) README = open(patch_dir + '/README', 'w') README.write(""" The .pkl files in this directory may be opened in python using cPickle, pickle, or pylearn2.serial.load. data.pkl contains a pylearn2 Dataset object defining an unlabeled dataset of 2 million 8x8 approximately whitened, contrast-normalized patches drawn uniformly at random from the CIFAR-100 train set. preprocessor.pkl contains a pylearn2 Pipeline object that was used to extract the patches and approximately whiten / contrast normalize them. This object is necessary when extracting features for supervised learning or test set classification, because the extracted features must be computed using inputs that have been whitened with the ZCA matrix learned and stored by this Pipeline. They were created with the pylearn2 script make_cifar100_patches.py. All other files in this directory, including this README, were created by the same script and are necessary for the other files to function correctly. """) README.close() print("Preprocessing the data...") pipeline = preprocessing.Pipeline() pipeline.items.append( preprocessing.ExtractPatches(patch_shape=(8, 8), num_patches=2*1000*1000)) pipeline.items.append( preprocessing.GlobalContrastNormalization(sqrt_bias=10., use_std=True)) pipeline.items.append(preprocessing.ZCA()) data.apply_preprocessor(preprocessor=pipeline, can_fit=True) data.use_design_loc(patch_dir + '/data.npy') serial.save(patch_dir + '/data.pkl', data) serial.save(patch_dir + '/preprocessor.pkl', pipeline)
bsd-3-clause
9d03fdf3390e4ca08cf7eb03b8297570
35.222222
78
0.786591
3.674718
false
false
false
false
lisa-lab/pylearn2
pylearn2/format/tests/test_target_format.py
33
5476
import numpy import theano from numpy.testing import assert_equal, assert_, assert_raises from theano.scalar.basic import all_types from pylearn2.format.target_format import OneHotFormatter, compressed_one_hot def test_one_hot_formatter_simple(): def check_one_hot_formatter(seed, max_labels, dtype, ncases): rng = numpy.random.RandomState(seed) fmt = OneHotFormatter(max_labels=max_labels, dtype=dtype) integer_labels = rng.random_integers(0, max_labels - 1, size=ncases) one_hot_labels = fmt.format(integer_labels) assert len(list(zip(*one_hot_labels.nonzero()))) == ncases assert one_hot_labels.dtype == dtype for case, label in enumerate(integer_labels): assert one_hot_labels[case, label] == 1 rng = numpy.random.RandomState(0) for seed, dtype in enumerate(all_types): yield (check_one_hot_formatter, seed, rng.random_integers(1, 30), dtype, rng.random_integers(1, 100)) fmt = OneHotFormatter(max_labels=10) assert fmt.format(numpy.zeros((1, 1), dtype='uint8')).shape == (1, 1, 10) def test_one_hot_formatter_symbolic(): def check_one_hot_formatter_symbolic(seed, max_labels, dtype, ncases): rng = numpy.random.RandomState(seed) fmt = OneHotFormatter(max_labels=max_labels, dtype=dtype) integer_labels = rng.random_integers(0, max_labels - 1, size=ncases) x = theano.tensor.vector(dtype='int64') y = fmt.theano_expr(x) f = theano.function([x], y) one_hot_labels = f(integer_labels) assert len(list(zip(*one_hot_labels.nonzero()))) == ncases assert one_hot_labels.dtype == dtype for case, label in enumerate(integer_labels): assert one_hot_labels[case, label] == 1 rng = numpy.random.RandomState(0) for seed, dtype in enumerate(all_types): yield (check_one_hot_formatter_symbolic, seed, rng.random_integers(1, 30), dtype, rng.random_integers(1, 100)) def test_dtype_errors(): # Try to call theano_expr with a bad label dtype. raised = False fmt = OneHotFormatter(max_labels=50) try: fmt.theano_expr(theano.tensor.vector(dtype=theano.config.floatX)) except TypeError: raised = True assert raised # Try to call format with a bad label dtype. raised = False try: fmt.format(numpy.zeros(10, dtype='float64')) except TypeError: raised = True assert raised def test_bad_arguments(): # Make sure an invalid max_labels raises an error. raised = False try: fmt = OneHotFormatter(max_labels=-10) except ValueError: raised = True assert raised raised = False try: fmt = OneHotFormatter(max_labels='10') except ValueError: raised = True assert raised # Make sure an invalid dtype identifier raises an error. raised = False try: fmt = OneHotFormatter(max_labels=10, dtype='invalid') except TypeError: raised = True assert raised # Make sure an invalid ndim raises an error for format(). fmt = OneHotFormatter(max_labels=10) raised = False try: fmt.format(numpy.zeros((2, 3, 4), dtype='int32')) except ValueError: raised = True assert raised # Make sure an invalid ndim raises an error for theano_expr(). raised = False try: fmt.theano_expr(theano.tensor.itensor3()) except ValueError: raised = True assert raised def test_one_hot_formatter_merge_simple(): def check_one_hot_formatter(seed, max_labels, dtype, ncases, nmultis): rng = numpy.random.RandomState(seed) fmt = OneHotFormatter(max_labels=max_labels, dtype=dtype) integer_labels = rng.random_integers( 0, max_labels - 1, size=ncases*nmultis ).reshape(ncases, nmultis) one_hot_labels = fmt.format(integer_labels, mode='merge') # n_ones was expected to be equal to ncases * nmultis if integer_labels # do not contain duplicated tags. (i.e., those labels like # [1, 2, 2, 3, 5, 6].) Because that we are not depreciating this kind # of duplicated labels, which allows different cases belong to # different number of classes, and those duplicated tags will only # activate one neuron in the k-hot representation, we need to use # numpy.unique() here to eliminate those duplications while counting # "1"s in the final k-hot representation. n_ones = numpy.concatenate([numpy.unique(l) for l in integer_labels]) assert len(list(zip(*one_hot_labels.nonzero()))) == len(n_ones) for case, label in enumerate(integer_labels): assert numpy.sum(one_hot_labels[case, label]) == nmultis rng = numpy.random.RandomState(0) for seed, dtype in enumerate(all_types): yield (check_one_hot_formatter, seed, rng.random_integers(11, 30), dtype, rng.random_integers(1, 100), rng.random_integers(1, 10)) def test_out_compressed_one_hot(): out, uniq = compressed_one_hot([2, 5, 3]) assert_equal(out, [[1, 0, 0], [0, 0, 1], [0, 1, 0]]) assert_equal(uniq, [2, 3, 5]) out, uniq = compressed_one_hot([2, 5]) assert_equal(out, [[0], [1]]) assert_equal(uniq, [2, 5]) out, uniq = compressed_one_hot([2, 5], simplify_binary=False) assert_equal(out, [[1, 0], [0, 1]]) assert_equal(uniq, [2, 5])
bsd-3-clause
1d3d2292a118a5808fe895b9954cdcbf
36
79
0.638605
3.636122
false
false
false
false
lisa-lab/pylearn2
pylearn2/scripts/datasets/make_mnistplus.py
44
8910
""" Script to generate the MNIST+ dataset. The purpose of this dataset is to make a more challenging MNIST-like dataset, with multiple factors of variation. These factors can serve to evaluate a model's performance at learning invariant features, or its ability to disentangle factors of variation in a multi-task classification setting. The dataset is stored under $PYLEARN2_DATA_PATH. The dataset variants are created as follows. For each MNIST image, we: 1. Perform a random rotation of the image (optional) 2. Rescale the image from 28x28 to 48x48, yielding variable `image`. 3.1 Extract a random patch `textured_patch` from a fixed or random image of the Brodatz texture dataset. 3.2 Generate mask of MNIST digit outline, by thresholding MNIST digit at 0.1 3.3 Fuse MNIST digit and textured patch as follows: textured_patch[mask] <= image[mask]; image <= textured_patch; 4. Randomly select position of light source (optional) 5. Perform embossing operation, given fixed lighting position obtained in 4. """ import numpy from theano.compat.six.moves import xrange, cPickle as pickle import pylab as pl from copy import copy from optparse import OptionParser from pylearn2.datasets import mnist from pylearn2.utils import string_utils import warnings try: from PIL import Image except ImportError: warnings.warn("Couldn't import Image from PIL, so far make_mnistplus " "is only supported with PIL") OUTPUT_SIZE = 48 DOWN_SAMPLE = 1 def to_array(img): """ Convert PIL.Image to numpy.ndarray. :param img: numpy.ndarray """ return numpy.array(img.getdata()) / 255. def to_img(arr, os): """ Convert numpy.ndarray to PIL.Image :param arr: numpy.ndarray :param os: integer, size of output image. """ return Image.fromarray(arr.reshape(os, os) * 255.) def emboss(img, azi=45., ele=18., dep=2): """ Perform embossing of image `img`. :param img: numpy.ndarray, matrix representing image to emboss. :param azi: azimuth (in degrees) :param ele: elevation (in degrees) :param dep: depth, (0-100) """ # defining azimuth, elevation, and depth ele = (ele * 2 * numpy.pi) / 360. azi = (azi * 2 * numpy.pi) / 360. a = numpy.asarray(img).astype('float') # find the gradient grad = numpy.gradient(a) # (it is two arrays: grad_x and grad_y) grad_x, grad_y = grad # getting the unit incident ray gd = numpy.cos(ele) # length of projection of ray on ground plane dx = gd * numpy.cos(azi) dy = gd * numpy.sin(azi) dz = numpy.sin(ele) # adjusting the gradient by the "depth" factor # (I think this is how GIMP defines it) grad_x = grad_x * dep / 100. grad_y = grad_y * dep / 100. # finding the unit normal vectors for the image leng = numpy.sqrt(grad_x**2 + grad_y**2 + 1.) uni_x = grad_x/leng uni_y = grad_y/leng uni_z = 1./leng # take the dot product a2 = 255 * (dx*uni_x + dy*uni_y + dz*uni_z) # avoid overflow a2 = a2.clip(0, 255) # you must convert back to uint8 /before/ converting to an image return Image.fromarray(a2.astype('uint8')) def extract_patch(textid, os, downsample): """ Extract a patch of texture #textid of Brodatz dataset. :param textid: id of texture image to load. :param os: size of MNIST+ output images. :param downsample: integer, downsampling factor. """ temp = '${PYLEARN2_DATA_PATH}/textures/brodatz/D%i.gif' % textid fname = string_utils.preprocess(temp) img_i = Image.open(fname) img_i = img_i.resize((img_i.size[0]/downsample, img_i.size[1]/downsample), Image.BILINEAR) x = numpy.random.randint(0, img_i.size[0] - os) y = numpy.random.randint(0, img_i.size[1] - os) patch = img_i.crop((x, y, x+os, y+os)) return patch, (x, y) def gendata(enable, os, downsample, textid=None, seed=2313, verbose=False): """ Generate the MNIST+ dataset. :param enable: dictionary of flags with keys ['texture', 'azimuth', 'rotation', 'elevation'] to enable/disable a given factor of variation. :param textid: if enable['texture'], id number of the Brodatz texture to load. If textid is None, we load a random texture for each MNIST image. :param os: output size (width and height) of MNIST+ images. :param downsample: factor by which to downsample texture. :param seed: integer for seeding RNG. :param verbose: bool """ rng = numpy.random.RandomState(seed) data = mnist.MNIST('train') test = mnist.MNIST('test') data.X = numpy.vstack((data.X, test.X)) data.y = numpy.hstack((data.y, test.y)) del test output = {} output['data'] = numpy.zeros((len(data.X), os*os)) output['label'] = numpy.zeros(len(data.y)) if enable['azimuth']: output['azimuth'] = numpy.zeros(len(data.y)) if enable['elevation']: output['elevation'] = numpy.zeros(len(data.y)) if enable['rotation']: output['rotation'] = numpy.zeros(len(data.y)) if enable['texture']: output['texture_id'] = numpy.zeros(len(data.y)) output['texture_pos'] = numpy.zeros((len(data.y), 2)) for i in xrange(len(data.X)): # get MNIST image frgd_img = to_img(data.X[i], 28) frgd_img = frgd_img.convert('L') if enable['rotation']: rot = rng.randint(0, 360) output['rotation'][i] = rot frgd_img = frgd_img.rotate(rot, Image.BILINEAR) frgd_img = frgd_img.resize((os, os), Image.BILINEAR) if enable['texture']: if textid is None: # extract patch from texture database. Note that texture #14 # does not exist. textid = 14 while textid == 14: textid = rng.randint(1, 113) patch_img, (px, py) = extract_patch(textid, os, downsample) patch_arr = to_array(patch_img) # store output details output['texture_id'][i] = textid output['texture_pos'][i] = (px, py) # generate binary mask for digit outline frgd_arr = to_array(frgd_img) mask_arr = frgd_arr > 0.1 # copy contents of masked-MNIST image into background texture blend_arr = copy(patch_arr) blend_arr[mask_arr] = frgd_arr[mask_arr] # this now because the image to emboss frgd_img = to_img(blend_arr, os) azi = 45 if enable['azimuth']: azi = rng.randint(0, 360) output['azimuth'][i] = azi ele = 18. if enable['elevation']: ele = rng.randint(0, 60) output['elevation'][i] = ele mboss_img = emboss(frgd_img, azi=azi, ele=ele) mboss_arr = to_array(mboss_img) output['data'][i] = mboss_arr output['label'][i] = data.y[i] if verbose: pl.imshow(mboss_arr.reshape(os, os)) pl.gray() pl.show() fname = 'mnistplus' if enable['azimuth']: fname += "_azi" if enable['rotation']: fname += "_rot" if enable['texture']: fname += "_tex" fp = open(fname+'.pkl','w') pickle.dump(output, fp, protocol=pickle.HIGHEST_PROTOCOL) fp.close() if __name__ == '__main__': parser = OptionParser() parser.add_option('-v', action='store_true', dest='verbose') parser.add_option('--azimuth', action='store_true', dest='azimuth', help='Enable random azimuth for light-source used in embossing.') parser.add_option('--elevation', action='store_true', dest='elevation', help='Enable random elevation for light-source used in embossing.') parser.add_option('--rotation', action='store_true', dest='rotation', help='Randomly rotate MNIST digit prior to embossing.') parser.add_option('--texture', action='store_true', dest='texture', help='Perform joint embossing of fused {MNIST + Texture} image.') parser.add_option('--textid', action='store', type='int', dest='textid', help='If specified, use a single texture ID for all MNIST images.', default=None) parser.add_option('--output_size', action='store', type='int', dest='os', help='Integer specifying size of (square) output images.', default=OUTPUT_SIZE) parser.add_option('--downsample', action='store', type='int', dest='downsample', default=DOWN_SAMPLE, help='Downsampling factor for Brodatz textures.') (opts, args) = parser.parse_args() enable = {'texture': opts.texture, 'azimuth': opts.azimuth, 'rotation': opts.rotation, 'elevation': opts.elevation} gendata(enable=enable, os=opts.os, downsample=opts.downsample, verbose=opts.verbose, textid=opts.textid)
bsd-3-clause
a8dd87b5cd80eddbb76a4edaadb33ac7
34.64
79
0.619753
3.491379
false
false
false
false
lisa-lab/pylearn2
pylearn2/datasets/norb.py
44
14401
""" An interface to the small NORB dataset. Unlike `./norb_small.py`, this reads the original NORB file format, not the LISA lab's `.npy` version. Currently only supports the Small NORB Dataset. Download the dataset from `here <http://www.cs.nyu.edu/~ylclab/data/norb-v1.0-small/>`_. NORB dataset(s) by Fu Jie Huang and Yann LeCun. """ __authors__ = "Guillaume Desjardins and Matthew Koichi Grimes" __copyright__ = "Copyright 2010-2014, Universite de Montreal" __credits__ = __authors__.split(" and ") __license__ = "3-clause BSD" __maintainer__ = "Matthew Koichi Grimes" __email__ = "mkg alum mit edu (@..)" import bz2 import gzip import logging import os import warnings try: from exceptions import DeprecationWarning except ImportError: pass import numpy import theano from pylearn2.datasets import dense_design_matrix from pylearn2.datasets.cache import datasetCache from pylearn2.space import VectorSpace, Conv2DSpace, CompositeSpace from pylearn2.datasets.new_norb import StereoViewConverter logger = logging.getLogger(__name__) warnings.warn("Using deprecated module pylearn2.datasets.norb. " "This will be replaced with pylearn2.datasets.new_norb in " "December 2014. Users are encouraged to switch to that " "module now.", DeprecationWarning) class SmallNORB(dense_design_matrix.DenseDesignMatrix): """ An interface to the small NORB dataset. If instantiated with default arguments, target labels are integers representing categories, which can be looked up using category_name = SmallNORB.get_category(label). If instantiated with multi_target=True, labels are vectors of indices representing: [ category, instance, elevation, azimuth, lighting ] Like with category, there are class methods that map these ints to their actual values, e.g: category = SmallNORB.get_category(label[0]) elevation = SmallNORB.get_elevation_degrees(label[2]) Parameters ---------- which_set: str Must be 'train' or 'test'. multi_target: bool, optional If False, each label is an integer labeling the image catergory. If True, each label is a vector: [category, instance, lighting, elevation, azimuth]. All labels are given as integers. Use the categories, elevation_degrees, and azimuth_degrees arrays to map from these integers to actual values. """ # Actual image shape may change, e.g. after being preprocessed by # datasets.preprocessing.Downsample original_image_shape = (96, 96) _categories = ['animal', # four-legged animal 'human', # human figure 'airplane', 'truck', 'car'] @classmethod def get_category(cls, scalar_label): """ Returns the category string corresponding to an integer category label. """ return cls._categories[int(scalar_label)] @classmethod def get_elevation_degrees(cls, scalar_label): """ Returns the elevation, in degrees, corresponding to an integer elevation label. """ scalar_label = int(scalar_label) assert scalar_label >= 0 assert scalar_label < 9 return 30 + 5 * scalar_label @classmethod def get_azimuth_degrees(cls, scalar_label): """ Returns the azimuth, in degrees, corresponding to an integer label. """ scalar_label = int(scalar_label) assert scalar_label >= 0 assert scalar_label <= 34 assert (scalar_label % 2) == 0 return scalar_label * 10 # Maps azimuth labels (ints) to their actual values, in degrees. azimuth_degrees = numpy.arange(0, 341, 20) # Maps a label type to its index within a label vector. label_type_to_index = {'category': 0, 'instance': 1, 'elevation': 2, 'azimuth': 3, 'lighting': 4} # Number of labels, for each label type. num_labels_by_type = (len(_categories), 10, # instances 9, # elevations 18, # azimuths 6) # lighting # [mkg] Dropped support for the 'center' argument for now. In Pylearn 1, it # shifted the pixel values from [0:255] by subtracting 127.5. Seems like a # form of preprocessing, which might be better implemented separately using # the Preprocess class. def __init__(self, which_set, multi_target=False, stop=None): """ parameters ---------- which_set : str Must be 'train' or 'test'. multi_target : bool If False, each label is an integer labeling the image catergory. If True, each label is a vector: [category, instance, lighting, elevation, azimuth]. All labels are given as integers. Use the categories, elevation_degrees, and azimuth_degrees arrays to map from these integers to actual values. """ assert which_set in ['train', 'test'] self.which_set = which_set subtensor = slice(0, stop) if stop is not None else None X = SmallNORB.load(which_set, 'dat', subtensor=subtensor) # Casts to the GPU-supported float type, using theano._asarray(), a # safer alternative to numpy.asarray(). # # TODO: move the dtype-casting to the view_converter's output space, # once dtypes-for-spaces is merged into master. X = theano._asarray(X, theano.config.floatX) # Formats data as rows in a matrix, for DenseDesignMatrix X = X.reshape(-1, 2 * numpy.prod(self.original_image_shape)) # This is uint8 y = SmallNORB.load(which_set, 'cat', subtensor=subtensor) if multi_target: y_extra = SmallNORB.load(which_set, 'info', subtensor=subtensor) y = numpy.hstack((y[:, numpy.newaxis], y_extra)) datum_shape = ((2, ) + # two stereo images self.original_image_shape + (1, )) # one color channel # 's' is the stereo channel: 0 (left) or 1 (right) axes = ('b', 's', 0, 1, 'c') view_converter = StereoViewConverter(datum_shape, axes) super(SmallNORB, self).__init__(X=X, y=y, y_labels=numpy.max(y) + 1, view_converter=view_converter) @classmethod def load(cls, which_set, filetype, subtensor): """Reads and returns a single file as a numpy array.""" assert which_set in ['train', 'test'] assert filetype in ['dat', 'cat', 'info'] def getPath(which_set): dirname = os.path.join(os.getenv('PYLEARN2_DATA_PATH'), 'norb_small/original') if which_set == 'train': instance_list = '46789' elif which_set == 'test': instance_list = '01235' filename = 'smallnorb-5x%sx9x18x6x2x96x96-%s-%s.mat' % \ (instance_list, which_set + 'ing', filetype) return os.path.join(dirname, filename) def parseNORBFile(file_handle, subtensor=None, debug=False): """ Load all or part of file 'file_handle' into a numpy ndarray .. todo:: WRITEME properly :param file_handle: file from which to read file can be opended with open(), gzip.open() and bz2.BZ2File() @type file_handle: file-like object. Can be a gzip open file. :param subtensor: If subtensor is not None, it should be like the argument to numpy.ndarray.__getitem__. The following two expressions should return equivalent ndarray objects, but the one on the left may be faster and more memory efficient if the underlying file f is big. read(file_handle, subtensor) <===> read(file_handle)[*subtensor] Support for subtensors is currently spotty, so check the code to see if your particular type of subtensor is supported. """ def readNums(file_handle, num_type, count): """ Reads 4 bytes from file, returns it as a 32-bit integer. """ num_bytes = count * numpy.dtype(num_type).itemsize string = file_handle.read(num_bytes) return numpy.fromstring(string, dtype=num_type) def readHeader(file_handle, debug=False, from_gzip=None): """ .. todo:: WRITEME properly :param file_handle: an open file handle. :type file_handle: a file or gzip.GzipFile object :param from_gzip: bool or None :type from_gzip: if None determine the type of file handle. :returns: data type, element size, rank, shape, size """ if from_gzip is None: from_gzip = isinstance(file_handle, (gzip.GzipFile, bz2.BZ2File)) key_to_type = {0x1E3D4C51: ('float32', 4), # what is a packed matrix? # 0x1E3D4C52: ('packed matrix', 0), 0x1E3D4C53: ('float64', 8), 0x1E3D4C54: ('int32', 4), 0x1E3D4C55: ('uint8', 1), 0x1E3D4C56: ('int16', 2)} type_key = readNums(file_handle, 'int32', 1)[0] elem_type, elem_size = key_to_type[type_key] if debug: logger.debug("header's type key, type, type size: " "{0} {1} {2}".format(type_key, elem_type, elem_size)) if elem_type == 'packed matrix': raise NotImplementedError('packed matrix not supported') num_dims = readNums(file_handle, 'int32', 1)[0] if debug: logger.debug('# of dimensions, according to header: ' '{0}'.format(num_dims)) if from_gzip: shape = readNums(file_handle, 'int32', max(num_dims, 3))[:num_dims] else: shape = numpy.fromfile(file_handle, dtype='int32', count=max(num_dims, 3))[:num_dims] if debug: logger.debug('Tensor shape, as listed in header: ' '{0}'.format(shape)) return elem_type, elem_size, shape elem_type, elem_size, shape = readHeader(file_handle, debug) beginning = file_handle.tell() num_elems = numpy.prod(shape) result = None if isinstance(file_handle, (gzip.GzipFile, bz2.BZ2File)): assert subtensor is None, \ "Subtensors on gzip files are not implemented." result = readNums(file_handle, elem_type, num_elems * elem_size).reshape(shape) elif subtensor is None: result = numpy.fromfile(file_handle, dtype=elem_type, count=num_elems).reshape(shape) elif isinstance(subtensor, slice): if subtensor.step not in (None, 1): raise NotImplementedError('slice with step', subtensor.step) if subtensor.start not in (None, 0): bytes_per_row = numpy.prod(shape[1:]) * elem_size file_handle.seek( beginning + subtensor.start * bytes_per_row) shape[0] = min(shape[0], subtensor.stop) - subtensor.start num_elems = numpy.prod(shape) result = numpy.fromfile(file_handle, dtype=elem_type, count=num_elems).reshape(shape) else: raise NotImplementedError('subtensor access not written yet:', subtensor) return result fname = getPath(which_set) fname = datasetCache.cache_file(fname) file_handle = open(fname) return parseNORBFile(file_handle, subtensor) def get_topological_view(self, mat=None, single_tensor=True): """ .. todo:: WRITEME """ result = super(SmallNORB, self).get_topological_view(mat) if single_tensor: warnings.warn("The single_tensor argument is True by default to " "maintain backwards compatibility. This argument " "will be removed, and the behavior will become that " "of single_tensor=False, as of August 2014.") axes = list(self.view_converter.axes) s_index = axes.index('s') assert axes.index('b') == 0 num_image_pairs = result[0].shape[0] shape = (num_image_pairs, ) + self.view_converter.shape # inserts a singleton dimension where the 's' dimesion will be mono_shape = shape[:s_index] + (1, ) + shape[(s_index + 1):] for i, res in enumerate(result): logger.info("result {0} shape: {1}".format(i, str(res.shape))) result = tuple(t.reshape(mono_shape) for t in result) result = numpy.concatenate(result, axis=s_index) else: warnings.warn("The single_tensor argument will be removed on " "August 2014. The behavior will be the same as " "single_tensor=False.") return result
bsd-3-clause
a95516eac2a62a8e968260d151d8220b
37.300532
79
0.539338
4.315553
false
false
false
false
lisa-lab/pylearn2
pylearn2/sandbox/cuda_convnet/probabilistic_max_pooling.py
2
22477
""" A GPU implementation of probabilistic max-pooling, based on "Convolutional Deep Belief Networks for Scalable Unsupervised Learning of Hierarchical Representations" Honglak Lee, Roger Grosse, Rajesh Ranganath, and Andrew Y. Ng ICML 2009 This paper defines probabilistic max-pooling in the context of a Convolutional Deep Belief Network (its energy function is more like a DBM than a DBN but it is trained like a DBN). Here we define probabilistic max pooling as a general layer for use in an energy-based model regardless of how the rest of the model is assembled. The gpu code is written around Alex Krizhevsky's cuda-convnet library """ __authors__ = "Mehdi Mirza" __copyright__ = "Copyright 2010-2013, Universite de Montreal" __credits__ = ["Mehdi Mirza", "Ian Goodfellow", "David Warde-Farley"] __license__ = "3-clause BSD" __maintainer__ = "Mehdi Mirza" __email__ = "mirzamom@iro" import warnings import theano import numpy from theano import tensor from theano.gof import Apply from theano.sandbox.cuda import CudaNdarrayType from theano.sandbox.cuda.basic_ops import as_cuda_ndarray_variable from theano.sandbox.cuda.basic_ops import gpu_contiguous from theano.sandbox.cuda import GpuOp from theano.tensor import get_scalar_constant_value, NotScalarConstantError from pylearn2.sandbox.cuda_convnet.base_acts import UnimplementedError from pylearn2.sandbox.cuda_convnet.convnet_compile import convnet_available from pylearn2.sandbox.cuda_convnet.convnet_compile import cuda_convnet_loc from pylearn2.sandbox.cuda_convnet.shared_code import this_dir import pylearn2.sandbox.cuda_convnet.pthreads from theano import config def prob_max_pool_c01b(c01b, pool_shape, top_down = None): """ .. todo:: WRITEME """ if pool_shape[0] != pool_shape[1]: raise UnimplementedError("Non sqaure pool shapes are not supported yet") assert pool_shape[0] > 0 ch, zr, zc, batch_size = c01b.shape r, c = pool_shape if top_down is None: top_down = tensor.zeros((ch, zr / r, zc / c, batch_size), dtype = c01b.dtype) op = ProbMaxPool(pool_shape[0]) c01b = gpu_contiguous(c01b) top_down = gpu_contiguous(top_down) return op(c01b, top_down) class ProbMaxPool(GpuOp): """ Probabilistic max pooling code on the GPU. The input are in the order (channel, image rows, image cols, batch) Works only on square images wiht square pooling shape and the grad works only when channel % 16 == 0. Parameters ---------- ds : int defines the size of the pooling region in the x (equivalently, y) dimension. Squares of size (ds)2 get reduced to one value by this layer. There are no restrictions on the value of this parameter. It's fine for a pooling square to fall off the boundary of the image. Named SizeX in Alex's code. stride : int defines the stride size between successive pooling squares. Setting this parameter smaller than sizeX produces overlapping pools. Setting it equal to sizeX gives the usual, non-overlapping pools. Values greater than sizeX are not allowed. start : int, optional tells the net where in the input image to start the pooling (in x,y coordinates). In principle, you can start anywhere you want. Setting this to a positive number will cause the net to discard some pixels at the top and at the left of the image. Setting this to a negative number will cause it to include pixels that don't exist (which is fine). start=0 is the usual setting. outputs : int, optional allows you to control how many output values in the x (equivalently, y) dimension this operation will produce. This parameter is analogous to the start parameter, in that it allows you to discard some portion of the image by setting it to a value small enough to leave part of the image uncovered. Setting it to zero instructs the net to produce as many outputs as is necessary to ensure that the whole image is covered. default 0 """ def __init__(self, ds, start=0, outputs=0): self.ds = ds self.stride = ds self.start = start self.copy_non_contiguous = 0 assert ds > 0, ds # We check in the code if ds <= imgSizeX warnings.warn("non square pool shape and strides different than " "pool shape hasn't been tested and disabled") def __eq__(self, other): """ .. todo:: WRITEME """ #Dont put copy_non_contigous as this doesn't change the output return (type(self) == type(other) and self.ds == other.ds and self.stride == other.stride and self.start == other.start) def __hash__(self): """ .. todo:: WRITEME """ #Dont put copy_non_contigous as this doesn't change the output return (hash(type(self)) ^ hash(self.ds) ^ hash(self.stride) ^ hash(self.start)) def c_header_dirs(self): """ .. todo:: WRITEME """ return [this_dir, config.pthreads.inc_dir] if config.pthreads.inc_dir else [this_dir] def c_headers(self): """ .. todo:: WRITEME """ return ['nvmatrix.cuh', 'conv_util.cuh'] def c_lib_dirs(self): """ .. todo:: WRITEME """ return [cuda_convnet_loc, config.pthreads.lib_dir] if config.pthreads.lib_dir else [cuda_convnet_loc] def c_libraries(self): """ .. todo:: WRITEME """ return ['cuda_convnet', config.pthreads.lib] if config.pthreads.lib else ['cuda_convnet'] def c_code_cache_version(self): """ .. todo:: WRITEME """ return (1,) def _argument_contiguity_check(self, arg_name): """ .. todo:: WRITEME """ return """ if (!CudaNdarray_is_c_contiguous(%%(%(arg_name)s)s)) { if (!(%(class_name_caps)s_COPY_NON_CONTIGUOUS)) { PyErr_SetString(PyExc_ValueError, "%(class)s: %(arg_name)s must be C contiguous"); %%(fail)s; } } """ % { 'class': self.__class__.__name__, 'arg_name': arg_name, 'class_name_caps': self.__class__.__name__.upper(), } def make_node(self, images, top_down): """ .. todo:: WRITEME """ images = as_cuda_ndarray_variable(images) top_down = as_cuda_ndarray_variable(top_down) assert images.ndim == 4 assert top_down.ndim == 4 channels_broadcastable = images.type.broadcastable[0] batch_broadcastable = images.type.broadcastable[3] rows_broadcastable = False cols_broadcastable = False houtput_broadcastable = (channels_broadcastable, rows_broadcastable, cols_broadcastable, batch_broadcastable) houtput_type = CudaNdarrayType(broadcastable=houtput_broadcastable) houtput = houtput_type() poutput_broadcastable = (channels_broadcastable, rows_broadcastable, cols_broadcastable, batch_broadcastable) poutput_type = CudaNdarrayType(broadcastable=poutput_broadcastable) poutput = poutput_type() return Apply(self, [images, top_down], [houtput, poutput]) def c_code(self, node, name, inputs, outputs, sub): """ .. todo:: WRITEME """ images, top_down = inputs ptargets, htargets = outputs fail = sub['fail'] # The amount of braces that must be closed at the end num_braces = 0 if self.copy_non_contiguous: raise UnimplementedError() else: basic_setup = "#define PROBMAXPOOL_COPY_NON_CONTIGUOUS 0\n" # Convert images in nv_images, an NVMatrix, for compatibility # with the cuda-convnet functions setup_nv_images = self._argument_contiguity_check("images") + """ if (%(images)s->nd != 4) { PyErr_Format(PyExc_ValueError, "images must have nd=4, got nd=%%i", %(images)s->nd); %(fail)s; } { //setup_nv_images brace 1 const int * images_dims = CudaNdarray_HOST_DIMS(%(images)s); const int img_channels = images_dims[0]; const int imgSizeY = images_dims[1]; const int imgSizeX = images_dims[2]; const int batch_size = images_dims[3]; if(imgSizeY != imgSizeX){ PyErr_Format(PyExc_ValueError, "images must be square(dims[1] == dims[2]). Shape (%%i,%%i,%%i,%%i)", img_channels, imgSizeY, imgSizeX, batch_size); %(fail)s; } if(%(ds)s > imgSizeY){ PyErr_Format(PyExc_ValueError, "ds(%%d) must be <= imgSizeX(%%d) and imgSizeY(%%d).", %(ds)s, imgSizeX, imgSizeY); %(fail)s; } if(%(start)s >= imgSizeX){ PyErr_Format(PyExc_ValueError, "start is %%d but must be smaller then the images size of %%d x %%d.", %(start)s, imgSizeX, imgSizeY); %(fail)s; } NVMatrix nv_images(%(images)s, img_channels * imgSizeY * imgSizeX, batch_size, "ProbMaxPool:nv_images"); """ num_braces += 1 # TODO check if stride != pool shape works, if not put error check setup_nv_top_down = self._argument_contiguity_check("top_down") + """ if (%(top_down)s->nd != 4) { PyErr_Format(PyExc_ValueError, "top_down must have nd=4, got nd=%%i", %(images)s->nd); %(fail)s; } { //setup_nv_images brace 1 int _outputsX = ((int)(ceil((imgSizeY - %(start)s - %(ds)s) / ((float)%(stride)s)))) + 1; NVMatrix nv_top_down(%(top_down)s, img_channels * _outputsX * _outputsX, batch_size, "ProbMaxPool:nv_top_down"); """ num_braces += 1 setup_nv_ptargets = """ //int _outputsX = ((int)(ceil((imgSizeY - %(start)s - %(ds)s) / ((float)%(stride)s)))) + 1; int target_dims [] = { img_channels, _outputsX, _outputsX, batch_size }; if (CudaNdarray_prep_output(& %(ptargets)s, 4, target_dims)) { %(fail)s; } { // setup_nv_target brace # 1 NVMatrix nv_ptargets(%(ptargets)s, target_dims[0] * target_dims[1] * target_dims[2], target_dims[3], "ProbMaxPool:nv_ptargets"); """ num_braces += 1 setup_nv_htargets = """ int target_dims [] = { img_channels, imgSizeX, imgSizeY, batch_size }; if (CudaNdarray_prep_output(& %(htargets)s, 4, target_dims)) { %(fail)s; } { // setup_nv_target brace # 1 NVMatrix nv_htargets(%(htargets)s, target_dims[0] * target_dims[1] * target_dims[2], target_dims[3], "ProbMaxPool:nv_htargets"); """ num_braces += 1 do_pool = """ probabilisticPool(nv_images, nv_top_down, nv_ptargets, nv_htargets, img_channels, %(ds)s, %(start)s, %(stride)s, _outputsX, MaxPooler()); """ braces = '}' * num_braces rval = (basic_setup + setup_nv_images + setup_nv_top_down + setup_nv_ptargets + setup_nv_htargets + do_pool + braces) start = self.start stride = self.stride ds = self.ds rval = rval % locals() return rval def grad(self, inp, grads): """ .. todo:: WRITEME """ x, top_down = inp p, h = self(x, top_down) gp, gh = grads gp_iszero = 0. gh_iszero = 0. if isinstance(gp.type, theano.gradient.DisconnectedType): gp = tensor.zeros_like(p) gp_iszero = 1. if isinstance(gh.type, theano.gradient.DisconnectedType): gh = tensor.zeros_like(h) gh_iszero = 1. gp = gpu_contiguous(gp) gh = gpu_contiguous(gh) gp_iszero = as_cuda_ndarray_variable(gp_iszero) gh_iszero = as_cuda_ndarray_variable(gh_iszero) return ProbMaxPoolGrad(self.ds, self.stride, self.start)(p, h, gp, gh, gp_iszero, gh_iszero) # Make sure the cuda_convnet library is compiled and up-to-date def make_thunk(self, *args, **kwargs): """ .. todo:: WRITEME """ if not convnet_available(): raise RuntimeError('Could not compile cuda_convnet') return super(ProbMaxPool, self).make_thunk(*args, **kwargs) class ProbMaxPoolGrad(GpuOp): """ .. todo:: WRITEME """ def __init__(self, ds, stride, start): self.ds = ds self.stride = stride self.start = start self.copy_non_contiguous = 0 assert stride > 0 and stride <= ds, (stride, ds) assert ds > 0, ds #We check in the code if ds <= imgSizeX def __eq__(self, other): """ .. todo:: WRITEME """ #Dont put copy_non_contigous as this doesn't change the output return (type(self) == type(other) and self.ds == other.ds and self.stride == other.stride and self.start == other.start) def __hash__(self): """ .. todo:: WRITEME """ #Dont put copy_non_contigous as this doesn't change the output return (hash(type(self)) ^ hash(self.ds) ^ hash(self.stride) ^ hash(self.start)) def c_header_dirs(self): """ .. todo:: WRITEME """ return [this_dir, config.pthreads.inc_dir] if config.pthreads.inc_dir else [this_dir] def c_headers(self): """ .. todo:: WRITEME """ return ['nvmatrix.cuh', 'conv_util.cuh'] def c_lib_dirs(self): """ .. todo:: WRITEME """ return [cuda_convnet_loc, config.pthreads.lib_dir] if config.pthreads.lib_dir else [cuda_convnet_loc] def c_libraries(self): """ .. todo:: WRITEME """ return ['cuda_convnet', config.pthreads.lib] if config.pthreads.lib else ['cuda_convnet'] def c_code_cache_version(self): """ .. todo:: WRITEME """ return (1,) def _argument_contiguity_check(self, arg_name): """ .. todo:: WRITEME """ return """ if (!CudaNdarray_is_c_contiguous(%%(%(arg_name)s)s)) { if (!(%(class_name_caps)s_COPY_NON_CONTIGUOUS)) { PyErr_SetString(PyExc_ValueError, "%(class)s: %(arg_name)s must be C contiguous"); %%(fail)s; } } """ % { 'class': self.__class__.__name__, 'arg_name': arg_name, 'class_name_caps': self.__class__.__name__.upper(), } def make_node(self, p, h, gp, gh, gp_iszero, gh_iszero): """ .. todo:: WRITEME """ p = as_cuda_ndarray_variable(p) h = as_cuda_ndarray_variable(h) gp = as_cuda_ndarray_variable(gp) gh = as_cuda_ndarray_variable(gh) assert p.ndim == 4 assert h.ndim == 4 assert gp.ndim == 4 assert gh.ndim == 4 try: nb_channel = int(get_scalar_constant_value(h.shape[0])) assert nb_channel % 16 == 0 except NotScalarConstantError: pass return Apply(self, [p, h, gp, gh, gp_iszero, gh_iszero], [p.type(), h.type()]) def c_code(self, node, name, inputs, outputs, sub): """ .. todo:: WRITEME """ p, h, gp, gh, gp_iszero, gh_iszero = inputs targets_z, targets_t, = outputs fail = sub['fail'] # The amount of braces that must be closed at the end num_braces = 0 if self.copy_non_contiguous: raise UnimplementedError() else: basic_setup = "#define PROBMAXPOOLGRAD_COPY_NON_CONTIGUOUS 0\n" # Convert images in nv_images, an NVMatrix, for compatibility # with the cuda-convnet functions setup_nv_h = self._argument_contiguity_check("h") + """ if (%(h)s->nd != 4) { PyErr_Format(PyExc_ValueError, "h must have nd=4, got nd=%%i", %(h)s->nd); %(fail)s; } { //setup_nv_images brace 1 const int * images_dims = CudaNdarray_HOST_DIMS(%(h)s); const int img_channels = images_dims[0]; const int imgSizeY = images_dims[1]; const int imgSizeX = images_dims[2]; const int batch_size = images_dims[3]; if(imgSizeY != imgSizeX){ PyErr_Format(PyExc_ValueError, "images must be square(dims[1] == dims[2]). Shape (%%i,%%i,%%i,%%i)", img_channels, imgSizeY, imgSizeX, batch_size); %(fail)s; } if(%(ds)s > imgSizeY){ PyErr_Format(PyExc_ValueError, "ds(%%d) must be <= imgSizeX(%%d) and imgSizeY(%%d).", %(ds)s, imgSizeX, imgSizeY); %(fail)s; } if (CudaNdarray_HOST_DIMS(%(h)s)[0] %% 16 != 0) { PyErr_Format(PyExc_ValueError, "h must have a number of channels that is a multiple of 16. Got %%d", CudaNdarray_HOST_DIMS(%(gh)s)[0]); %(fail)s; } NVMatrix nv_h(%(h)s, img_channels * imgSizeY * imgSizeX, batch_size, "ProbMaxPool:nv_h"); """ num_braces += 1 setup_nv_p = self._argument_contiguity_check("p") + """ if (%(p)s->nd != 4) { PyErr_Format(PyExc_ValueError, "P must have nd=4, got nd=%%i", %(p)s->nd); %(fail)s; } { //setup_nv_images brace 1 int _outputsX = ((int)(ceil((imgSizeY - %(start)s - %(ds)s) / ((float)%(stride)s)))) + 1; NVMatrix nv_p(%(p)s, img_channels * _outputsX * _outputsX, batch_size, "ProbMaxPool:nv_p"); """ num_braces += 1 # Convert gh in nv_gh setup_nv_gh = self._argument_contiguity_check("gh") + """ if (%(gh)s->nd != 4) { PyErr_Format(PyExc_ValueError, "gh must have nd=4, got nd=%%i", %(gh)s->nd); %(fail)s; } if (CudaNdarray_HOST_DIMS(%(gh)s)[0] %% 16 != 0) { PyErr_Format(PyExc_ValueError, "gh must have a number of channels that is a multiple of 16. Got %%d", CudaNdarray_HOST_DIMS(%(gh)s)[0]); %(fail)s; } { //setup_nv_gh brace 1 const int * gh_dims = CudaNdarray_HOST_DIMS(%(gh)s); const int gh_channels = gh_dims[0]; const int ghSizeY = gh_dims[1]; const int ghSizeX = gh_dims[2]; NVMatrix nv_gh(%(gh)s, gh_channels * ghSizeY * ghSizeX, batch_size, "ProbMaxPool:nv_gh"); """ num_braces += 1 setup_nv_gp = self._argument_contiguity_check("gp") + """ if (%(gp)s->nd != 4) { PyErr_Format(PyExc_ValueError, "gp must have nd=4, got nd=%%i", %(gp)s->nd); %(fail)s; } { //setup_nv_images brace 1 int _outputsX = ((int)(ceil((imgSizeY - %(start)s - %(ds)s) / ((float)%(stride)s)))) + 1; NVMatrix nv_gp(%(gp)s, img_channels * _outputsX * _outputsX, batch_size, "ProbMaxPool:nv_gp"); """ num_braces += 1 setup_nv_targets_z = """ int target_z_dims [] = { img_channels, imgSizeX, imgSizeY, batch_size }; if (CudaNdarray_prep_output(& %(targets_z)s, 4, target_z_dims)) { %(fail)s; } { // setup_nv_target brace # 1 NVMatrix nv_targets_z(%(targets_z)s, target_z_dims[0] * target_z_dims[1] * target_z_dims[2], target_z_dims[3], "ProbMaxPool:nv_targets_z"); """ num_braces += 1 setup_nv_targets_t = """ int target_t_dims [] = { img_channels, _outputsX, _outputsX, batch_size }; if (CudaNdarray_prep_output(& %(targets_t)s, 4, target_t_dims)) { %(fail)s; } { // setup_nv_target brace # 1 NVMatrix nv_targets_t(%(targets_t)s, target_t_dims[0] * target_t_dims[1] * target_t_dims[2], target_t_dims[3], "ProbMaxPool:nv_targets_t"); float * gp_iszero = CudaNdarray_DEV_DATA(%(gp_iszero)s); float * gh_iszero = CudaNdarray_DEV_DATA(%(gh_iszero)s); """ num_braces += 1 undo_pool = """ localProbMaxUndo(nv_h, nv_p, nv_gh, nv_gp, nv_targets_z, nv_targets_t, %(ds)s, %(start)s, %(stride)s, _outputsX, imgSizeX, gp_iszero, gh_iszero); """ braces = '}' * num_braces rval = (basic_setup + setup_nv_h + setup_nv_p + setup_nv_gh + setup_nv_gp + setup_nv_targets_z + setup_nv_targets_t + undo_pool + braces) start = self.start stride = self.stride ds = self.ds rval = rval % locals() return rval # Make sure the cuda_convnet library is compiled and up-to-date def make_thunk(self, node, storage_map, compute_map, no_recycling): """ .. todo:: WRITEME """ if not convnet_available(): raise RuntimeError('Could not compile cuda_convnet') return super(ProbMaxPoolGrad, self).make_thunk( node, storage_map, compute_map, no_recycling)
bsd-3-clause
6a004703d0e664bec780ef7614dcc46d
29.333333
109
0.533523
3.675114
false
false
false
false
lisa-lab/pylearn2
pylearn2/expr/tests/test_normalize.py
44
3322
from __future__ import print_function __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2013, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" import numpy as np import warnings from theano.compat.six.moves import xrange from theano import config from theano import function import theano.tensor as T from pylearn2.expr.normalize import (CrossChannelNormalization, CrossChannelNormalizationBC01) def ground_truth_normalizer(c01b, k, n, alpha, beta): out = np.zeros(c01b.shape) for r in xrange(out.shape[1]): for c in xrange(out.shape[2]): for x in xrange(out.shape[3]): out[:,r,c,x] = ground_truth_normalize_row(row=c01b[:,r,c,x], k=k, n=n, alpha=alpha, beta=beta) return out def ground_truth_normalize_row(row, k, n, alpha, beta): assert row.ndim == 1 out = np.zeros(row.shape) for i in xrange(row.shape[0]): s = k tot = 0 for j in xrange(max(0, i-n//2), min(row.shape[0], i+n//2+1)): tot += 1 sq = row[j] ** 2. assert sq > 0. assert s >= k assert alpha > 0. s += alpha * sq assert s >= k assert tot <= n assert s >= k s = s ** beta out[i] = row[i] / s return out def basic_test(): channels = 15 rows = 3 cols = 4 batch_size = 2 shape = [channels, rows, cols, batch_size] k = 2 n = 5 # use a big value of alpha so mistakes involving alpha show up strong alpha = 1.5 beta = 0.75 # Perform test for C01B rng = np.random.RandomState([2013,2]) c01b = rng.randn(*shape).astype(config.floatX) normalizer = CrossChannelNormalization(k=k, n=n, alpha=alpha, beta=beta) warnings.warn("TODO: add test for the CudaConvnet version.") X = T.TensorType(dtype=config.floatX, broadcastable=tuple([False]*4))() out = normalizer(X) out = function([X], out)(c01b) ground_out = ground_truth_normalizer(c01b, n=n, k=k, alpha=alpha, beta=beta) assert out.shape == ground_out.shape diff = out - ground_out err = np.abs(diff) max_err = err.max() if not np.allclose(out, ground_out): print('C01B test failed') print('error range: ',(err.min(), err.max())) print('output: ') print(out) print('expected output: ') print(ground_out) assert False # Perform test for BC01 bc01 = np.transpose(c01b, [3,0,1,2]) normalizerBC01 = CrossChannelNormalizationBC01(k=k, n=n, alpha=alpha, beta=beta) X = T.TensorType(dtype=config.floatX, broadcastable=tuple([False]*4))() out = normalizerBC01(X) out = function([X], out)(bc01) ground_out_BC01 = np.transpose(ground_out, [3,0,1,2]) assert out.shape == ground_out_BC01.shape diff = out - ground_out_BC01 err = np.abs(diff) max_err = err.max() if not np.allclose(out, ground_out_BC01): print('BC01 test failed') print('error range: ',(err.min(), err.max())) print('output: ') print(out) print('expected output: ') print(ground_out) assert False
bsd-3-clause
e7c380640c4ca6c73358d12a37b7f0b5
25.576
110
0.582781
3.322
false
false
false
false
lisa-lab/pylearn2
pylearn2/testing/skip.py
49
1363
""" Helper functions for determining which tests to skip. """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" from nose.plugins.skip import SkipTest import os from theano.sandbox import cuda scipy_works = True try: import scipy except ImportError: # pyflakes gets mad if you set scipy to None here scipy_works = False sklearn_works = True try: import sklearn except ImportError: sklearn_works = False h5py_works = True try: import h5py except ImportError: h5py_works = False matplotlib_works = True try: from matplotlib import pyplot except ImportError: matplotlib_works = False def skip_if_no_data(): if 'PYLEARN2_DATA_PATH' not in os.environ: raise SkipTest() def skip_if_no_scipy(): if not scipy_works: raise SkipTest() def skip_if_no_sklearn(): if not sklearn_works: raise SkipTest() def skip_if_no_gpu(): if cuda.cuda_available == False: raise SkipTest('Optional package cuda disabled.') def skip_if_no_h5py(): if not h5py_works: raise SkipTest() def skip_if_no_matplotlib(): if not matplotlib_works: raise SkipTest("matplotlib and pyplot are not available")
bsd-3-clause
859839c223ae977ff4d736504079db82
19.044118
65
0.679384
3.485934
false
true
false
false
lisa-lab/pylearn2
pylearn2/sandbox/lisa_rl/bandit/gaussian_bandit.py
49
1542
__author__ = "Ian Goodfellow" import numpy as np from theano import config from theano import function from theano import tensor as T from pylearn2.sandbox.lisa_rl.bandit.environment import Environment from pylearn2.utils import sharedX from pylearn2.utils.rng import make_np_rng, make_theano_rng class GaussianBandit(Environment): """ An n-armed bandit whose rewards are drawn from a different Gaussian distribution for each arm. The mean and standard deviation of the reward for each arm is drawn at initialization time from N(0, <corresponding std arg>). (For the standard deviation we use the absolute value of the Gaussian sample) .. todo:: WRITEME : parameter list """ def __init__(self, num_arms, mean_std = 1.0, std_std = 1.0): self.rng = make_np_rng(None, [2013, 11, 12], which_method="randn") self.means = sharedX(self.rng.randn(num_arms) * mean_std) self.stds = sharedX(np.abs(self.rng.randn(num_arms) * std_std)) self.theano_rng = make_theano_rng(None, self.rng.randint(2 ** 16), which_method="normal") def get_action_func(self): """ Returns a theano function that takes an action and returns a reward. """ action = T.iscalar() reward_mean = self.means[action] reward_std = self.stds[action] reward = self.theano_rng.normal(avg=reward_mean, std=reward_std, dtype=config.floatX, size=reward_mean.shape) rval = function([action], reward) return rval
bsd-3-clause
7d2fd42d71221ef0877b795856d4d334
33.266667
97
0.664721
3.680191
false
false
false
false
lisa-lab/pylearn2
pylearn2/sandbox/rnn/models/rnn.py
34
29276
""" Recurrent Neural Network Layer """ __authors__ = "Junyoung Chung" __copyright__ = "Copyright 2014, Universite de Montreal" __credits__ = "Junyoung Chung" __license__ = "3-clause BSD" __maintainer__ = "Junyoung Chung" __email__ = "chungjun@iro" import numpy as np import scipy.linalg from functools import wraps from theano import config, scan, tensor from theano.compat import six from theano.compat.six.moves import xrange from pylearn2.compat import OrderedDict from pylearn2.models.mlp import Layer, MLP from pylearn2.monitor import get_monitor_doc from pylearn2.sandbox.rnn.space import SequenceSpace, SequenceDataSpace from pylearn2.space import CompositeSpace, VectorSpace from pylearn2.utils import sharedX from pylearn2.utils.rng import make_theano_rng class RNN(MLP): """ This method overrides MLP's __init__ method. It recursively goes through the spaces and sources, and for each SequenceSpace it adds an extra source for the mask. This is just syntactic sugar, preventing people from adding a source for each mask. Eventually this behaviour could maybe be moved to the DataSpecsMapping class. Parameters ---------- See https://docs.python.org/2/reference/datamodel.html#object.__new__ """ def __init__(self, layers, batch_size=None, input_space=None, input_source='features', nvis=None, seed=None, layer_name=None, **kwargs): input_source = self.add_mask_source(input_space, input_source) self.use_monitoring_channels = kwargs.pop('use_monitoring_channels', 0) super(RNN, self).__init__(layers=layers, batch_size=batch_size, input_space=input_space, input_source=input_source, nvis=nvis, seed=seed, layer_name=layer_name, **kwargs) self.theano_rng = make_theano_rng(int(self.rng.randint(2 ** 30)), which_method=["normal", "uniform"]) @wraps(MLP.get_target_source) def get_target_source(self): if isinstance(self.input_space, SequenceSpace): # Add mask source for targets # ('targets') -> ('targets', 'targets_mask') target_source = self.add_mask_source(self.get_target_space(), 'targets') return target_source else: return 'targets' @classmethod def add_mask_source(cls, space, source): """ This is a recursive helper function to go through the nested spaces and tuples Parameters ---------- space : Space source : string """ if isinstance(space, CompositeSpace): if not isinstance(space, SequenceSpace): source = tuple( cls.add_mask_source(component, source) for component, source in zip(space.components, source) ) else: assert isinstance(source, six.string_types) source = (source, source + '_mask') return source @wraps(Layer.get_layer_monitoring_channels) def get_layer_monitoring_channels(self, state_below=None, state=None, targets=None): """ Block monitoring channels if not necessary Parameters --------- : todo """ rval = OrderedDict() if self.use_monitoring_channels: state = state_below x = state state_conc = None for layer in self.layers: # We don't go through all the inner layers recursively state_below = state if ((self.x_shortcut and layer is not self.layers[0] and layer is not self.layers[-1])): state = self.create_shortcut_batch(state, x, 2, 1) if self.y_shortcut and layer is self.layers[-1]: state = layer.fprop(state_conc) else: state = layer.fprop(state) if self.y_shortcut and layer is not self.layers[-1]: if layer is self.layers[0]: state_conc = state else: state_conc = self.create_shortcut_batch(state_conc, state, 2) args = [state_below, state] if layer is self.layers[-1] and targets is not None: args.append(targets) ch = layer.get_layer_monitoring_channels(*args) if not isinstance(ch, OrderedDict): raise TypeError(str((type(ch), layer.layer_name))) for key in ch: value = ch[key] doc = get_monitor_doc(value) if doc is None: doc = str(type(layer)) + \ ".get_monitoring_channels_from_state did" + \ " not provide any further documentation for" + \ " this channel." doc = 'This channel came from a layer called "' + \ layer.layer_name + '" of an MLP.\n' + doc value.__doc__ = doc rval[layer.layer_name + '_' + key] = value return rval class Recurrent(Layer): """ A recurrent neural network layer using the hyperbolic tangent activation function, passing on all hidden states or a selection of them to the next layer. The hidden state is initialized to zeros. Parameters ---------- dim : int The number of elements in the hidden layer layer_name : str The name of the layer. All layers in an MLP must have a unique name. irange : float Initializes each weight randomly in U(-irange, irange) irange : float The input-to-hidden weight matrix is initialized with weights in the uniform interval (-irange, irange). The hidden-to-hidden matrix weights are sampled in the same manner, unless the argument svd is set to True (see below). indices : slice, list of integers or integer, optional If specified this layer will return only the given hidden states. If an integer is given, it will not return a SequenceSpace. Otherwise, it will return a SequenceSpace of fixed length. Note that a SequenceSpace of fixed length can be flattened by using the FlattenerLayer. Note: For now only [-1] is supported. init_bias : float, optional Set an initial bias to be added at each time step. Defaults to 0. nonlinearity : theano.function, optional weight_noise : bool, optional Additive Gaussian noise applied to parameters """ def __init__(self, dim, layer_name, irange, indices=None, init_bias=0., nonlinearity=tensor.tanh, weight_noise=False, **kwargs): self._std_dev = kwargs.pop('noise_std_dev', .075) self.rnn_friendly = True self._scan_updates = OrderedDict() self.__dict__.update(locals()) del self.self super(Recurrent, self).__init__() if not self.weight_noise: self._std_dev = None @wraps(Layer.set_input_space) def set_input_space(self, space): if ((not isinstance(space, SequenceSpace) and not isinstance(space, SequenceDataSpace)) or not isinstance(space.space, VectorSpace)): raise ValueError("Recurrent layer needs a SequenceSpace(" "VectorSpace) or SequenceDataSpace(VectorSpace)\ as input but received %s instead" % (space)) self.input_space = space if self.indices is not None: if len(self.indices) > 1: raise ValueError("Only indices = [-1] is supported right now") self.output_space = CompositeSpace( [VectorSpace(dim=self.dim) for _ in range(len(self.indices))] ) else: assert self.indices == [-1], "Only indices = [-1] works now" self.output_space = VectorSpace(dim=self.dim) else: if isinstance(self.input_space, SequenceSpace): self.output_space = SequenceSpace(VectorSpace(dim=self.dim)) elif isinstance(self.input_space, SequenceDataSpace): self.output_space =\ SequenceDataSpace(VectorSpace(dim=self.dim)) # Initialize the parameters rng = self.mlp.rng if self.irange is None: raise ValueError("Recurrent layer requires an irange value in " "order to initialize its weight matrices") input_dim = self.input_space.dim # W is the input-to-hidden matrix W = rng.uniform(-self.irange, self.irange, (input_dim, self.dim)) # U is the hidden-to-hidden transition matrix U = rng.randn(self.dim, self.dim) U, _ = scipy.linalg.qr(U) # b is the bias b = np.zeros((self.dim,)) self._params = [ sharedX(W, name=(self.layer_name + '_W')), sharedX(U, name=(self.layer_name + '_U')), sharedX(b + self.init_bias, name=(self.layer_name + '_b')) ] @wraps(Layer.get_layer_monitoring_channels) def get_layer_monitoring_channels(self, state_below=None, state=None, targets=None): W, U, b = self._params sq_W = tensor.sqr(W) sq_U = tensor.sqr(U) row_norms = tensor.sqrt(sq_W.sum(axis=1)) col_norms = tensor.sqrt(sq_W.sum(axis=0)) u_row_norms = tensor.sqrt(sq_U.sum(axis=1)) u_col_norms = tensor.sqrt(sq_U.sum(axis=0)) rval = OrderedDict([('W_row_norms_min', row_norms.min()), ('W_row_norms_mean', row_norms.mean()), ('W_row_norms_max', row_norms.max()), ('W_col_norms_min', col_norms.min()), ('W_col_norms_mean', col_norms.mean()), ('W_col_norms_max', col_norms.max()), ('U_row_norms_min', u_row_norms.min()), ('U_row_norms_mean', u_row_norms.mean()), ('U_row_norms_max', u_row_norms.max()), ('U_col_norms_min', u_col_norms.min()), ('U_col_norms_mean', u_col_norms.mean()), ('U_col_norms_max', u_col_norms.max())]) if (state is not None) or (state_below is not None): if state is None: state = self.fprop(state_below) if isinstance(self.input_space, SequenceSpace): state, _ = state state_below, _ = state_below mx = state.max(axis=0) mean = state.mean(axis=0) mn = state.min(axis=0) rg = mx - mn rval['range_x_max_u'] = rg.max() rval['range_x_mean_u'] = rg.mean() rval['range_x_min_u'] = rg.min() rval['max_x_max_u'] = mx.max() rval['max_x_mean_u'] = mx.mean() rval['max_x_min_u'] = mx.min() rval['mean_x_max_u'] = mean.max() rval['mean_x_mean_u'] = mean.mean() rval['mean_x_min_u'] = mean.min() rval['min_x_max_u'] = mn.max() rval['min_x_mean_u'] = mn.mean() rval['min_x_min_u'] = mn.min() return rval @wraps(Layer._modify_updates) def _modify_updates(self, updates): # When random variables are used in the scan function the updates # dictionary returned by scan might not be empty, and needs to be # added to the updates dictionary before compiling the training # function if any(key in updates for key in self._scan_updates): # Don't think this is possible, but let's check anyway raise ValueError("A single shared variable is being updated by " "multiple scan functions") updates.update(self._scan_updates) def add_noise(self, param): """ A function that adds additive Gaussian noise Parameters ---------- param : sharedX model parameter to be regularized Returns ------- param : sharedX model parameter with additive noise """ param += self.mlp.theano_rng.normal(size=param.shape, avg=0., std=self._std_dev, dtype=param.dtype) return param @wraps(Layer.fprop) def fprop(self, state_below, return_all=False): if isinstance(state_below, tuple): state_below, mask = state_below else: mask = None # z0 is the initial hidden state which is (batch size, output dim) z0 = tensor.alloc(np.cast[config.floatX](0), state_below.shape[1], self.dim) if self.dim == 1: # This should fix the bug described in Theano issue #1772 z0 = tensor.unbroadcast(z0, 1) # Later we will add a noise function W, U, b = self._params if self.weight_noise: W = self.add_noise(W) U = self.add_noise(U) # It is faster to do the input-to-hidden matrix multiplications # outside of scan state_below = tensor.dot(state_below, W) + b if mask is not None: z, updates = scan(fn=self.fprop_step_mask, sequences=[state_below, mask], outputs_info=[z0], non_sequences=[U]) else: z, updates = scan(fn=self.fprop_step, sequences=[state_below], outputs_info=[z0], non_sequences=[U]) self._scan_updates.update(updates) if self.indices is not None: if len(self.indices) > 1: return [z[i] for i in self.indices] else: return z[self.indices[0]] else: return (z, mask) def fprop_step_mask(self, state_below, mask, state_before, U): """ Scan function for case using masks Parameters ---------- : todo state_below : TheanoTensor """ z = self.nonlinearity(state_below + tensor.dot(state_before, U)) # Only update the state for non-masked data, otherwise # just carry on the previous state until the end z = mask[:, None] * z + (1 - mask[:, None]) * state_before return z def fprop_step(self, state_below, state_before, U): """ Scan function for case without masks Parameters ---------- : todo state_below : TheanoTensor """ z = self.nonlinearity(state_below + tensor.dot(state_before, U)) return z class LSTM(Recurrent): """ Implementation of Long Short-Term Memory proposed by W. Zaremba and I.Sutskever and O. Vinyals in their paper "Recurrent Neural Network Regularization", arXiv, 2014. Parameters ---------- dim : int The number of elements in the hidden layer layer_name : str The name of the layer. All layers in an MLP must have a unique name. irange : float Initializes each weight randomly in U(-irange, irange) indices : slice, list of integers or integer, optional If specified this layer will return only the given hidden states. If an integer is given, it will not return a SequenceSpace. Otherwise, it will return a SequenceSpace of fixed length. Note that a SequenceSpace of fixed length can be flattened by using the FlattenerLayer. Note: For now only [-1] is supported. irange : float init_bias : float forget_gate_init_bias : float Bias for forget gate. Set this variable into high value to force the model to learn long-term dependencies. input_gate_init_bias : float output_gate_init_bias : float """ def __init__(self, forget_gate_init_bias=0., input_gate_init_bias=0., output_gate_init_bias=0., **kwargs): super(LSTM, self).__init__(**kwargs) self.rnn_friendly = True self.__dict__.update(locals()) del self.self @wraps(Layer.set_input_space) def set_input_space(self, space): if ((not isinstance(space, SequenceSpace) and not isinstance(space, SequenceDataSpace)) or not isinstance(space.space, VectorSpace)): raise ValueError("Recurrent layer needs a SequenceSpace(" "VectorSpace) or SequenceDataSpace(VectorSpace)\ as input but received %s instead" % (space)) self.input_space = space if self.indices is not None: if len(self.indices) > 1: raise ValueError("Only indices = [-1] is supported right now") self.output_space = CompositeSpace( [VectorSpace(dim=self.dim) for _ in range(len(self.indices))] ) else: assert self.indices == [-1], "Only indices = [-1] works now" self.output_space = VectorSpace(dim=self.dim) else: if isinstance(self.input_space, SequenceSpace): self.output_space = SequenceSpace(VectorSpace(dim=self.dim)) elif isinstance(self.input_space, SequenceDataSpace): self.output_space =\ SequenceDataSpace(VectorSpace(dim=self.dim)) # Initialize the parameters rng = self.mlp.rng if self.irange is None: raise ValueError("Recurrent layer requires an irange value in " "order to initialize its weight matrices") input_dim = self.input_space.dim # W is the input-to-hidden matrix W = rng.uniform(-self.irange, self.irange, (input_dim, self.dim * 4)) # U is the hidden-to-hidden transition matrix U = np.zeros((self.dim, self.dim * 4)) for i in xrange(4): u = rng.randn(self.dim, self.dim) U[:, i*self.dim:(i+1)*self.dim], _ = scipy.linalg.qr(u) # b is the bias b = np.zeros((self.dim * 4,)) self._params = [ sharedX(W, name=(self.layer_name + '_W')), sharedX(U, name=(self.layer_name + '_U')), sharedX(b + self.init_bias, name=(self.layer_name + '_b')) ] @wraps(Layer.fprop) def fprop(self, state_below, return_all=False): if isinstance(state_below, tuple): state_below, mask = state_below else: mask = None z0 = tensor.alloc(np.cast[config.floatX](0), state_below.shape[1], self.dim * 2) z0 = tensor.unbroadcast(z0, 0) if self.dim == 1: z0 = tensor.unbroadcast(z0, 1) W, U, b = self._params if self.weight_noise: W = self.add_noise(W) U = self.add_noise(U) state_below = tensor.dot(state_below, W) + b if mask is not None: (z, updates) = scan(fn=self.fprop_step_mask, sequences=[state_below, mask], outputs_info=[z0], non_sequences=[U]) else: (z, updates) = scan(fn=self.fprop_step, sequences=[state_below], outputs_info=[z0], non_sequences=[U]) self._scan_updates.update(updates) if return_all: return z if self.indices is not None: if len(self.indices) > 1: return [z[i, :, :self.dim] for i in self.indices] else: return z[self.indices[0], :, :self.dim] else: if mask is not None: return (z[:, :, :self.dim], mask) else: return z[:, :, :self.dim] def fprop_step_mask(self, state_below, mask, state_before, U): """ Scan function for case using masks Parameters ---------- : todo state_below : TheanoTensor """ g_on = state_below + tensor.dot(state_before[:, :self.dim], U) i_on = tensor.nnet.sigmoid(g_on[:, :self.dim]) f_on = tensor.nnet.sigmoid(g_on[:, self.dim:2*self.dim]) o_on = tensor.nnet.sigmoid(g_on[:, 2*self.dim:3*self.dim]) z = tensor.set_subtensor(state_before[:, self.dim:], f_on * state_before[:, self.dim:] + i_on * tensor.tanh(g_on[:, 3*self.dim:])) z = tensor.set_subtensor(z[:, :self.dim], o_on * tensor.tanh(z[:, self.dim:])) # Only update the state for non-masked data, otherwise # just carry on the previous state until the end z = mask[:, None] * z + (1 - mask[:, None]) * state_before return z def fprop_step(self, state_below, z, U): """ Scan function for case without masks Parameters ---------- : todo state_below : TheanoTensor """ g_on = state_below + tensor.dot(z[:, :self.dim], U) i_on = tensor.nnet.sigmoid(g_on[:, :self.dim]) f_on = tensor.nnet.sigmoid(g_on[:, self.dim:2*self.dim]) o_on = tensor.nnet.sigmoid(g_on[:, 2*self.dim:3*self.dim]) z = tensor.set_subtensor(z[:, self.dim:], f_on * z[:, self.dim:] + i_on * tensor.tanh(g_on[:, 3*self.dim:])) z = tensor.set_subtensor(z[:, :self.dim], o_on * tensor.tanh(z[:, self.dim:])) return z class GRU(Recurrent): """ Implementation of Gated Recurrent Unit proposed by Cho et al. "Learning phrase representations using rnn encoder-decoder for statistical machine translation", arXiv, 2014. Parameters ---------- dim : int The number of elements in the hidden layer layer_name : str The name of the layer. All layers in an MLP must have a unique name. irange : float Initializes each weight randomly in U(-irange, irange) indices : slice, list of integers or integer, optional If specified this layer will return only the given hidden states. If an integer is given, it will not return a SequenceSpace. Otherwise, it will return a SequenceSpace of fixed length. Note that a SequenceSpace of fixed length can be flattened by using the FlattenerLayer. Note: For now only [-1] is supported. irange : float init_bias : float reset_gate_init_bias: float Bias for reset gate. update_gate_init_bias: float Bias for update gate. """ def __init__(self, reset_gate_init_bias=0., update_gate_init_bias=0., **kwargs): super(GRU, self).__init__(**kwargs) self.rnn_friendly = True self.__dict__.update(locals()) del self.self @wraps(Layer.set_input_space) def set_input_space(self, space): if ((not isinstance(space, SequenceSpace) and not isinstance(space, SequenceDataSpace)) or not isinstance(space.space, VectorSpace)): raise ValueError("Recurrent layer needs a SequenceSpace(" "VectorSpace) or SequenceDataSpace(VectorSpace)\ as input but received %s instead" % (space)) self.input_space = space if self.indices is not None: if len(self.indices) > 1: raise ValueError("Only indices = [-1] is supported right now") self.output_space = CompositeSpace( [VectorSpace(dim=self.dim) for _ in range(len(self.indices))] ) else: assert self.indices == [-1], "Only indices = [-1] works now" self.output_space = VectorSpace(dim=self.dim) else: if isinstance(self.input_space, SequenceSpace): self.output_space = SequenceSpace(VectorSpace(dim=self.dim)) elif isinstance(self.input_space, SequenceDataSpace): self.output_space =\ SequenceDataSpace(VectorSpace(dim=self.dim)) # Initialize the parameters rng = self.mlp.rng if self.irange is None: raise ValueError("Recurrent layer requires an irange value in " "order to initialize its weight matrices") input_dim = self.input_space.dim # W is the input-to-hidden matrix W = rng.uniform(-self.irange, self.irange, (input_dim, self.dim * 3)) # U is the hidden-to-hidden transition matrix U = np.zeros((self.dim, self.dim * 3)) for i in xrange(3): u = rng.randn(self.dim, self.dim) U[:, i*self.dim:(i+1)*self.dim] = scipy.linalg.orth(u) # b is the bias b = np.zeros((self.dim * 3,)) self._params = [ sharedX(W, name=(self.layer_name + '_W')), sharedX(U, name=(self.layer_name + '_U')), sharedX(b, name=(self.layer_name + '_b')), ] @wraps(Layer.fprop) def fprop(self, state_below, return_all=False): if isinstance(state_below, tuple): state_below, mask = state_below else: mask = None z0 = tensor.alloc(np.cast[config.floatX](0), state_below.shape[1], self.dim) z0 = tensor.unbroadcast(z0, 0) if self.dim == 1: z0 = tensor.unbroadcast(z0, 1) W, U, b = self._params if self.weight_noise: W = self.add_noise(W) U = self.add_noise(U) state_below = tensor.dot(state_below, W) + b if mask is not None: (z, updates) = scan(fn=self.fprop_step_mask, sequences=[state_below, mask], outputs_info=[z0], non_sequences=[U]) else: (z, updates) = scan(fn=self.fprop_step, sequences=[state_below], outputs_info=[z0], non_sequences=[U]) self._scan_updates.update(updates) if return_all: return z if self.indices is not None: if len(self.indices) > 1: return [z[i, :, :self.dim] for i in self.indices] else: return z[self.indices[0], :, :self.dim] else: if mask is not None: return (z[:, :, :self.dim], mask) else: return z[:, :, :self.dim] def fprop_step_mask(self, state_below, mask, state_before, U): """ Scan function for case using masks Parameters ---------- : todo state_below : TheanoTensor """ g_on = tensor.inc_subtensor( state_below[:, self.dim:], tensor.dot(state_before, U[:, self.dim:]) ) r_on = tensor.nnet.sigmoid(g_on[:, self.dim:2*self.dim]) u_on = tensor.nnet.sigmoid(g_on[:, 2*self.dim:]) z_t = tensor.tanh( g_on[:, :self.dim] + tensor.dot(r_on * state_before, U[:, :self.dim]) ) z_t = u_on * state_before + (1. - u_on) * z_t z_t = mask[:, None] * z_t + (1 - mask[:, None]) * state_before return z_t def fprop_step(self, state_below, state_before, U): """ Scan function for case without masks Parameters ---------- : todo state_below : TheanoTensor """ g_on = tensor.inc_subtensor( state_below[:, self.dim:], tensor.dot(state_before, U[:, self.dim:]) ) r_on = tensor.nnet.sigmoid(g_on[:, self.dim:2*self.dim]) u_on = tensor.nnet.sigmoid(g_on[:, 2*self.dim:]) z_t = tensor.tanh( g_on[:, :self.dim] + tensor.dot(r_on * state_before, U[:, :self.dim]) ) z_t = u_on * state_before + (1. - u_on) * z_t return z_t
bsd-3-clause
2dd6a108083d6a93576489733932c3dc
35.686717
79
0.524115
4.137951
false
false
false
false
lisa-lab/pylearn2
pylearn2/scripts/print_monitor_cv.py
30
3378
#!/usr/bin/env python """ Print (average) channel values for a collection of models, such as that serialized by TrainCV. Based on print_monitor.py. usage: print_monitor_cv.py model.pkl [-a] """ from __future__ import print_function __author__ = "Steven Kearnes" __copyright__ = "Copyright 2014, Stanford University" __license__ = "3-clause BSD" import argparse from collections import Iterable import numpy as np from pylearn2.utils import serial def main(models, all=False): """ Print (average) final channel values for a collection of models. Parameters ---------- models : list Filename(s) for models to analyze. all : bool, optional (default False) Whether to output values for all models. If False, only averages and standard deviations across all models are displayed. """ epochs = [] time = [] values = {} for filename in np.atleast_1d(models): this_models = serial.load(filename) if not isinstance(this_models, Iterable): this_models = [this_models] for model in list(this_models): monitor = model.monitor channels = monitor.channels epochs.append(monitor._epochs_seen) time.append(max(channels[key].time_record[-1] for key in channels)) for key in sorted(channels.keys()): if key not in values: values[key] = [] values[key].append(channels[key].val_record[-1]) n_models = len(epochs) print('number of models: {0}'.format(n_models)) if n_models > 1: if all: print('\nepochs seen:\n{0}\n{1} +/- {2}'.format(np.asarray(epochs), np.mean(epochs), np.std(epochs))) print('\ntraining time:\n{0}\n{1} +/- {2}'.format(np.asarray(time), np.mean(time), np.std(time))) else: print('epochs seen: {0} +/- {1}'.format(np.mean(epochs), np.std(epochs))) print('training time: {0} +/- {1}'.format(np.mean(time), np.std(time))) for key in sorted(values.keys()): if all: print('\n{0}:\n{1}\n{2} +/- {3}'.format( key, np.asarray(values[key]), np.mean(values[key]), np.std(values[key]))) else: print('{0}: {1} +/- {2}'.format(key, np.mean(values[key]), np.std(values[key]))) else: print('epochs seen: {0}'.format(epochs[0])) print('training time: {0}'.format(time[0])) for key in sorted(values.keys()): print('{0}: {1}'.format(key, values[key][0])) if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('models', nargs='+', help='Model or models to analyze.') parser.add_argument('-a', '--all', action='store_true', help='Print values for all models instead of ' + 'averages.') args = parser.parse_args() main(**vars(args))
bsd-3-clause
afe13946198906066a1daf733b6f5838
38.27907
79
0.499408
4.217228
false
false
false
false
lisa-lab/pylearn2
pylearn2/datasets/vector_spaces_dataset.py
41
6009
"""TODO: module-level docstring.""" __authors__ = "Pascal Lamblin and Razvan Pascanu" __copyright__ = "Copyright 2010-2013, Universite de Montreal" __credits__ = ["Pascal Lamblin", "Razvan Pascanu", "Ian Goodfellow", "Mehdi Mirza"] __license__ = "3-clause BSD" __maintainer__ = "Pascal Lamblin" __email__ = "lamblinp@iro" import functools import numpy as np from pylearn2.datasets.dataset import Dataset from pylearn2.utils import wraps from pylearn2.utils.iteration import ( FiniteDatasetIterator, resolve_iterator_class ) from pylearn2.utils.data_specs import is_flat_specs from pylearn2.utils.rng import make_np_rng from pylearn2.utils import contains_nan class VectorSpacesDataset(Dataset): """ A class representing datasets being stored as a number of VectorSpaces. This can be seen as a generalization of DenseDesignMatrix where there can be any number of sources, not just X and possibly y. Parameters ---------- data : ndarray, or tuple of ndarrays, containing the data. It is formatted as specified in `data_specs`. For instance, if `data_specs` is (VectorSpace(nfeat), 'features'), then `data` has to be a 2-d ndarray, of shape (nb examples, nfeat), that defines an unlabeled dataset. If `data_specs` is (CompositeSpace(Conv2DSpace(...), VectorSpace(1)), ('features', 'target')), then `data` has to be an (X, y) pair, with X being an ndarray containing images stored in the topological view specified by the `Conv2DSpace`, and y being a 2-D ndarray of width 1, containing the labels or targets for each example. data_specs : (space, source) pair space is an instance of `Space` (possibly a `CompositeSpace`), and `source` is a string (or tuple of strings, if `space` is a `CompositeSpace`), defining the format and labels associated to `data`. rng : object, optional A random number generator used for picking random indices into the design matrix when choosing minibatches. preprocessor: WRITEME fit_preprocessor: WRITEME """ _default_seed = (17, 2, 946) def __init__(self, data=None, data_specs=None, rng=_default_seed, preprocessor=None, fit_preprocessor=False): # data_specs should be flat, and there should be no # duplicates in source, as we keep only one version assert is_flat_specs(data_specs) if isinstance(data_specs[1], tuple): assert sorted(set(data_specs[1])) == sorted(data_specs[1]) space, source = data_specs if isinstance(data, list): data = tuple(data) space.np_validate(data) assert len(set(elem.shape[0] for elem in list(data))) <= 1 self.data = data self.data_specs = data_specs self.num_examples = list(data)[0].shape[0] self.compress = False self.design_loc = None self.rng = make_np_rng(rng, which_method='random_integers') # Defaults for iterators self._iter_mode = resolve_iterator_class('sequential') if preprocessor: preprocessor.apply(self, can_fit=fit_preprocessor) self.preprocessor = preprocessor @functools.wraps(Dataset.iterator) def iterator(self, mode=None, batch_size=None, num_batches=None, rng=None, data_specs=None, return_tuple=False): if mode is None: if hasattr(self, '_iter_subset_class'): mode = self._iter_subset_class else: raise ValueError('iteration mode not provided and no default ' 'mode set for %s' % str(self)) else: mode = resolve_iterator_class(mode) if batch_size is None: batch_size = getattr(self, '_iter_batch_size', None) if num_batches is None: num_batches = getattr(self, '_iter_num_batches', None) if rng is None and mode.stochastic: rng = self.rng if data_specs is None: data_specs = self.data_specs return FiniteDatasetIterator( self, mode(self.get_num_examples(), batch_size, num_batches, rng), data_specs=data_specs, return_tuple=return_tuple ) def get_data_specs(self): """ Returns the data_specs specifying how the data is internally stored. This is the format the data returned by `self.get_data()` will be. """ return self.data_specs def get_data(self): """ .. todo:: WRITEME """ return self.data def set_data(self, data, data_specs): """ .. todo:: WRITEME """ # data is organized as data_specs # keep self.data_specs, and convert data data_specs[0].np_validate(data) assert not [contains_nan(X) for X in data] raise NotImplementedError() def get_source(self, name): """ .. todo:: WRITEME """ raise NotImplementedError() @wraps(Dataset.get_num_examples) def get_num_examples(self): return self.num_examples def get_batch(self, batch_size, data_specs=None): """ .. todo:: WRITEME """ raise NotImplementedError() """ try: idx = self.rng.randint(self.X.shape[0] - batch_size + 1) except ValueError: if batch_size > self.X.shape[0]: raise ValueError("Requested "+str(batch_size)+" examples" "from a dataset containing only "+str(self.X.shape[0])) raise rx = self.X[idx:idx + batch_size, :] if include_labels: if self.y is None: return rx, None ry = self.y[idx:idx + batch_size] return rx, ry rx = np.cast[config.floatX](rx) return rx """
bsd-3-clause
12ff3413d47b817012eecc0993db5d33
33.534483
79
0.594442
4.032886
false
false
false
false
lisa-lab/pylearn2
pylearn2/packaged_dependencies/theano_linear/pyramid.py
49
4318
""" .. todo:: WRITEME """ import logging import sys import numpy import theano import warnings from theano.gof import Variable, Op, utils, Type, Constant, Value, Apply from theano.tensor import as_tensor_variable logger = logging.getLogger(__name__) try: import cv except ImportError: warnings.warn("cv not available") def cv_available(): """ .. todo:: WRITEME """ return 'cv' in globals() class GaussianPyramid(Op): """ Returns `n_levels` images Parameters ---------- n_levels : WRITEME """ default_output = slice(0,None,1) #always return a list, even when there's only one element in it def __init__(self, n_levels): self.n_levels = n_levels def props(self): """ .. todo:: WRITEME """ return (self.n_levels,) def __hash__(self): """ .. todo:: WRITEME """ return hash((type(self), self.props())) def __eq__(self, other): """ .. todo:: WRITEME """ return (type(self)==type(other) and self.props() == other.props()) def __repr__(self): """ .. todo:: WRITEME """ return '%s{n_levels=%s}' %(self.__class__.__name__, self.n_levels) def infer_shape(self, node, input_shapes): """ .. todo:: WRITEME """ xshp, = input_shapes out_shapes = [xshp] while len(out_shapes) < self.n_levels: s = out_shapes[-1] out_shapes.append((s[0], s[1]//2, s[2]//2,s[3])) return out_shapes def make_node(self, x): """ .. todo:: WRITEME """ if self.n_levels < 1: raise ValueError(('It does not make sense for' ' GaussianPyramid to generate %i levels'), self.n_levels) x = as_tensor_variable(x) return Apply(self, [x], [x.type() for i in range(self.n_levels)]) def perform(self, node, ins, outs): """ .. todo:: WRITEME """ x, = ins outs[0][0] = z = x.copy() B,M,N,K = x.shape for level in range(1,self.n_levels): # z is the whole pyramid at level `level-1` # loop body builds `out` which is the pyramid at `level` z0 = z[0] if z0.shape[0] <=2 or z0.shape[1] <= 2: raise ValueError('Cannot downsample an image smaller than 3x3', z0.shape) logger.info('{0} {1} {2}'.format(z0.shape, z0.dtype, z0.strides)) out0 = cv.pyrDown(z0) assert out0.dtype == x.dtype if out0.ndim ==3: assert out0.shape[2] == x.shape[3] # assert same # channels else: assert K==1 out = numpy.empty( (x.shape[0], out0.shape[0], out0.shape[1], K), dtype=out0.dtype) if K==1: out[0][:,:,0] = out0 else: out[0] = out0 for i, zi in enumerate(z[1:]): if K==1: out[i][:,:,0] = cv.pyrDown(z[i]) else: out[i] = cv.pyrDown(z[i]) outs[level][0] = out z = out # test infer shape # test non power-of-two shapes # test different numbers of channels def test_gaussian_pyramid_shapes(): for dtype in ('float32', 'float64'): x = theano.tensor.tensor4(dtype=dtype) f = theano.function([x], GaussianPyramid(3)(x)) xval = numpy.ones((1, 64, 64, 1), dtype=dtype) a,b,c = f(xval) assert a.shape == (1,64,64,1) assert b.shape == (1,32,32,1) assert c.shape == (1,16,16,1) xval = numpy.ones((1, 12, 12, 10), dtype=dtype) a,b,c = f(xval) assert a.shape == (1,12,12,10) assert b.shape == (1,6,6,10) assert c.shape == (1,3,3,10) p = GaussianPyramid(1)(x) f = theano.function([x], p) a, = f(xval) assert a.shape == xval.shape #print a.max(), a.min() #print x.max(), x.min() #assert numpy.allclose(a, x)
bsd-3-clause
a24a586b3f8be3d45dc183053011cb6a
23.959538
100
0.469662
3.568595
false
false
false
false
lisa-lab/pylearn2
pylearn2/models/tests/test_reflection_clip.py
44
1514
import numpy as np from pylearn2.models.s3c import reflection_clip from theano.compat.six.moves import xrange from theano import function from theano import shared from pylearn2.utils.rng import make_np_rng def test_reflection_clip(): N = 5 m = 10 rng = make_np_rng([1,2,3], which_method='randn') Mu1_old = rng.randn(m,N) Mu1_new = rng.randn(m,N) rho = .6 Mu1_clipped = function([],reflection_clip( \ shared(Mu1_old), shared(Mu1_new), rho))() case1 = False case2 = False case3 = False case4 = False for i in xrange(m): for j in xrange(N): old = Mu1_old[i,j] new = Mu1_new[i,j] clipped = Mu1_clipped[i,j] if old > 0.: if new < - rho * old: case1 = True assert abs(clipped-(-rho*old)) < 1e-6 else: case2 = True assert new == clipped elif old < 0.: if new > - rho * old: case3 = True assert abs(clipped-(-rho*old)) < 1e-6 else: case4 = True assert new == clipped else: assert new == clipped #if any of the following fail, it doesn't necessarily mean #that reflection_clip is broken, just that the test needs #to be adjusted to have better coverage assert case1 assert case2 assert case3 assert case4
bsd-3-clause
d69f966cdb859b8d8d14a509ea6340ee
26.035714
62
0.516513
3.832911
false
false
false
false
lisa-lab/pylearn2
setup.py
42
3978
from __future__ import print_function import warnings from setuptools import setup, find_packages, Extension from setuptools.command.install import install import numpy from theano.compat.six.moves import input # Because many people neglected to run the pylearn2/utils/setup.py script # separately, we compile the necessary Cython extensions here but because # Cython is not a strict dependency, we issue a warning when it is not # available. try: from Cython.Distutils import build_ext cython_available = True except ImportError: warnings.warn("Cython was not found and hence pylearn2.utils._window_flip " "and pylearn2.utils._video and classes that depend on them " "(e.g. pylearn2.train_extensions.window_flip) will not be " "available") cython_available = False if cython_available: cmdclass = {'build_ext': build_ext} ext_modules = [Extension("pylearn2.utils._window_flip", ["pylearn2/utils/_window_flip.pyx"], include_dirs=[numpy.get_include()]), Extension("pylearn2.utils._video", ["pylearn2/utils/_video.pyx"], include_dirs=[numpy.get_include()])] else: cmdclass = {} ext_modules = [] # Inform user of setup.py develop preference class pylearn2_install(install): def run(self): print("Because Pylearn2 is under heavy development, we generally do " "not advice using the `setup.py install` command. Please " "consider using the `setup.py develop` command instead for the " "following reasons:\n\n1. Using `setup.py install` creates a " "copy of the Pylearn2 source code in your Python installation " "path. In order to update Pylearn2 afterwards you will need to " "rerun `setup.py install` (!). Simply using `git pull` to " "update your local copy of Pylearn2 code will not suffice. \n\n" "2. When using `sudo` to install Pylearn2, all files, " "including the tutorials, will be copied to a directory owned " "by root. Not only is running tutorials as root unsafe, it " "also means that all Pylearn2-related environment variables " "which were defined for the user will be unavailable.\n\n" "Pressing enter will continue the installation of Pylearn2 in " "`develop` mode instead. Note that this means that you need to " "keep this folder with the Pylearn2 code in its current " "location. If you know what you are doing, and are very sure " "that you want to install Pylearn2 using the `install` " "command instead, please type `install`.\n") mode = None while mode not in ['', 'install', 'develop', 'cancel']: if mode is not None: print("Please try again") mode = input("Installation mode: [develop]/install/cancel: ") if mode in ['', 'develop']: self.distribution.run_command('develop') if mode == 'install': return install.run(self) cmdclass.update({'install': pylearn2_install}) setup( cmdclass=cmdclass, ext_modules=ext_modules, name='pylearn2', version='0.1dev', packages=find_packages(), description='A machine learning library built on top of Theano.', license='BSD 3-clause license', long_description=open('README.rst', 'rb').read().decode('utf8'), dependency_links=['git+http://github.com/Theano/Theano.git#egg=Theano'], install_requires=['numpy>=1.5', 'pyyaml', 'argparse', "Theano"], scripts=['bin/pylearn2-plot-monitor', 'bin/pylearn2-print-monitor', 'bin/pylearn2-show-examples', 'bin/pylearn2-show-weights', 'bin/pylearn2-train'], package_data={ '': ['*.cu', '*.cuh', '*.h'], }, )
bsd-3-clause
c42d9cf74835a430372448145c41cf23
44.724138
79
0.620161
4.12228
false
false
false
false
mrjoes/flask-admin
doc/conf.py
10
8737
# -*- coding: utf-8 -*- # # flask-admin documentation build configuration file, created by # sphinx-quickstart on Tue Nov 01 18:35:30 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('..')) import flask_admin from flask_admin import __version__ # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'flask-admin' copyright = u'2012-2013, Serge S. Koval' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = __version__ # The full version, including alpha/beta/rc tags. release = version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = [] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). add_module_names = False # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. sys.path.append(os.path.abspath('_themes')) html_theme = 'flask' html_theme_path = ['_themes'] # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. html_logo = '_static/logo.png' # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. html_favicon = 'favicon.ico' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. html_sidebars = { 'index': ['sidebarintro.html', 'sourcelink.html', 'searchbox.html'], '**': ['localtoc.html', 'relations.html', 'sourcelink.html', 'searchbox.html'] } # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a <link> tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'flask-admin' # -- Options for LaTeX output -------------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'flask-admin', u'Flask-Admin documentation', u'Serge S. Koval', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'flask-admin', u'Flask-Admin documentation', [u'Serge S. Koval'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------------ # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'flask-admin', u'Flask-Admin documentation', u'Serge S. Koval', 'Flask-Admin', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'http://docs.python.org/': None} # fall back if theme is not there try: __import__('flask_theme_support') except ImportError, e: print '-' * 74 print 'Warning: Flask themes unavailable. Building with default theme' print 'If you want the Flask themes, run this command and build again:' print print ' git submodule update --init' print '-' * 74 pygments_style = 'tango' html_theme = 'default' html_theme_options = {}
bsd-3-clause
d35e9f2ccaf4a432a95a6dc33ed31a62
31.479554
107
0.701156
3.761085
false
true
false
false
mrjoes/flask-admin
examples/layout/app.py
7
6085
import os import os.path as op from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from flask.ext import admin from flask.ext.admin.contrib.sqla import ModelView # Create application app = Flask(__name__) # Create dummy secrey key so we can use sessions app.config['SECRET_KEY'] = '123456790' # Create in-memory database app.config['DATABASE_FILE'] = 'sample_db.sqlite' app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + app.config['DATABASE_FILE'] app.config['SQLALCHEMY_ECHO'] = True db = SQLAlchemy(app) # Models class User(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.Unicode(64)) email = db.Column(db.Unicode(64)) def __unicode__(self): return self.name class Page(db.Model): id = db.Column(db.Integer, primary_key=True) title = db.Column(db.Unicode(64)) content = db.Column(db.UnicodeText) def __unicode__(self): return self.name # Customized admin interface class CustomView(ModelView): list_template = 'list.html' create_template = 'create.html' edit_template = 'edit.html' class UserAdmin(CustomView): column_searchable_list = ('name',) column_filters = ('name', 'email') # Flask views @app.route('/') def index(): return '<a href="/admin/">Click me to get to Admin!</a>' # Create admin with custom base template admin = admin.Admin(app, 'Example: Layout', base_template='layout.html') # Add views admin.add_view(UserAdmin(User, db.session)) admin.add_view(CustomView(Page, db.session)) def build_sample_db(): """ Populate a small db with some example entries. """ db.drop_all() db.create_all() first_names = [ 'Harry', 'Amelia', 'Oliver', 'Jack', 'Isabella', 'Charlie','Sophie', 'Mia', 'Jacob', 'Thomas', 'Emily', 'Lily', 'Ava', 'Isla', 'Alfie', 'Olivia', 'Jessica', 'Riley', 'William', 'James', 'Geoffrey', 'Lisa', 'Benjamin', 'Stacey', 'Lucy' ] last_names = [ 'Brown', 'Smith', 'Patel', 'Jones', 'Williams', 'Johnson', 'Taylor', 'Thomas', 'Roberts', 'Khan', 'Lewis', 'Jackson', 'Clarke', 'James', 'Phillips', 'Wilson', 'Ali', 'Mason', 'Mitchell', 'Rose', 'Davis', 'Davies', 'Rodriguez', 'Cox', 'Alexander' ] for i in range(len(first_names)): user = User() user.name = first_names[i] + " " + last_names[i] user.email = first_names[i].lower() + "@example.com" db.session.add(user) sample_text = [ { 'title': "de Finibus Bonorum et Malorum - Part I", 'content': "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor \ incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud \ exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure \ dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. \ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt \ mollit anim id est laborum." }, { 'title': "de Finibus Bonorum et Malorum - Part II", 'content': "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque \ laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto \ beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur \ aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi \ nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, \ adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam \ aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam \ corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum \ iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum \ qui dolorem eum fugiat quo voluptas nulla pariatur?" }, { 'title': "de Finibus Bonorum et Malorum - Part III", 'content': "At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium \ voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati \ cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id \ est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam \ libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod \ maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. \ Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet \ ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur \ a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis \ doloribus asperiores repellat." } ] for entry in sample_text: page = Page() page.title = entry['title'] page.content = entry['content'] db.session.add(page) db.session.commit() return if __name__ == '__main__': # Build a sample db on the fly, if one does not exist yet. app_dir = op.realpath(os.path.dirname(__file__)) database_path = op.join(app_dir, app.config['DATABASE_FILE']) if not os.path.exists(database_path): build_sample_db() # Start app app.run(debug=True)
bsd-3-clause
dc61195fe1eeb8a88db9d39e7c945a19
39.838926
120
0.624486
3.202632
false
false
false
false
mrjoes/flask-admin
setup.py
4
1819
# Fix for older setuptools import re import os from setuptools import setup, find_packages def fpath(name): return os.path.join(os.path.dirname(__file__), name) def read(fname): return open(fpath(fname)).read() def desc(): info = read('README.rst') try: return info + '\n\n' + read('doc/changelog.rst') except IOError: return info # grep flask_admin/__init__.py since python 3.x cannot import it before using 2to3 file_text = read(fpath('flask_admin/__init__.py')) def grep(attrname): pattern = r"{0}\W*=\W*'([^']+)'".format(attrname) strval, = re.findall(pattern, file_text) return strval setup( name='Flask-Admin', version=grep('__version__'), url='https://github.com/mrjoes/flask-admin/', license='BSD', author=grep('__author__'), author_email=grep('__email__'), description='Simple and extensible admin interface framework for Flask', long_description=desc(), packages=find_packages(), include_package_data=True, zip_safe=False, platforms='any', install_requires=[ 'Flask>=0.7', 'wtforms' ], tests_require=[ 'nose>=1.0', 'pillow', 'mongoengine', 'pymongo', 'wtf-peewee', 'sqlalchemy', 'flask-mongoengine', 'flask-sqlalchemy', 'flask-babelex', 'shapely', 'geoalchemy2', 'psycopg2', ], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules' ], test_suite='nose.collector' )
bsd-3-clause
9898a8092865d9967158cdcbb7b388ef
23.581081
82
0.588785
3.805439
false
false
false
false
mrjoes/flask-admin
flask_admin/form/rules.py
7
9864
from jinja2 import Markup from flask.ext.admin._compat import string_types from flask.ext.admin import helpers class BaseRule(object): """ Base form rule. All form formatting rules should derive from `BaseRule`. """ def __init__(self): self.parent = None self.rule_set = None def configure(self, rule_set, parent): """ Configure rule and assign to rule set. :param rule_set: Rule set :param parent: Parent rule (if any) """ self.parent = parent self.rule_set = rule_set return self def __call__(self, form, form_opts=None, field_args={}): """ Render rule. :param form: Form object :param form_opts: Form options :param field_args: Optional arguments that should be passed to template or the field """ raise NotImplementedError() class NestedRule(BaseRule): """ Nested rule. Can contain child rules and render them. """ def __init__(self, rules=[], separator=''): """ Constructor. :param rules: Child rule list :param separator: Default separator between rules when rendering them. """ super(NestedRule, self).__init__() self.rules = list(rules) self.separator = separator def configure(self, rule_set, parent): """ Configure rule. :param rule_set: Rule set :param parent: Parent rule (if any) """ self.rules = rule_set.configure_rules(self.rules, self) return super(NestedRule, self).configure(rule_set, parent) def __iter__(self): """ Return rules. """ return self.rules def __call__(self, form, form_opts=None, field_args={}): """ Render all children. :param form: Form object :param form_opts: Form options :param field_args: Optional arguments that should be passed to template or the field """ result = [] for r in self.rules: result.append(r(form, form_opts, field_args)) return Markup(self.separator.join(result)) class Text(BaseRule): """ Render text (or HTML snippet) from string. """ def __init__(self, text, escape=True): """ Constructor. :param text: Text to render :param escape: Should text be escaped or not. Default is `True`. """ super(Text, self).__init__() self.text = text self.escape = escape def __call__(self, form, form_opts=None, field_args={}): if self.escape: return self.text return Markup(self.text) class HTML(Text): """ Shortcut for `Text` rule with `escape` set to `False. """ def __init__(self, html): super(HTML, self).__init__(html, escape=False) class Macro(BaseRule): """ Render macro by its name from current Jinja2 context. """ def __init__(self, macro_name, **kwargs): """ Constructor. :param macro_name: Macro name :param kwargs: Default macro parameters """ super(Macro, self).__init__() self.macro_name = macro_name self.default_args = kwargs def _resolve(self, context, name): """ Resolve macro in a Jinja2 context :param context: Jinja2 context :param name: Macro name. May be full path (with dots) """ parts = name.split('.') field = context.resolve(parts[0]) if not field: return None for p in parts[1:]: field = getattr(field, p, None) if not field: return field return field def __call__(self, form, form_opts=None, field_args={}): """ Render macro rule. :param form: Form object :param form_opts: Form options :param field_args: Optional arguments that should be passed to the macro """ context = helpers.get_render_ctx() macro = self._resolve(context, self.macro_name) if not macro: raise ValueError('Cannot find macro %s in current context.' % self.macro_name) opts = dict(self.default_args) opts.update(field_args) return macro(**opts) class Container(Macro): """ Render container around child rule. """ def __init__(self, macro_name, child_rule, **kwargs): """ Constructor. :param macro_name: Macro name that will be used as a container :param child_rule: Child rule to be rendered inside of container :param kwargs: Container macro arguments """ super(Container, self).__init__(macro_name, **kwargs) self.child_rule = child_rule def configure(self, rule_set, parent): """ Configure rule. :param rule_set: Rule set :param parent: Parent rule (if any) """ self.child_rule.configure(rule_set, self) return super(Container, self).configure(rule_set, parent) def __call__(self, form, form_opts=None, field_args={}): """ Render container. :param form: Form object :param form_opts: Form options :param field_args: Optional arguments that should be passed to template or the field """ context = helpers.get_render_ctx() def caller(**kwargs): return context.call(self.child_rule, form, form_opts, kwargs) args = dict(field_args) args['caller'] = caller return super(Container, self).__call__(form, form_opts, args) class Field(Macro): """ Form field rule. """ def __init__(self, field_name, render_field='lib.render_field'): """ Constructor. :param field_name: Field name to render :param render_field: Macro that will be used to render the field. """ super(Field, self).__init__(render_field) self.field_name = field_name def __call__(self, form, form_opts=None, field_args={}): """ Render field. :param form: Form object :param form_opts: Form options :param field_args: Optional arguments that should be passed to template or the field """ field = getattr(form, self.field_name, None) if field is None: raise ValueError('Form %s does not have field %s' % (form, self.field_name)) opts = {} if form_opts: opts.update(form_opts.widget_args.get(self.field_name, {})) opts.update(field_args) params = { 'form': form, 'field': field, 'kwargs': opts } return super(Field, self).__call__(form, form_opts, params) class Header(Macro): """ Render header text. """ def __init__(self, text, header_macro='lib.render_header'): """ Constructor. :param text: Text to render :param header_macro: Header rendering macro """ super(Header, self).__init__(header_macro, text=text) class FieldSet(NestedRule): """ Field set with header. """ def __init__(self, rules, header=None, separator=''): """ Constructor. :param rules: Child rules :param header: Header text :param separator: Child rule separator """ if header: rule_set = [Header(header)] + list(rules) else: rule_set = list(rules) super(FieldSet, self).__init__(rule_set, separator=separator) class RuleSet(object): """ Rule set. """ def __init__(self, view, rules): """ Constructor. :param view: Administrative view :param rules: Rule list """ self.view = view self.rules = self.configure_rules(rules) def convert_string(self, value): """ Convert string to rule. Override this method to change default behavior. """ return Field(value) def configure_rules(self, rules, parent=None): """ Configure all rules recursively - bind them to current RuleSet and convert string references to `Field` rules. :param rules: Rule list :param parent: Parent rule (if any) """ result = [] for r in rules: if isinstance(r, BaseRule): result.append(r.configure(self, parent)) elif isinstance(r, string_types): result.append(self.convert_string(r).configure(self, parent)) else: raise ValueError('Dont know how to convert %s' % repr(r)) return result def __iter__(self): """ Iterate through registered rules. """ for r in self.rules: yield r
bsd-3-clause
f7afbfaee5d00dcf1ae9ec5193d8975e
24.754569
90
0.503852
4.681538
false
false
false
false
johnbywater/eventsourcing
eventsourcing/tests/test_runner.py
1
8679
import os from time import sleep from typing import Type from unittest.case import TestCase from eventsourcing.postgres import PostgresDatastore from eventsourcing.system import ( MultiThreadedRunner, Runner, RunnerAlreadyStarted, SingleThreadedRunner, System, ) from eventsourcing.tests.ramdisk import tmpfile_uris from eventsourcing.tests.test_application_with_popo import BankAccounts from eventsourcing.tests.test_postgres import drop_postgres_table from eventsourcing.tests.test_processapplication import EmailNotifications class EmailNotifications2(EmailNotifications): pass class RunnerTestCase(TestCase): runner_class: Type[Runner] = Runner def test_runs_ok(self): system = System( pipes=[ [ BankAccounts, EmailNotifications, ], [ BankAccounts, EmailNotifications2, ], ] ) runner = self.runner_class(system) runner.start() with self.assertRaises(RunnerAlreadyStarted): runner.start() accounts = runner.get(BankAccounts) notifications1 = runner.get(EmailNotifications) notifications2 = runner.get(EmailNotifications2) section = notifications1.log["1,5"] self.assertEqual(len(section.items), 0, section.items) section = notifications2.log["1,5"] self.assertEqual(len(section.items), 0, section.items) for _ in range(10): accounts.open_account( full_name="Alice", email_address="alice@example.com", ) self.wait_for_runner() section = notifications1.log["1,10"] self.assertEqual(len(section.items), 10) section = notifications2.log["1,10"] self.assertEqual(len(section.items), 10) runner.stop() def wait_for_runner(self): pass class TestSingleThreadedRunner(RunnerTestCase): runner_class: Type[Runner] = SingleThreadedRunner def test_prompts_received_doesnt_accumulate_names(self): system = System( pipes=[ [ BankAccounts, EmailNotifications, ], ] ) runner = self.runner_class(system) runner.start() with self.assertRaises(RunnerAlreadyStarted): runner.start() # Check prompts_received list doesn't accumulate. runner.is_prompting = True self.assertEqual(runner.prompts_received, []) runner.receive_prompt("BankAccounts") self.assertEqual(runner.prompts_received, ["BankAccounts"]) runner.receive_prompt("BankAccounts") self.assertEqual(runner.prompts_received, ["BankAccounts"]) runner.is_prompting = False class TestMultiThreadedRunner(RunnerTestCase): runner_class = MultiThreadedRunner def wait_for_runner(self): sleep(0.1) class BrokenInitialisation(EmailNotifications): def __init__(self, *args, **kwargs): raise Exception("Just testing error handling when initialisation is broken") class BrokenProcessing(EmailNotifications): def pull_and_process(self, name: str) -> None: raise Exception("Just testing error handling when processing is broken") def test_stops_if_app_initialisation_is_broken(self): system = System( pipes=[ [ BankAccounts, TestMultiThreadedRunner.BrokenInitialisation, ], ] ) runner = self.runner_class(system) with self.assertRaises(Exception) as cm: runner.start() self.assertEqual( cm.exception.args[0], "Thread for 'BrokenInitialisation' failed to start" ) self.assertTrue(runner.has_stopped) def test_stops_if_app_processing_is_broken(self): system = System( pipes=[ [ BankAccounts, TestMultiThreadedRunner.BrokenProcessing, ], ] ) runner = self.runner_class(system) runner.start() accounts = runner.get(BankAccounts) accounts.open_account( full_name="Alice", email_address="alice@example.com", ) self.wait_for_runner() self.assertTrue(runner.has_stopped) def test_prompts_received_doesnt_accumulate_names(self): system = System( pipes=[ [ BankAccounts, TestMultiThreadedRunner.BrokenProcessing, ], ] ) runner = self.runner_class(system) runner.start() runner.stop() for thread in runner.threads.values(): # Check the prompted names don't accumulate. self.assertEqual(thread.prompted_names, []) thread.receive_prompt("LeaderName") self.assertEqual(thread.prompted_names, ["LeaderName"]) thread.receive_prompt("LeaderName") self.assertEqual(thread.prompted_names, ["LeaderName"]) class TestMultiThreadedRunnerWithSQLiteFileBased(TestMultiThreadedRunner): def setUp(self): os.environ["INFRASTRUCTURE_FACTORY"] = "eventsourcing.sqlite:Factory" uris = tmpfile_uris() os.environ["BANKACCOUNTS_SQLITE_DBNAME"] = next(uris) os.environ["EMAILNOTIFICATIONS_SQLITE_DBNAME"] = next(uris) os.environ["EMAILNOTIFICATIONS2_SQLITE_DBNAME"] = next(uris) os.environ["BROKENPROCESSING_SQLITE_DBNAME"] = next(uris) def tearDown(self): del os.environ["INFRASTRUCTURE_FACTORY"] del os.environ["BANKACCOUNTS_SQLITE_DBNAME"] del os.environ["EMAILNOTIFICATIONS_SQLITE_DBNAME"] del os.environ["EMAILNOTIFICATIONS2_SQLITE_DBNAME"] del os.environ["BROKENPROCESSING_SQLITE_DBNAME"] def test_runs_ok(self): super().test_runs_ok() class TestMultiThreadedRunnerWithSQLiteInMemory(TestMultiThreadedRunner): def setUp(self): os.environ["INFRASTRUCTURE_FACTORY"] = "eventsourcing.sqlite:Factory" os.environ[ "BANKACCOUNTS_SQLITE_DBNAME" ] = "file:bankaccounts?mode=memory&cache=shared" os.environ[ "EMAILNOTIFICATIONS_SQLITE_DBNAME" ] = "file:emailnotifications1?mode=memory&cache=shared" os.environ[ "EMAILNOTIFICATIONS2_SQLITE_DBNAME" ] = "file:emailnotifications2?mode=memory&cache=shared" os.environ[ "BROKENPROCESSING_SQLITE_DBNAME" ] = "file:brokenprocessing?mode=memory&cache=shared" def tearDown(self): del os.environ["INFRASTRUCTURE_FACTORY"] del os.environ["BANKACCOUNTS_SQLITE_DBNAME"] del os.environ["EMAILNOTIFICATIONS_SQLITE_DBNAME"] del os.environ["EMAILNOTIFICATIONS2_SQLITE_DBNAME"] del os.environ["BROKENPROCESSING_SQLITE_DBNAME"] def test_runs_ok(self): super().test_runs_ok() class TestMultiThreadedRunnerWithPostgres(TestMultiThreadedRunner): def setUp(self): os.environ["POSTGRES_DBNAME"] = "eventsourcing" os.environ["POSTGRES_HOST"] = "127.0.0.1" os.environ["POSTGRES_PORT"] = "5432" os.environ["POSTGRES_USER"] = "eventsourcing" os.environ["POSTGRES_PASSWORD"] = "eventsourcing" db = PostgresDatastore( os.getenv("POSTGRES_DBNAME"), os.getenv("POSTGRES_HOST"), os.getenv("POSTGRES_PORT"), os.getenv("POSTGRES_USER"), os.getenv("POSTGRES_PASSWORD"), ) drop_postgres_table(db, "bankaccounts_events") drop_postgres_table(db, "emailnotifications_events") drop_postgres_table(db, "emailnotifications_tracking") drop_postgres_table(db, "emailnotifications2_events") drop_postgres_table(db, "emailnotifications2_tracking") drop_postgres_table(db, "brokenprocessing_events") drop_postgres_table(db, "brokenprocessing_tracking") os.environ["INFRASTRUCTURE_FACTORY"] = "eventsourcing.postgres:Factory" def tearDown(self): del os.environ["INFRASTRUCTURE_FACTORY"] del os.environ["POSTGRES_DBNAME"] del os.environ["POSTGRES_HOST"] del os.environ["POSTGRES_PORT"] del os.environ["POSTGRES_USER"] del os.environ["POSTGRES_PASSWORD"] def test_prompts_received_doesnt_accumulate_names(self): super().test_prompts_received_doesnt_accumulate_names() del RunnerTestCase
bsd-3-clause
b6fa5c646db59986350ad0142678792a
31.384328
88
0.619887
4.099669
false
true
false
false
jupyterhub/oauthenticator
oauthenticator/generic.py
1
5274
""" Custom Authenticator to use generic OAuth2 with JupyterHub """ import os from functools import reduce from jupyterhub.auth import LocalAuthenticator from tornado.httpclient import AsyncHTTPClient from traitlets import Bool, List, Unicode, Union, default from .oauth2 import OAuthenticator from .traitlets import Callable class GenericOAuthenticator(OAuthenticator): _deprecated_oauth_aliases = { "username_key": ("username_claim", "16.0.0"), "extra_params": ("token_params", "16.0.0"), **OAuthenticator._deprecated_oauth_aliases, } login_service = Unicode("OAuth 2.0", config=True) claim_groups_key = Union( [Unicode(os.environ.get('OAUTH2_GROUPS_KEY', 'groups')), Callable()], config=True, help=""" Userdata groups claim key from returned json for USERDATA_URL. Can be a string key name (use periods for nested keys), or a callable that accepts the returned json (as a dict) and returns the groups list. """, ) allowed_groups = List( Unicode(), config=True, help="Automatically allow members of selected groups", ) admin_groups = List( Unicode(), config=True, help="Groups whose members should have Jupyterhub admin privileges", ) username_key = Union( [Unicode(os.environ.get('OAUTH2_USERNAME_KEY', 'username')), Callable()], config=True, help="""Deprecated, use `GenericOAuthenticator.username_claim`""", ) username_claim = Union( [Unicode(os.environ.get('OAUTH2_USERNAME_KEY', 'username')), Callable()], config=True, help=""" Userdata username key from returned json for USERDATA_URL. Can be a string key name or a callable that accepts the returned json (as a dict) and returns the username. The callable is useful e.g. for extracting the username from a nested object in the response. """, ) tls_verify = Bool( os.environ.get('OAUTH2_TLS_VERIFY', 'True').lower() in {'true', '1'}, config=True, help="Disable TLS verification on http request", ) @default("basic_auth") def _basic_auth_default(self): return os.environ.get('OAUTH2_BASIC_AUTH', 'True').lower() in {'true', '1'} @default("http_client") def _default_http_client(self): return AsyncHTTPClient( force_instance=True, defaults=dict(validate_cert=self.tls_verify) ) @staticmethod def check_user_in_groups(member_groups, allowed_groups): return bool(set(member_groups) & set(allowed_groups)) def user_info_to_username(self, user_info): if callable(self.username_claim): username = self.username_claim(user_info) else: username = user_info.get(self.username_claim, None) if not username: message = (f"No {self.username_claim} found in {user_info}",) self.log.error(message) raise ValueError(message) return username async def user_is_authorized(self, auth_model): user_info = auth_model["auth_state"][self.user_auth_state_key] if self.allowed_groups: self.log.info( 'Validating if user claim groups match any of {}'.format( self.allowed_groups ) ) if callable(self.claim_groups_key): groups = self.claim_groups_key(user_info) else: try: groups = reduce( dict.get, self.claim_groups_key.split("."), user_info ) except TypeError: # This happens if a nested key does not exist (reduce trying to call None.get) self.log.error( "The key {} does not exist in the user token, or it is set to null".format( self.claim_groups_key ) ) groups = None if not groups: self.log.error( "No claim groups found for user! Something wrong with the `claim_groups_key` {}? {}".format( self.claim_groups_key, user_info ) ) return False if not self.check_user_in_groups(groups, self.allowed_groups): return False return True async def update_auth_model(self, auth_model): user_info = auth_model["auth_state"][self.user_auth_state_key] if self.allowed_groups: if callable(self.claim_groups_key): groups = self.claim_groups_key(user_info) else: groups = user_info.get(self.claim_groups_key) # User has been checked to be in allowed_groups too if we're here if groups: auth_model['admin'] = self.check_user_in_groups( groups, self.admin_groups ) return auth_model class LocalGenericOAuthenticator(LocalAuthenticator, GenericOAuthenticator): """A version that mixes in local system user creation""" pass
bsd-3-clause
352b4de623ef78ce6f7602e5a85ff97a
33.025806
112
0.576981
4.312347
false
false
false
false
flask-admin/flask-admin
flask_admin/contrib/sqla/validators.py
1
3153
from sqlalchemy.orm.exc import NoResultFound from wtforms import ValidationError try: from wtforms.validators import InputRequired except ImportError: from wtforms.validators import Required as InputRequired from flask_admin._compat import filter_list class Unique(object): """Checks field value unicity against specified table field. :param get_session: A function that return a SQAlchemy Session. :param model: The model to check unicity against. :param column: The unique column. :param message: The error message. """ field_flags = ('unique', ) def __init__(self, db_session, model, column, message=None): self.db_session = db_session self.model = model self.column = column self.message = message def __call__(self, form, field): # databases allow multiple NULL values for unique columns if field.data is None: return try: obj = (self.db_session.query(self.model) .filter(self.column == field.data) .one()) if not hasattr(form, '_obj') or not form._obj == obj: if self.message is None: self.message = field.gettext(u'Already exists.') raise ValidationError(self.message) except NoResultFound: pass class ItemsRequired(InputRequired): """ A version of the ``InputRequired`` validator that works with relations, to require a minimum number of related items. """ def __init__(self, min=1, message=None): super(ItemsRequired, self).__init__(message=message) self.min = min def __call__(self, form, field): items = filter_list(lambda e: not field.should_delete(e), field.entries) if len(items) < self.min: if self.message is None: message = field.ngettext( u"At least %(num)d item is required", u"At least %(num)d items are required", self.min ) else: message = self.message raise ValidationError(message) def valid_currency(form, field): from sqlalchemy_utils import Currency try: Currency(field.data) except (TypeError, ValueError): raise ValidationError(field.gettext(u'Not a valid ISO currency code (e.g. USD, EUR, CNY).')) def valid_color(form, field): from colour import Color try: Color(field.data) except (ValueError): raise ValidationError(field.gettext(u'Not a valid color (e.g. "red", "#f00", "#ff0000").')) class TimeZoneValidator(object): """ Tries to coerce a TimZone object from input data """ def __init__(self, coerce_function): self.coerce_function = coerce_function def __call__(self, form, field): try: self.coerce_function(str(field.data)) except Exception: msg = u'Not a valid timezone (e.g. "America/New_York", "Africa/Johannesburg", "Asia/Singapore").' raise ValidationError(field.gettext(msg))
bsd-3-clause
ece3756d62a87ccadeb14d5c1c3ef0c4
29.911765
109
0.601332
4.220884
false
false
false
false
flask-admin/flask-admin
flask_admin/contrib/peewee/filters.py
9
9955
from flask_admin.babel import lazy_gettext from flask_admin.model import filters from .tools import parse_like_term class BasePeeweeFilter(filters.BaseFilter): """ Base Peewee filter. """ def __init__(self, column, name, options=None, data_type=None): """ Constructor. :param column: Model field :param name: Display name :param options: Fixed set of options :param data_type: Client data type """ super(BasePeeweeFilter, self).__init__(name, options, data_type) self.column = column # Common filters class FilterEqual(BasePeeweeFilter): def apply(self, query, value): return query.filter(self.column == value) def operation(self): return lazy_gettext('equals') class FilterNotEqual(BasePeeweeFilter): def apply(self, query, value): return query.filter(self.column != value) def operation(self): return lazy_gettext('not equal') class FilterLike(BasePeeweeFilter): def apply(self, query, value): term = parse_like_term(value) return query.filter(self.column ** term) def operation(self): return lazy_gettext('contains') class FilterNotLike(BasePeeweeFilter): def apply(self, query, value): term = parse_like_term(value) return query.filter(~(self.column ** term)) def operation(self): return lazy_gettext('not contains') class FilterGreater(BasePeeweeFilter): def apply(self, query, value): return query.filter(self.column > value) def operation(self): return lazy_gettext('greater than') class FilterSmaller(BasePeeweeFilter): def apply(self, query, value): return query.filter(self.column < value) def operation(self): return lazy_gettext('smaller than') class FilterEmpty(BasePeeweeFilter, filters.BaseBooleanFilter): def apply(self, query, value): if value == '1': return query.filter(self.column >> None) else: return query.filter(~(self.column >> None)) def operation(self): return lazy_gettext('empty') class FilterInList(BasePeeweeFilter): def __init__(self, column, name, options=None, data_type=None): super(FilterInList, self).__init__(column, name, options, data_type='select2-tags') def clean(self, value): return [v.strip() for v in value.split(',') if v.strip()] def apply(self, query, value): return query.filter(self.column << (value or [None])) def operation(self): return lazy_gettext('in list') class FilterNotInList(FilterInList): def apply(self, query, value): # NOT IN can exclude NULL values, so "or_ == None" needed to be added return query.filter(~(self.column << (value or [None])) | (self.column >> None)) def operation(self): return lazy_gettext('not in list') # Customized type filters class BooleanEqualFilter(FilterEqual, filters.BaseBooleanFilter): def clean(self, value): return int(value) class BooleanNotEqualFilter(FilterNotEqual, filters.BaseBooleanFilter): def clean(self, value): return int(value) class IntEqualFilter(FilterEqual, filters.BaseIntFilter): pass class IntNotEqualFilter(FilterNotEqual, filters.BaseIntFilter): pass class IntGreaterFilter(FilterGreater, filters.BaseIntFilter): pass class IntSmallerFilter(FilterSmaller, filters.BaseIntFilter): pass class IntInListFilter(filters.BaseIntListFilter, FilterInList): pass class IntNotInListFilter(filters.BaseIntListFilter, FilterNotInList): pass class FloatEqualFilter(FilterEqual, filters.BaseFloatFilter): pass class FloatNotEqualFilter(FilterNotEqual, filters.BaseFloatFilter): pass class FloatGreaterFilter(FilterGreater, filters.BaseFloatFilter): pass class FloatSmallerFilter(FilterSmaller, filters.BaseFloatFilter): pass class FloatInListFilter(filters.BaseFloatListFilter, FilterInList): pass class FloatNotInListFilter(filters.BaseFloatListFilter, FilterNotInList): pass class DateEqualFilter(FilterEqual, filters.BaseDateFilter): pass class DateNotEqualFilter(FilterNotEqual, filters.BaseDateFilter): pass class DateGreaterFilter(FilterGreater, filters.BaseDateFilter): pass class DateSmallerFilter(FilterSmaller, filters.BaseDateFilter): pass class DateBetweenFilter(BasePeeweeFilter, filters.BaseDateBetweenFilter): def __init__(self, column, name, options=None, data_type=None): super(DateBetweenFilter, self).__init__(column, name, options, data_type='daterangepicker') def apply(self, query, value): start, end = value return query.filter(self.column.between(start, end)) class DateNotBetweenFilter(DateBetweenFilter): def apply(self, query, value): start, end = value return query.filter(~(self.column.between(start, end))) def operation(self): return lazy_gettext('not between') class DateTimeEqualFilter(FilterEqual, filters.BaseDateTimeFilter): pass class DateTimeNotEqualFilter(FilterNotEqual, filters.BaseDateTimeFilter): pass class DateTimeGreaterFilter(FilterGreater, filters.BaseDateTimeFilter): pass class DateTimeSmallerFilter(FilterSmaller, filters.BaseDateTimeFilter): pass class DateTimeBetweenFilter(BasePeeweeFilter, filters.BaseDateTimeBetweenFilter): def __init__(self, column, name, options=None, data_type=None): super(DateTimeBetweenFilter, self).__init__(column, name, options, data_type='datetimerangepicker') def apply(self, query, value): start, end = value return query.filter(self.column.between(start, end)) class DateTimeNotBetweenFilter(DateTimeBetweenFilter): def apply(self, query, value): start, end = value return query.filter(~(self.column.between(start, end))) def operation(self): return lazy_gettext('not between') class TimeEqualFilter(FilterEqual, filters.BaseTimeFilter): pass class TimeNotEqualFilter(FilterNotEqual, filters.BaseTimeFilter): pass class TimeGreaterFilter(FilterGreater, filters.BaseTimeFilter): pass class TimeSmallerFilter(FilterSmaller, filters.BaseTimeFilter): pass class TimeBetweenFilter(BasePeeweeFilter, filters.BaseTimeBetweenFilter): def __init__(self, column, name, options=None, data_type=None): super(TimeBetweenFilter, self).__init__(column, name, options, data_type='timerangepicker') def apply(self, query, value): start, end = value return query.filter(self.column.between(start, end)) class TimeNotBetweenFilter(TimeBetweenFilter): def apply(self, query, value): start, end = value return query.filter(~(self.column.between(start, end))) def operation(self): return lazy_gettext('not between') # Base peewee filter field converter class FilterConverter(filters.BaseFilterConverter): strings = (FilterLike, FilterNotLike, FilterEqual, FilterNotEqual, FilterEmpty, FilterInList, FilterNotInList) int_filters = (IntEqualFilter, IntNotEqualFilter, IntGreaterFilter, IntSmallerFilter, FilterEmpty, IntInListFilter, IntNotInListFilter) float_filters = (FloatEqualFilter, FloatNotEqualFilter, FloatGreaterFilter, FloatSmallerFilter, FilterEmpty, FloatInListFilter, FloatNotInListFilter) bool_filters = (BooleanEqualFilter, BooleanNotEqualFilter) date_filters = (DateEqualFilter, DateNotEqualFilter, DateGreaterFilter, DateSmallerFilter, DateBetweenFilter, DateNotBetweenFilter, FilterEmpty) datetime_filters = (DateTimeEqualFilter, DateTimeNotEqualFilter, DateTimeGreaterFilter, DateTimeSmallerFilter, DateTimeBetweenFilter, DateTimeNotBetweenFilter, FilterEmpty) time_filters = (TimeEqualFilter, TimeNotEqualFilter, TimeGreaterFilter, TimeSmallerFilter, TimeBetweenFilter, TimeNotBetweenFilter, FilterEmpty) def convert(self, type_name, column, name): filter_name = type_name.lower() if filter_name in self.converters: return self.converters[filter_name](column, name) return None @filters.convert('CharField', 'TextField') def conv_string(self, column, name): return [f(column, name) for f in self.strings] @filters.convert('BooleanField') def conv_bool(self, column, name): return [f(column, name) for f in self.bool_filters] @filters.convert('IntegerField', 'BigIntegerField', 'PrimaryKeyField') def conv_int(self, column, name): return [f(column, name) for f in self.int_filters] @filters.convert('DecimalField', 'FloatField', 'DoubleField') def conv_float(self, column, name): return [f(column, name) for f in self.float_filters] @filters.convert('DateField') def conv_date(self, column, name): return [f(column, name) for f in self.date_filters] @filters.convert('DateTimeField') def conv_datetime(self, column, name): return [f(column, name) for f in self.datetime_filters] @filters.convert('TimeField') def conv_time(self, column, name): return [f(column, name) for f in self.time_filters]
bsd-3-clause
c1db3de5827d164919eb0d62f8ceddef
28.279412
91
0.655851
4.161789
false
false
false
false
flask-admin/flask-admin
flask_admin/model/typefmt.py
1
2170
import json from markupsafe import Markup from flask_admin._compat import text_type try: from enum import Enum except ImportError: Enum = None def null_formatter(view, value, name): """ Return `NULL` as the string for `None` value :param value: Value to check """ return Markup('<i>NULL</i>') def empty_formatter(view, value, name): """ Return empty string for `None` value :param value: Value to check """ return '' def bool_formatter(view, value, name): """ Return check icon if value is `True` or empty string otherwise. :param value: Value to check """ glyph = 'ok-circle' if value else 'minus-sign' fa = 'fa-check-circle' if value else 'fa-minus-circle' label = f'{name}: {"true" if value else "false"}' return Markup('<span class="fa %s glyphicon glyphicon-%s icon-%s" title="%s"></span>' % (fa, glyph, glyph, label)) def list_formatter(view, values, name): """ Return string with comma separated values :param values: Value to check """ return u', '.join(text_type(v) for v in values) def enum_formatter(view, value, name): """ Return the name of the enumerated member. :param value: Value to check """ return value.name def dict_formatter(view, value, name): """ Removes unicode entities when displaying dict as string. Also unescapes non-ASCII characters stored in the JSON. :param value: Dict to convert to string """ return json.dumps(value, ensure_ascii=False) BASE_FORMATTERS = { type(None): empty_formatter, bool: bool_formatter, list: list_formatter, dict: dict_formatter, } EXPORT_FORMATTERS = { type(None): empty_formatter, list: list_formatter, dict: dict_formatter, } DETAIL_FORMATTERS = { type(None): empty_formatter, list: list_formatter, dict: dict_formatter, } if Enum is not None: BASE_FORMATTERS[Enum] = enum_formatter EXPORT_FORMATTERS[Enum] = enum_formatter DETAIL_FORMATTERS[Enum] = enum_formatter
bsd-3-clause
80cb242715f7e298efae39f61a563cc9
21.371134
118
0.616129
3.807018
false
false
false
false
flask-admin/flask-admin
flask_admin/contrib/mongoengine/typefmt.py
1
1361
from markupsafe import Markup, escape from mongoengine.base import BaseList from mongoengine.fields import GridFSProxy, ImageGridFsProxy from flask_admin.model.typefmt import BASE_FORMATTERS, list_formatter from . import helpers def grid_formatter(view, value): if not value.grid_id: return '' args = helpers.make_gridfs_args(value) return Markup( ('<a href="%(url)s" target="_blank">' + '<i class="icon-file"></i>%(name)s' + '</a> %(size)dk (%(content_type)s)') % { 'url': view.get_url('.api_file_view', **args), 'name': escape(value.name), 'size': value.length // 1024, 'content_type': escape(value.content_type) }) def grid_image_formatter(view, value): if not value.grid_id: return '' return Markup( ('<div class="image-thumbnail">' + '<a href="%(url)s" target="_blank"><img src="%(thumb)s"/></a>' + '</div>') % { 'url': view.get_url('.api_file_view', **helpers.make_gridfs_args(value)), 'thumb': view.get_url('.api_file_view', **helpers.make_thumb_args(value)), }) DEFAULT_FORMATTERS = BASE_FORMATTERS.copy() DEFAULT_FORMATTERS.update({ BaseList: list_formatter, GridFSProxy: grid_formatter, ImageGridFsProxy: grid_image_formatter })
bsd-3-clause
be217200b55f2caf08aa34f7907d006c
27.354167
86
0.589273
3.525907
false
false
false
false
flask-admin/flask-admin
flask_admin/contrib/mongoengine/fields.py
17
2575
from mongoengine.base import get_document from werkzeug.datastructures import FileStorage from wtforms import fields try: from wtforms.fields.core import _unset_value as unset_value except ImportError: from wtforms.utils import unset_value from . import widgets from flask_admin.model.fields import InlineFormField def is_empty(file_object): file_object.seek(0) first_char = file_object.read(1) file_object.seek(0) return not bool(first_char) class ModelFormField(InlineFormField): """ Customized ModelFormField for MongoEngine EmbeddedDocuments. """ def __init__(self, model, view, form_class, form_opts=None, **kwargs): super(ModelFormField, self).__init__(form_class, **kwargs) self.model = model if isinstance(self.model, str): self.model = get_document(self.model) self.view = view self.form_opts = form_opts def populate_obj(self, obj, name): candidate = getattr(obj, name, None) is_created = candidate is None if is_created: candidate = self.model() setattr(obj, name, candidate) self.form.populate_obj(candidate) self.view._on_model_change(self.form, candidate, is_created) class MongoFileField(fields.FileField): """ GridFS file field. """ widget = widgets.MongoFileInput() def __init__(self, label=None, validators=None, **kwargs): super(MongoFileField, self).__init__(label, validators, **kwargs) self._should_delete = False def process(self, formdata, data=unset_value): if formdata: marker = '_%s-delete' % self.name if marker in formdata: self._should_delete = True return super(MongoFileField, self).process(formdata, data) def populate_obj(self, obj, name): field = getattr(obj, name, None) if field is not None: # If field should be deleted, clean it up if self._should_delete: field.delete() return if isinstance(self.data, FileStorage) and not is_empty(self.data.stream): if not field.grid_id: func = field.put else: func = field.replace func(self.data.stream, filename=self.data.filename, content_type=self.data.content_type) class MongoImageField(MongoFileField): """ GridFS image field. """ widget = widgets.MongoImageInput()
bsd-3-clause
4fd5d1da791deccae990388dbb866bbd
26.98913
85
0.608155
4.12
false
false
false
false
flask-admin/flask-admin
setup.py
1
2267
# Fix for older setuptools import re import os import sys from setuptools import setup, find_packages def fpath(name): return os.path.join(os.path.dirname(__file__), name) def read(fname): return open(fpath(fname)).read() def desc(): info = read('README.rst') try: return info + '\n\n' + read('doc/changelog.rst') except IOError: return info # grep flask_admin/__init__.py since python 3.x cannot import it before using 2to3 file_text = read(fpath('flask_admin/__init__.py')) def grep(attrname): pattern = r"{0}\W*=\W*'([^']+)'".format(attrname) strval, = re.findall(pattern, file_text) return strval extras_require = { 'aws': ['boto'], 'azure': ['azure-storage-blob'] } install_requires = [ 'Flask>=0.7', 'wtforms' ] setup( name='Flask-Admin', version=grep('__version__'), url='https://github.com/flask-admin/flask-admin/', license='BSD', python_requires='>=3.6', author=grep('__author__'), author_email=grep('__email__'), description='Simple and extensible admin interface framework for Flask', long_description=desc(), packages=find_packages(), include_package_data=True, zip_safe=False, platforms='any', extras_require=extras_require, install_requires=install_requires, tests_require=[ 'pytest', 'pillow>=3.3.2', 'mongoengine', 'pymongo', 'wtf-peewee', 'sqlalchemy', 'flask-mongoengine<=0.21.0', 'flask-sqlalchemy', 'flask-babelex', 'shapely', 'geoalchemy2', 'psycopg2', ], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Software Development :: Libraries :: Python Modules', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', ], test_suite='flask_admin.tests' )
bsd-3-clause
65177c6e4af44b43f53f1ee8cd7f2409
23.912088
82
0.591972
3.759536
false
false
false
false
flask-admin/flask-admin
flask_admin/contrib/rediscli.py
1
5165
import logging import shlex from flask import request from markupsafe import Markup from flask_admin.base import BaseView, expose from flask_admin.babel import gettext # Set up logger log = logging.getLogger("flask-admin.redis") class CommandError(Exception): """ RedisCli error exception. """ pass class TextWrapper(str): """ Small text wrapper for result formatter to distinguish between different string types. """ pass class RedisCli(BaseView): """ Simple redis console. To use it, simply pass `Redis` connection object to the constructor. """ remapped_commands = { 'del': 'delete' } """ List of redis remapped commands. """ excluded_commands = set(('pubsub', 'set_response_callback', 'from_url')) """ List of excluded commands. """ def __init__(self, redis, name=None, category=None, endpoint=None, url=None): """ Constructor. :param redis: Redis connection :param name: View name. If not provided, will use the model class name :param category: View category :param endpoint: Base endpoint. If not provided, will use the model name + 'view'. For example if model name was 'User', endpoint will be 'userview' :param url: Base URL. If not provided, will use endpoint as a URL. """ super(RedisCli, self).__init__(name, category, endpoint, url) self.redis = redis self.commands = {} self._inspect_commands() self._contribute_commands() def _inspect_commands(self): """ Inspect connection object and extract command names. """ for name in dir(self.redis): if not name.startswith('_'): attr = getattr(self.redis, name) if callable(attr) and name not in self.excluded_commands: doc = (getattr(attr, '__doc__', '') or '').strip() self.commands[name] = (attr, doc) for new, old in self.remapped_commands.items(): self.commands[new] = self.commands[old] def _contribute_commands(self): """ Contribute custom commands. """ self.commands['help'] = (self._cmd_help, 'Help!') def _execute_command(self, name, args): """ Execute single command. :param name: Command name :param args: Command arguments """ # Do some remapping new_cmd = self.remapped_commands.get(name) if new_cmd: name = new_cmd # Execute command if name not in self.commands: return self._error(gettext('Cli: Invalid command.')) handler, _ = self.commands[name] return self._result(handler(*args)) def _parse_cmd(self, cmd): """ Parse command by using shlex module. :param cmd: Command to parse """ return tuple(shlex.split(cmd)) def _error(self, msg): """ Format error message as HTTP response. :param msg: Message to format """ return Markup('<div class="error">%s</div>' % msg) def _result(self, result): """ Format result message as HTTP response. :param msg: Result to format. """ return self.render('admin/rediscli/response.html', type_name=lambda d: type(d).__name__, result=result) # Commands def _cmd_help(self, *args): """ Help command implementation. """ if not args: help = 'Usage: help <command>.\nList of supported commands: ' help += ', '.join(n for n in sorted(self.commands)) return TextWrapper(help) cmd = args[0] if cmd not in self.commands: raise CommandError('Invalid command.') help = self.commands[cmd][1] if not help: return TextWrapper('Command does not have any help.') return TextWrapper(help) # Views @expose('/') def console_view(self): """ Console view. """ return self.render('admin/rediscli/console.html') @expose('/run/', methods=('POST',)) def execute_view(self): """ AJAX API. """ try: cmd = request.form.get('cmd') if not cmd: return self._error('Cli: Empty command.') parts = self._parse_cmd(cmd) if not parts: return self._error('Cli: Failed to parse command.') return self._execute_command(parts[0], parts[1:]) except CommandError as err: return self._error('Cli: %s' % err) except Exception as ex: log.exception(ex) return self._error('Cli: %s' % ex)
bsd-3-clause
00174594766ed0e26e1f99e469ae414b
25.623711
81
0.522362
4.566755
false
false
false
false
flask-admin/flask-admin
flask_admin/model/template.py
1
3518
from flask_admin._compat import pass_context, string_types, reduce from flask_admin.babel import gettext class BaseListRowAction(object): def __init__(self, title=None): self.title = title def render(self, context, row_id, row): raise NotImplementedError() @pass_context def render_ctx(self, context, row_id, row): return self.render(context, row_id, row) def _resolve_symbol(self, context, symbol): if '.' in symbol: parts = symbol.split('.') m = context.resolve(parts[0]) return reduce(getattr, parts[1:], m) else: return context.resolve(symbol) class LinkRowAction(BaseListRowAction): def __init__(self, icon_class, url, title=None): super(LinkRowAction, self).__init__(title=title) self.url = url self.icon_class = icon_class def render(self, context, row_id, row): m = self._resolve_symbol(context, 'row_actions.link') if isinstance(self.url, string_types): url = self.url.format(row_id=row_id) else: url = self.url(self, row_id, row) return m(self, url) class EndpointLinkRowAction(BaseListRowAction): def __init__(self, icon_class, endpoint, title=None, id_arg='id', url_args=None): super(EndpointLinkRowAction, self).__init__(title=title) self.icon_class = icon_class self.endpoint = endpoint self.id_arg = id_arg self.url_args = url_args def render(self, context, row_id, row): m = self._resolve_symbol(context, 'row_actions.link') get_url = self._resolve_symbol(context, 'get_url') kwargs = dict(self.url_args) if self.url_args else {} kwargs[self.id_arg] = row_id url = get_url(self.endpoint, **kwargs) return m(self, url) class TemplateLinkRowAction(BaseListRowAction): def __init__(self, template_name, title=None): super(TemplateLinkRowAction, self).__init__(title=title) self.template_name = template_name def render(self, context, row_id, row): m = self._resolve_symbol(context, self.template_name) return m(self, row_id, row) class ViewRowAction(TemplateLinkRowAction): def __init__(self): super(ViewRowAction, self).__init__( 'row_actions.view_row', gettext('View Record')) class ViewPopupRowAction(TemplateLinkRowAction): def __init__(self): super(ViewPopupRowAction, self).__init__( 'row_actions.view_row_popup', gettext('View Record')) class EditRowAction(TemplateLinkRowAction): def __init__(self): super(EditRowAction, self).__init__( 'row_actions.edit_row', gettext('Edit Record')) class EditPopupRowAction(TemplateLinkRowAction): def __init__(self): super(EditPopupRowAction, self).__init__( 'row_actions.edit_row_popup', gettext('Edit Record')) class DeleteRowAction(TemplateLinkRowAction): def __init__(self): super(DeleteRowAction, self).__init__( 'row_actions.delete_row', gettext('Delete Record')) # Macro helper def macro(name): ''' Jinja2 macro list column formatter. :param name: Macro name in the current template ''' def inner(view, context, model, column): m = context.resolve(name) if not m: return m return m(model=model, column=column) return inner
bsd-3-clause
c7aad2291baa9d85a7b8d47987defb83
26.920635
85
0.608584
3.786868
false
false
false
false
dcramer/sentry-old
sentry/interfaces.py
1
3589
""" sentry.interfaces ~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import urlparse from flask import render_template # unserialization concept is based on pickle class _EmptyClass(object): pass def unserialize(klass, data): value = _EmptyClass() value.__class__ = klass value.__setstate__(data) return value class Interface(object): """ An interface is a structured represntation of data, which may render differently than the default ``extra`` metadata in an event. """ def __setstate__(self, data): self.__dict__.update(self.unserialize(data)) def __getstate__(self): return self.serialize() def unserialize(self, data): return data def serialize(self): return {} def to_html(self, event): return '' class Message(Interface): def __init__(self, message, params): self.message = message self.params = params def serialize(self): return { 'message': self.message, 'params': self.params, } class Query(Interface): def __init__(self, query, engine): self.query = query self.engine = engine def serialize(self): return { 'query': self.query, 'engine': self.engine, } class Stacktrace(Interface): def __init__(self, frames): self.frames = frames def serialize(self): return { 'frames': self.frames, } def to_html(self, event): return render_template('sentry/partial/interfaces/stacktrace.html', **{ 'frames': self.frames, }) class Exception(Interface): def __init__(self, type, value): self.type = type self.value = value def serialize(self): return { 'type': self.type, 'value': self.value, } def to_html(self, event): return render_template('sentry/partial/interfaces/exception.html', **{ 'exception_value': self.value, 'exception_type': self.type, }) class Http(Interface): # methods as defined by http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html METHODS = ('GET', 'POST', 'PUT', 'OPTIONS', 'HEAD', 'DELETE', 'TRACE', 'CONNECT') def __init__(self, url, method, data=None, querystring=None, **kwargs): if data is None: data = {} method = method.upper() assert method in self.METHODS urlparts = urlparse.urlsplit(url) if not querystring: # define querystring from url querystring = urlparts.query elif querystring.startswith('?'): # remove '?' prefix querystring = querystring[1:] self.url = '%s://%s%s' % (urlparts.scheme, urlparts.netloc, urlparts.path) self.method = method self.data = data self.querystring = querystring def serialize(self): return { 'url': self.url, 'method': self.method, 'data': self.data, 'querystring': self.querystring, } def to_html(self, event): return render_template('sentry/partial/interfaces/http.html', **{ 'full_url': '?'.join(filter(None, [self.url, self.querystring])), 'url': self.url, 'method': self.method, 'data': self.data, 'querystring': self.querystring, })
bsd-3-clause
cca07ac66bebf29e8ba74e1cab5122dd
24.635714
85
0.558651
4.153935
false
false
false
false
dcramer/sentry-old
sentry/utils/__init__.py
1
8378
""" sentry.utils ~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import datetime import hashlib import logging import sys import uuid import warnings from pprint import pformat from types import ClassType, TypeType import sentry from sentry.utils.encoding import force_unicode def construct_checksum(level=logging.ERROR, class_name='', traceback='', message='', **kwargs): checksum = hashlib.md5(str(level)) checksum.update(class_name or '') if traceback: traceback = '\n'.join(traceback.split('\n')[:-3]) message = traceback or message if isinstance(message, unicode): message = message.encode('utf-8', 'replace') checksum.update(message) return checksum.hexdigest() def varmap(func, var, context=None): if context is None: context = {} objid = id(var) if objid in context: return func('<...>') context[objid] = 1 if isinstance(var, dict): ret = dict((k, varmap(func, v, context)) for k, v in var.iteritems()) elif isinstance(var, (list, tuple)): ret = [varmap(func, f, context) for f in var] else: ret = func(var) del context[objid] return ret def has_sentry_metadata(value): try: return callable(getattr(value, '__sentry__', None)) except: return False def transform(value, stack=[], context=None): # TODO: make this extendable # TODO: include some sane defaults, like UUID # TODO: dont coerce strings to unicode, leave them as strings if context is None: context = {} objid = id(value) if objid in context: return '<...>' context[objid] = 1 if any(value is s for s in stack): ret = 'cycle' transform_rec = lambda o: transform(o, stack + [value], context) if isinstance(value, (tuple, list, set, frozenset)): try: ret = type(value)(transform_rec(o) for o in value[:]) except: ret = tuple(transform_rec(o) for o in value) elif isinstance(value, uuid.UUID): ret = repr(value) elif isinstance(value, datetime.datetime): ret = value.strftime('%Y-%m-%dT%H:%M:%S.%f') elif isinstance(value, datetime.date): ret = value.strftime('%Y-%m-%d') elif isinstance(value, dict): ret = dict((k, transform_rec(v)) for k, v in value.iteritems()) elif isinstance(value, unicode): ret = to_unicode(value) elif isinstance(value, str): try: ret = str(value) except: ret = to_unicode(value) elif not isinstance(value, (ClassType, TypeType)) and \ has_sentry_metadata(value): ret = transform_rec(value.__sentry__()) elif not isinstance(value, (int, bool)) and value is not None: # XXX: we could do transform(repr(value)) here ret = to_unicode(value) else: ret = value del context[objid] return ret def to_unicode(value): try: value = unicode(force_unicode(value)) except (UnicodeEncodeError, UnicodeDecodeError): value = '(Error decoding value)' except Exception: # in some cases we get a different exception try: value = str(repr(type(value))) except Exception: value = '(Error decoding value)' return value class _Missing(object): def __repr__(self): return 'no value' def __reduce__(self): return '_missing' _missing = _Missing() class cached_property(object): # This is borrowed from werkzeug : http://bytebucket.org/mitsuhiko/werkzeug-main """A decorator that converts a function into a lazy property. The function wrapped is called the first time to retrieve the result and then that calculated result is used the next time you access the value:: class Foo(object): @cached_property def foo(self): # calculate something important here return 42 The class has to have a `__dict__` in order for this property to work. .. versionchanged:: 0.6 the `writeable` attribute and parameter was deprecated. If a cached property is writeable or not has to be documented now. For performance reasons the implementation does not honor the writeable setting and will always make the property writeable. """ # implementation detail: this property is implemented as non-data # descriptor. non-data descriptors are only invoked if there is # no entry with the same name in the instance's __dict__. # this allows us to completely get rid of the access function call # overhead. If one choses to invoke __get__ by hand the property # will still work as expected because the lookup logic is replicated # in __get__ for manual invocation. def __init__(self, func, name=None, doc=None, writeable=False): if writeable: warnings.warn(DeprecationWarning('the writeable argument to the ' 'cached property is a noop since 0.6 ' 'because the property is writeable ' 'by default for performance reasons')) self.__name__ = name or func.__name__ self.__module__ = func.__module__ self.__doc__ = doc or func.__doc__ self.func = func def __get__(self, obj, type=None): if obj is None: return self value = obj.__dict__.get(self.__name__, _missing) if value is _missing: value = self.func(obj) obj.__dict__[self.__name__] = value return value def get_versions(module_list=[]): # TODO: ext_module_list = set() for m in module_list: parts = m.split('.') ext_module_list.update('.'.join(parts[:idx]) for idx in xrange(1, len(parts)+1)) versions = {} for module_name in ext_module_list: __import__(module_name) app = sys.modules[module_name] if hasattr(app, 'get_version'): get_version = app.get_version if callable(get_version): version = get_version() else: version = get_version elif hasattr(app, 'VERSION'): version = app.VERSION elif hasattr(app, '__version__'): version = app.__version__ else: continue if isinstance(version, (list, tuple)): version = '.'.join(str(o) for o in version) versions[module_name] = version return versions def shorten(var): var = transform(var) if isinstance(var, basestring) and len(var) > sentry.app.config['MAX_LENGTH_STRING']: var = var[:sentry.app.config['MAX_LENGTH_STRING']] + '...' elif isinstance(var, (list, tuple, set, frozenset)) and len(var) > sentry.app.config['MAX_LENGTH_LIST']: # TODO: we should write a real API for storing some metadata with vars when # we get around to doing ref storage # TODO: when we finish the above, we should also implement this for dicts var = list(var)[:sentry.app.config['MAX_LENGTH_LIST']] + ['...', '(%d more elements)' % (len(var) - sentry.app.config['MAX_LENGTH_LIST'],)] return var def is_float(var): try: float(var) except ValueError: return False return True class MockRequest(object): GET = {} POST = {} META = {} COOKIES = {} FILES = {} raw_post_data = '' url = '' def __init__(self, **kwargs): self.__dict__.update(kwargs) def __repr__(self): # Since this is called as part of error handling, we need to be very # robust against potentially malformed input. try: get = pformat(self.GET) except: get = '<could not parse>' try: post = pformat(self.POST) except: post = '<could not parse>' try: cookies = pformat(self.COOKIES) except: cookies = '<could not parse>' try: meta = pformat(self.META) except: meta = '<could not parse>' return '<Request\nGET:%s,\nPOST:%s,\nCOOKIES:%s,\nMETA:%s>' % \ (get, post, cookies, meta) def build_absolute_uri(self): return self.url
bsd-3-clause
94f327c3929197b2842b195a0fd26439
32.114625
147
0.591669
4.10284
false
false
false
false
dcramer/sentry-old
sentry/web/templatetags.py
1
6690
""" sentry.web.templatetags ~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from sentry import app #from sentry.plugins import GroupActionProvider from flaskext.babel import ngettext, gettext from jinja2 import Markup, escape import datetime import simplejson @app.template_filter() def maybe_link(value): if value.startswith('http') and '://' in value: value = escape(value) return Markup(u'<a href="%s">%s</a>' % (value, value)) return value @app.template_filter() def as_sorted(value): return sorted(value) @app.template_filter() def is_dict(value): return isinstance(value, dict) @app.template_filter() def with_priority(result_list, key='score'): if result_list: if isinstance(result_list[0], dict): _get = lambda x, k: x[k] else: _get = lambda x, k: getattr(x, k, 0) min_, max_ = min([_get(r, key) for r in result_list]), max([_get(r, key) for r in result_list]) mid = (max_ - min_) / 4 for result in result_list: val = _get(result, key) if val > max_ - mid: priority = 'veryhigh' elif val > max_ - mid * 2: priority = 'high' elif val > max_ - mid * 3: priority = 'medium' elif val > max_ - mid * 4: priority = 'low' else: priority = 'verylow' yield result, priority @app.template_filter() def num_digits(value): return len(str(value)) @app.template_filter() def chart_data(group, max_days=90): return {} hours = max_days*24 today = datetime.datetime.now().replace(microsecond=0, second=0, minute=0) min_date = today - datetime.timedelta(hours=hours) if get_db_engine(getattr(conn, 'alias', 'default')).startswith('oracle'): method = conn.ops.date_trunc_sql('hh24', 'datetime') else: method = conn.ops.date_trunc_sql('hour', 'datetime') chart_qs = list(group.message_set.all()\ .filter(datetime__gte=min_date)\ .extra(select={'grouper': method}).values('grouper')\ .annotate(num=Count('id')).values_list('grouper', 'num')\ .order_by('grouper')) if not chart_qs: return {} rows = dict(chart_qs) #just skip zeroes first_seen = hours while not rows.get(today - datetime.timedelta(hours=first_seen)) and first_seen > 24: first_seen -= 1 return { 'points': [rows.get(today-datetime.timedelta(hours=d), 0) for d in xrange(first_seen, -1, -1)], 'categories': [str(today-datetime.timedelta(hours=d)) for d in xrange(first_seen, -1, -1)], } @app.template_filter() def to_json(data): return simplejson.dumps(data) @app.context_processor def sentry_version(): import sentry return {'sentry_version': sentry.VERSION} @app.template_filter() def get_actions(group): # TODO: return [] @app.template_filter() def get_panels(group): # TODO: return [] @app.template_filter() def get_widgets(group): # TODO: return [] # @app.template_filter() # def get_actions(group): # action_list = [] # for cls in GroupActionProvider.plugins.itervalues(): # inst = cls(group.pk) # action_list = inst.actions(request, action_list, group) # for action in action_list: # yield action[0], action[1], request.path == action[1] # # @app.template_filter() # def get_panels(group): # panel_list = [] # for cls in GroupActionProvider.plugins.itervalues(): # inst = cls(group.pk) # panel_list = inst.panels(request, panel_list, group) # for panel in panel_list: # yield panel[0], panel[1], request.path == panel[1] # # @app.template_filter() # def get_widgets(group): # for cls in GroupActionProvider.plugins.itervalues(): # inst = cls(group.pk) # resp = inst.widget(request, group) # if resp: # yield resp @app.template_filter() def timesince(d, now=None): """ Takes two datetime objects and returns the time between d and now as a nicely formatted string, e.g. "10 minutes". If d occurs after now, then "0 minutes" is returned. Units used are years, months, weeks, days, hours, and minutes. Seconds and microseconds are ignored. Up to two adjacent units will be displayed. For example, "2 weeks, 3 days" and "1 year, 3 months" are possible outputs, but "2 weeks, 3 hours" and "1 year, 5 days" are not. Adapted from http://blog.natbat.co.uk/archive/2003/Jun/14/time_since """ if not d: return 'Never' if d < datetime.datetime.now() - datetime.timedelta(days=5): return d.date() chunks = ( (60 * 60 * 24 * 365, lambda n: ngettext('year', 'years', n)), (60 * 60 * 24 * 30, lambda n: ngettext('month', 'months', n)), (60 * 60 * 24 * 7, lambda n : ngettext('week', 'weeks', n)), (60 * 60 * 24, lambda n : ngettext('day', 'days', n)), (60 * 60, lambda n: ngettext('hour', 'hours', n)), (60, lambda n: ngettext('minute', 'minutes', n)) ) # Convert datetime.date to datetime.datetime for comparison. if not isinstance(d, datetime.datetime): d = datetime.datetime(d.year, d.month, d.day) if now and not isinstance(now, datetime.datetime): now = datetime.datetime(now.year, now.month, now.day) if not now: if d.tzinfo: now = datetime.datetime.now(d.tzinfo) else: now = datetime.datetime.now() # ignore microsecond part of 'd' since we removed it from 'now' delta = now - (d - datetime.timedelta(0, 0, d.microsecond)) since = delta.days * 24 * 60 * 60 + delta.seconds if since <= 0: # d is in the future compared to now, stop processing. return d.date() for i, (seconds, name) in enumerate(chunks): count = since // seconds if count != 0: break s = gettext('%(number)d %(type)s', number=count, type=name(count)) if s == '0 minutes': return 'Just now' if s == '1 day': return 'Yesterday' return s + ' ago' @app.template_filter(name='truncatechars') def truncatechars(value, arg): """ Truncates a string after a certain number of chars. Argument: Number of chars to truncate after. """ try: length = int(arg) except ValueError: # Invalid literal for int(). return value # Fail silently. if len(value) > length: return value[:length] + '...' return value
bsd-3-clause
7a9333ed59c5835975f4d1346de58b89
29.972222
103
0.593722
3.515502
false
false
false
false
dcramer/sentry-old
sentry/client/async/__init__.py
1
1530
""" sentry.client.async ~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from Queue import Queue from sentry.client.base import SentryClient from threading import Thread, Lock class AsyncSentryClient(SentryClient): """This client uses a single background thread to dispatch errors.""" _terminator = object() def __init__(self): """Starts the task thread.""" self.queue = Queue(-1) self._lock = Lock() self._thread = None self.start() def start(self): self._lock.acquire() try: if not self._thread: self._thread = Thread(target=self._target) self._thread.setDaemon(False) self._thread.start() finally: self._lock.release() def stop(self): """Stops the task thread. Synchronous!""" self._lock.acquire() try: if self._thread: self.queue.put_nowait(self._terminator) self._thread.join() self._thread = None finally: self._lock.release() def _target(self): while 1: record = self.queue.get() if record is self._terminator: break self.send_sync(**record) def send_sync(self, **kwargs): super(AsyncSentryClient, self).send(**kwargs) def send(self, **kwargs): self.queue.put_nowait(kwargs)
bsd-3-clause
f5072f204a28fe5dd58a72271bd39494
26.321429
73
0.552941
4.261838
false
false
false
false
dcramer/sentry-old
tests/test_orm.py
1
4227
from . import BaseTest from sentry.db import models class TestModel(models.Model): str_ = models.String() int_ = models.Integer() float_ = models.Float() list_ = models.List() class Meta: sortables = ('int_', 'float_') indexes = (('str_',),) class ORMTest(BaseTest): def test_create(self): inst = TestModel.objects.create( str_='foo', int_=0, float_=0.1, list_=[1, 2, 3], ) self.assertEquals(TestModel.objects.count(), 1) self.assertTrue(inst.pk) self.assertEquals(inst.str_, 'foo') self.assertEquals(inst.int_, 0) self.assertEquals(inst.float_, 0.1) self.assertEquals(len(inst.list_), 3) self.assertTrue(1 in inst.list_) self.assertTrue(2 in inst.list_) self.assertTrue(3 in inst.list_) def test_get_or_create(self): inst, created = TestModel.objects.get_or_create(str_='foo', defaults={ 'int_': 0, 'float_': 0.1, 'list_': [1, 2, 3], }) self.assertTrue(created) self.assertEquals(TestModel.objects.count(), 1) self.assertTrue(inst.pk) self.assertEquals(inst.str_, 'foo') self.assertEquals(inst.int_, 0) self.assertEquals(inst.float_, 0.1) self.assertEquals(len(inst.list_), 3) self.assertTrue(1 in inst.list_) self.assertTrue(2 in inst.list_) self.assertTrue(3 in inst.list_) inst, created = TestModel.objects.get_or_create(str_='foo', defaults={ 'int_': 1, 'float_': 1.1, 'list_': [1], }) self.assertFalse(created) self.assertEquals(TestModel.objects.count(), 1) self.assertTrue(inst.pk) self.assertEquals(inst.str_, 'foo') self.assertEquals(inst.int_, 0) self.assertEquals(inst.float_, 0.1) self.assertTrue(len(inst.list_), 3) self.assertTrue(1 in inst.list_) self.assertTrue(2 in inst.list_) self.assertTrue(3 in inst.list_) def test_get(self): self.assertEquals(TestModel.objects.count(), 0) self.assertRaises(TestModel.DoesNotExist, TestModel.objects.get, 'foo') inst = TestModel.objects.create(str_='foo') self.assertEquals(TestModel.objects.count(), 1) self.assertEquals(TestModel.objects.get(inst.pk), inst) def test_delete(self): self.assertEquals(TestModel.objects.count(), 0) inst = TestModel.objects.create(str_='foo') self.assertEquals(TestModel.objects.count(), 1) inst.delete() self.assertEquals(TestModel.objects.count(), 0) self.assertRaises(TestModel.DoesNotExist, TestModel.objects.get, 'foo') def test_saving_behavior(self): self.assertEquals(TestModel.objects.count(), 0) inst = TestModel() self.assertFalse(inst.pk) self.assertEquals(TestModel.objects.count(), 0) inst.save() self.assertTrue(inst.pk) self.assertEquals(TestModel.objects.count(), 1) self.assertEquals(TestModel.objects.get(inst.pk), inst) self.assertEquals(inst.str_, '') self.assertEquals(inst.int_, 0) self.assertEquals(inst.float_, 0.0) self.assertEquals(len(inst.list_), 0) inst.update(str_='foo') self.assertEquals(TestModel.objects.count(), 1) self.assertEquals(inst.str_, 'foo') self.assertEquals(inst.int_, 0) self.assertEquals(inst.float_, 0.0) self.assertEquals(len(inst.list_), 0) inst = TestModel.objects.get(pk=inst.pk) self.assertEquals(inst.str_, 'foo') self.assertEquals(inst.int_, 0) self.assertEquals(inst.float_, 0.0) self.assertEquals(len(inst.list_), 0) inst = TestModel(float_=1.0) self.assertFalse(inst.pk) inst.save() self.assertEquals(TestModel.objects.count(), 2) self.assertEquals(inst.str_, '') self.assertEquals(inst.int_, 0) self.assertEquals(inst.float_, 1.0) self.assertEquals(len(inst.list_), 0)
bsd-3-clause
f871f494e44747b180d94117eb97cb50
29.861314
79
0.581027
3.832276
false
true
false
false
dcramer/sentry-old
sentry/db/backends/sqlalchemy/models.py
1
1625
import sentry.models from sentry.db import models from sqlalchemy import Table, Column, Integer, Float, String, Text, \ DateTime, MetaData __all__ = ('metadata', 'model_map', 'model_meta') column_map = { models.String: lambda x: String(255, default=x.default, nullable=True), models.Text: lambda x: Text(default=x.default, nullable=True), models.Integer: lambda x: Integer(default=x.default, nullable=True), models.Float: lambda x: Float(default=x.default, nullable=True), models.DateTime: lambda x: DateTime(default=x.default, nullable=True), models.List: lambda x: Text(default=x.default, nullable=True), } model_map = {} model_meta = {} def create_sqlalchemy_def(metadata, model): columns = [ Column('id', String(32), primary_key=True), ] for name, field in model._meta.fields: columns.append(Column(name, column_map[field](field), nullable=True)) table = Table(model.__name__.lower(), metadata, *columns) return table def create_sqlalchemy_metadata_def(metadata, model): columns = [ Column('id', String(32), primary_key=True), Column('key', String(255), primary_key=True), Column('value', Text(nullable=True), primary_key=True), ] table = Table('%s_metadata' % (model.__name__.lower(),), metadata, *columns) return table metadata = MetaData() # metadata.create_all(engine) for var in dir(sentry.models): if isinstance(var, models.Model): model_map[var] = create_sqlalchemy_def(metadata, var) model_meta[var] = create_sqlalchemy_metadata_def(metadata, var)
bsd-3-clause
997300ff2dd6501a031e3ffccb2dc90c
32.163265
80
0.659692
3.595133
false
false
false
false
dcramer/sentry-old
sentry/events.py
1
7927
""" sentry.events ~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import sys from sentry import app from sentry.utils import transform __all__ = ('BaseEvent', 'Exception', 'Message', 'Query') class BaseEvent(object): def to_string(self, data): raise NotImplementedError def get_data(self, **kwargs): return {} def get_tags(self, **kwargs): return [] def capture(self, **kwargs): # tags and culprit are special cased and not stored with the # default metadata return { 'culprit': None, 'tags': self.get_tags(**kwargs), self.interface: self.get_data(**kwargs), } class Exception(BaseEvent): """ Exceptions store the following metadata: - value: 'My exception value' - type: 'module.ClassName' - frames: a list of serialized frames (see _get_traceback_frames) - template: 'template/name.html' """ interface = 'sentry.interfaces.Exception' def to_string(self, data): if data['value']: return '%s: %s' % (data['type'], data['value']) return data['type'] def get_event_hash(self, type, value, **kwargs): # TODO: Need to add in the frames without line numbers return [type, value] def capture(self, exc_info=None, **kwargs): if exc_info is None: exc_info = sys.exc_info() exc_type, exc_value, exc_traceback = exc_info tags = [('level', 'error')] culprit = self._get_culprit(exc_info[2]) if hasattr(exc_type, '__class__'): exc_module = exc_type.__class__.__module__ if exc_module == '__builtin__': exc_type = exc_type.__name__ else: exc_type = '%s.%s' % (exc_module, exc_type.__name__) else: exc_module = None exc_type = exc_type.__name__ # if isinstance(exc_value, TemplateSyntaxError) and hasattr(exc_value, 'source'): # origin, (start, end) = exc_value.source # result['template'] = (origin.reload(), start, end, origin.name) # result['tags'].append(('template', origin.loadname)) return { 'culprit': culprit, 'tags': tags, 'sentry.interfaces.Exception': { 'value': transform(exc_value), 'type': exc_type, }, 'sentry.interfaces.Stacktrace': { 'frames': self._get_traceback_frames(exc_traceback) }, } def _iter_tb(self, tb): while tb: # support for __traceback_hide__ which is used by a few libraries # to hide internal frames. if tb.tb_frame.f_locals.get('__traceback_hide__'): continue yield tb tb = tb.tb_next def _get_lines_from_file(self, filename, lineno, context_lines, loader=None, module_name=None): """ Returns context_lines before and after lineno from file. Returns (pre_context_lineno, pre_context, context_line, post_context). """ source = None if loader is not None and hasattr(loader, "get_source"): source = loader.get_source(module_name) if source is not None: source = source.splitlines() if source is None: try: f = open(filename) try: source = f.readlines() finally: f.close() except (OSError, IOError): pass if source is None: return None, [], None, [] encoding = 'ascii' for line in source[:2]: # File coding may be specified. Match pattern from PEP-263 # (http://www.python.org/dev/peps/pep-0263/) match = re.search(r'coding[:=]\s*([-\w.]+)', line) if match: encoding = match.group(1) break source = [unicode(sline, encoding, 'replace') for sline in source] lower_bound = max(0, lineno - context_lines) upper_bound = lineno + context_lines pre_context = [line.strip('\n') for line in source[lower_bound:lineno]] context_line = source[lineno].strip('\n') post_context = [line.strip('\n') for line in source[lineno+1:upper_bound]] return lower_bound, pre_context, context_line, post_context def _get_culprit(self, traceback): # We iterate through each frame looking for a deterministic culprit # When one is found, we mark it as last "best guess" (best_guess) and then # check it against SENTRY_EXCLUDE_PATHS. If it isnt listed, then we # use this option. If nothing is found, we use the "best guess". def contains(iterator, value): for k in iterator: if value.startswith(k): return True return False if app.config['INCLUDE_PATHS']: modules = app.config['INCLUDE_PATHS'] else: modules = [] best_guess = None for tb in self._iter_tb(traceback): frame = tb.tb_frame try: culprit = '.'.join([frame.f_globals['__name__'], frame.f_code.co_name]) except: continue if contains(modules, culprit): if not (contains(app.config['EXCLUDE_PATHS'], culprit) and best_guess): best_guess = culprit elif best_guess: break return best_guess def _get_traceback_frames(self, tb): frames = [] for tb in self._iter_tb(tb): filename = tb.tb_frame.f_code.co_filename function = tb.tb_frame.f_code.co_name lineno = tb.tb_lineno - 1 loader = tb.tb_frame.f_globals.get('__loader__') module_name = tb.tb_frame.f_globals.get('__name__') pre_context_lineno, pre_context, context_line, post_context = self._get_lines_from_file(filename, lineno, 7, loader, module_name) if pre_context_lineno is not None: frames.append({ 'id': id(tb), 'filename': filename, 'module': module_name, 'function': function, 'lineno': lineno + 1, # TODO: vars need to be references 'vars': tb.tb_frame.f_locals, 'pre_context': pre_context, 'context_line': context_line, 'post_context': post_context, 'pre_context_lineno': pre_context_lineno + 1, }) return frames class Message(BaseEvent): """ Messages store the following metadata: - message: 'My message from %s about %s' - params: ('foo', 'bar') """ interface = 'sentry.interfaces.Message' def to_string(self, data): return data['message'] % tuple(data.get('params', ())) def get_event_hash(self, message, params=(), **kwargs): return [message] + list(params) def get_data(self, message, params=(), **kwargs): return { 'message': message, 'params': params, } class Query(BaseEvent): """ Messages store the following metadata: - query: 'SELECT * FROM table' - engine: 'postgesql_psycopg2' """ interface = 'sentry.interfaces.Query' def to_string(self, data): return data['query'] def get_event_hash(self, query, engine, **kwargs): return [query, engine] def get_data(self, query, engine, **kwargs): return { 'query': query, 'engine': engine, }
bsd-3-clause
59baeea3491eba0b6581d62a11d51af7
32.033333
141
0.530213
4.117922
false
false
false
false
qiime2/qiime2
qiime2/jupyter/handlers.py
1
1973
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2022, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ---------------------------------------------------------------------------- import os import pathlib import tornado.web as web from notebook.base.handlers import IPythonHandler from qiime2.core.archive.archiver import ArchiveCheck class QIIME2RedirectHandler(IPythonHandler): """Add a location to location_store for later retrieval""" def initialize(self, result_store): self.result_store = result_store def get(self): location = self.get_query_argument('location') if not os.path.exists(location): # Client DOM should explain that the user should re-run the cell self.send_error(409) # Conflict return # is it actually a QIIME 2 result, or a random part of the filesystem archive = ArchiveCheck(pathlib.Path(location)) self.result_store[archive.uuid] = os.path.join(location, 'data') self.redirect('view/%s/' % archive.uuid) class QIIME2ResultHandler(web.StaticFileHandler): def initialize(self, path, default_filename): super().initialize(path, default_filename) self.result_store = path # path is actually result_store @classmethod def get_absolute_path(cls, root, path): uuid, path = path.split('/', 1) root = root[uuid] # This is janky, but validate_absolute_path is the only thing # that will use this data, so it can know to unpack the tuple again return (super().get_absolute_path(root, path), uuid) def validate_absolute_path(self, root, abspath_uuid): absolute_path, uuid = abspath_uuid root = self.result_store[uuid] return super().validate_absolute_path(root, absolute_path)
bsd-3-clause
e8ebe8d1ff3fe9a662d6d66b56c587de
36.942308
78
0.627978
4.215812
false
false
false
false
qiime2/qiime2
qiime2/jupyter/template.py
2
2598
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2022, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ---------------------------------------------------------------------------- import urllib.parse def make_html(location): url = "/qiime2/redirect?location={location}".format( location=urllib.parse.quote(location)) # This is dark magic. An image has an onload handler, which let's me # grab the parent dom in an anonymous way without needing to scope the # output cells of Jupyter with some kind of random ID. # Using transparent pixel from: https://stackoverflow.com/a/14115340/579416 return ('<div><img onload="({anon_func})(this.parentElement, \'{url}\')"' ' src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAAL' 'AAAAAABAAEAAAICRAEAOw==" /></div>'.format( anon_func=_anonymous_function, url=url)) # 404 - the extension isn't installed # 428 - the result went out of scope, re-run cell # 302->200 - set up the iframe for that location _anonymous_function = '''\ function(div, url){ if (typeof require !== 'undefined') { var baseURL = require.toUrl('').split('/').slice(0, -2).join('/'); } else { var baseURL = JSON.parse( document.getElementById('jupyter-config-data').innerHTML ).baseUrl.slice(0, -1); } url = baseURL + url; fetch(url).then(function(res) { if (res.status === 404) { div.innerHTML = 'Install QIIME 2 Jupyter extension with:<br />' + '<code>jupyter serverextension enable --py qiime2' + ' --sys-prefix</code><br />then restart your server.' + '<br /><br />(Interactive output not available on ' + 'static notebook viewer services like nbviewer.)'; } else if (res.status === 409) { div.innerHTML = 'Visualization no longer in scope. Re-run this cell' + ' to see the visualization.'; } else if (res.ok) { url = res.url; div.innerHTML = '<iframe src=\\'' + url + '\\' style=\\'' + 'width: 100%; height: 700px; border: 0;\\'>' + '</iframe><hr />Open in a: <a href=\\'' + url + '\\'' + ' target=\\'_blank\\'>new window</a>' } else { div.innerHTML = 'Something has gone wrong. Check notebook server for' + ' errors.'; } }); }'''
bsd-3-clause
ce6ba3837e829ed38ed05c511dd89e91
43.033898
79
0.548114
3.877612
false
false
false
false
qiime2/qiime2
qiime2/util.py
2
3260
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2022, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ---------------------------------------------------------------------------- import os import sys import errno import shutil import threading import contextlib _REDIRECTED_STDIO_LOCK = threading.Lock() @contextlib.contextmanager def redirected_stdio(stdout=None, stderr=None): with _REDIRECTED_STDIO_LOCK: if stdout is not None: with _redirected_fd(to=stdout, stdio=sys.stdout): if stderr is not None: with _redirected_fd(to=stderr, stdio=sys.stderr): yield else: yield elif stderr is not None: with _redirected_fd(to=stderr, stdio=sys.stderr): yield else: yield # Taken whole-sale from: http://stackoverflow.com/a/22434262/579416 @contextlib.contextmanager def _redirected_fd(to=os.devnull, stdio=None): if stdio is None: stdio = sys.stdout stdio_fd = _get_fileno(stdio) # copy stdio_fd before it is overwritten # NOTE: `copied` is inheritable on Windows when duplicating a standard # stream with os.fdopen(os.dup(stdio_fd), 'wb') as copied: stdio.flush() # flush library buffers that dup2 knows nothing about try: os.dup2(_get_fileno(to), stdio_fd) # $ exec >&to except ValueError: # filename with open(to, 'wb') as to_file: os.dup2(to_file.fileno(), stdio_fd) # $ exec > to try: yield stdio # allow code to be run with the redirected stdio finally: # restore stdio to its previous value # NOTE: dup2 makes stdio_fd inheritable unconditionally stdio.flush() os.dup2(copied.fileno(), stdio_fd) # $ exec >&copied def _get_fileno(file_or_fd): fd = getattr(file_or_fd, 'fileno', lambda: file_or_fd)() if not isinstance(fd, int): raise ValueError("Expected a file (`.fileno()`) or a file descriptor") return fd def duplicate(src, dst): """Alternative to shutil.copyfile, this will use os.link when possible. See shutil.copyfile for documention. Only `src` and `dst` are supported. Unlike copyfile, this will not overwrite the destination if it exists. """ if os.path.isdir(src): # os.link will give a permission error raise OSError(errno.EISDIR, "Is a directory", src) if os.path.isdir(dst): # os.link will give a FileExists error raise OSError(errno.EISDIR, "Is a directory", dst) if os.path.exists(dst): # shutil.copyfile will overwrite the existing file raise OSError(errno.EEXIST, "File exists", src, "File exists", dst) try: os.link(src, dst) except OSError as e: if e.errno == errno.EXDEV: # Invalid cross-device link shutil.copyfile(src, dst) elif e.errno == errno.EPERM: # Permissions/ownership error shutil.copyfile(src, dst) else: raise
bsd-3-clause
84dd88a4d4c7fc9f763118f7b767ee4b
32.958333
78
0.589571
3.956311
false
false
false
false
qiime2/qiime2
qiime2/metadata/io.py
1
20142
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2022, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ---------------------------------------------------------------------------- import csv import itertools import os.path import re import numpy as np import pandas as pd from qiime2.core.util import find_duplicates import qiime2.core.missing as _missing from .base import SUPPORTED_COLUMN_TYPES, FORMATTED_ID_HEADERS, is_id_header from .metadata import Metadata, MetadataColumn class MetadataFileError(Exception): _suffix = ( "There may be more errors present in the metadata file. To get a full " "report, sample/feature metadata files can be validated with Keemei: " "https://keemei.qiime2.org\n\nFind details on QIIME 2 metadata " "requirements here: https://docs.qiime2.org/%s/tutorials/metadata/") def __init__(self, message, include_suffix=True): # Lazy import because `qiime2.__release__` is available at runtime but # not at import time (otherwise the release value could be interpolated # into `_suffix` in the class definition above). import qiime2 if include_suffix: message = message + '\n\n' + self._suffix % qiime2.__release__ super().__init__(message) class MetadataReader: def __init__(self, filepath): if not os.path.isfile(filepath): raise MetadataFileError( "Metadata file path doesn't exist, or the path points to " "something other than a file. Please check that the path " "exists, has read permissions, and points to a regular file " "(not a directory): %s" % filepath) self._filepath = filepath # Used by `read()` to store an iterator yielding rows with # leading/trailing whitespace stripped from their cells (this is a # preprocessing step that should happen with *every* row). The iterator # protocol is the only guaranteed API on this object. self._reader = None def read(self, into, column_types=None, column_missing_schemes=None, default_missing_scheme=_missing.DEFAULT_MISSING): if column_types is None: column_types = {} try: # Newline settings based on recommendation from csv docs: # https://docs.python.org/3/library/csv.html#id3 # Ignore BOM on read (but do not write BOM) with open(self._filepath, 'r', newline='', encoding='utf-8-sig') as fh: tsv_reader = csv.reader(fh, dialect='excel-tab', strict=True) self._reader = (self._strip_cell_whitespace(row) for row in tsv_reader) header = self._read_header() directives = self._read_directives(header) ids, data = self._read_data(header) except UnicodeDecodeError as e: if ('0xff in position 0' in str(e) or '0xfe in position 0' in str(e)): raise MetadataFileError( "Metadata file must be encoded as UTF-8 or ASCII, found " "UTF-16. If this file is from Microsoft Excel, save " "as a plain text file, not 'UTF-16 Unicode'") raise MetadataFileError( "Metadata file must be encoded as UTF-8 or ASCII. The " "following error occurred when decoding the file:\n\n%s" % e) finally: self._reader = None index = pd.Index(ids, name=header[0], dtype=object) df = pd.DataFrame(data, columns=header[1:], index=index, dtype=object) # TODO: move these checks over to Metadata.__init__() so that you can # pass column_types with an untyped dataframe. This would require a bit # of a refactor and doesn't buy a whole lot at the moment, hence the # TODO. for name, type in column_types.items(): if name not in df.columns: raise MetadataFileError( "Column name %r specified in `column_types` is not a " "column in the metadata file." % name) if type not in SUPPORTED_COLUMN_TYPES: fmt_column_types = ', '.join( repr(e) for e in sorted(SUPPORTED_COLUMN_TYPES)) raise MetadataFileError( "Column name %r specified in `column_types` has an " "unrecognized column type %r. Supported column types: %s" % (name, type, fmt_column_types)) resolved_column_types = directives.get('types', {}) resolved_column_types.update(column_types) if column_missing_schemes is None: column_missing_schemes = {} resolved_missing = {c: default_missing_scheme for c in df.columns} resolved_missing.update(directives.get('missing', {})) resolved_missing.update(column_missing_schemes) try: # Cast each column to the appropriate dtype based on column type. df = df.apply(self._cast_column, axis='index', column_types=resolved_column_types, missing_schemes=resolved_missing) except MetadataFileError as e: # HACK: If an exception is raised within `DataFrame.apply`, pandas # adds an extra tuple element to `e.args`, making the original # error message difficult to read because a tuple is repr'd instead # of a string. To work around this, we catch and reraise a # MetadataFileError with the original error message. We use # `include_suffix=False` to avoid adding another suffix to the # error message we're reraising. msg = e.args[0] raise MetadataFileError(msg, include_suffix=False) try: return into(df, column_missing_schemes=resolved_missing, default_missing_scheme=default_missing_scheme) except Exception as e: raise MetadataFileError( "There was an issue with loading the metadata file:\n\n%s" % e) def _read_header(self): header = None for row in self._reader: if self._is_header(row): header = row break elif self._is_comment(row): continue elif self._is_empty(row): continue elif self._is_directive(row): raise MetadataFileError( "Found directive %r while searching for header. " "Directives may only appear immediately after the header." % row[0]) else: raise MetadataFileError( "Found unrecognized ID column name %r while searching for " "header. The first column name in the header defines the " "ID column, and must be one of these values:\n\n%s\n\n" "NOTE: Metadata files must contain tab-separated values." % (row[0], FORMATTED_ID_HEADERS)) if header is None: raise MetadataFileError( "Failed to locate header. The metadata file may be empty, or " "consists only of comments or empty rows.") # Trim trailing empty cells from header. data_extent = None for idx, cell in enumerate(header): if cell != '': data_extent = idx header = header[:data_extent+1] # Basic validation to 1) fail early before processing entire file; and # 2) make some basic guarantees about the header for things in this # class that use the header as part of reading the file. column_names = set(header) if '' in column_names: raise MetadataFileError( "Found at least one column without a name in the header. Each " "column must be named.") elif len(header) != len(column_names): duplicates = find_duplicates(header) raise MetadataFileError( "Column names must be unique. The following column names are " "duplicated: %s" % (', '.join(repr(e) for e in sorted(duplicates)))) # Skip the first element of the header because we know it is a valid ID # header. The other column names are validated to ensure they *aren't* # valid ID headers. for column_name in header[1:]: if is_id_header(column_name): raise MetadataFileError( "Metadata column name %r conflicts with a name reserved " "for the ID column header. Reserved ID column headers:" "\n\n%s" % (column_name, FORMATTED_ID_HEADERS)) return header def _read_directives(self, header): directives = {} for row in self._reader: directive_kind = None if not self._is_directive(row): self._reader = itertools.chain([row], self._reader) break if self._is_column_types_directive(row): directive_kind = 'types' elif self._is_missing_directive(row): directive_kind = 'missing' else: raise MetadataFileError( "Unrecognized directive %r. Only the #q2:types" " and #q2:missing directives are supported at this" " time." % row[0]) if directive_kind in directives: raise MetadataFileError( "Found duplicate directive %r. Each directive may " "only be specified a single time." % row[0]) row = self._match_header_len(row, header) collected = {name: arg for name, arg in zip(header[1:], row[1:]) if arg} directives[directive_kind] = collected if 'types' in directives: column_types = directives['types'] for column_name, column_type in column_types.items(): type_nocase = column_type.lower() if type_nocase in SUPPORTED_COLUMN_TYPES: column_types[column_name] = type_nocase else: fmt_column_types = ', '.join( repr(e) for e in sorted(SUPPORTED_COLUMN_TYPES)) raise MetadataFileError( "Column %r has an unrecognized column type %r " "specified in its #q2:types directive. " "Supported column types (case-insensitive): %s" % (column_name, column_type, fmt_column_types)) if 'missing' in directives: for column_name, column_missing in directives['missing'].items(): if column_missing not in _missing.BUILTIN_MISSING: raise MetadataFileError( "Column %r has an unrecognized missing value scheme %r" " specified in its #q2:missing directive." " Supported missing value schemes (case-sensitive): %s" % (column_name, column_missing, list(_missing.BUILTIN_MISSING)) ) return directives def _read_data(self, header): ids = [] data = [] for row in self._reader: if self._is_comment(row): continue elif self._is_empty(row): continue elif self._is_directive(row): raise MetadataFileError( "Found directive %r outside of the directives section of " "the file. Directives may only appear immediately after " "the header." % row[0]) elif self._is_header(row): raise MetadataFileError( "Metadata ID %r conflicts with a name reserved for the ID " "column header. Reserved ID column headers:\n\n%s" % (row[0], FORMATTED_ID_HEADERS)) row = self._match_header_len(row, header) ids.append(row[0]) data.append(row[1:]) return ids, data def _strip_cell_whitespace(self, row): return [cell.strip() for cell in row] def _match_header_len(self, row, header): row_len = len(row) header_len = len(header) if row_len < header_len: # Pad row with empty cells to match header length. row = row + [''] * (header_len - row_len) elif row_len > header_len: trailing_row = row[header_len:] if not self._is_empty(trailing_row): raise MetadataFileError( "Metadata row contains more cells than are declared by " "the header. The row has %d cells, while the header " "declares %d cells." % (row_len, header_len)) row = row[:header_len] return row def _is_empty(self, row): # `all` returns True for an empty iterable, so this check works for a # row of zero elements (corresponds to a blank line in the file). return all((cell == '' for cell in row)) def _is_comment(self, row): return ( len(row) > 0 and row[0].startswith('#') and not self._is_directive(row) and not self._is_header(row) ) def _is_header(self, row): if len(row) == 0: return False return is_id_header(row[0]) def _is_directive(self, row): return len(row) > 0 and row[0].startswith('#q2:') def _is_column_types_directive(self, row): return len(row) > 0 and row[0].split(' ')[0] == '#q2:types' def _is_missing_directive(self, row): return len(row) > 0 and row[0].split(' ')[0] == '#q2:missing' def _cast_column(self, series, column_types, missing_schemes): if series.name in missing_schemes: scheme = missing_schemes[series.name] series = _missing.series_encode_missing(series, scheme) if series.name in column_types: if column_types[series.name] == 'numeric': return self._to_numeric(series) else: # 'categorical' return self._to_categorical(series) else: # Infer type try: return self._to_numeric(series) except MetadataFileError: return self._to_categorical(series) def _to_categorical(self, series): # Replace empty strings with `None` to force the series to remain # dtype=object (this only matters if the series consists solely of # missing data). Replacing with np.nan and casting to dtype=object # won't retain the correct dtype in the resulting dataframe # (`DataFrame.apply` seems to force series consisting solely of np.nan # to dtype=float64, even if dtype=object is specified. # # To replace a value with `None`, the following invocation of # `Series.replace` must be used because `None` is a sentinel: # https://stackoverflow.com/a/17097397/3776794 return series.replace([''], [None]) def _to_numeric(self, series): series = series.replace('', np.nan) is_numeric = series.apply(self._is_numeric) if is_numeric.all(): return pd.to_numeric(series, errors='raise') else: non_numerics = series[~is_numeric].unique() raise MetadataFileError( "Cannot convert metadata column %r to numeric. The following " "values could not be interpreted as numeric: %s" % (series.name, ', '.join(repr(e) for e in sorted(non_numerics)))) def _is_numeric(self, value): return (isinstance(value, float) or len(_numeric_regex.findall(value)) == 1) class MetadataWriter: def __init__(self, metadata): self._metadata = metadata def write(self, filepath): # Newline settings based on recommendation from csv docs: # https://docs.python.org/3/library/csv.html#id3 # Do NOT write a BOM, hence utf-8 not utf-8-sig with open(filepath, 'w', newline='', encoding='utf-8') as fh: tsv_writer = csv.writer(fh, dialect='excel-tab', strict=True) md = self._metadata header = [md.id_header] types_directive = ['#q2:types'] missing_directive = ['#q2:missing'] if isinstance(md, Metadata): for name, props in md.columns.items(): header.append(name) types_directive.append(props.type) missing_directive.append(props.missing_scheme) elif isinstance(md, MetadataColumn): header.append(md.name) types_directive.append(md.type) missing_directive.append(md.missing_scheme) else: raise NotImplementedError tsv_writer.writerow(header) tsv_writer.writerow(types_directive) if self._non_default_missing(missing_directive): tsv_writer.writerow(missing_directive) df = md.to_dataframe(encode_missing=True) df.fillna('', inplace=True) df = df.applymap(self._format) tsv_writer.writerows(df.itertuples(index=True)) def _non_default_missing(self, missing_directive): missing = missing_directive[1:] result = False for m in missing: if m != _missing.DEFAULT_MISSING: result = True break return result def _format(self, value): if isinstance(value, str): return value elif isinstance(value, float): # Use fixed precision or scientific notation as necessary (both are # roundtrippable in the metadata file format), with up to 15 digits # *total* precision (i.e. before and after the decimal point), # rounding if necessary. Trailing zeros or decimal points will not # be included in the formatted string (e.g. 42.0 will be formatted # as "42"). A precision of 15 digits is used because that is within # the 64-bit floating point spec (things get weird after that). # # Using repr() and str() each have their own predefined precision # which varies across Python versions. Using the string formatting # presentation types (e.g. %g, %f) without specifying a precision # will usually default to 6 digits past the decimal point, which # seems a little low. # # References: # # - https://stackoverflow.com/a/2440786/3776794 # - https://stackoverflow.com/a/2440708/3776794 # - https://docs.python.org/3/library/string.html# # format-specification-mini-language # - https://stackoverflow.com/a/20586479/3776794 # - https://drj11.wordpress.com/2007/07/03/python-poor-printing- # of-floating-point/ return '{0:.15g}'.format(value) else: raise NotImplementedError # Credit: https://stackoverflow.com/a/4703508/3776794 _numeric_pattern = r""" ^[-+]? # optional sign (?: (?: \d* \. \d+ ) # .1 .12 .123 etc 9.1 etc 98.1 etc | (?: \d+ \.? ) # 1. 12. 123. etc 1 12 123 etc ) # followed by optional exponent part if desired (?: [Ee] [+-]? \d+ ) ?$ """ _numeric_regex = re.compile(_numeric_pattern, re.VERBOSE)
bsd-3-clause
fed3da7495e9ad2e218fe3f7ea39e922
41.404211
79
0.558634
4.459154
false
false
false
false
colour-science/colour
colour/plotting/colorimetry.py
1
34590
""" Colorimetry Plotting ==================== Defines the colorimetry plotting objects: - :func:`colour.plotting.plot_single_sd` - :func:`colour.plotting.plot_multi_sds` - :func:`colour.plotting.plot_single_cmfs` - :func:`colour.plotting.plot_multi_cmfs` - :func:`colour.plotting.plot_single_illuminant_sd` - :func:`colour.plotting.plot_multi_illuminant_sds` - :func:`colour.plotting.plot_visible_spectrum` - :func:`colour.plotting.plot_single_lightness_function` - :func:`colour.plotting.plot_multi_lightness_functions` - :func:`colour.plotting.plot_single_luminance_function` - :func:`colour.plotting.plot_multi_luminance_functions` - :func:`colour.plotting.plot_blackbody_spectral_radiance` - :func:`colour.plotting.plot_blackbody_colours` References ---------- - :cite:`Spiker2015a` : Borer, T. (2017). Private Discussion with Mansencal, T. and Shaw, N. """ from __future__ import annotations import matplotlib.pyplot as plt import numpy as np from functools import reduce from matplotlib.patches import Polygon from colour.algebra import ( LinearInterpolator, normalise_maximum, sdiv, sdiv_mode, ) from colour.colorimetry import ( CCS_ILLUMINANTS, SDS_ILLUMINANTS, LIGHTNESS_METHODS, LUMINANCE_METHODS, MultiSpectralDistributions, SpectralDistribution, SpectralShape, sd_blackbody, sd_ones, sd_to_XYZ, sds_and_msds_to_sds, wavelength_to_XYZ, ) from colour.hints import ( Any, Boolean, Callable, Dict, Floating, List, NDArray, Optional, Sequence, Tuple, Union, cast, ) from colour.plotting import ( CONSTANTS_COLOUR_STYLE, XYZ_to_plotting_colourspace, artist, filter_passthrough, filter_cmfs, filter_illuminants, override_style, render, plot_single_colour_swatch, plot_multi_functions, update_settings_collection, ) from colour.utilities import ( as_float_array, domain_range_scale, first_item, ones, tstack, ) __author__ = "Colour Developers" __copyright__ = "Copyright 2013 Colour Developers" __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" __maintainer__ = "Colour Developers" __email__ = "colour-developers@colour-science.org" __status__ = "Production" __all__ = [ "plot_single_sd", "plot_multi_sds", "plot_single_cmfs", "plot_multi_cmfs", "plot_single_illuminant_sd", "plot_multi_illuminant_sds", "plot_visible_spectrum", "plot_single_lightness_function", "plot_multi_lightness_functions", "plot_single_luminance_function", "plot_multi_luminance_functions", "plot_blackbody_spectral_radiance", "plot_blackbody_colours", ] @override_style() def plot_single_sd( sd: SpectralDistribution, cmfs: Union[ MultiSpectralDistributions, str, Sequence[Union[MultiSpectralDistributions, str]], ] = "CIE 1931 2 Degree Standard Observer", out_of_gamut_clipping: Boolean = True, modulate_colours_with_sd_amplitude: Boolean = False, equalize_sd_amplitude: Boolean = False, **kwargs: Any, ) -> Tuple[plt.Figure, plt.Axes]: """ Plot given spectral distribution. Parameters ---------- sd Spectral distribution to plot. cmfs Standard observer colour matching functions used for computing the spectrum domain and colours. ``cmfs`` can be of any type or form supported by the :func:`colour.plotting.common.filter_cmfs` definition. out_of_gamut_clipping Whether to clip out of gamut colours otherwise, the colours will be offset by the absolute minimal colour leading to a rendering on gray background, less saturated and smoother. modulate_colours_with_sd_amplitude Whether to modulate the colours with the spectral distribution amplitude. equalize_sd_amplitude Whether to equalize the spectral distribution amplitude. Equalization occurs after the colours modulation thus setting both arguments to *True* will generate a spectrum strip where each wavelength colour is modulated by the spectral distribution amplitude. The usual 5% margin above the spectral distribution is also omitted. Other Parameters ---------------- kwargs {:func:`colour.plotting.artist`, :func:`colour.plotting.render`}, See the documentation of the previously listed definitions. Returns ------- :class:`tuple` Current figure and axes. References ---------- :cite:`Spiker2015a` Examples -------- >>> from colour import SpectralDistribution >>> data = { ... 500: 0.0651, ... 520: 0.0705, ... 540: 0.0772, ... 560: 0.0870, ... 580: 0.1128, ... 600: 0.1360, ... } >>> sd = SpectralDistribution(data, name="Custom") >>> plot_single_sd(sd) # doctest: +ELLIPSIS (<Figure size ... with 1 Axes>, <...AxesSubplot...>) .. image:: ../_static/Plotting_Plot_Single_SD.png :align: center :alt: plot_single_sd """ _figure, axes = artist(**kwargs) cmfs = cast( MultiSpectralDistributions, first_item(filter_cmfs(cmfs).values()) ) sd = cast(SpectralDistribution, sd.copy()) sd.interpolator = LinearInterpolator wavelengths = cmfs.wavelengths[ np.logical_and( cmfs.wavelengths >= max(min(cmfs.wavelengths), min(sd.wavelengths)), cmfs.wavelengths <= min(max(cmfs.wavelengths), max(sd.wavelengths)), ) ] values = as_float_array(sd[wavelengths]) RGB = XYZ_to_plotting_colourspace( wavelength_to_XYZ(wavelengths, cmfs), CCS_ILLUMINANTS["CIE 1931 2 Degree Standard Observer"]["E"], apply_cctf_encoding=False, ) if not out_of_gamut_clipping: RGB += np.abs(np.min(RGB)) RGB = normalise_maximum(RGB) if modulate_colours_with_sd_amplitude: with sdiv_mode(): RGB *= cast(NDArray, sdiv(values, np.max(values)))[..., None] RGB = CONSTANTS_COLOUR_STYLE.colour.colourspace.cctf_encoding(RGB) if equalize_sd_amplitude: values = ones(values.shape) margin = 0 if equalize_sd_amplitude else 0.05 x_min, x_max = min(wavelengths), max(wavelengths) y_min, y_max = 0, max(values) + max(values) * margin polygon = Polygon( np.vstack( [ (x_min, 0), tstack([wavelengths, values]), (x_max, 0), ] ), facecolor="none", edgecolor="none", zorder=CONSTANTS_COLOUR_STYLE.zorder.background_polygon, ) axes.add_patch(polygon) padding = 0.1 axes.bar( x=wavelengths - padding, height=max(values), width=1 + padding, color=RGB, align="edge", clip_path=polygon, zorder=CONSTANTS_COLOUR_STYLE.zorder.background_polygon, ) axes.plot( wavelengths, values, color=CONSTANTS_COLOUR_STYLE.colour.dark, zorder=CONSTANTS_COLOUR_STYLE.zorder.midground_line, ) settings: Dict[str, Any] = { "axes": axes, "bounding_box": (x_min, x_max, y_min, y_max), "title": f"{sd.display_name} - {cmfs.display_name}", "x_label": "Wavelength $\\lambda$ (nm)", "y_label": "Spectral Distribution", } settings.update(kwargs) return render(**settings) @override_style() def plot_multi_sds( sds: Union[ Sequence[Union[SpectralDistribution, MultiSpectralDistributions]], MultiSpectralDistributions, ], plot_kwargs: Optional[Union[Dict, List[Dict]]] = None, **kwargs: Any, ) -> Tuple[plt.Figure, plt.Axes]: """ Plot given spectral distributions. Parameters ---------- sds Spectral distributions or multi-spectral distributions to plot. `sds` can be a single :class:`colour.MultiSpectralDistributions` class instance, a list of :class:`colour.MultiSpectralDistributions` class instances or a list of :class:`colour.SpectralDistribution` class instances. plot_kwargs Keyword arguments for the :func:`matplotlib.pyplot.plot` definition, used to control the style of the plotted spectral distributions. `plot_kwargs`` can be either a single dictionary applied to all the plotted spectral distributions with the same settings or a sequence of dictionaries with different settings for each plotted spectral distributions. The following special keyword arguments can also be used: - ``illuminant`` : The illuminant used to compute the spectral distributions colours. The default is the illuminant associated with the whitepoint of the default plotting colourspace. ``illuminant`` can be of any type or form supported by the :func:`colour.plotting.common.filter_cmfs` definition. - ``cmfs`` : The standard observer colour matching functions used for computing the spectral distributions colours. ``cmfs`` can be of any type or form supported by the :func:`colour.plotting.common.filter_cmfs` definition. - ``normalise_sd_colours`` : Whether to normalise the computed spectral distributions colours. The default is *True*. - ``use_sd_colours`` : Whether to use the computed spectral distributions colours under the plotting colourspace illuminant. Alternatively, it is possible to use the :func:`matplotlib.pyplot.plot` definition ``color`` argument with pre-computed values. The default is *True*. Other Parameters ---------------- kwargs {:func:`colour.plotting.artist`, :func:`colour.plotting.render`}, See the documentation of the previously listed definitions. Returns ------- :class:`tuple` Current figure and axes. Examples -------- >>> from colour import SpectralDistribution >>> data_1 = { ... 500: 0.004900, ... 510: 0.009300, ... 520: 0.063270, ... 530: 0.165500, ... 540: 0.290400, ... 550: 0.433450, ... 560: 0.594500, ... } >>> data_2 = { ... 500: 0.323000, ... 510: 0.503000, ... 520: 0.710000, ... 530: 0.862000, ... 540: 0.954000, ... 550: 0.994950, ... 560: 0.995000, ... } >>> sd_1 = SpectralDistribution(data_1, name="Custom 1") >>> sd_2 = SpectralDistribution(data_2, name="Custom 2") >>> plot_kwargs = [ ... {"use_sd_colours": True}, ... {"use_sd_colours": True, "linestyle": "dashed"}, ... ] >>> plot_multi_sds([sd_1, sd_2], plot_kwargs=plot_kwargs) ... # doctest: +ELLIPSIS (<Figure size ... with 1 Axes>, <...AxesSubplot...>) .. image:: ../_static/Plotting_Plot_Multi_SDS.png :align: center :alt: plot_multi_sds """ _figure, axes = artist(**kwargs) sds_converted = sds_and_msds_to_sds(sds) plot_settings_collection = [ { "label": f"{sd.display_name}", "zorder": CONSTANTS_COLOUR_STYLE.zorder.midground_line, "cmfs": "CIE 1931 2 Degree Standard Observer", "illuminant": SDS_ILLUMINANTS[ CONSTANTS_COLOUR_STYLE.colour.colourspace.whitepoint_name ], "use_sd_colours": False, "normalise_sd_colours": False, } for sd in sds_converted ] if plot_kwargs is not None: update_settings_collection( plot_settings_collection, plot_kwargs, len(sds_converted) ) x_limit_min, x_limit_max, y_limit_min, y_limit_max = [], [], [], [] for i, sd in enumerate(sds_converted): plot_settings = plot_settings_collection[i] cmfs = cast( MultiSpectralDistributions, first_item(filter_cmfs(plot_settings.pop("cmfs")).values()), ) illuminant = cast( SpectralDistribution, first_item( filter_illuminants(plot_settings.pop("illuminant")).values() ), ) normalise_sd_colours = plot_settings.pop("normalise_sd_colours") use_sd_colours = plot_settings.pop("use_sd_colours") wavelengths, values = sd.wavelengths, sd.values shape = sd.shape x_limit_min.append(shape.start) x_limit_max.append(shape.end) y_limit_min.append(min(values)) y_limit_max.append(max(values)) if use_sd_colours: with domain_range_scale("1"): XYZ = sd_to_XYZ(sd, cmfs, illuminant) if normalise_sd_colours: XYZ /= XYZ[..., 1] plot_settings["color"] = np.clip( XYZ_to_plotting_colourspace(XYZ), 0, 1 ) axes.plot(wavelengths, values, **plot_settings) bounding_box = ( min(x_limit_min), max(x_limit_max), min(y_limit_min), max(y_limit_max) + np.max(y_limit_max) * 0.05, ) settings: Dict[str, Any] = { "axes": axes, "bounding_box": bounding_box, "legend": True, "x_label": "Wavelength $\\lambda$ (nm)", "y_label": "Spectral Distribution", } settings.update(kwargs) return render(**settings) @override_style() def plot_single_cmfs( cmfs: Union[ MultiSpectralDistributions, str, Sequence[Union[MultiSpectralDistributions, str]], ] = "CIE 1931 2 Degree Standard Observer", **kwargs: Any, ) -> Tuple[plt.Figure, plt.Axes]: """ Plot given colour matching functions. Parameters ---------- cmfs Colour matching functions to plot. ``cmfs`` can be of any type or form supported by the :func:`colour.plotting.common.filter_cmfs` definition. Other Parameters ---------------- kwargs {:func:`colour.plotting.artist`, :func:`colour.plotting.plot_multi_cmfs`, :func:`colour.plotting.render`}, See the documentation of the previously listed definitions. Returns ------- :class:`tuple` Current figure and axes. Examples -------- >>> plot_single_cmfs("CIE 1931 2 Degree Standard Observer") ... # doctest: +ELLIPSIS (<Figure size ... with 1 Axes>, <...AxesSubplot...>) .. image:: ../_static/Plotting_Plot_Single_CMFS.png :align: center :alt: plot_single_cmfs """ cmfs = cast( MultiSpectralDistributions, first_item(filter_cmfs(cmfs).values()) ) settings: Dict[str, Any] = { "title": f"{cmfs.display_name} - Colour Matching Functions" } settings.update(kwargs) return plot_multi_cmfs((cmfs,), **settings) @override_style() def plot_multi_cmfs( cmfs: Union[ MultiSpectralDistributions, str, Sequence[Union[MultiSpectralDistributions, str]], ], **kwargs: Any, ) -> Tuple[plt.Figure, plt.Axes]: """ Plot given colour matching functions. Parameters ---------- cmfs Colour matching functions to plot. ``cmfs`` elements can be of any type or form supported by the :func:`colour.plotting.common.filter_cmfs` definition. Other Parameters ---------------- kwargs {:func:`colour.plotting.artist`, :func:`colour.plotting.render`}, See the documentation of the previously listed definitions. Returns ------- :class:`tuple` Current figure and axes. Examples -------- >>> cmfs = [ ... "CIE 1931 2 Degree Standard Observer", ... "CIE 1964 10 Degree Standard Observer", ... ] >>> plot_multi_cmfs(cmfs) # doctest: +ELLIPSIS (<Figure size ... with 1 Axes>, <...AxesSubplot...>) .. image:: ../_static/Plotting_Plot_Multi_CMFS.png :align: center :alt: plot_multi_cmfs """ cmfs = cast( List[MultiSpectralDistributions], list(filter_cmfs(cmfs).values()) ) _figure, axes = artist(**kwargs) axes.axhline( color=CONSTANTS_COLOUR_STYLE.colour.dark, linestyle="--", zorder=CONSTANTS_COLOUR_STYLE.zorder.foreground_line, ) x_limit_min, x_limit_max, y_limit_min, y_limit_max = [], [], [], [] for i, cmfs_i in enumerate(cmfs): for j, RGB in enumerate( as_float_array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) ): RGB = [reduce(lambda y, _: y * 0.5, range(i), x) for x in RGB] values = cmfs_i.values[:, j] shape = cmfs_i.shape x_limit_min.append(shape.start) x_limit_max.append(shape.end) y_limit_min.append(np.min(values)) y_limit_max.append(np.max(values)) axes.plot( cmfs_i.wavelengths, values, color=RGB, label=f"{cmfs_i.display_labels[j]} - {cmfs_i.display_name}", zorder=CONSTANTS_COLOUR_STYLE.zorder.midground_line, ) bounding_box = ( min(x_limit_min), max(x_limit_max), min(y_limit_min) - np.abs(np.min(y_limit_min)) * 0.05, max(y_limit_max) + np.abs(np.max(y_limit_max)) * 0.05, ) cmfs_display_names = ", ".join([cmfs_i.display_name for cmfs_i in cmfs]) title = f"{cmfs_display_names} - Colour Matching Functions" settings: Dict[str, Any] = { "axes": axes, "bounding_box": bounding_box, "legend": True, "title": title, "x_label": "Wavelength $\\lambda$ (nm)", "y_label": "Tristimulus Values", } settings.update(kwargs) return render(**settings) @override_style() def plot_single_illuminant_sd( illuminant: Union[SpectralDistribution, str], cmfs: Union[ MultiSpectralDistributions, str, Sequence[Union[MultiSpectralDistributions, str]], ] = "CIE 1931 2 Degree Standard Observer", **kwargs: Any, ) -> Tuple[plt.Figure, plt.Axes]: """ Plot given single illuminant spectral distribution. Parameters ---------- illuminant Illuminant to plot. ``illuminant`` can be of any type or form supported by the :func:`colour.plotting.common.filter_illuminants` definition. cmfs Standard observer colour matching functions used for computing the spectrum domain and colours. ``cmfs`` can be of any type or form supported by the :func:`colour.plotting.common.filter_cmfs` definition. Other Parameters ---------------- kwargs {:func:`colour.plotting.artist`, :func:`colour.plotting.plot_single_sd`, :func:`colour.plotting.render`}, See the documentation of the previously listed definitions. Returns ------- :class:`tuple` Current figure and axes. References ---------- :cite:`Spiker2015a` Examples -------- >>> plot_single_illuminant_sd("A") # doctest: +ELLIPSIS (<Figure size ... with 1 Axes>, <...AxesSubplot...>) .. image:: ../_static/Plotting_Plot_Single_Illuminant_SD.png :align: center :alt: plot_single_illuminant_sd """ cmfs = cast( MultiSpectralDistributions, first_item(filter_cmfs(cmfs).values()) ) title = f"Illuminant {illuminant} - {cmfs.display_name}" illuminant = first_item(filter_illuminants(illuminant).values()) settings: Dict[str, Any] = {"title": title, "y_label": "Relative Power"} settings.update(kwargs) return plot_single_sd(illuminant, **settings) @override_style() def plot_multi_illuminant_sds( illuminants: Union[ SpectralDistribution, str, Sequence[Union[SpectralDistribution, str]] ], **kwargs: Any, ) -> Tuple[plt.Figure, plt.Axes]: """ Plot given illuminants spectral distributions. Parameters ---------- illuminants Illuminants to plot. ``illuminants`` elements can be of any type or form supported by the :func:`colour.plotting.common.filter_illuminants` definition. Other Parameters ---------------- kwargs {:func:`colour.plotting.artist`, :func:`colour.plotting.plot_multi_sds`, :func:`colour.plotting.render`}, See the documentation of the previously listed definitions. Returns ------- :class:`tuple` Current figure and axes. Examples -------- >>> plot_multi_illuminant_sds(["A", "B", "C"]) # doctest: +ELLIPSIS (<Figure size ... with 1 Axes>, <...AxesSubplot...>) .. image:: ../_static/Plotting_Plot_Multi_Illuminant_SDS.png :align: center :alt: plot_multi_illuminant_sds """ if "plot_kwargs" not in kwargs: kwargs["plot_kwargs"] = {} SD_E = SDS_ILLUMINANTS["E"] if isinstance(kwargs["plot_kwargs"], dict): kwargs["plot_kwargs"]["illuminant"] = SD_E else: for i in range(len(kwargs["plot_kwargs"])): kwargs["plot_kwargs"][i]["illuminant"] = SD_E illuminants = cast( List[SpectralDistribution], list(filter_illuminants(illuminants).values()), ) illuminant_display_names = ", ".join( [illuminant.display_name for illuminant in illuminants] ) title = f"{illuminant_display_names} - Illuminants Spectral Distributions" settings: Dict[str, Any] = {"title": title, "y_label": "Relative Power"} settings.update(kwargs) return plot_multi_sds(illuminants, **settings) @override_style( **{ "ytick.left": False, "ytick.labelleft": False, } ) def plot_visible_spectrum( cmfs: Union[ MultiSpectralDistributions, str, Sequence[Union[MultiSpectralDistributions, str]], ] = "CIE 1931 2 Degree Standard Observer", out_of_gamut_clipping: Boolean = True, **kwargs: Any, ) -> Tuple[plt.Figure, plt.Axes]: """ Plot the visible colours spectrum using given standard observer *CIE XYZ* colour matching functions. Parameters ---------- cmfs Standard observer colour matching functions used for computing the spectrum domain and colours. ``cmfs`` can be of any type or form supported by the :func:`colour.plotting.common.filter_cmfs` definition. out_of_gamut_clipping Whether to clip out of gamut colours otherwise, the colours will be offset by the absolute minimal colour leading to a rendering on gray background, less saturated and smoother. Other Parameters ---------------- kwargs {:func:`colour.plotting.artist`, :func:`colour.plotting.plot_single_sd`, :func:`colour.plotting.render`}, See the documentation of the previously listed definitions. Returns ------- :class:`tuple` Current figure and axes. References ---------- :cite:`Spiker2015a` Examples -------- >>> plot_visible_spectrum() # doctest: +ELLIPSIS (<Figure size ... with 1 Axes>, <...AxesSubplot...>) .. image:: ../_static/Plotting_Plot_Visible_Spectrum.png :align: center :alt: plot_visible_spectrum """ cmfs = cast( MultiSpectralDistributions, first_item(filter_cmfs(cmfs).values()) ) bounding_box = (min(cmfs.wavelengths), max(cmfs.wavelengths), 0, 1) settings: Dict[str, Any] = {"bounding_box": bounding_box, "y_label": None} settings.update(kwargs) settings["standalone"] = False _figure, axes = plot_single_sd( sd_ones(cmfs.shape), cmfs=cmfs, out_of_gamut_clipping=out_of_gamut_clipping, **settings, ) # Removing wavelength line as it doubles with the axes spine. axes.lines.pop(0) settings = { "axes": axes, "standalone": True, "title": f"The Visible Spectrum - {cmfs.display_name}", "x_label": "Wavelength $\\lambda$ (nm)", } settings.update(kwargs) return render(**settings) @override_style() def plot_single_lightness_function( function: Union[Callable, str], **kwargs: Any ) -> Tuple[plt.Figure, plt.Axes]: """ Plot given *Lightness* function. Parameters ---------- function *Lightness* function to plot. ``function`` can be of any type or form supported by the :func:`colour.plotting.common.filter_passthrough` definition. Other Parameters ---------------- kwargs {:func:`colour.plotting.artist`, :func:`colour.plotting.plot_multi_functions`, :func:`colour.plotting.render`}, See the documentation of the previously listed definitions. Returns ------- :class:`tuple` Current figure and axes. Examples -------- >>> plot_single_lightness_function("CIE 1976") # doctest: +ELLIPSIS (<Figure size ... with 1 Axes>, <...AxesSubplot...>) .. image:: ../_static/Plotting_Plot_Single_Lightness_Function.png :align: center :alt: plot_single_lightness_function """ settings: Dict[str, Any] = {"title": f"{function} - Lightness Function"} settings.update(kwargs) return plot_multi_lightness_functions((function,), **settings) @override_style() def plot_multi_lightness_functions( functions: Union[Callable, str, Sequence[Union[Callable, str]]], **kwargs: Any, ) -> Tuple[plt.Figure, plt.Axes]: """ Plot given *Lightness* functions. Parameters ---------- functions *Lightness* functions to plot. ``functions`` elements can be of any type or form supported by the :func:`colour.plotting.common.filter_passthrough` definition. Other Parameters ---------------- kwargs {:func:`colour.plotting.artist`, :func:`colour.plotting.plot_multi_functions`, :func:`colour.plotting.render`}, See the documentation of the previously listed definitions. Returns ------- :class:`tuple` Current figure and axes. Examples -------- >>> plot_multi_lightness_functions(["CIE 1976", "Wyszecki 1963"]) ... # doctest: +ELLIPSIS (<Figure size ... with 1 Axes>, <...AxesSubplot...>) .. image:: ../_static/Plotting_Plot_Multi_Lightness_Functions.png :align: center :alt: plot_multi_lightness_functions """ functions_filtered = filter_passthrough(LIGHTNESS_METHODS, functions) settings: Dict[str, Any] = { "bounding_box": (0, 1, 0, 1), "legend": True, "title": f"{', '.join(functions_filtered)} - Lightness Functions", "x_label": "Normalised Relative Luminance Y", "y_label": "Normalised Lightness", } settings.update(kwargs) with domain_range_scale("1"): return plot_multi_functions(functions_filtered, **settings) @override_style() def plot_single_luminance_function( function: Union[Callable, str], **kwargs: Any ) -> Tuple[plt.Figure, plt.Axes]: """ Plot given *Luminance* function. Parameters ---------- function *Luminance* function to plot. Other Parameters ---------------- kwargs {:func:`colour.plotting.artist`, :func:`colour.plotting.plot_multi_functions`, :func:`colour.plotting.render`}, See the documentation of the previously listed definitions. Returns ------- :class:`tuple` Current figure and axes. Examples -------- >>> plot_single_luminance_function("CIE 1976") # doctest: +ELLIPSIS (<Figure size ... with 1 Axes>, <...AxesSubplot...>) .. image:: ../_static/Plotting_Plot_Single_Luminance_Function.png :align: center :alt: plot_single_luminance_function """ settings: Dict[str, Any] = {"title": f"{function} - Luminance Function"} settings.update(kwargs) return plot_multi_luminance_functions((function,), **settings) @override_style() def plot_multi_luminance_functions( functions: Union[Callable, str, Sequence[Union[Callable, str]]], **kwargs: Any, ) -> Tuple[plt.Figure, plt.Axes]: """ Plot given *Luminance* functions. Parameters ---------- functions *Luminance* functions to plot. ``functions`` elements can be of any type or form supported by the :func:`colour.plotting.common.filter_passthrough` definition. Other Parameters ---------------- kwargs {:func:`colour.plotting.artist`, :func:`colour.plotting.plot_multi_functions`, :func:`colour.plotting.render`}, See the documentation of the previously listed definitions. Returns ------- :class:`tuple` Current figure and axes. Examples -------- >>> plot_multi_luminance_functions(["CIE 1976", "Newhall 1943"]) ... # doctest: +ELLIPSIS (<Figure size ... with 1 Axes>, <...AxesSubplot...>) .. image:: ../_static/Plotting_Plot_Multi_Luminance_Functions.png :align: center :alt: plot_multi_luminance_functions """ functions_filtered = filter_passthrough(LUMINANCE_METHODS, functions) settings: Dict[str, Any] = { "bounding_box": (0, 1, 0, 1), "legend": True, "title": f"{', '.join(functions_filtered)} - Luminance Functions", "x_label": "Normalised Munsell Value / Lightness", "y_label": "Normalised Relative Luminance Y", } settings.update(kwargs) with domain_range_scale("1"): return plot_multi_functions(functions_filtered, **settings) @override_style() def plot_blackbody_spectral_radiance( temperature: Floating = 3500, cmfs: Union[ MultiSpectralDistributions, str, Sequence[Union[MultiSpectralDistributions, str]], ] = "CIE 1931 2 Degree Standard Observer", blackbody: str = "VY Canis Major", **kwargs: Any, ) -> Tuple[plt.Figure, plt.Axes]: """ Plot given blackbody spectral radiance. Parameters ---------- temperature Blackbody temperature. cmfs Standard observer colour matching functions used for computing the spectrum domain and colours. ``cmfs`` can be of any type or form supported by the :func:`colour.plotting.common.filter_cmfs` definition. blackbody Blackbody name. Other Parameters ---------------- kwargs {:func:`colour.plotting.artist`, :func:`colour.plotting.plot_single_sd`, :func:`colour.plotting.render`}, See the documentation of the previously listed definitions. Returns ------- :class:`tuple` Current figure and axes. Examples -------- >>> plot_blackbody_spectral_radiance(3500, blackbody="VY Canis Major") ... # doctest: +ELLIPSIS (<Figure size ... with 2 Axes>, <...AxesSubplot...>) .. image:: ../_static/Plotting_Plot_Blackbody_Spectral_Radiance.png :align: center :alt: plot_blackbody_spectral_radiance """ figure = plt.figure() figure.subplots_adjust(hspace=CONSTANTS_COLOUR_STYLE.geometry.short / 2) cmfs = cast( MultiSpectralDistributions, first_item(filter_cmfs(cmfs).values()) ) sd = sd_blackbody(temperature, cmfs.shape) axes = figure.add_subplot(211) settings: Dict[str, Any] = { "axes": axes, "title": f"{blackbody} - Spectral Radiance", "y_label": "W / (sr m$^2$) / m", } settings.update(kwargs) settings["standalone"] = False plot_single_sd(sd, cmfs.name, **settings) axes = figure.add_subplot(212) with domain_range_scale("1"): XYZ = sd_to_XYZ(sd, cmfs) RGB = normalise_maximum(XYZ_to_plotting_colourspace(XYZ)) settings = { "axes": axes, "aspect": None, "title": f"{blackbody} - Colour", "x_label": f"{temperature}K", "y_label": "", "x_ticker": False, "y_ticker": False, } settings.update(kwargs) settings["standalone"] = False figure, axes = plot_single_colour_swatch(RGB, **settings) settings = {"axes": axes, "standalone": True} settings.update(kwargs) return render(**settings) @override_style( **{ "ytick.left": False, "ytick.labelleft": False, } ) def plot_blackbody_colours( shape: SpectralShape = SpectralShape(150, 12500, 50), cmfs: Union[ MultiSpectralDistributions, str, Sequence[Union[MultiSpectralDistributions, str]], ] = "CIE 1931 2 Degree Standard Observer", **kwargs: Any, ) -> Tuple[plt.Figure, plt.Axes]: """ Plot blackbody colours. Parameters ---------- shape Spectral shape to use as plot boundaries. cmfs Standard observer colour matching functions used for computing the blackbody colours. ``cmfs`` can be of any type or form supported by the :func:`colour.plotting.common.filter_cmfs` definition. Other Parameters ---------------- kwargs {:func:`colour.plotting.artist`, :func:`colour.plotting.render`}, See the documentation of the previously listed definitions. Returns ------- :class:`tuple` Current figure and axes. Examples -------- >>> plot_blackbody_colours(SpectralShape(150, 12500, 50)) ... # doctest: +ELLIPSIS (<Figure size ... with 1 Axes>, <...AxesSubplot...>) .. image:: ../_static/Plotting_Plot_Blackbody_Colours.png :align: center :alt: plot_blackbody_colours """ _figure, axes = artist(**kwargs) cmfs = cast( MultiSpectralDistributions, first_item(filter_cmfs(cmfs).values()) ) RGB = [] temperatures = [] for temperature in shape: sd = sd_blackbody(temperature, cmfs.shape) with domain_range_scale("1"): XYZ = sd_to_XYZ(sd, cmfs) RGB.append(normalise_maximum(XYZ_to_plotting_colourspace(XYZ))) temperatures.append(temperature) x_min, x_max = min(temperatures), max(temperatures) y_min, y_max = 0, 1 padding = 0.1 axes.bar( x=np.array(temperatures) - padding, height=1, width=shape.interval + (padding * shape.interval), color=RGB, align="edge", zorder=CONSTANTS_COLOUR_STYLE.zorder.background_polygon, ) settings: Dict[str, Any] = { "axes": axes, "bounding_box": (x_min, x_max, y_min, y_max), "title": "Blackbody Colours", "x_label": "Temperature K", "y_label": None, } settings.update(kwargs) return render(**settings)
bsd-3-clause
5502402d18f60277d08b3440dd3b497b
27.969849
86
0.603267
3.634549
false
false
false
false
colour-science/colour
colour/quality/tm3018.py
1
6823
""" ANSI/IES TM-30-18 Colour Fidelity Index ======================================= Defines the *ANSI/IES TM-30-18 Colour Fidelity Index* (CFI) computation objects: - :class:`colour.quality.ColourQuality_Specification_ANSIIESTM3018` - :func:`colour.quality.colour_fidelity_index_ANSIIESTM3018` References ---------- - :cite:`ANSI2018` : ANSI, & IES Color Committee. (2018). ANSI/IES TM-30-18 - IES Method for Evaluating Light Source Color Rendition. ISBN:978-0-87995-379-9 """ from __future__ import annotations import numpy as np from dataclasses import dataclass from colour.colorimetry import SpectralDistribution from colour.hints import ( ArrayLike, Boolean, Floating, List, NDArray, Tuple, Union, cast, ) from colour.quality import colour_fidelity_index_CIE2017 from colour.quality.cfi2017 import ( ColourRendering_Specification_CIE2017, DataColorimetry_TCS_CIE2017, delta_E_to_R_f, ) from colour.utilities import as_float_array, as_float_scalar, as_int_scalar @dataclass class ColourQuality_Specification_ANSIIESTM3018: """ Define the *ANSI/IES TM-30-18 Colour Fidelity Index* (CFI) colour quality specification. Parameters ---------- name Name of the test spectral distribution. sd_test Spectral distribution of the tested illuminant. sd_reference Spectral distribution of the reference illuminant. R_f *Colour Fidelity Index* (CFI) :math:`R_f`. R_s Individual *colour fidelity indexes* data for each sample. CCT Correlated colour temperature :math:`T_{cp}`. D_uv Distance from the Planckian locus :math:`\\Delta_{uv}`. colorimetry_data Colorimetry data for the test and reference computations. R_g Gamut index :math:`R_g`. bins List of 16 lists, each containing the indexes of colour samples that lie in the respective hue bin. averages_test Averages of *CAM02-UCS* a', b' coordinates for each hue bin for test samples. averages_reference Averages for reference samples. average_norms Distance of averages for reference samples from the origin. R_fs Local colour fidelities for each hue bin. R_cs Local chromaticity shifts for each hue bin, in percents. R_hs Local hue shifts for each hue bin. """ name: str sd_test: SpectralDistribution sd_reference: SpectralDistribution R_f: Floating R_s: NDArray CCT: Floating D_uv: Floating colorimetry_data: Tuple[ Tuple[DataColorimetry_TCS_CIE2017, ...], Tuple[DataColorimetry_TCS_CIE2017, ...], ] R_g: Floating bins: List[List[int]] averages_test: NDArray averages_reference: NDArray average_norms: NDArray R_fs: NDArray R_cs: NDArray R_hs: NDArray def colour_fidelity_index_ANSIIESTM3018( sd_test: SpectralDistribution, additional_data: Boolean = False ) -> Union[ Floating, ColourQuality_Specification_ANSIIESTM3018, ColourRendering_Specification_CIE2017, ]: """ Return the *ANSI/IES TM-30-18 Colour Fidelity Index* (CFI) :math:`R_f` of given spectral distribution. Parameters ---------- sd_test Test spectral distribution. additional_data Whether to output additional data. Returns ------- :class:`numpy.floating` or \ :class:`colour.quality.ColourQuality_Specification_ANSIIESTM3018` *ANSI/IES TM-30-18 Colour Fidelity Index* (CFI). References ---------- :cite:`ANSI2018` Examples -------- >>> from colour import SDS_ILLUMINANTS >>> sd = SDS_ILLUMINANTS["FL2"] >>> colour_fidelity_index_ANSIIESTM3018(sd) # doctest: +ELLIPSIS 70.1208254... """ if not additional_data: return colour_fidelity_index_CIE2017(sd_test, False) specification: ( ColourRendering_Specification_CIE2017 ) = colour_fidelity_index_CIE2017( sd_test, True ) # type: ignore[assignment] # Setup bins based on where the reference a'b' points are located. bins: List[List[int]] = [[] for _i in range(16)] for i, sample in enumerate(specification.colorimetry_data[1]): bin_index = as_int_scalar( np.floor(cast(Floating, sample.CAM.h) / 22.5) ) bins[bin_index].append(i) # Per-bin a'b' averages. averages_test = np.empty([16, 2]) averages_reference = np.empty([16, 2]) for i in range(16): apbp_s = [ specification.colorimetry_data[0][j].Jpapbp[[1, 2]] for j in bins[i] ] averages_test[i, :] = np.mean(apbp_s, axis=0) apbp_s = [ specification.colorimetry_data[1][j].Jpapbp[[1, 2]] for j in bins[i] ] averages_reference[i, :] = np.mean(apbp_s, axis=0) # Gamut Index. R_g = 100 * ( averages_area(averages_test) / averages_area(averages_reference) ) # Local colour fidelity indexes, i.e. 16 CFIs for each bin. bin_delta_E_s = [ np.mean([specification.delta_E_s[bins[i]]]) for i in range(16) ] R_fs = as_float_array(delta_E_to_R_f(bin_delta_E_s)) # Angles bisecting the hue bins. angles = (22.5 * np.arange(16) + 11.25) / 180 * np.pi cosines = np.cos(angles) sines = np.sin(angles) average_norms = np.linalg.norm(averages_reference, axis=1) a_deltas = averages_test[:, 0] - averages_reference[:, 0] b_deltas = averages_test[:, 1] - averages_reference[:, 1] # Local chromaticity shifts, multiplied by 100 to obtain percentages. R_cs = 100 * (a_deltas * cosines + b_deltas * sines) / average_norms # Local hue shifts. R_hs = (-a_deltas * sines + b_deltas * cosines) / average_norms return ColourQuality_Specification_ANSIIESTM3018( specification.name, sd_test, specification.sd_reference, specification.R_f, specification.R_s, specification.CCT, specification.D_uv, specification.colorimetry_data, R_g, bins, averages_test, averages_reference, average_norms, R_fs, R_cs, R_hs, ) def averages_area(averages: ArrayLike) -> Floating: """ Compute the area of the polygon formed by the hue bin averages. Parameters ---------- averages Hue bin averages. Returns ------- :class:`numpy.floating` Area of the polygon. """ averages = as_float_array(averages) N = averages.shape[0] triangle_areas = np.empty(N) for i in range(N): u = averages[i, :] v = averages[(i + 1) % N, :] triangle_areas[i] = (u[0] * v[1] - u[1] * v[0]) / 2 return as_float_scalar(np.sum(triangle_areas))
bsd-3-clause
77f6ef83b262b3c815bd3f4439299fe6
26.623482
79
0.6226
3.3348
false
true
false
false
colour-science/colour
colour/models/cam16_ucs.py
1
13152
""" CAM16-LCD, CAM16-SCD, and CAM16-UCS Colourspaces - Li et al. (2017) =================================================================== Defines the *Li, Li, Wang, Zu, Luo, Cui, Melgosa, Brill and Pointer (2017)* *CAM16-LCD*, *CAM16-SCD*, and *CAM16-UCS* colourspaces transformations: - :func:`colour.JMh_CAM16_to_CAM16LCD` - :func:`colour.CAM16LCD_to_JMh_CAM16` - :func:`colour.JMh_CAM16_to_CAM16SCD` - :func:`colour.CAM16SCD_to_JMh_CAM16` - :func:`colour.JMh_CAM16_to_CAM16UCS` - :func:`colour.CAM16UCS_to_JMh_CAM16` - :func:`colour.XYZ_to_CAM16LCD` - :func:`colour.CAM16LCD_to_XYZ` - :func:`colour.XYZ_to_CAM16SCD` - :func:`colour.CAM16SCD_to_XYZ` - :func:`colour.XYZ_to_CAM16UCS` - :func:`colour.CAM16UCS_to_XYZ` References ---------- - :cite:`Li2017` : Li, C., Li, Z., Wang, Z., Xu, Y., Luo, M. R., Cui, G., Melgosa, M., Brill, M. H., & Pointer, M. (2017). Comprehensive color solutions: CAM16, CAT16, and CAM16-UCS. Color Research & Application, 42(6), 703-718. doi:10.1002/col.22131 """ from __future__ import annotations import re from functools import partial from colour.hints import ( Callable, Any, ArrayLike, FloatingOrNDArray, NDArray, cast, ) from colour.models.cam02_ucs import ( COEFFICIENTS_UCS_LUO2006, JMh_CIECAM02_to_UCS_Luo2006, UCS_Luo2006_to_JMh_CIECAM02, JMh_CIECAM02_to_CAM02LCD, CAM02LCD_to_JMh_CIECAM02, JMh_CIECAM02_to_CAM02SCD, CAM02SCD_to_JMh_CIECAM02, JMh_CIECAM02_to_CAM02UCS, CAM02UCS_to_JMh_CIECAM02, XYZ_to_CAM02LCD, CAM02LCD_to_XYZ, XYZ_to_CAM02SCD, CAM02SCD_to_XYZ, XYZ_to_CAM02UCS, CAM02UCS_to_XYZ, ) from colour.utilities import ( as_float_array, copy_definition, get_domain_range_scale, optional, tsplit, tstack, ) __author__ = "Colour Developers" __copyright__ = "Copyright 2013 Colour Developers" __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" __maintainer__ = "Colour Developers" __email__ = "colour-developers@colour-science.org" __status__ = "Production" __all__ = [ "JMh_CAM16_to_UCS_Li2017", "UCS_Li2017_to_JMh_CAM16", "JMh_CAM16_to_CAM16LCD", "CAM16LCD_to_JMh_CAM16", "JMh_CAM16_to_CAM16SCD", "CAM16SCD_to_JMh_CAM16", "JMh_CAM16_to_CAM16UCS", "CAM16UCS_to_JMh_CAM16", "XYZ_to_UCS_Li2017", "UCS_Li2017_to_XYZ", "XYZ_to_CAM16LCD", "CAM16LCD_to_XYZ", "XYZ_to_CAM16SCD", "CAM16SCD_to_XYZ", "XYZ_to_CAM16UCS", "CAM16UCS_to_XYZ", ] def _UCS_Luo2006_callable_to_UCS_Li2017_docstring(callable_: Callable) -> str: """ Convert given *Luo et al. (2006)* callable docstring to *Li et al. (2017)* docstring. Parameters ---------- callable_ Callable to use the docstring from. Returns ------- :class:`str` Docstring. """ docstring = callable_.__doc__ # NOTE: Required for optimised python launch. docstring = optional(docstring, "") docstring = docstring.replace("Luo et al. (2006)", "Li et al. (2017)") docstring = docstring.replace("CIECAM02", "CAM16") docstring = docstring.replace("CAM02", "CAM16") docstring = docstring.replace("Luo2006b", "Li2017") match = re.match("(.*)Examples", docstring, re.DOTALL) if match is not None: docstring = match.group(1) return docstring JMh_CAM16_to_UCS_Li2017 = copy_definition( JMh_CIECAM02_to_UCS_Luo2006, "JMh_CAM16_to_UCS_Li2017" ) JMh_CAM16_to_UCS_Li2017.__doc__ = ( _UCS_Luo2006_callable_to_UCS_Li2017_docstring(JMh_CIECAM02_to_UCS_Luo2006) ) UCS_Li2017_to_JMh_CAM16 = copy_definition( UCS_Luo2006_to_JMh_CIECAM02, "UCS_Li2017_to_JMh_CAM16" ) UCS_Li2017_to_JMh_CAM16.__doc__ = ( _UCS_Luo2006_callable_to_UCS_Li2017_docstring(UCS_Luo2006_to_JMh_CIECAM02) ) JMh_CAM16_to_CAM16LCD = partial( JMh_CAM16_to_UCS_Li2017, coefficients=COEFFICIENTS_UCS_LUO2006["CAM02-LCD"] ) JMh_CAM16_to_CAM16LCD.__doc__ = _UCS_Luo2006_callable_to_UCS_Li2017_docstring( JMh_CIECAM02_to_CAM02LCD ) CAM16LCD_to_JMh_CAM16 = partial( UCS_Li2017_to_JMh_CAM16, coefficients=COEFFICIENTS_UCS_LUO2006["CAM02-LCD"] ) CAM16LCD_to_JMh_CAM16.__doc__ = _UCS_Luo2006_callable_to_UCS_Li2017_docstring( CAM02LCD_to_JMh_CIECAM02 ) JMh_CAM16_to_CAM16SCD = partial( JMh_CAM16_to_UCS_Li2017, coefficients=COEFFICIENTS_UCS_LUO2006["CAM02-SCD"] ) JMh_CAM16_to_CAM16SCD.__doc__ = _UCS_Luo2006_callable_to_UCS_Li2017_docstring( JMh_CIECAM02_to_CAM02SCD ) CAM16SCD_to_JMh_CAM16 = partial( UCS_Li2017_to_JMh_CAM16, coefficients=COEFFICIENTS_UCS_LUO2006["CAM02-SCD"] ) CAM16SCD_to_JMh_CAM16.__doc__ = _UCS_Luo2006_callable_to_UCS_Li2017_docstring( CAM02SCD_to_JMh_CIECAM02 ) JMh_CAM16_to_CAM16UCS = partial( JMh_CAM16_to_UCS_Li2017, coefficients=COEFFICIENTS_UCS_LUO2006["CAM02-UCS"] ) JMh_CAM16_to_CAM16UCS.__doc__ = _UCS_Luo2006_callable_to_UCS_Li2017_docstring( JMh_CIECAM02_to_CAM02UCS ) CAM16UCS_to_JMh_CAM16 = partial( UCS_Li2017_to_JMh_CAM16, coefficients=COEFFICIENTS_UCS_LUO2006["CAM02-UCS"] ) CAM16UCS_to_JMh_CAM16.__doc__ = _UCS_Luo2006_callable_to_UCS_Li2017_docstring( CAM02UCS_to_JMh_CIECAM02 ) def XYZ_to_UCS_Li2017( XYZ: ArrayLike, coefficients: ArrayLike, **kwargs: Any ) -> NDArray: """ Convert from *CIE XYZ* tristimulus values to one of the *Li et al. (2017)* *CAM16-LCD*, *CAM16-SCD*, or *CAM16-UCS* colourspaces :math:`J'a'b'` array. Parameters ---------- XYZ *CIE XYZ* tristimulus values. coefficients Coefficients of one of the *Li et al. (2017)* *CAM16-LCD*, *CAM16-SCD*, or *CAM16-UCS* colourspaces. Other Parameters ---------------- kwargs {:func:`colour.XYZ_to_CAM16`}, See the documentation of the previously listed definition. The default viewing conditions are that of *IEC 61966-2-1:1999*, i.e. *sRGB* 64 Lux ambient illumination, 80 :math:`cd/m^2`, adapting field luminance about 20% of a white object in the scene. Returns ------- :class:`numpy.ndarray` *Li et al. (2017)* *CAM16-LCD*, *CAM16-SCD*, or *CAM16-UCS* colourspaces :math:`J'a'b'` array. Warnings -------- The ``XYZ_w`` parameter for :func:`colour.XYZ_to_CAM16` definition must be given in the same domain-range scale than the ``XYZ`` parameter. Notes ----- +------------+------------------------+------------------+ | **Domain** | **Scale - Reference** | **Scale - 1** | +============+========================+==================+ | ``XYZ`` | [0, 1] | [0, 1] | +------------+------------------------+------------------+ +------------+------------------------+------------------+ | **Range** | **Scale - Reference** | **Scale - 1** | +============+========================+==================+ | ``Jpapbp`` | ``Jp`` : [0, 100] | ``Jp`` : [0, 1] | | | | | | | ``ap`` : [-100, 100] | ``ap`` : [-1, 1] | | | | | | | ``bp`` : [-100, 100] | ``bp`` : [-1, 1] | +------------+------------------------+------------------+ Examples -------- >>> import numpy as np >>> XYZ = np.array([0.20654008, 0.12197225, 0.05136952]) >>> XYZ_to_UCS_Li2017(XYZ, COEFFICIENTS_UCS_LUO2006["CAM02-LCD"]) ... # doctest: +ELLIPSIS array([ 46.0658603..., 41.0758649..., 14.5102582...]) >>> from colour.appearance import CAM_KWARGS_CIECAM02_sRGB >>> XYZ_w = CAM_KWARGS_CIECAM02_sRGB["XYZ_w"] >>> XYZ_to_UCS_Li2017( ... XYZ, COEFFICIENTS_UCS_LUO2006["CAM02-LCD"], XYZ_w=XYZ_w / 100 ... ) ... # doctest: +ELLIPSIS array([ 46.0658603..., 41.0758649..., 14.5102582...]) """ from colour.appearance import CAM_KWARGS_CIECAM02_sRGB, XYZ_to_CAM16 domain_range_reference = get_domain_range_scale() == "reference" settings = CAM_KWARGS_CIECAM02_sRGB.copy() settings.update(**kwargs) XYZ_w = kwargs.get("XYZ_w") if XYZ_w is not None and domain_range_reference: settings["XYZ_w"] = XYZ_w * 100 if domain_range_reference: XYZ = as_float_array(XYZ) * 100 specification = XYZ_to_CAM16(XYZ, **settings) JMh = tstack( [ cast(FloatingOrNDArray, specification.J), cast(FloatingOrNDArray, specification.M), cast(FloatingOrNDArray, specification.h), ] ) return JMh_CAM16_to_UCS_Li2017(JMh, coefficients) def UCS_Li2017_to_XYZ( Jpapbp: ArrayLike, coefficients: ArrayLike, **kwargs: Any ) -> NDArray: """ Convert from one of the *Li et al. (2017)* *CAM16-LCD*, *CAM16-SCD*, or *CAM16-UCS* colourspaces :math:`J'a'b'` array to *CIE XYZ* tristimulus values. Parameters ---------- Jpapbp *Li et al. (2017)* *CAM16-LCD*, *CAM16-SCD*, or *CAM16-UCS* colourspaces :math:`J'a'b'` array. coefficients Coefficients of one of the *Li et al. (2017)* *CAM16-LCD*, *CAM16-SCD*, or *CAM16-UCS* colourspaces. Other Parameters ---------------- kwargs {:func:`colour.CAM16_to_XYZ`}, See the documentation of the previously listed definition. The default viewing conditions are that of *IEC 61966-2-1:1999*, i.e. *sRGB* 64 Lux ambient illumination, 80 :math:`cd/m^2`, adapting field luminance about 20% of a white object in the scene. Returns ------- :class:`numpy.ndarray` *CIE XYZ* tristimulus values. Warnings -------- The ``XYZ_w`` parameter for :func:`colour.XYZ_to_CAM16` definition must be given in the same domain-range scale than the ``XYZ`` parameter. Notes ----- +------------+------------------------+------------------+ | **Domain** | **Scale - Reference** | **Scale - 1** | +============+========================+==================+ | ``Jpapbp`` | ``Jp`` : [0, 100] | ``Jp`` : [0, 1] | | | | | | | ``ap`` : [-100, 100] | ``ap`` : [-1, 1] | | | | | | | ``bp`` : [-100, 100] | ``bp`` : [-1, 1] | +------------+------------------------+------------------+ +------------+------------------------+------------------+ | **Range** | **Scale - Reference** | **Scale - 1** | +============+========================+==================+ | ``XYZ`` | [0, 1] | [0, 1] | +------------+------------------------+------------------+ Examples -------- >>> import numpy as np >>> Jpapbp = np.array([46.06586037, 41.07586491, 14.51025828]) >>> UCS_Li2017_to_XYZ(Jpapbp, COEFFICIENTS_UCS_LUO2006["CAM02-LCD"]) ... # doctest: +ELLIPSIS array([ 0.2065400..., 0.1219722..., 0.0513695...]) >>> from colour.appearance import CAM_KWARGS_CIECAM02_sRGB >>> XYZ_w = CAM_KWARGS_CIECAM02_sRGB["XYZ_w"] >>> UCS_Li2017_to_XYZ( ... Jpapbp, COEFFICIENTS_UCS_LUO2006["CAM02-LCD"], XYZ_w=XYZ_w / 100 ... ) ... # doctest: +ELLIPSIS array([ 0.2065400..., 0.1219722..., 0.0513695...]) """ from colour.appearance import ( CAM_KWARGS_CIECAM02_sRGB, CAM_Specification_CAM16, CAM16_to_XYZ, ) domain_range_reference = get_domain_range_scale() == "reference" settings = CAM_KWARGS_CIECAM02_sRGB.copy() settings.update(**kwargs) XYZ_w = kwargs.get("XYZ_w") if XYZ_w is not None and domain_range_reference: settings["XYZ_w"] = XYZ_w * 100 J, M, h = tsplit(UCS_Li2017_to_JMh_CAM16(Jpapbp, coefficients)) specification = CAM_Specification_CAM16(J=J, M=M, h=h) XYZ = CAM16_to_XYZ(specification, **settings) if domain_range_reference: XYZ /= 100 return XYZ XYZ_to_CAM16LCD = partial( XYZ_to_UCS_Li2017, coefficients=COEFFICIENTS_UCS_LUO2006["CAM02-LCD"] ) XYZ_to_CAM16LCD.__doc__ = _UCS_Luo2006_callable_to_UCS_Li2017_docstring( XYZ_to_CAM02LCD ) CAM16LCD_to_XYZ = partial( UCS_Li2017_to_XYZ, coefficients=COEFFICIENTS_UCS_LUO2006["CAM02-LCD"] ) CAM16LCD_to_XYZ.__doc__ = _UCS_Luo2006_callable_to_UCS_Li2017_docstring( CAM02LCD_to_XYZ ) XYZ_to_CAM16SCD = partial( XYZ_to_UCS_Li2017, coefficients=COEFFICIENTS_UCS_LUO2006["CAM02-SCD"] ) XYZ_to_CAM16SCD.__doc__ = _UCS_Luo2006_callable_to_UCS_Li2017_docstring( XYZ_to_CAM02SCD ) CAM16SCD_to_XYZ = partial( UCS_Li2017_to_XYZ, coefficients=COEFFICIENTS_UCS_LUO2006["CAM02-SCD"] ) CAM16SCD_to_XYZ.__doc__ = _UCS_Luo2006_callable_to_UCS_Li2017_docstring( CAM02SCD_to_XYZ ) XYZ_to_CAM16UCS = partial( XYZ_to_UCS_Li2017, coefficients=COEFFICIENTS_UCS_LUO2006["CAM02-UCS"] ) XYZ_to_CAM16UCS.__doc__ = _UCS_Luo2006_callable_to_UCS_Li2017_docstring( XYZ_to_CAM02UCS ) CAM16UCS_to_XYZ = partial( UCS_Li2017_to_XYZ, coefficients=COEFFICIENTS_UCS_LUO2006["CAM02-UCS"] ) CAM16UCS_to_XYZ.__doc__ = _UCS_Luo2006_callable_to_UCS_Li2017_docstring( CAM02UCS_to_XYZ )
bsd-3-clause
0ec74730a7374bbec474172ccd428b11
30.539568
79
0.569343
2.788213
false
false
false
false
colour-science/colour
colour/models/cie_luv.py
1
15852
""" CIE L*u*v* Colourspace ====================== Defines the *CIE L\\*u\\*v\\** colourspace transformations: - :func:`colour.XYZ_to_Luv` - :func:`colour.Luv_to_XYZ` - :func:`colour.Luv_to_uv` - :func:`colour.uv_to_Luv` - :func:`colour.Luv_uv_to_xy` - :func:`colour.xy_to_Luv_uv` - :func:`colour.Luv_to_LCHuv` - :func:`colour.LCHuv_to_Luv` References ---------- - :cite:`CIETC1-482004j` : CIE TC 1-48. (2004). CIE 1976 uniform chromaticity scale diagram (UCS diagram). In CIE 015:2004 Colorimetry, 3rd Edition (p. 24). ISBN:978-3-901906-33-6 - :cite:`CIETC1-482004m` : CIE TC 1-48. (2004). CIE 1976 uniform colour spaces. In CIE 015:2004 Colorimetry, 3rd Edition (p. 24). ISBN:978-3-901906-33-6 - :cite:`Wikipedia2007b` : Wikipedia. (2007). CIELUV. Retrieved February 24, 2014, from http://en.wikipedia.org/wiki/CIELUV - :cite:`Wikipedia2007d` : Wikipedia. (2007). The reverse transformation. Retrieved February 24, 2014, from http://en.wikipedia.org/wiki/CIELUV#The_reverse_transformation """ from __future__ import annotations from colour.algebra import sdiv, sdiv_mode from colour.colorimetry import ( CCS_ILLUMINANTS, lightness_CIE1976, luminance_CIE1976, ) from colour.hints import ArrayLike, Floating, NDArray from colour.models import xy_to_xyY, xyY_to_XYZ, Jab_to_JCh, JCh_to_Jab from colour.utilities import ( domain_range_scale, as_float_scalar, from_range_1, from_range_100, full, to_domain_1, to_domain_100, tsplit, tstack, ) __author__ = "Colour Developers" __copyright__ = "Copyright 2013 Colour Developers" __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" __maintainer__ = "Colour Developers" __email__ = "colour-developers@colour-science.org" __status__ = "Production" __all__ = [ "XYZ_to_Luv", "Luv_to_XYZ", "Luv_to_uv", "uv_to_Luv", "Luv_uv_to_xy", "xy_to_Luv_uv", "Luv_to_LCHuv", "LCHuv_to_Luv", ] def XYZ_to_Luv( XYZ: ArrayLike, illuminant: ArrayLike = CCS_ILLUMINANTS[ "CIE 1931 2 Degree Standard Observer" ]["D65"], ) -> NDArray: """ Convert from *CIE XYZ* tristimulus values to *CIE L\\*u\\*v\\** colourspace. Parameters ---------- XYZ *CIE XYZ* tristimulus values. illuminant Reference *illuminant* *CIE xy* chromaticity coordinates or *CIE xyY* colourspace array. Returns ------- :class:`numpy.ndarray` *CIE L\\*u\\*v\\** colourspace array. Notes ----- +----------------+-----------------------+-----------------+ | **Domain** | **Scale - Reference** | **Scale - 1** | +================+=======================+=================+ | ``XYZ`` | [0, 1] | [0, 1] | +----------------+-----------------------+-----------------+ | ``illuminant`` | [0, 1] | [0, 1] | +----------------+-----------------------+-----------------+ +----------------+-----------------------+-----------------+ | **Range** | **Scale - Reference** | **Scale - 1** | +================+=======================+=================+ | ``Luv`` | ``L`` : [0, 100] | ``L`` : [0, 1] | | | | | | | ``u`` : [-100, 100] | ``u`` : [-1, 1] | | | | | | | ``v`` : [-100, 100] | ``v`` : [-1, 1] | +----------------+-----------------------+-----------------+ References ---------- :cite:`CIETC1-482004m`, :cite:`Wikipedia2007b` Examples -------- >>> import numpy as np >>> XYZ = np.array([0.20654008, 0.12197225, 0.05136952]) >>> XYZ_to_Luv(XYZ) # doctest: +ELLIPSIS array([ 41.5278752..., 96.8362605..., 17.7521014...]) """ X, Y, Z = tsplit(to_domain_1(XYZ)) X_r, Y_r, Z_r = tsplit(xyY_to_XYZ(xy_to_xyY(illuminant))) with domain_range_scale("100"): L = lightness_CIE1976(Y, Y_r) X_Y_Z = X + 15 * Y + 3 * Z X_r_Y_r_Z_r = X_r + 15 * Y_r + 3 * Z_r with sdiv_mode(): u = 13 * L * ((4 * sdiv(X, X_Y_Z)) - (4 * sdiv(X_r, X_r_Y_r_Z_r))) v = 13 * L * ((9 * sdiv(Y, X_Y_Z)) - (9 * sdiv(Y_r, X_r_Y_r_Z_r))) Luv = tstack([L, u, v]) return from_range_100(Luv) def Luv_to_XYZ( Luv: ArrayLike, illuminant: ArrayLike = CCS_ILLUMINANTS[ "CIE 1931 2 Degree Standard Observer" ]["D65"], ) -> NDArray: """ Convert from *CIE L\\*u\\*v\\** colourspace to *CIE XYZ* tristimulus values. Parameters ---------- Luv *CIE L\\*u\\*v\\** colourspace array. illuminant Reference *illuminant* *CIE xy* chromaticity coordinates or *CIE xyY* colourspace array. Returns ------- :class:`numpy.ndarray` *CIE XYZ* tristimulus values. Notes ----- +----------------+-----------------------+-----------------+ | **Domain** | **Scale - Reference** | **Scale - 1** | +================+=======================+=================+ | ``Luv`` | ``L`` : [0, 100] | ``L`` : [0, 1] | | | | | | | ``u`` : [-100, 100] | ``u`` : [-1, 1] | | | | | | | ``v`` : [-100, 100] | ``v`` : [-1, 1] | +----------------+-----------------------+-----------------+ | ``illuminant`` | [0, 1] | [0, 1] | +----------------+-----------------------+-----------------+ +----------------+-----------------------+-----------------+ | **Range** | **Scale - Reference** | **Scale - 1** | +================+=======================+=================+ | ``XYZ`` | [0, 1] | [0, 1] | +----------------+-----------------------+-----------------+ References ---------- :cite:`CIETC1-482004m`, :cite:`Wikipedia2007b` Examples -------- >>> import numpy as np >>> Luv = np.array([41.52787529, 96.83626054, 17.75210149]) >>> Luv_to_XYZ(Luv) # doctest: +ELLIPSIS array([ 0.2065400..., 0.1219722..., 0.0513695...]) """ L, u, v = tsplit(to_domain_100(Luv)) X_r, Y_r, Z_r = tsplit(xyY_to_XYZ(xy_to_xyY(illuminant))) with domain_range_scale("100"): Y = luminance_CIE1976(L, Y_r) X_r_Y_r_Z_r = X_r + 15 * Y_r + 3 * Z_r with sdiv_mode(): a_1 = u + 13 * L * (4 * sdiv(X_r, X_r_Y_r_Z_r)) d_1 = v + 13 * L * (9 * sdiv(Y_r, X_r_Y_r_Z_r)) a = 1 / 3 * (52 * sdiv(L, a_1) - 1) b = -5 * Y c = -1 / 3 d = Y * (39 * sdiv(L, d_1) - 5) X = sdiv(d - b, a - c) Z = X * a + b XYZ = tstack([X, Y, Z]) return from_range_1(XYZ) def Luv_to_uv( Luv: ArrayLike, illuminant: ArrayLike = CCS_ILLUMINANTS[ "CIE 1931 2 Degree Standard Observer" ]["D65"], ) -> NDArray: """ Return the :math:`uv^p` chromaticity coordinates from given *CIE L\\*u\\*v\\** colourspace array. Parameters ---------- Luv *CIE L\\*u\\*v\\** colourspace array. illuminant Reference *illuminant* *CIE xy* chromaticity coordinates or *CIE xyY* colourspace array. Returns ------- :class:`numpy.ndarray` :math:`uv^p` chromaticity coordinates. Notes ----- +----------------+-----------------------+-----------------+ | **Domain** | **Scale - Reference** | **Scale - 1** | +================+=======================+=================+ | ``Luv`` | ``L`` : [0, 100] | ``L`` : [0, 1] | | | | | | | ``u`` : [-100, 100] | ``u`` : [-1, 1] | | | | | | | ``v`` : [-100, 100] | ``v`` : [-1, 1] | +----------------+-----------------------+-----------------+ | ``illuminant`` | [0, 1] | [0, 1] | +----------------+-----------------------+-----------------+ References ---------- :cite:`CIETC1-482004j` Examples -------- >>> import numpy as np >>> Luv = np.array([41.52787529, 96.83626054, 17.75210149]) >>> Luv_to_uv(Luv) # doctest: +ELLIPSIS array([ 0.3772021..., 0.5012026...]) """ Luv = to_domain_100(Luv) X, Y, Z = tsplit(Luv_to_XYZ(Luv, illuminant)) X_Y_Z = X + 15 * Y + 3 * Z with sdiv_mode(): uv = tstack([4 * sdiv(X, X_Y_Z), 9 * sdiv(Y, X_Y_Z)]) return uv def uv_to_Luv( uv: ArrayLike, illuminant: ArrayLike = CCS_ILLUMINANTS[ "CIE 1931 2 Degree Standard Observer" ]["D65"], Y: Floating = 1, ) -> NDArray: """ Return the *CIE L\\*u\\*v\\** colourspace array from given :math:`uv^p` chromaticity coordinates by extending the array last dimension with given :math:`L` *Lightness*. Parameters ---------- uv :math:`uv^p` chromaticity coordinates. illuminant Reference *illuminant* *CIE xy* chromaticity coordinates or *CIE xyY* colourspace array. Y Optional :math:`Y` *luminance* value used to construct the intermediate *CIE XYZ* colourspace array, the default :math:`Y` *luminance* value is 1. Returns ------- :class:`numpy.ndarray` *CIE L\\*u\\*v\\** colourspace array. Notes ----- +----------------+-----------------------+-----------------+ | **Range** | **Scale - Reference** | **Scale - 1** | +================+=======================+=================+ | ``Luv`` | ``L`` : [0, 100] | ``L`` : [0, 1] | | | | | | | ``u`` : [-100, 100] | ``u`` : [-1, 1] | | | | | | | ``v`` : [-100, 100] | ``v`` : [-1, 1] | +----------------+-----------------------+-----------------+ | ``illuminant`` | [0, 1] | [0, 1] | +----------------+-----------------------+-----------------+ References ---------- :cite:`CIETC1-482004j` Examples -------- >>> import numpy as np >>> uv = np.array([0.37720213, 0.50120264]) >>> uv_to_Luv(uv) # doctest: +ELLIPSIS array([ 100. , 233.1837603..., 42.7474385...]) """ u, v = tsplit(uv) Y = as_float_scalar(to_domain_1(Y)) with sdiv_mode(): X = 9 * sdiv(u, 4 * v) Z = sdiv(-5 * Y * v - 3 * u / 4 + 3, v) XYZ = tstack([X, full(u.shape, Y), Z]) return XYZ_to_Luv(from_range_1(XYZ), illuminant) def Luv_uv_to_xy(uv: ArrayLike) -> NDArray: """ Return the *CIE xy* chromaticity coordinates from given *CIE L\\*u\\*v\\** colourspace :math:`uv^p` chromaticity coordinates. Parameters ---------- uv *CIE L\\*u\\*v\\* u"v"* chromaticity coordinates. Returns ------- :class:`numpy.ndarray` *CIE xy* chromaticity coordinates. References ---------- :cite:`Wikipedia2007d` Examples -------- >>> import numpy as np >>> uv = np.array([0.37720213, 0.50120264]) >>> Luv_uv_to_xy(uv) # doctest: +ELLIPSIS array([ 0.5436955..., 0.3210794...]) """ u, v = tsplit(uv) d = 6 * u - 16 * v + 12 xy = tstack([9 * u / d, 4 * v / d]) return xy def xy_to_Luv_uv(xy: ArrayLike) -> NDArray: """ Return the *CIE L\\*u\\*v\\** colourspace :math:`uv^p` chromaticity coordinates from given *CIE xy* chromaticity coordinates. Parameters ---------- xy *CIE xy* chromaticity coordinates. Returns ------- :class:`numpy.ndarray` *CIE L\\*u\\*v\\* u"v"* chromaticity coordinates. References ---------- :cite:`Wikipedia2007b` Examples -------- >>> import numpy as np >>> xy = np.array([0.54369558, 0.32107944]) >>> xy_to_Luv_uv(xy) # doctest: +ELLIPSIS array([ 0.3772021..., 0.5012026...]) """ x, y = tsplit(xy) d = -2 * x + 12 * y + 3 uv = tstack([4 * x / d, 9 * y / d]) return uv def Luv_to_LCHuv(Luv: ArrayLike) -> NDArray: """ Convert from *CIE L\\*u\\*v\\** colourspace to *CIE L\\*C\\*Huv* colourspace. Parameters ---------- Luv *CIE L\\*u\\*v\\** colourspace array. Returns ------- :class:`numpy.ndarray` *CIE L\\*C\\*Huv* colourspace array. Notes ----- +------------+-----------------------+-----------------+ | **Domain** | **Scale - Reference** | **Scale - 1** | +============+=======================+=================+ | ``Luv`` | ``L`` : [0, 100] | ``L`` : [0, 1] | | | | | | | ``u`` : [-100, 100] | ``u`` : [-1, 1] | | | | | | | ``v`` : [-100, 100] | ``v`` : [-1, 1] | +------------+-----------------------+-----------------+ +------------+-----------------------+------------------+ | **Range** | **Scale - Reference** | **Scale - 1** | +============+=======================+==================+ | ``LCHuv`` | ``L`` : [0, 100] | ``L`` : [0, 1] | | | | | | | ``C`` : [0, 100] | ``C`` : [0, 1] | | | | | | | ``Huv`` : [0, 360] | ``Huv`` : [0, 1] | +------------+-----------------------+------------------+ References ---------- :cite:`CIETC1-482004m` Examples -------- >>> import numpy as np >>> Luv = np.array([41.52787529, 96.83626054, 17.75210149]) >>> Luv_to_LCHuv(Luv) # doctest: +ELLIPSIS array([ 41.5278752..., 98.4499795..., 10.3881634...]) """ return Jab_to_JCh(Luv) def LCHuv_to_Luv(LCHuv: ArrayLike) -> NDArray: """ Convert from *CIE L\\*C\\*Huv* colourspace to *CIE L\\*u\\*v\\** colourspace. Parameters ---------- LCHuv *CIE L\\*C\\*Huv* colourspace array. Returns ------- :class:`numpy.ndarray` *CIE L\\*u\\*v\\** colourspace array. Notes ----- +------------+-----------------------+------------------+ | **Domain** | **Scale - Reference** | **Scale - 1** | +============+=======================+==================+ | ``LCHuv`` | ``L`` : [0, 100] | ``L`` : [0, 1] | | | | | | | ``C`` : [0, 100] | ``C`` : [0, 1] | | | | | | | ``Huv`` : [0, 360] | ``Huv`` : [0, 1] | +------------+-----------------------+------------------+ +------------+-----------------------+-----------------+ | **Range** | **Scale - Reference** | **Scale - 1** | +============+=======================+=================+ | ``Luv`` | ``L`` : [0, 100] | ``L`` : [0, 1] | | | | | | | ``u`` : [-100, 100] | ``u`` : [-1, 1] | | | | | | | ``v`` : [-100, 100] | ``v`` : [-1, 1] | +------------+-----------------------+-----------------+ References ---------- :cite:`CIETC1-482004m` Examples -------- >>> import numpy as np >>> LCHuv = np.array([41.52787529, 98.44997950, 10.38816348]) >>> LCHuv_to_Luv(LCHuv) # doctest: +ELLIPSIS array([ 41.5278752..., 96.8362605..., 17.7521014...]) """ return JCh_to_Jab(LCHuv)
bsd-3-clause
95d9a95fbfa65c532efb32795d1494e2
29.079696
79
0.384116
3.140876
false
false
false
false
colour-science/colour
colour/hints/__init__.py
1
9126
""" Annotation Type Hints ===================== Defines the annotation type hints, the module exposes many aliases from :mod:`typing` and :mod:`numpy.typing` to avoid having to handle multiple imports. """ from __future__ import annotations import numpy as np import numpy.typing as npt import re from types import ModuleType from typing import ( Any, Callable, Dict, Generator, Iterable, Iterator, List, Mapping, NewType, Optional, Union, Sequence, TextIO, Tuple, TYPE_CHECKING, Type, TypeVar, cast, overload, ) try: from typing import ( Literal, Protocol, SupportsIndex, TypedDict, runtime_checkable, ) # TODO: Drop "typing_extensions" when "Google Colab" uses Python >= 3.8. # Remove exclusion in ".pre-commit-config.yaml" file for "pyupgrade". except ImportError: # pragma: no cover from typing_extensions import ( # type: ignore[assignment] Literal, Protocol, SupportsIndex, TypedDict, runtime_checkable, ) __author__ = "Colour Developers" __copyright__ = "Copyright 2013 Colour Developers" __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" __maintainer__ = "Colour Developers" __email__ = "colour-developers@colour-science.org" __status__ = "Production" __all__ = [ "Any", "Callable", "Dict", "Generator", "Iterable", "Iterator", "List", "Mapping", "ModuleType", "Optional", "Union", "Sequence", "SupportsIndex", "TextIO", "Tuple", "Type", "TypedDict", "TypeVar", "RegexFlag", "DTypeBoolean", "DTypeInteger", "DTypeFloating", "DTypeNumber", "DTypeComplex", "DType", "Integer", "Floating", "Number", "Complex", "Boolean", "Literal", "Dataclass", "NestedSequence", "ArrayLike", "IntegerOrArrayLike", "FloatingOrArrayLike", "NumberOrArrayLike", "ComplexOrArrayLike", "BooleanOrArrayLike", "ScalarType", "StrOrArrayLike", "NDArray", "IntegerOrNDArray", "FloatingOrNDArray", "NumberOrNDArray", "ComplexOrNDArray", "BooleanOrNDArray", "StrOrNDArray", "TypeInterpolator", "TypeExtrapolator", "TypeLUTSequenceItem", "LiteralWarning", "cast", ] Any = Any Callable = Callable Dict = Dict Generator = Generator Iterable = Iterable Iterator = Iterator List = List Mapping = Mapping ModuleType = ModuleType Optional = Optional Union = Union Sequence = Sequence SupportsIndex = SupportsIndex TextIO = TextIO Tuple = Tuple Type = Type TypedDict = TypedDict TypeVar = TypeVar RegexFlag = NewType("RegexFlag", re.RegexFlag) DTypeInteger = Union[ np.int8, np.int16, np.int32, np.int64, np.uint8, np.uint16, np.uint32, np.uint64, ] DTypeFloating = Union[np.float16, np.float32, np.float64] DTypeNumber = Union[DTypeInteger, DTypeFloating] DTypeComplex = Union[np.csingle, np.cdouble] DTypeBoolean = np.bool_ DType = Union[DTypeBoolean, DTypeNumber, DTypeComplex] Integer = int Floating = float Number = Union[Integer, Floating] Complex = complex Boolean = bool # TODO: Use "typing.Literal" when minimal Python version is raised to 3.8. Literal = Literal # TODO: Revisit to use Protocol. Dataclass = Any # TODO: Drop mocking when minimal "Numpy" version is 1.21.x. _T_co = TypeVar("_T_co", covariant=True) class NestedSequence(Protocol[_T_co]): """A protocol for representing nested sequences. Warning ------- `NestedSequence` currently does not work in combination with typevars, *e.g.* ``def func(a: _NestedSequnce[T]) -> T: ...``. See Also -------- collections.abc.Sequence ABCs for read-only and mutable :term:`sequences`. Examples -------- >>> from __future__ import annotations >>> from typing import TYPE_CHECKING >>> import numpy as np >>> def get_dtype(seq: NestedSequence[float]) -> np.dtype[np.float64]: ... return np.asarray(seq).dtype >>> a = get_dtype([1.0]) >>> b = get_dtype([[1.0]]) >>> c = get_dtype([[[1.0]]]) >>> d = get_dtype([[[[1.0]]]]) >>> if TYPE_CHECKING: ... reveal_locals() ... # note: Revealed local types are: ... # note: a: numpy.dtype[numpy.floating[numpy._typing._64Bit]] ... # note: b: numpy.dtype[numpy.floating[numpy._typing._64Bit]] ... # note: c: numpy.dtype[numpy.floating[numpy._typing._64Bit]] ... # note: d: numpy.dtype[numpy.floating[numpy._typing._64Bit]] ... """ def __len__(self) -> int: """Implement ``len(self)``.""" raise NotImplementedError @overload def __getitem__( self, index: int ) -> _T_co | NestedSequence[_T_co]: # noqa: D105 ... @overload def __getitem__(self, index: slice) -> NestedSequence[_T_co]: # noqa: D105 ... def __getitem__(self, index): """Implement ``self[x]``.""" raise NotImplementedError def __contains__(self, x: object) -> bool: """Implement ``x in self``.""" raise NotImplementedError def __iter__(self) -> Iterator[_T_co | NestedSequence[_T_co]]: """Implement ``iter(self)``.""" raise NotImplementedError def __reversed__(self) -> Iterator[_T_co | NestedSequence[_T_co]]: """Implement ``reversed(self)``.""" raise NotImplementedError def count(self, value: Any) -> int: """Return the number of occurrences of `value`.""" raise NotImplementedError def index(self, value: Any) -> int: """Return the first index of `value`.""" raise NotImplementedError ArrayLike = npt.ArrayLike IntegerOrArrayLike = Union[Integer, ArrayLike] FloatingOrArrayLike = Union[Floating, ArrayLike] NumberOrArrayLike = Union[Number, ArrayLike] ComplexOrArrayLike = Union[Complex, ArrayLike] BooleanOrArrayLike = Union[Boolean, ArrayLike] StrOrArrayLike = Union[str, ArrayLike] ScalarType = TypeVar("ScalarType", bound=np.generic, covariant=True) # TODO: Use "numpy.typing.NDArray" when minimal Numpy version is raised to # 1.21. if TYPE_CHECKING: # pragma: no cover NDArray = np.ndarray[Any, np.dtype[ScalarType]] else: NDArray = np.ndarray # TODO: Drop when minimal Python is raised to 3.9. if TYPE_CHECKING: # pragma: no cover IntegerOrNDArray = Union[Integer, NDArray[DTypeInteger]] FloatingOrNDArray = Union[Floating, NDArray[DTypeFloating]] NumberOrNDArray = Union[ Number, NDArray[Union[DTypeInteger, DTypeFloating]] ] ComplexOrNDArray = Union[Complex, NDArray[DTypeComplex]] BooleanOrNDArray = Union[Boolean, NDArray[DTypeBoolean]] StrOrNDArray = Union[str, NDArray[np.str_]] else: IntegerOrNDArray = Union[Integer, NDArray] FloatingOrNDArray = Union[Floating, NDArray] NumberOrNDArray = Union[Number, NDArray] ComplexOrNDArray = Union[Complex, NDArray] BooleanOrNDArray = Union[Boolean, NDArray] StrOrNDArray = Union[str, NDArray] class TypeInterpolator(Protocol): # noqa: D101 x: NDArray y: NDArray def __init__(self, *args: Any, **kwargs: Any) -> None: # noqa: D102 ... # pragma: no cover def __call__( self, x: FloatingOrArrayLike ) -> FloatingOrNDArray: # noqa: D102 ... # pragma: no cover class TypeExtrapolator(Protocol): # noqa: D101 interpolator: TypeInterpolator def __init__(self, *args: Any, **kwargs: Any) -> None: # noqa: D102 ... # pragma: no cover def __call__( self, x: FloatingOrArrayLike ) -> FloatingOrNDArray: # noqa: D102 ... # pragma: no cover @runtime_checkable class TypeLUTSequenceItem(Protocol): # noqa: D101 def apply(self, RGB: ArrayLike, **kwargs: Any) -> NDArray: # noqa: D102 ... # pragma: no cover LiteralWarning = Literal[ "default", "error", "ignore", "always", "module", "once" ] cast = cast def arraylike( # type: ignore[empty-body] a: ArrayLike | NestedSequence[ArrayLike], ) -> NDArray: ... def number_or_arraylike( # type: ignore[empty-body] a: NumberOrArrayLike | NestedSequence[ArrayLike], ) -> NDArray: ... a: DTypeFloating = np.float64(1) b: float = 1 c: Floating = 1 d: ArrayLike = [c, c] e: FloatingOrArrayLike = d s_a: Sequence[DTypeFloating] = [a, a] s_b: Sequence[float] = [b, b] s_c: Sequence[Floating] = [c, c] arraylike(a) arraylike(b) arraylike(c) arraylike(d) arraylike([d, d]) arraylike(e) arraylike([e, e]) arraylike(s_a) arraylike(s_b) arraylike(s_c) number_or_arraylike(a) number_or_arraylike(b) number_or_arraylike(c) number_or_arraylike(d) number_or_arraylike([d, d]) number_or_arraylike(e) number_or_arraylike([e, e]) number_or_arraylike(s_a) number_or_arraylike(s_b) number_or_arraylike(s_c) np.atleast_1d(a) np.atleast_1d(b) np.atleast_1d(c) np.atleast_1d(arraylike(d)) np.atleast_1d(arraylike([d, d])) np.atleast_1d(arraylike(e)) np.atleast_1d(arraylike([e, e])) np.atleast_1d(s_a) np.atleast_1d(s_b) np.atleast_1d(s_c) del a, b, c, d, e, s_a, s_b, s_c
bsd-3-clause
50f0190aa18dc57f43540a3c1c3e8a36
22.642487
79
0.635108
3.312523
false
false
false
false
colour-science/colour
colour/characterisation/datasets/displays/crt/primaries.py
1
5068
""" Primaries of CRT Displays ========================= Defines the primaries multi-spectral distributions of *CRT* displays. Each *CRT* display data is in the form of a *dict* of :class:`colour.characterisation.RGB_DisplayPrimaries` classes as follows:: { 'name': RGB_DisplayPrimaries, ..., 'name': RGB_DisplayPrimaries } The following *CRT* displays are available: - Typical CRT Brainard 1997 References ---------- - :cite:`Machado2010a` : Machado, Gustavo Mello. (2010). A model for simulation of color vision deficiency and a color contrast enhancement technique for dichromats. (pp. 1-94). http://www.lume.ufrgs.br/handle/10183/26950 """ from __future__ import annotations from functools import partial from colour.characterisation import RGB_DisplayPrimaries from colour.hints import Dict from colour.utilities import LazyCanonicalMapping __author__ = "Colour Developers" __copyright__ = "Copyright 2013 Colour Developers" __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" __maintainer__ = "Colour Developers" __email__ = "colour-developers@colour-science.org" __status__ = "Production" __all__ = [ "DATA_DISPLAY_PRIMARIES_CRT", "MSDS_DISPLAY_PRIMARIES_CRT", ] DATA_DISPLAY_PRIMARIES_CRT: Dict = { "Typical CRT Brainard 1997": { 380.0: (0.0025, 0.0018, 0.0219), 385.0: (0.0017, 0.0016, 0.0336), 390.0: (0.0017, 0.0020, 0.0524), 395.0: (0.0011, 0.0021, 0.0785), 400.0: (0.0017, 0.0025, 0.1130), 405.0: (0.0028, 0.0030, 0.1624), 410.0: (0.0037, 0.0043, 0.2312), 415.0: (0.0046, 0.0059, 0.3214), 420.0: (0.0064, 0.0079, 0.4263), 425.0: (0.0079, 0.0104, 0.5365), 430.0: (0.0094, 0.0126, 0.6296), 435.0: (0.0105, 0.0147, 0.6994), 440.0: (0.0113, 0.0170, 0.7470), 445.0: (0.0115, 0.0191, 0.7654), 450.0: (0.0113, 0.0220, 0.7519), 455.0: (0.0113, 0.0267, 0.7151), 460.0: (0.0115, 0.0340, 0.6619), 465.0: (0.0164, 0.0462, 0.5955), 470.0: (0.0162, 0.0649, 0.5177), 475.0: (0.0120, 0.0936, 0.4327), 480.0: (0.0091, 0.1345, 0.3507), 485.0: (0.0119, 0.1862, 0.2849), 490.0: (0.0174, 0.2485, 0.2278), 495.0: (0.0218, 0.3190, 0.1809), 500.0: (0.0130, 0.3964, 0.1408), 505.0: (0.0123, 0.4691, 0.1084), 510.0: (0.0260, 0.5305, 0.0855), 515.0: (0.0242, 0.5826, 0.0676), 520.0: (0.0125, 0.6195, 0.0537), 525.0: (0.0119, 0.6386, 0.0422), 530.0: (0.0201, 0.6414, 0.0341), 535.0: (0.0596, 0.6348, 0.0284), 540.0: (0.0647, 0.6189, 0.0238), 545.0: (0.0251, 0.5932, 0.0197), 550.0: (0.0248, 0.5562, 0.0165), 555.0: (0.0325, 0.5143, 0.0143), 560.0: (0.0199, 0.4606, 0.0119), 565.0: (0.0161, 0.3993, 0.0099), 570.0: (0.0128, 0.3297, 0.0079), 575.0: (0.0217, 0.2719, 0.0065), 580.0: (0.0693, 0.2214, 0.0057), 585.0: (0.1220, 0.1769, 0.0051), 590.0: (0.1861, 0.1407, 0.0047), 595.0: (0.2173, 0.1155, 0.0043), 600.0: (0.0777, 0.0938, 0.0029), 605.0: (0.0531, 0.0759, 0.0023), 610.0: (0.2434, 0.0614, 0.0036), 615.0: (0.5812, 0.0522, 0.0061), 620.0: (0.9354, 0.0455, 0.0088), 625.0: (1.6054, 0.0437, 0.0141), 630.0: (0.6464, 0.0278, 0.0060), 635.0: (0.1100, 0.0180, 0.0015), 640.0: (0.0322, 0.0136, 0.0008), 645.0: (0.0207, 0.0107, 0.0006), 650.0: (0.0194, 0.0085, 0.0006), 655.0: (0.0196, 0.0067, 0.0007), 660.0: (0.0166, 0.0055, 0.0006), 665.0: (0.0173, 0.0044, 0.0005), 670.0: (0.0220, 0.0039, 0.0006), 675.0: (0.0186, 0.0033, 0.0005), 680.0: (0.0377, 0.0030, 0.0007), 685.0: (0.0782, 0.0028, 0.0010), 690.0: (0.0642, 0.0023, 0.0010), 695.0: (0.1214, 0.0028, 0.0016), 700.0: (0.7169, 0.0078, 0.0060), 705.0: (1.1098, 0.0113, 0.0094), 710.0: (0.3106, 0.0039, 0.0030), 715.0: (0.0241, 0.0011, 0.0007), 720.0: (0.0180, 0.0009, 0.0009), 725.0: (0.0149, 0.0008, 0.0008), 730.0: (0.0108, 0.0009, 0.0011), 735.0: (0.0097, 0.0011, 0.0010), 740.0: (0.0091, 0.0009, 0.0010), 745.0: (0.0093, 0.0010, 0.0012), 750.0: (0.0083, 0.0011, 0.0013), 755.0: (0.0073, 0.0013, 0.0012), 760.0: (0.0081, 0.0015, 0.0016), 765.0: (0.0067, 0.0018, 0.0015), 770.0: (0.0070, 0.0021, 0.0028), 775.0: (0.0073, 0.0015, 0.0046), 780.0: (0.0066, 0.0018, 0.0058), } } MSDS_DISPLAY_PRIMARIES_CRT: LazyCanonicalMapping = LazyCanonicalMapping( { "Typical CRT Brainard 1997": partial( RGB_DisplayPrimaries, DATA_DISPLAY_PRIMARIES_CRT["Typical CRT Brainard 1997"], name="Typical CRT Brainard 1997", ) } ) """ Primaries multi-spectral distributions of *CRT* displays. References ---------- :cite:`Machado2010a` """
bsd-3-clause
936f3c46b03f75f46a93c34fe5327796
33.013423
78
0.537687
2.300499
false
false
false
false
colour-science/colour
colour/models/rgb/transfer_functions/rimm_romm_rgb.py
1
15934
""" RIMM, ROMM and ERIMM Encodings ============================== Defines the *RIMM, ROMM and ERIMM* encodings opto-electrical transfer functions (OETF) and electro-optical transfer functions (EOTF): - :func:`colour.models.cctf_encoding_ROMMRGB` - :func:`colour.models.cctf_decoding_ROMMRGB` - :func:`colour.models.cctf_encoding_ProPhotoRGB` - :func:`colour.models.cctf_decoding_ProPhotoRGB` - :func:`colour.models.cctf_encoding_RIMMRGB` - :func:`colour.models.cctf_decoding_RIMMRGB` - :func:`colour.models.log_encoding_ERIMMRGB` - :func:`colour.models.log_decoding_ERIMMRGB` References ---------- - :cite:`ANSI2003a` : ANSI. (2003). Specification of ROMM RGB (pp. 1-2). http://www.color.org/ROMMRGB.pdf - :cite:`Spaulding2000b` : Spaulding, K. E., Woolfe, G. J., & Giorgianni, E. J. (2000). Reference Input/Output Medium Metric RGB Color Encodings (RIMM/ROMM RGB) (pp. 1-8). http://www.photo-lovers.org/pdf/color/romm.pdf """ from __future__ import annotations import numpy as np from colour.algebra import spow from colour.hints import ( Boolean, Floating, FloatingOrArrayLike, FloatingOrNDArray, Integer, IntegerOrArrayLike, IntegerOrNDArray, Union, ) from colour.utilities import ( as_float, as_float_scalar, as_int, copy_definition, domain_range_scale, from_range_1, to_domain_1, ) __author__ = "Colour Developers" __copyright__ = "Copyright 2013 Colour Developers" __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" __maintainer__ = "Colour Developers" __email__ = "colour-developers@colour-science.org" __status__ = "Production" __all__ = [ "cctf_encoding_ROMMRGB", "cctf_decoding_ROMMRGB", "cctf_encoding_ProPhotoRGB", "cctf_decoding_ProPhotoRGB", "cctf_encoding_RIMMRGB", "cctf_decoding_RIMMRGB", "log_encoding_ERIMMRGB", "log_decoding_ERIMMRGB", ] def cctf_encoding_ROMMRGB( X: FloatingOrArrayLike, bit_depth: Integer = 8, out_int: Boolean = False ) -> Union[FloatingOrNDArray, IntegerOrNDArray]: """ Define the *ROMM RGB* encoding colour component transfer function (Encoding CCTF). Parameters ---------- X Linear data :math:`X_{ROMM}`. bit_depth Bit depth used for conversion. out_int Whether to return value as integer code value or float equivalent of a code value at a given bit depth. Returns ------- :class:`numpy.floating` or :class:`numpy.integer` or :class:`numpy.ndarray` Non-linear data :math:`X'_{ROMM}`. Notes ----- +----------------+-----------------------+---------------+ | **Domain \\*** | **Scale - Reference** | **Scale - 1** | +================+=======================+===============+ | ``X`` | [0, 1] | [0, 1] | +----------------+-----------------------+---------------+ +----------------+-----------------------+---------------+ | **Range \\*** | **Scale - Reference** | **Scale - 1** | +================+=======================+===============+ | ``X_p`` | [0, 1] | [0, 1] | +----------------+-----------------------+---------------+ \\* This definition has an output integer switch, thus the domain-range scale information is only given for the floating point mode. References ---------- :cite:`ANSI2003a`, :cite:`Spaulding2000b` Examples -------- >>> cctf_encoding_ROMMRGB(0.18) # doctest: +ELLIPSIS 0.3857114... >>> cctf_encoding_ROMMRGB(0.18, out_int=True) 98 """ X = to_domain_1(X) I_max = 2**bit_depth - 1 E_t = 16 ** (1.8 / (1 - 1.8)) X_p = np.where(X < E_t, X * 16 * I_max, spow(X, 1 / 1.8) * I_max) if out_int: return as_int(np.round(X_p)) else: return as_float(from_range_1(X_p / I_max)) def cctf_decoding_ROMMRGB( X_p: Union[FloatingOrArrayLike, IntegerOrArrayLike], bit_depth: Integer = 8, in_int: Boolean = False, ) -> FloatingOrNDArray: """ Define the *ROMM RGB* decoding colour component transfer function (Encoding CCTF). Parameters ---------- X_p Non-linear data :math:`X'_{ROMM}`. bit_depth Bit depth used for conversion. in_int Whether to treat the input value as integer code value or float equivalent of a code value at a given bit depth. Returns ------- :class:`numpy.floating` or :class:`numpy.ndarray` Linear data :math:`X_{ROMM}`. Notes ----- +----------------+-----------------------+---------------+ | **Domain \\*** | **Scale - Reference** | **Scale - 1** | +================+=======================+===============+ | ``X_p`` | [0, 1] | [0, 1] | +----------------+-----------------------+---------------+ +----------------+-----------------------+---------------+ | **Range \\*** | **Scale - Reference** | **Scale - 1** | +================+=======================+===============+ | ``X`` | [0, 1] | [0, 1] | +----------------+-----------------------+---------------+ \\* This definition has an input integer switch, thus the domain-range scale information is only given for the floating point mode. References ---------- :cite:`ANSI2003a`, :cite:`Spaulding2000b` Examples -------- >>> cctf_decoding_ROMMRGB(0.385711424751138) # doctest: +ELLIPSIS 0.1... >>> cctf_decoding_ROMMRGB(98, in_int=True) # doctest: +ELLIPSIS 0.1... """ X_p = to_domain_1(X_p) I_max = 2**bit_depth - 1 if not in_int: X_p = X_p * I_max E_t = 16 ** (1.8 / (1 - 1.8)) X = np.where( X_p < 16 * E_t * I_max, X_p / (16 * I_max), spow(X_p / I_max, 1.8), ) return as_float(from_range_1(X)) cctf_encoding_ProPhotoRGB = copy_definition( cctf_encoding_ROMMRGB, "cctf_encoding_ProPhotoRGB" ) # If-clause required for optimised python launch. if cctf_encoding_ProPhotoRGB.__doc__ is not None: cctf_encoding_ProPhotoRGB.__doc__ = ( cctf_encoding_ProPhotoRGB.__doc__.replace( "*ROMM RGB*", "*ProPhoto RGB*" ) ) cctf_decoding_ProPhotoRGB = copy_definition( cctf_decoding_ROMMRGB, "cctf_decoding_ProPhotoRGB" ) # If-clause required for optimised python launch. if cctf_decoding_ProPhotoRGB.__doc__ is not None: cctf_decoding_ProPhotoRGB.__doc__ = ( cctf_decoding_ProPhotoRGB.__doc__.replace( "*ROMM RGB*", "*ProPhoto RGB*" ) ) def cctf_encoding_RIMMRGB( X: FloatingOrArrayLike, bit_depth: Integer = 8, out_int: Boolean = False, E_clip: Floating = 2.0, ) -> Union[FloatingOrNDArray, IntegerOrNDArray]: """ Define the *RIMM RGB* encoding colour component transfer function (Encoding CCTF). *RIMM RGB* encoding non-linearity is based on that specified by *Recommendation ITU-R BT.709-6*. Parameters ---------- X Linear data :math:`X_{RIMM}`. bit_depth Bit depth used for conversion. out_int Whether to return value as integer code value or float equivalent of a code value at a given bit depth. E_clip Maximum exposure level. Returns ------- :class:`numpy.floating` or :class:`numpy.integer` or :class:`numpy.ndarray` Non-linear data :math:`X'_{RIMM}`. Notes ----- +----------------+-----------------------+---------------+ | **Domain \\*** | **Scale - Reference** | **Scale - 1** | +================+=======================+===============+ | ``X`` | [0, 1] | [0, 1] | +----------------+-----------------------+---------------+ +----------------+-----------------------+---------------+ | **Range \\*** | **Scale - Reference** | **Scale - 1** | +================+=======================+===============+ | ``X_p`` | [0, 1] | [0, 1] | +----------------+-----------------------+---------------+ \\* This definition has an output integer switch, thus the domain-range scale information is only given for the floating point mode. References ---------- :cite:`Spaulding2000b` Examples -------- >>> cctf_encoding_RIMMRGB(0.18) # doctest: +ELLIPSIS 0.2916737... >>> cctf_encoding_RIMMRGB(0.18, out_int=True) 74 """ X = to_domain_1(X) I_max = 2**bit_depth - 1 V_clip = 1.099 * spow(E_clip, 0.45) - 0.099 q = I_max / V_clip X_p = q * np.select( [X < 0.0, X < 0.018, X >= 0.018, X > E_clip], [0, 4.5 * X, 1.099 * spow(X, 0.45) - 0.099, I_max], ) if out_int: return as_int(np.round(X_p)) else: return as_float(from_range_1(X_p / I_max)) def cctf_decoding_RIMMRGB( X_p: Union[FloatingOrArrayLike, IntegerOrArrayLike], bit_depth: Integer = 8, in_int: Boolean = False, E_clip: Floating = 2.0, ) -> FloatingOrNDArray: """ Define the *RIMM RGB* decoding colour component transfer function (Encoding CCTF). Parameters ---------- X_p Non-linear data :math:`X'_{RIMM}`. bit_depth Bit depth used for conversion. in_int Whether to treat the input value as integer code value or float equivalent of a code value at a given bit depth. E_clip Maximum exposure level. Returns ------- :class:`numpy.floating` or :class:`numpy.ndarray` Linear data :math:`X_{RIMM}`. Notes ----- +----------------+-----------------------+---------------+ | **Domain \\*** | **Scale - Reference** | **Scale - 1** | +================+=======================+===============+ | ``X_p`` | [0, 1] | [0, 1] | +----------------+-----------------------+---------------+ +----------------+-----------------------+---------------+ | **Range \\*** | **Scale - Reference** | **Scale - 1** | +================+=======================+===============+ | ``X`` | [0, 1] | [0, 1] | +----------------+-----------------------+---------------+ \\* This definition has an input integer switch, thus the domain-range scale information is only given for the floating point mode. References ---------- :cite:`Spaulding2000b` Examples -------- >>> cctf_decoding_RIMMRGB(0.291673732475746) # doctest: +ELLIPSIS 0.1... >>> cctf_decoding_RIMMRGB(74, in_int=True) # doctest: +ELLIPSIS 0.1... """ X_p = to_domain_1(X_p) I_max = as_float_scalar(2**bit_depth - 1) if not in_int: X_p = X_p * I_max V_clip = 1.099 * spow(E_clip, 0.45) - 0.099 m = V_clip * X_p / I_max with domain_range_scale("ignore"): X = np.where( X_p / I_max < cctf_encoding_RIMMRGB(0.018, bit_depth, E_clip=E_clip), m / 4.5, spow((m + 0.099) / 1.099, 1 / 0.45), ) return as_float(from_range_1(X)) def log_encoding_ERIMMRGB( X: FloatingOrArrayLike, bit_depth: Integer = 8, out_int: Boolean = False, E_min: Floating = 0.001, E_clip: Floating = 316.2, ) -> Union[FloatingOrNDArray, IntegerOrNDArray]: """ Define the *ERIMM RGB* log encoding curve / opto-electronic transfer function (OETF). Parameters ---------- X Linear data :math:`X_{ERIMM}`. bit_depth Bit depth used for conversion. out_int Whether to return value as integer code value or float equivalent of a code value at a given bit depth. E_min Minimum exposure limit. E_clip Maximum exposure limit. Returns ------- :class:`numpy.floating` or :class:`numpy.integer` or :class:`numpy.ndarray` Non-linear data :math:`X'_{ERIMM}`. Notes ----- +----------------+-----------------------+---------------+ | **Domain \\*** | **Scale - Reference** | **Scale - 1** | +================+=======================+===============+ | ``X`` | [0, 1] | [0, 1] | +----------------+-----------------------+---------------+ +----------------+-----------------------+---------------+ | **Range \\*** | **Scale - Reference** | **Scale - 1** | +================+=======================+===============+ | ``X_p`` | [0, 1] | [0, 1] | +----------------+-----------------------+---------------+ \\* This definition has an output integer switch, thus the domain-range scale information is only given for the floating point mode. References ---------- :cite:`Spaulding2000b` Examples -------- >>> log_encoding_ERIMMRGB(0.18) # doctest: +ELLIPSIS 0.4100523... >>> log_encoding_ERIMMRGB(0.18, out_int=True) 105 """ X = to_domain_1(X) I_max = 2**bit_depth - 1 E_t = np.exp(1) * E_min l_E_t = np.log(E_t) l_E_min = np.log(E_min) l_E_clip = np.log(E_clip) X_p = np.select( [ X < 0.0, X <= E_t, X > E_t, X > E_clip, ], [ 0, I_max * ((l_E_t - l_E_min) / (l_E_clip - l_E_min)) * X / E_t, I_max * ((np.log(X) - l_E_min) / (l_E_clip - l_E_min)), I_max, ], ) if out_int: return as_int(np.round(X_p)) else: return as_float(from_range_1(X_p / I_max)) def log_decoding_ERIMMRGB( X_p: Union[FloatingOrArrayLike, IntegerOrArrayLike], bit_depth: Integer = 8, in_int: Boolean = False, E_min: Floating = 0.001, E_clip: Floating = 316.2, ) -> FloatingOrNDArray: """ Define the *ERIMM RGB* log decoding curve / electro-optical transfer function (EOTF). Parameters ---------- X_p Non-linear data :math:`X'_{ERIMM}`. bit_depth Bit depth used for conversion. in_int Whether to treat the input value as integer code value or float equivalent of a code value at a given bit depth. E_min Minimum exposure limit. E_clip Maximum exposure limit. Returns ------- :class:`numpy.floating` or :class:`numpy.ndarray` Linear data :math:`X_{ERIMM}`. Notes ----- +----------------+-----------------------+---------------+ | **Domain \\*** | **Scale - Reference** | **Scale - 1** | +================+=======================+===============+ | ``X_p`` | [0, 1] | [0, 1] | +----------------+-----------------------+---------------+ +----------------+-----------------------+---------------+ | **Range \\*** | **Scale - Reference** | **Scale - 1** | +================+=======================+===============+ | ``X`` | [0, 1] | [0, 1] | +----------------+-----------------------+---------------+ \\* This definition has an input integer switch, thus the domain-range scale information is only given for the floating point mode. References ---------- :cite:`Spaulding2000b` Examples -------- >>> log_decoding_ERIMMRGB(0.410052389492129) # doctest: +ELLIPSIS 0.1... >>> log_decoding_ERIMMRGB(105, in_int=True) # doctest: +ELLIPSIS 0.1... """ X_p = to_domain_1(X_p) I_max = 2**bit_depth - 1 if not in_int: X_p = X_p * I_max E_t = np.exp(1) * E_min l_E_t = np.log(E_t) l_E_min = np.log(E_min) l_E_clip = np.log(E_clip) X = np.where( X_p <= I_max * ((l_E_t - l_E_min) / (l_E_clip - l_E_min)), ((l_E_clip - l_E_min) / (l_E_t - l_E_min)) * ((X_p * E_t) / I_max), np.exp((X_p / I_max) * (l_E_clip - l_E_min) + l_E_min), ) return as_float(from_range_1(X))
bsd-3-clause
a225f7160ae09a31e0d58e366da3a63c
28.023679
79
0.46724
3.417113
false
false
false
false
colour-science/colour
colour/algebra/extrapolation.py
1
9531
""" Extrapolation ============= Defines the classes for extrapolating variables: - :class:`colour.Extrapolator`: 1-D function extrapolation. References ---------- - :cite:`Sastanina` : sastanin. (n.d.). How to make scipy.interpolate give an extrapolated result beyond the input range? Retrieved August 8, 2014, from http://stackoverflow.com/a/2745496/931625 - :cite:`Westland2012i` : Westland, S., Ripamonti, C., & Cheung, V. (2012). Extrapolation Methods. In Computational Colour Science Using MATLAB (2nd ed., p. 38). ISBN:978-0-470-66569-5 """ from __future__ import annotations import numpy as np from colour.algebra import NullInterpolator, sdiv, sdiv_mode from colour.constants import DEFAULT_FLOAT_DTYPE from colour.hints import ( DTypeNumber, FloatingOrArrayLike, FloatingOrNDArray, Literal, NDArray, Number, Optional, Type, TypeInterpolator, Union, cast, ) from colour.utilities import ( as_float, attest, is_numeric, is_string, optional, validate_method, ) __author__ = "Colour Developers" __copyright__ = "Copyright 2013 Colour Developers" __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" __maintainer__ = "Colour Developers" __email__ = "colour-developers@colour-science.org" __status__ = "Production" __all__ = [ "Extrapolator", ] class Extrapolator: """ Extrapolate the 1-D function of given interpolator. The :class:`colour.Extrapolator` class acts as a wrapper around a given *Colour* or *scipy* interpolator class instance with compatible signature. Two extrapolation methods are available: - *Linear*: Linearly extrapolates given points using the slope defined by the interpolator boundaries (xi[0], xi[1]) if x < xi[0] and (xi[-1], xi[-2]) if x > xi[-1]. - *Constant*: Extrapolates given points by assigning the interpolator boundaries values xi[0] if x < xi[0] and xi[-1] if x > xi[-1]. Specifying the *left* and *right* arguments takes precedence on the chosen extrapolation method and will assign the respective *left* and *right* values to the given points. Parameters ---------- interpolator Interpolator object. method Extrapolation method. left Value to return for x < xi[0]. right Value to return for x > xi[-1]. dtype Data type used for internal conversions. Methods ------- - :meth:`~colour.Extrapolator.__init__` - :meth:`~colour.Extrapolator.__class__` Notes ----- - The interpolator must define ``x`` and ``y`` properties. References ---------- :cite:`Sastanina`, :cite:`Westland2012i` Examples -------- Extrapolating a single numeric variable: >>> from colour.algebra import LinearInterpolator >>> x = np.array([3, 4, 5]) >>> y = np.array([1, 2, 3]) >>> interpolator = LinearInterpolator(x, y) >>> extrapolator = Extrapolator(interpolator) >>> extrapolator(1) -1.0 Extrapolating an `ArrayLike` variable: >>> extrapolator(np.array([6, 7, 8])) array([ 4., 5., 6.]) Using the *Constant* extrapolation method: >>> x = np.array([3, 4, 5]) >>> y = np.array([1, 2, 3]) >>> interpolator = LinearInterpolator(x, y) >>> extrapolator = Extrapolator(interpolator, method="Constant") >>> extrapolator(np.array([0.1, 0.2, 8, 9])) array([ 1., 1., 3., 3.]) Using defined *left* boundary and *Constant* extrapolation method: >>> x = np.array([3, 4, 5]) >>> y = np.array([1, 2, 3]) >>> interpolator = LinearInterpolator(x, y) >>> extrapolator = Extrapolator(interpolator, method="Constant", left=0) >>> extrapolator(np.array([0.1, 0.2, 8, 9])) array([ 0., 0., 3., 3.]) """ def __init__( self, interpolator: Optional[TypeInterpolator] = None, method: Union[Literal["Linear", "Constant"], str] = "Linear", left: Optional[Number] = None, right: Optional[Number] = None, dtype: Optional[Type[DTypeNumber]] = None, ) -> None: dtype = cast(Type[DTypeNumber], optional(dtype, DEFAULT_FLOAT_DTYPE)) self._interpolator: TypeInterpolator = NullInterpolator( np.array([-np.inf, np.inf]), np.array([-np.inf, np.inf]) ) self.interpolator = optional(interpolator, self._interpolator) self._method: Union[Literal["Linear", "Constant"], str] = "Linear" self.method = optional(method, self._method) self._right: Optional[Number] = None self.right = right self._left: Optional[Number] = None self.left = left self._dtype: Type[DTypeNumber] = dtype @property def interpolator(self) -> TypeInterpolator: """ Getter and setter property for the *Colour* or *scipy* interpolator class instance. Parameters ---------- value Value to set the *Colour* or *scipy* interpolator class instance with. Returns ------- TypeInterpolator *Colour* or *scipy* interpolator class instance. """ return self._interpolator @interpolator.setter def interpolator(self, value: TypeInterpolator): """Setter for the **self.interpolator** property.""" attest( hasattr(value, "x"), f'"{value}" interpolator has no "x" attribute!', ) attest( hasattr(value, "y"), f'"{value}" interpolator has no "y" attribute!', ) self._interpolator = value @property def method(self) -> Union[Literal["Linear", "Constant"], str]: """ Getter and setter property for the extrapolation method. Parameters ---------- value Value to set the extrapolation method. with. Returns ------- :class:`str` Extrapolation method. """ return self._method @method.setter def method(self, value: Union[Literal["Linear", "Constant"], str]): """Setter for the **self.method** property.""" attest( is_string(value), f'"method" property: "{value}" type is not "str"!', ) value = validate_method(value, ["Linear", "Constant"]) self._method = value @property def left(self) -> Optional[Number]: """ Getter and setter property for left value to return for x < xi[0]. Parameters ---------- value Left value to return for x < xi[0]. Returns ------- :py:data:`None` or Number Left value to return for x < xi[0]. """ return self._left @left.setter def left(self, value: Optional[Number]): """Setter for the **self.left** property.""" if value is not None: attest( is_numeric(value), f'"left" property: "{value}" is not a "number"!', ) self._left = value @property def right(self) -> Optional[Number]: """ Getter and setter property for right value to return for x > xi[-1]. Parameters ---------- value Right value to return for x > xi[-1]. Returns ------- :py:data:`None` or Number Right value to return for x > xi[-1]. """ return self._right @right.setter def right(self, value: Optional[Number]): """Setter for the **self.right** property.""" if value is not None: attest( is_numeric(value), f'"right" property: "{value}" is not a "number"!', ) self._right = value def __call__(self, x: FloatingOrArrayLike) -> FloatingOrNDArray: """ Evaluate the Extrapolator at given point(s). Parameters ---------- x Point(s) to evaluate the Extrapolator at. Returns ------- :class:`numpy.floating` or :class:`numpy.ndarray` Extrapolated points value(s). """ x = np.atleast_1d(x).astype(self._dtype) xe = as_float(self._evaluate(x)) return xe def _evaluate(self, x: NDArray) -> NDArray: """ Perform the extrapolating evaluation at given points. Parameters ---------- x Points to evaluate the Extrapolator at. Returns ------- :class:`numpy.ndarray` Extrapolated points values. """ xi = self._interpolator.x yi = self._interpolator.y y = np.empty_like(x) if self._method == "linear": with sdiv_mode(): y[x < xi[0]] = yi[0] + (x[x < xi[0]] - xi[0]) * sdiv( yi[1] - yi[0], xi[1] - xi[0] ) y[x > xi[-1]] = yi[-1] + (x[x > xi[-1]] - xi[-1]) * sdiv( yi[-1] - yi[-2], xi[-1] - xi[-2] ) elif self._method == "constant": y[x < xi[0]] = yi[0] y[x > xi[-1]] = yi[-1] if self._left is not None: y[x < xi[0]] = self._left if self._right is not None: y[x > xi[-1]] = self._right in_range = np.logical_and(x >= xi[0], x <= xi[-1]) y[in_range] = self._interpolator(x[in_range]) return y
bsd-3-clause
e4feaac9c987bc51ce1870cf7e2dc3c0
26.231429
79
0.550519
3.838502
false
false
false
false
colour-science/colour
colour/models/rgb/transfer_functions/tests/test_nikon_n_log.py
1
6035
""" Define the unit tests for the :mod:`colour.models.rgb.transfer_functions.\ nikon_n_log` module. """ import numpy as np import unittest from colour.models.rgb.transfer_functions import ( log_encoding_NLog, log_decoding_NLog, ) from colour.utilities import domain_range_scale, ignore_numpy_errors __author__ = "Colour Developers" __copyright__ = "Copyright 2013 Colour Developers" __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" __maintainer__ = "Colour Developers" __email__ = "colour-developers@colour-science.org" __status__ = "Production" __all__ = [ "TestLogEncoding_NLog", "TestLogDecoding_NLog", ] class TestLogEncoding_NLog(unittest.TestCase): """ Define :func:`colour.models.rgb.transfer_functions.nikon_n_log.\ log_encoding_NLog` definition unit tests methods. """ def test_log_encoding_NLog(self): """ Test :func:`colour.models.rgb.transfer_functions.nikon_n_log.\ log_encoding_NLog` definition. """ self.assertAlmostEqual( log_encoding_NLog(0.0), 0.124372627896372, places=7 ) self.assertAlmostEqual( log_encoding_NLog(0.18), 0.363667770117139, places=7 ) self.assertAlmostEqual( log_encoding_NLog(0.18, 12), 0.363667770117139, places=7 ) self.assertAlmostEqual( log_encoding_NLog(0.18, 10, False), 0.351634850262366, places=7 ) self.assertAlmostEqual( log_encoding_NLog(0.18, 10, False, False), 0.337584957293328, places=7, ) self.assertAlmostEqual( log_encoding_NLog(1.0), 0.605083088954056, places=7 ) def test_n_dimensional_log_encoding_NLog(self): """ Test :func:`colour.models.rgb.transfer_functions.nikon_n_log.\ log_encoding_NLog` definition n-dimensional arrays support. """ y = 0.18 x = log_encoding_NLog(y) y = np.tile(y, 6) x = np.tile(x, 6) np.testing.assert_array_almost_equal( log_encoding_NLog(y), x, decimal=7 ) y = np.reshape(y, (2, 3)) x = np.reshape(x, (2, 3)) np.testing.assert_array_almost_equal( log_encoding_NLog(y), x, decimal=7 ) y = np.reshape(y, (2, 3, 1)) x = np.reshape(x, (2, 3, 1)) np.testing.assert_array_almost_equal( log_encoding_NLog(y), x, decimal=7 ) def test_domain_range_scale_log_encoding_NLog(self): """ Test :func:`colour.models.rgb.transfer_functions.nikon_n_log.\ log_encoding_NLog` definition domain and range scale support. """ y = 0.18 x = log_encoding_NLog(y) d_r = (("reference", 1), ("1", 1), ("100", 100)) for scale, factor in d_r: with domain_range_scale(scale): np.testing.assert_array_almost_equal( log_encoding_NLog(y * factor), x * factor, decimal=7 ) @ignore_numpy_errors def test_nan_log_encoding_NLog(self): """ Test :func:`colour.models.rgb.transfer_functions.nikon_n_log.\ log_encoding_NLog` definition nan support. """ log_encoding_NLog(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan])) class TestLogDecoding_NLog(unittest.TestCase): """ Define :func:`colour.models.rgb.transfer_functions.nikon_n_log.\ log_decoding_NLog` definition unit tests methods. """ def test_log_decoding_NLog(self): """ Test :func:`colour.models.rgb.transfer_functions.nikon_n_log.\ log_decoding_NLog` definition. """ self.assertAlmostEqual( log_decoding_NLog(0.124372627896372), 0.0, places=7 ) self.assertAlmostEqual( log_decoding_NLog(0.363667770117139), 0.18, places=7 ) self.assertAlmostEqual( log_decoding_NLog(0.363667770117139, 12), 0.18, places=7 ) self.assertAlmostEqual( log_decoding_NLog(0.351634850262366, 10, False), 0.18, places=7 ) self.assertAlmostEqual( log_decoding_NLog(0.337584957293328, 10, False, False), 0.18, places=7, ) self.assertAlmostEqual( log_decoding_NLog(0.605083088954056), 1.0, places=7 ) def test_n_dimensional_log_decoding_NLog(self): """ Test :func:`colour.models.rgb.transfer_functions.nikon_n_log.\ log_decoding_NLog` definition n-dimensional arrays support. """ x = 0.363667770117139 y = log_decoding_NLog(x) x = np.tile(x, 6) y = np.tile(y, 6) np.testing.assert_array_almost_equal( log_decoding_NLog(x), y, decimal=7 ) x = np.reshape(x, (2, 3)) y = np.reshape(y, (2, 3)) np.testing.assert_array_almost_equal( log_decoding_NLog(x), y, decimal=7 ) x = np.reshape(x, (2, 3, 1)) y = np.reshape(y, (2, 3, 1)) np.testing.assert_array_almost_equal( log_decoding_NLog(x), y, decimal=7 ) def test_domain_range_scale_log_decoding_NLog(self): """ Test :func:`colour.models.rgb.transfer_functions.nikon_n_log.\ log_decoding_NLog` definition domain and range scale support. """ x = 0.363667770117139 y = log_decoding_NLog(x) d_r = (("reference", 1), ("1", 1), ("100", 100)) for scale, factor in d_r: with domain_range_scale(scale): np.testing.assert_array_almost_equal( log_decoding_NLog(x * factor), y * factor, decimal=7 ) @ignore_numpy_errors def test_nan_log_decoding_NLog(self): """ Test :func:`colour.models.rgb.transfer_functions.nikon_n_log.\ log_decoding_NLog` definition nan support. """ log_decoding_NLog(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan])) if __name__ == "__main__": unittest.main()
bsd-3-clause
1f8c898f449d8ca987e64d2360049c7b
27.601896
78
0.57879
3.297814
false
true
false
false
colour-science/colour
colour/models/rgb/datasets/display_p3.py
1
2290
""" Display P3 Colourspace ====================== Defines the *Display P3* colourspace: - :attr:`colour.models.RGB_COLOURSPACE_DISPLAY_P3`. References ---------- - :cite:`AppleInc.2019` : Apple. (2019). Apple Inc. (2019). displayP3. Retrieved December 18, 2019, from https://developer.apple.com/\ documentation/coregraphics/cgcolorspace/1408916-displayp3 """ from __future__ import annotations import numpy as np from colour.colorimetry import CCS_ILLUMINANTS from colour.hints import NDArray from colour.models.rgb import ( RGB_Colourspace, eotf_inverse_sRGB, eotf_sRGB, normalised_primary_matrix, ) from colour.models.rgb.datasets import RGB_COLOURSPACE_DCI_P3 __author__ = "Colour Developers" __copyright__ = "Copyright 2013 Colour Developers" __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" __maintainer__ = "Colour Developers" __email__ = "colour-science@googlegroups.com" __status__ = "Production" __all__ = [ "PRIMARIES_DISPLAY_P3", "WHITEPOINT_NAME_DISPLAY_P3", "CCS_WHITEPOINT_DISPLAY_P3", "MATRIX_DISPLAY_P3_TO_XYZ", "MATRIX_XYZ_TO_DISPLAY_P3", "RGB_COLOURSPACE_DISPLAY_P3", ] PRIMARIES_DISPLAY_P3: NDArray = RGB_COLOURSPACE_DCI_P3.primaries """*Display P3* colourspace primaries.""" WHITEPOINT_NAME_DISPLAY_P3: str = "D65" """*Display P3* colourspace whitepoint name.""" CCS_WHITEPOINT_DISPLAY_P3: NDArray = CCS_ILLUMINANTS[ "CIE 1931 2 Degree Standard Observer" ][WHITEPOINT_NAME_DISPLAY_P3] """*Display P3* colourspace whitepoint chromaticity coordinates.""" MATRIX_DISPLAY_P3_TO_XYZ: NDArray = normalised_primary_matrix( PRIMARIES_DISPLAY_P3, CCS_WHITEPOINT_DISPLAY_P3 ) """*Display P3* colourspace to *CIE XYZ* tristimulus values matrix.""" MATRIX_XYZ_TO_DISPLAY_P3: NDArray = np.linalg.inv(MATRIX_DISPLAY_P3_TO_XYZ) """*CIE XYZ* tristimulus values to *Display P3* colourspace matrix.""" RGB_COLOURSPACE_DISPLAY_P3: RGB_Colourspace = RGB_Colourspace( "Display P3", PRIMARIES_DISPLAY_P3, CCS_WHITEPOINT_DISPLAY_P3, WHITEPOINT_NAME_DISPLAY_P3, MATRIX_DISPLAY_P3_TO_XYZ, MATRIX_XYZ_TO_DISPLAY_P3, eotf_inverse_sRGB, eotf_sRGB, ) RGB_COLOURSPACE_DISPLAY_P3.__doc__ = """ *Display P3* colourspace. References ---------- :cite:`AppleInc.2019` """
bsd-3-clause
a218258cab8ab267605eb786ca945179
27.271605
78
0.706114
2.858926
false
false
true
false
colour-science/colour
colour/notation/tests/test_munsell.py
1
78813
# !/usr/bin/env python """Define the unit tests for the :mod:`colour.notation.munsell` module.""" from __future__ import annotations import numpy as np import unittest from itertools import product from colour.hints import List, NDArray, Tuple from colour.notation.munsell import ( CCS_ILLUMINANT_MUNSELL, ) from colour.notation.munsell import ( parse_munsell_colour, is_grey_munsell_colour, normalise_munsell_specification, ) from colour.notation.munsell import ( munsell_colour_to_munsell_specification, munsell_specification_to_munsell_colour, ) from colour.notation.munsell import ( xyY_from_renotation, is_specification_in_renotation, ) from colour.notation.munsell import bounding_hues_from_renotation from colour.notation.munsell import hue_to_hue_angle, hue_angle_to_hue from colour.notation.munsell import hue_to_ASTM_hue from colour.notation.munsell import ( interpolation_method_from_renotation_ovoid, xy_from_renotation_ovoid, ) from colour.notation.munsell import LCHab_to_munsell_specification from colour.notation.munsell import maximum_chroma_from_renotation from colour.notation.munsell import munsell_specification_to_xy from colour.notation.munsell import ( munsell_colour_to_xyY, xyY_to_munsell_colour, ) from colour.notation.munsell import ( munsell_specification_to_xyY, xyY_to_munsell_specification, ) from colour.notation import ( munsell_value_Priest1920, munsell_value_Munsell1933, munsell_value_Moon1943, munsell_value_Saunderson1944, munsell_value_Ladd1955, munsell_value_McCamy1987, munsell_value_ASTMD1535, ) from colour.utilities import ( as_float_array, domain_range_scale, ignore_numpy_errors, tstack, ) __author__ = "Colour Developers" __copyright__ = "Copyright 2013 Colour Developers" __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" __maintainer__ = "Colour Developers" __email__ = "colour-developers@colour-science.org" __status__ = "Production" __all__ = [ "MUNSELL_SPECIFICATIONS", "MUNSELL_GREYS_SPECIFICATIONS", "MUNSELL_EVEN_SPECIFICATIONS", "MUNSELL_BOUNDING_HUES", "MUNSELL_HUE_TO_ANGLE", "MUNSELL_HUE_TO_ASTM_HUE", "MUNSELL_INTERPOLATION_METHODS", "MUNSELL_XY_FROM_RENOTATION_OVOID", "TestMunsellValuePriest1920", "TestMunsellValueMunsell1933", "TestMunsellValueMoon1943", "TestMunsellValueSaunderson1944", "TestMunsellValueLadd1955", "TestMunsellValueMcCamy1992", "TestMunsellValueASTMD1535", "TestMunsellSpecification_to_xyY", "TestMunsellColour_to_xyY", "TestxyY_to_munsell_specification", "TestxyY_to_munsell_colour", "TestParseMunsellColour", "TestIsGreyMunsellColour", "TestNormaliseMunsellSpecification", "TestMunsellColourToMunsellSpecification", "TestMunsellSpecificationToMunsellColour", "Test_xyY_fromRenotation", "TestIsSpecificationInRenotation", "TestBoundingHuesFromRenotation", "TestHueToHueAngle", "TestHueAngleToHue", "TestHueTo_ASTM_hue", "TestInterpolationMethodFromRenotationOvoid", "Test_xy_fromRenotationOvoid", "TestLCHabToMunsellSpecification", "TestMaximumChromaFromRenotation", "TestMunsellSpecification_to_xy", ] def _generate_unit_tests_specifications() -> Tuple: # pragma: no cover """ Generate the unit tests specifications. Returns ------- :class:`tuple` Tuples of unit tests specifications. The first tuple represents even specifications and their corresponding *CIE xyY* colourspace values. The tuple represents random specifications and their corresponding *CIE xyY* colourspace values. """ from colour.notation import MUNSELL_COLOURS np.random.seed(16) indexes = np.arange(len(MUNSELL_COLOURS["real"])) np.random.shuffle(indexes) specifications, specifications_r = [], [] for i in indexes: munsell_colour = "{} {}/{}".format(*MUNSELL_COLOURS["real"][i][0]) try: specification = munsell_colour_to_munsell_specification( munsell_colour ) specification_r = specification + np.hstack( [np.random.uniform(-1, 1, 3), [0]] ) xyY = munsell_specification_to_xyY(specification) xyY_r = munsell_specification_to_xyY(specification_r) _munsell_colour = xyY_to_munsell_colour(xyY) # noqa _munsell_colour_r = xyY_to_munsell_colour(xyY_r) # noqa specifications.append([specification, xyY]) specifications_r.append([specification_r, xyY_r]) if len(specifications) == 100: break except Exception as error: print(specification) print(error) return specifications, specifications_r MUNSELL_SPECIFICATIONS: NDArray = np.array( [ [ [7.18927191, 5.34025196, 16.05861170, 3.00000000], [0.16623068, 0.45684550, 0.22399519], ], [ [6.75749691, 9.44255422, 11.79641069, 3.00000000], [0.27297006, 0.36631948, 0.86427673], ], [ [8.44964118, 7.42750072, 3.22576700, 7.00000000], [0.35016714, 0.32764928, 0.48285006], ], [ [2.27432787, 1.59581362, 8.78434161, 2.00000000], [0.08494989, 0.35448667, 0.02152067], ], [ [9.82364034, 5.10755230, 3.23527358, 6.00000000], [0.38135277, 0.37024591, 0.20229405], ], [ [9.43158071, 6.93268985, 23.81322134, 9.00000000], [0.33551832, 0.17578313, 0.41043153], ], [ [7.48132776, 2.89467904, 8.47029950, 7.00000000], [0.53871366, 0.32437859, 0.05953010], ], [ [7.19717582, 1.79579794, 3.60295782, 2.00000000], [0.21606607, 0.29770875, 0.02567493], ], [ [7.77779715, 1.83619425, 6.42105231, 1.00000000], [0.15191376, 0.18640506, 0.02657869], ], [ [7.05646374, 8.15113870, 2.63767438, 10.00000000], [0.29508705, 0.29769267, 0.60266436], ], [ [3.03969874, 8.41779328, 5.82455544, 10.00000000], [0.25900977, 0.27198272, 0.65133417], ], [ [7.12616461, 4.61877951, 3.25823453, 9.00000000], [0.30806367, 0.27715003, 0.16105305], ], [ [9.75994064, 5.00164995, 13.80804118, 3.00000000], [0.16988405, 0.41104446, 0.19286318], ], [ [6.97677165, 8.25846010, 6.75337147, 2.00000000], [0.24767890, 0.32314418, 0.62194498], ], [ [3.30599914, 6.13663591, 6.17907561, 1.00000000], [0.23048205, 0.28607980, 0.30872546], ], [ [9.18340797, 7.81066836, 4.15020349, 7.00000000], [0.36349464, 0.33324537, 0.54413876], ], [ [8.10631072, 3.26448077, 9.90156782, 1.00000000], [0.14334034, 0.18086971, 0.07589385], ], [ [5.69603430, 5.94554581, 26.45021730, 3.00000000], [0.10047143, 0.54485967, 0.28688700], ], [ [7.52941160, 3.10193862, 2.03837398, 2.00000000], [0.26959492, 0.31200708, 0.06836215], ], [ [9.01080996, 8.59514291, 5.06552338, 2.00000000], [0.26018550, 0.31561977, 0.68515300], ], [ [9.93350418, 6.92619502, 2.76022400, 3.00000000], [0.28894781, 0.33443098, 0.40952934], ], [ [9.96785141, 1.11835600, 3.99853550, 9.00000000], [0.31352711, 0.20634513, 0.01346611], ], [ [9.99840409, 3.19309711, 5.82065904, 10.00000000], [0.25414765, 0.20939962, 0.07251951], ], [ [9.27080064, 2.36096768, 2.35873176, 9.00000000], [0.31412335, 0.26537265, 0.04053697], ], [ [9.85478063, 4.04717472, 2.09829596, 5.00000000], [0.34970053, 0.37571825, 0.12005323], ], [ [8.02558980, 6.36819633, 4.60141462, 5.00000000], [0.37965729, 0.40977154, 0.33650122], ], [ [7.19056185, 7.66646120, 10.23200084, 3.00000000], [0.24865695, 0.39205285, 0.52051894], ], [ [9.27459121, 8.93329764, 2.82639874, 3.00000000], [0.29214864, 0.33503056, 0.75302151], ], [ [6.56514645, 4.20156404, 5.64991156, 9.00000000], [0.30195484, 0.24513718, 0.13037695], ], [ [9.90928732, 9.28999046, 17.40567009, 4.00000000], [0.30741363, 0.49906135, 0.82974391], ], [ [6.66033139, 7.82125559, 2.83656023, 10.00000000], [0.29234640, 0.29513484, 0.54589974], ], [ [7.09563810, 9.27179818, 3.41469395, 6.00000000], [0.34662788, 0.34241664, 0.82569659], ], [ [8.06308980, 7.35943482, 4.42642439, 8.00000000], [0.34290892, 0.30832480, 0.47244825], ], [ [6.73937163, 4.45035611, 17.29157077, 2.00000000], [0.09315578, 0.28811552, 0.14817605], ], [ [4.46091279, 4.97623184, 8.27347386, 3.00000000], [0.25257308, 0.42043736, 0.19064074], ], [ [9.59823267, 4.43380834, 4.49782459, 3.00000000], [0.26156547, 0.35357051, 0.14694714], ], [ [5.68236594, 5.20647917, 7.98231240, 4.00000000], [0.36926047, 0.50258483, 0.21135463], ], [ [6.75749120, 9.13825880, 5.79055270, 3.00000000], [0.28340044, 0.35597801, 0.79643638], ], [ [3.45818284, 2.10857125, 4.85791418, 8.00000000], [0.34999194, 0.24490799, 0.03328770], ], [ [2.88591190, 3.36970167, 10.21423066, 7.00000000], [0.51380217, 0.28835519, 0.08106070], ], [ [1.71270774, 1.53669828, 3.39403462, 9.00000000], [0.26997438, 0.21369276, 0.02038916], ], [ [4.90655199, 3.23724997, 18.85327042, 2.00000000], [0.05681430, 0.29884718, 0.07459423], ], [ [2.60942297, 4.07393682, 4.85686834, 8.00000000], [0.33889111, 0.27070427, 0.12180360], ], [ [7.80566706, 4.07902945, 30.88921341, 9.00000000], [0.30271734, 0.09713576, 0.12213854], ], [ [9.83519352, 8.12251250, 10.73221172, 5.00000000], [0.42441612, 0.48582983, 0.59759029], ], [ [7.35317886, 7.08150026, 4.62737592, 5.00000000], [0.37586606, 0.40232896, 0.43144075], ], [ [7.77389803, 6.90019200, 8.10157277, 9.00000000], [0.31242681, 0.25756495, 0.40592957], ], [ [4.87250279, 4.19552668, 18.70870067, 9.00000000], [0.26755998, 0.13995403, 0.12996294], ], [ [7.38366474, 3.35764668, 12.11239914, 9.00000000], [0.30031035, 0.16953394, 0.08045698], ], [ [5.11434827, 6.25840324, 18.46717586, 9.00000000], [0.27423716, 0.17360892, 0.32315057], ], [ [6.50234711, 7.39248581, 8.42947132, 8.00000000], [0.36895615, 0.29211972, 0.47748118], ], [ [5.12057785, 6.74131875, 9.90906687, 9.00000000], [0.28824634, 0.23317117, 0.38435902], ], [ [7.97767039, 3.80398969, 4.31555212, 7.00000000], [0.41347359, 0.33271080, 0.10489086], ], [ [8.28257058, 4.99288145, 4.13426077, 10.00000000], [0.27534267, 0.26445867, 0.19209471], ], [ [2.27833490, 3.13652250, 12.74644014, 9.00000000], [0.24604475, 0.14443079, 0.06991948], ], [ [4.17788614, 4.56875266, 4.69980113, 8.00000000], [0.34608761, 0.28369563, 0.15715775], ], [ [5.52166738, 2.72767471, 10.73842907, 8.00000000], [0.41659713, 0.21166956, 0.05302211], ], [ [1.96964226, 5.83362103, 28.30224843, 3.00000000], [0.11730240, 0.75674218, 0.27454364], ], [ [4.22034979, 7.29875716, 8.00238058, 7.00000000], [0.40163259, 0.32283516, 0.46329585], ], [ [8.10122939, 7.84099254, 13.76355873, 4.00000000], [0.34218201, 0.54357248, 0.54919251], ], [ [6.93175327, 3.88633728, 4.19698393, 4.00000000], [0.33428973, 0.42675447, 0.10987617], ], [ [7.17972997, 7.76394588, 5.52955464, 5.00000000], [0.38311308, 0.41154624, 0.53641155], ], [ [7.44539380, 2.45826571, 18.17553552, 8.00000000], [0.49593109, 0.16155048, 0.04361652], ], [ [6.57942671, 5.70954742, 4.21109407, 7.00000000], [0.37391946, 0.32682537, 0.26124266], ], [ [7.07918723, 3.60945090, 5.18867792, 10.00000000], [0.24565114, 0.22732867, 0.09371006], ], [ [9.19704045, 7.64270856, 20.12511878, 4.00000000], [0.31036980, 0.63853638, 0.51669329], ], [ [7.38744649, 2.69345468, 6.96087944, 8.00000000], [0.40651600, 0.25385677, 0.05175378], ], [ [5.71814887, 1.35726940, 4.25987210, 6.00000000], [0.55344553, 0.38963438, 0.01720090], ], [ [7.65193815, 5.15801515, 17.63637606, 8.00000000], [0.47344711, 0.24662331, 0.20688549], ], [ [5.80035357, 8.46843486, 3.91395266, 7.00000000], [0.35101966, 0.32394467, 0.66087042], ], [ [2.64017362, 6.58022725, 25.27474395, 3.00000000], [0.15857410, 0.65244571, 0.36322040], ], [ [6.81904597, 7.52735613, 14.14454379, 5.00000000], [0.46547138, 0.50598542, 0.49837113], ], [ [1.72002655, 2.00166767, 15.17756223, 3.00000000], [0.06593801, 0.78772140, 0.03052292], ], [ [7.17387426, 7.40686142, 4.67300544, 6.00000000], [0.38508722, 0.36570863, 0.47968081], ], [ [5.66354474, 8.29189799, 7.88289254, 2.00000000], [0.24153734, 0.33167097, 0.62803620], ], [ [4.96369167, 6.11709577, 2.83010340, 9.00000000], [0.30299188, 0.28933160, 0.30644773], ], [ [9.86666880, 3.53860824, 3.76283439, 4.00000000], [0.30878925, 0.40194660, 0.08984394], ], [ [2.54469570, 1.94205063, 6.51472847, 8.00000000], [0.34838418, 0.21610764, 0.02905603], ], [ [7.41841874, 7.28061720, 7.52688380, 5.00000000], [0.41055673, 0.44673738, 0.46058155], ], [ [1.75980807, 3.96245086, 15.45788733, 3.00000000], [0.19389711, 0.63957903, 0.11461936], ], [ [4.71729705, 3.34696841, 7.66988506, 6.00000000], [0.52645405, 0.39761412, 0.07992475], ], [ [2.08610570, 6.73042407, 7.05471426, 1.00000000], [0.22763195, 0.29145327, 0.38290628], ], [ [2.27268990, 3.26447649, 7.69468499, 6.00000000], [0.53002779, 0.37341819, 0.07589364], ], [ [7.23049017, 4.12309620, 15.10943786, 8.00000000], [0.46585026, 0.23748776, 0.12506155], ], [ [6.64140481, 2.17555713, 5.41523047, 7.00000000], [0.46318547, 0.31027036, 0.03511077], ], [ [7.37490620, 1.75480377, 16.97212717, 9.00000000], [0.28825940, 0.09568892, 0.02478061], ], [ [4.33290089, 2.10328054, 2.19891461, 10.00000000], [0.25933572, 0.26024656, 0.03314673], ], [ [9.12491352, 3.86980063, 15.33312818, 3.00000000], [0.12639463, 0.43809589, 0.10886288], ], [ [3.39633194, 4.88689265, 23.54167471, 3.00000000], [0.10976610, 0.64434470, 0.18295497], ], [ [2.61214646, 1.14977763, 7.81503339, 2.00000000], [0.06586815, 0.34294740, 0.01392758], ], [ [3.29714039, 2.54520254, 13.61325521, 8.00000000], [0.39022459, 0.16803475, 0.04650827], ], [ [2.78196233, 4.33925419, 16.17790238, 3.00000000], [0.17272546, 0.59343082, 0.14004876], ], [ [7.51260170, 3.39633095, 9.42584908, 2.00000000], [0.14825319, 0.28502763, 0.08240516], ], [ [4.46597913, 8.02986601, 3.85801792, 1.00000000], [0.26863443, 0.30193859, 0.58136398], ], [ [2.29263540, 4.86650662, 7.08151101, 8.00000000], [0.34377887, 0.26102802, 0.18122849], ], [ [6.82015249, 5.14066765, 21.13348572, 9.00000000], [0.29448492, 0.15338239, 0.20529997], ], [ [4.31245640, 4.85614027, 11.50803662, 6.00000000], [0.54231929, 0.40629376, 0.18035446], ], [ [8.22108412, 5.80818951, 3.94579416, 8.00000000], [0.34702328, 0.30674052, 0.27178470], ], [ [8.31388115, 4.66785495, 3.69434623, 5.00000000], [0.38078540, 0.41116296, 0.16493242], ], [ [3.40490668, 6.59689139, 9.20874115, 7.00000000], [0.41967010, 0.31821655, 0.36537324], ], ] ) MUNSELL_GREYS_SPECIFICATIONS: NDArray = np.array( list( zip( np.linspace(0, 10, 25)[:, None], ( [0.31006, 0.31616, 0.00000000], [0.31006, 0.31616, 0.00473582], [0.31006, 0.31616, 0.00961944], [0.31006, 0.31616, 0.01545756], [0.31006, 0.31616, 0.02293343], [0.31006, 0.31616, 0.03261914], [0.31006, 0.31616, 0.04498800], [0.31006, 0.31616, 0.06042690], [0.31006, 0.31616, 0.07924864], [0.31006, 0.31616, 0.10170428], [0.31006, 0.31616, 0.12799549], [0.31006, 0.31616, 0.15828689], [0.31006, 0.31616, 0.19271844], [0.31006, 0.31616, 0.23141772], [0.31006, 0.31616, 0.27451233], [0.31006, 0.31616, 0.32214224], [0.31006, 0.31616, 0.37447210], [0.31006, 0.31616, 0.43170362], [0.31006, 0.31616, 0.49408790], [0.31006, 0.31616, 0.56193781], [0.31006, 0.31616, 0.63564030], [0.31006, 0.31616, 0.71566876], [0.31006, 0.31616, 0.80259539], [0.31006, 0.31616, 0.89710353], [0.31006, 0.31616, 1.00000000], ), ) ) ) MUNSELL_EVEN_SPECIFICATIONS: NDArray = np.array( [ [(7.5, 6.0, 16.0, 3), [0.18320000, 0.44140000, 0.29301153]], [(7.5, 9.0, 12.0, 3), [0.24190000, 0.39850000, 0.76695586]], [(7.5, 8.0, 4.0, 7), [0.35640000, 0.32790000, 0.57619628]], [(2.5, 2.0, 8.0, 2), [0.15570000, 0.35170000, 0.03048116]], [(10.0, 6.0, 4.0, 6), [0.38610000, 0.37670000, 0.29301153]], [(10.0, 6.0, 24.0, 9), [0.34410000, 0.16980000, 0.29301153]], [(7.5, 2.0, 8.0, 7), [0.54330000, 0.30270000, 0.03048116]], [(7.5, 1.0, 4.0, 2), [0.17020000, 0.27680000, 0.01179925]], [(7.5, 1.0, 6.0, 1), [0.13030000, 0.16390000, 0.01179925]], [(7.5, 9.0, 2.0, 10), [0.30150000, 0.30520000, 0.76695586]], [(2.5, 8.0, 6.0, 10), [0.25620000, 0.27090000, 0.57619628]], [(7.5, 5.0, 4.0, 9), [0.31000000, 0.27500000, 0.19271844]], [(10.0, 5.0, 14.0, 3), [0.16710000, 0.40890000, 0.19271844]], [(7.5, 9.0, 6.0, 2), [0.25430000, 0.32200000, 0.76695586]], [(2.5, 6.0, 6.0, 1), [0.23120000, 0.28990000, 0.29301153]], [(10.0, 8.0, 4.0, 7), [0.36210000, 0.33490000, 0.57619628]], [(7.5, 4.0, 10.0, 1), [0.16010000, 0.20280000, 0.11700751]], [(5.0, 5.0, 26.0, 3), [0.07840000, 0.57610000, 0.19271844]], [(7.5, 3.0, 2.0, 2), [0.26990000, 0.31200000, 0.06391178]], [(10.0, 9.0, 6.0, 2), [0.25010000, 0.31180000, 0.76695586]], [(10.0, 6.0, 2.0, 3), [0.29290000, 0.33030000, 0.29301153]], [(10.0, 1.0, 4.0, 9), [0.31320000, 0.20320000, 0.01179925]], [(10.0, 3.0, 6.0, 10), [0.25110000, 0.20310000, 0.06391178]], [(10.0, 2.0, 2.0, 9), [0.31610000, 0.26910000, 0.03048116]], [(10.0, 5.0, 2.0, 5), [0.34220000, 0.36480000, 0.19271844]], [(7.5, 6.0, 4.0, 5), [0.37450000, 0.40040000, 0.29301153]], [(7.5, 7.0, 10.0, 3), [0.24450000, 0.39140000, 0.41985394]], [(10.0, 9.0, 2.0, 3), [0.29650000, 0.32930000, 0.76695586]], [(7.5, 4.0, 6.0, 9), [0.30760000, 0.24160000, 0.11700751]], [(10.0, 9.0, 18.0, 4), [0.30320000, 0.57480000, 0.76695586]], [(7.5, 7.0, 2.0, 10), [0.29820000, 0.30030000, 0.41985394]], [(7.5, 9.0, 4.0, 6), [0.36790000, 0.35850000, 0.76695586]], [(7.5, 7.0, 4.0, 8), [0.33890000, 0.30790000, 0.41985394]], [(7.5, 5.0, 18.0, 2), [0.09820000, 0.28280000, 0.19271844]], [(5.0, 5.0, 8.0, 3), [0.25110000, 0.41070000, 0.19271844]], [(10.0, 5.0, 4.0, 3), [0.27110000, 0.34550000, 0.19271844]], [(5.0, 5.0, 8.0, 4), [0.38150000, 0.50930000, 0.19271844]], [(7.5, 9.0, 6.0, 3), [0.27630000, 0.36070000, 0.76695586]], [(2.5, 2.0, 4.0, 8), [0.33820000, 0.24960000, 0.03048116]], [(2.5, 4.0, 10.0, 7), [0.47740000, 0.29690000, 0.11700751]], [(2.5, 2.0, 4.0, 9), [0.27580000, 0.22080000, 0.03048116]], [(5.0, 4.0, 18.0, 2), [0.08280000, 0.31080000, 0.11700751]], [(2.5, 5.0, 4.0, 8), [0.32980000, 0.28690000, 0.19271844]], [(7.5, 4.0, 30.0, 9), [0.29690000, 0.09790000, 0.11700751]], [(10.0, 8.0, 10.0, 5), [0.41900000, 0.47910000, 0.57619628]], [(7.5, 8.0, 4.0, 5), [0.36220000, 0.38610000, 0.57619628]], [(7.5, 6.0, 8.0, 9), [0.30990000, 0.25020000, 0.29301153]], [(5.0, 5.0, 18.0, 9), [0.27180000, 0.16040000, 0.19271844]], [(7.5, 4.0, 12.0, 9), [0.30450000, 0.19050000, 0.11700751]], [(5.0, 6.0, 18.0, 9), [0.27310000, 0.17380000, 0.29301153]], [(7.5, 8.0, 8.0, 8), [0.36820000, 0.29830000, 0.57619628]], [(5.0, 6.0, 10.0, 9), [0.28620000, 0.22600000, 0.29301153]], [(7.5, 3.0, 4.0, 7), [0.42400000, 0.33020000, 0.06391178]], [(7.5, 4.0, 4.0, 10), [0.26570000, 0.25280000, 0.11700751]], [(2.5, 4.0, 12.0, 9), [0.25590000, 0.17300000, 0.11700751]], [(5.0, 4.0, 4.0, 8), [0.34910000, 0.28720000, 0.11700751]], [(5.0, 3.0, 10.0, 8), [0.40730000, 0.22350000, 0.06391178]], [(2.5, 5.0, 28.0, 3), [0.07940000, 0.73850000, 0.19271844]], [(5.0, 8.0, 8.0, 7), [0.40010000, 0.32630000, 0.57619628]], [(7.5, 8.0, 14.0, 4), [0.35460000, 0.54900000, 0.57619628]], [(7.5, 3.0, 4.0, 4), [0.32700000, 0.42880000, 0.06391178]], [(7.5, 7.0, 6.0, 5), [0.39430000, 0.42640000, 0.41985394]], [(7.5, 3.0, 18.0, 8), [0.51300000, 0.18930000, 0.06391178]], [(7.5, 5.0, 4.0, 7), [0.38060000, 0.32940000, 0.19271844]], [(7.5, 3.0, 6.0, 10), [0.23110000, 0.20100000, 0.06391178]], [(10.0, 7.0, 20.0, 4), [0.28160000, 0.65630000, 0.41985394]], [(7.5, 3.0, 6.0, 8), [0.39900000, 0.27080000, 0.06391178]], [(5.0, 1.0, 4.0, 6), [0.56600000, 0.37950000, 0.01179925]], [(7.5, 6.0, 18.0, 8), [0.45810000, 0.25490000, 0.29301153]], [(5.0, 9.0, 4.0, 7), [0.34950000, 0.32260000, 0.76695586]], [(2.5, 6.0, 26.0, 3), [0.13400000, 0.68710000, 0.29301153]], [(7.5, 8.0, 14.0, 5), [0.45740000, 0.50620000, 0.57619628]], [(2.5, 2.0, 16.0, 3), [0.03290000, 0.73580000, 0.03048116]], [(7.5, 8.0, 4.0, 6), [0.36990000, 0.35860000, 0.57619628]], [(5.0, 8.0, 8.0, 2), [0.24190000, 0.33520000, 0.57619628]], [(5.0, 6.0, 2.0, 9), [0.30500000, 0.29670000, 0.29301153]], [(10.0, 4.0, 4.0, 4), [0.31000000, 0.40180000, 0.11700751]], [(2.5, 2.0, 6.0, 8), [0.34700000, 0.22590000, 0.03048116]], [(7.5, 7.0, 8.0, 5), [0.41840000, 0.45680000, 0.41985394]], [(2.5, 3.0, 16.0, 3), [0.13410000, 0.64200000, 0.06391178]], [(5.0, 3.0, 8.0, 6), [0.54560000, 0.40400000, 0.06391178]], [(2.5, 6.0, 8.0, 1), [0.20800000, 0.27890000, 0.29301153]], [(2.5, 4.0, 8.0, 6), [0.50710000, 0.37770000, 0.11700751]], [(7.5, 5.0, 16.0, 8), [0.46170000, 0.25060000, 0.19271844]], [(7.5, 2.0, 6.0, 7), [0.48750000, 0.31230000, 0.03048116]], [(7.5, 2.0, 16.0, 9), [0.29220000, 0.11060000, 0.03048116]], [(5.0, 2.0, 2.0, 10), [0.26380000, 0.26240000, 0.03048116]], [(10.0, 3.0, 16.0, 3), [0.09250000, 0.42750000, 0.06391178]], [(2.5, 5.0, 24.0, 3), [0.11880000, 0.69180000, 0.19271844]], [(2.5, 1.0, 8.0, 2), [0.04760000, 0.34580000, 0.01179925]], [(2.5, 2.0, 14.0, 8), [0.37110000, 0.14490000, 0.03048116]], [(2.5, 5.0, 16.0, 3), [0.20050000, 0.57590000, 0.19271844]], [(7.5, 3.0, 10.0, 2), [0.13260000, 0.27840000, 0.06391178]], [(5.0, 8.0, 4.0, 1), [0.26710000, 0.29980000, 0.57619628]], [(2.5, 5.0, 8.0, 8), [0.34900000, 0.25700000, 0.19271844]], [(7.5, 5.0, 22.0, 9), [0.30380000, 0.15000000, 0.19271844]], [(5.0, 5.0, 12.0, 6), [0.54220000, 0.41410000, 0.19271844]], [(7.5, 5.0, 4.0, 8), [0.35150000, 0.30240000, 0.19271844]], [(7.5, 5.0, 4.0, 5), [0.38500000, 0.41200000, 0.19271844]], [(2.5, 6.0, 10.0, 7), [0.43200000, 0.31180000, 0.29301153]], [(8.0, 2, 14.0, 1), [0.07257382, 0.10413956, 0.03048116]], ] ) MUNSELL_BOUNDING_HUES: NDArray = np.array( [ ((5.0, 3.0), (7.5, 3.0)), ((5.0, 3.0), (7.5, 3.0)), ((7.5, 7.0), (10, 7.0)), ((10, 3.0), (2.5, 2.0)), ((7.5, 6.0), (10, 6.0)), ((7.5, 9.0), (10, 9.0)), ((5.0, 7.0), (7.5, 7.0)), ((5.0, 2.0), (7.5, 2.0)), ((7.5, 1.0), (10, 1.0)), ((5.0, 10.0), (7.5, 10.0)), ((2.5, 10.0), (5.0, 10.0)), ((5.0, 9.0), (7.5, 9.0)), ((7.5, 3.0), (10, 3.0)), ((5.0, 2.0), (7.5, 2.0)), ((2.5, 1.0), (5.0, 1.0)), ((7.5, 7.0), (10, 7.0)), ((7.5, 1.0), (10, 1.0)), ((5.0, 3.0), (7.5, 3.0)), ((7.5, 2.0), (10, 2.0)), ((7.5, 2.0), (10, 2.0)), ((7.5, 3.0), (10, 3.0)), ((7.5, 9.0), (10, 9.0)), ((7.5, 10.0), (10, 10.0)), ((7.5, 9.0), (10, 9.0)), ((7.5, 5.0), (10, 5.0)), ((7.5, 5.0), (10, 5.0)), ((5.0, 3.0), (7.5, 3.0)), ((7.5, 3.0), (10, 3.0)), ((5.0, 9.0), (7.5, 9.0)), ((7.5, 4.0), (10, 4.0)), ((5.0, 10.0), (7.5, 10.0)), ((5.0, 6.0), (7.5, 6.0)), ((7.5, 8.0), (10, 8.0)), ((5.0, 2.0), (7.5, 2.0)), ((2.5, 3.0), (5.0, 3.0)), ((7.5, 3.0), (10, 3.0)), ((5.0, 4.0), (7.5, 4.0)), ((5.0, 3.0), (7.5, 3.0)), ((2.5, 8.0), (5.0, 8.0)), ((2.5, 7.0), (5.0, 7.0)), ((10, 10), (2.5, 9.0)), ((2.5, 2.0), (5.0, 2.0)), ((2.5, 8.0), (5.0, 8.0)), ((7.5, 9.0), (10, 9.0)), ((7.5, 5.0), (10, 5.0)), ((5.0, 5.0), (7.5, 5.0)), ((7.5, 9.0), (10, 9.0)), ((2.5, 9.0), (5.0, 9.0)), ((5.0, 9.0), (7.5, 9.0)), ((5.0, 9.0), (7.5, 9.0)), ((5.0, 8.0), (7.5, 8.0)), ((5.0, 9.0), (7.5, 9.0)), ((7.5, 7.0), (10, 7.0)), ((7.5, 10.0), (10, 10.0)), ((10, 10), (2.5, 9.0)), ((2.5, 8.0), (5.0, 8.0)), ((5.0, 8.0), (7.5, 8.0)), ((10, 4.0), (2.5, 3.0)), ((2.5, 7.0), (5.0, 7.0)), ((7.5, 4.0), (10, 4.0)), ((5.0, 4.0), (7.5, 4.0)), ((5.0, 5.0), (7.5, 5.0)), ((5.0, 8.0), (7.5, 8.0)), ((5.0, 7.0), (7.5, 7.0)), ((5.0, 10.0), (7.5, 10.0)), ((7.5, 4.0), (10, 4.0)), ((5.0, 8.0), (7.5, 8.0)), ((5.0, 6.0), (7.5, 6.0)), ((7.5, 8.0), (10, 8.0)), ((5.0, 7.0), (7.5, 7.0)), ((2.5, 3.0), (5.0, 3.0)), ((5.0, 5.0), (7.5, 5.0)), ((10, 4.0), (2.5, 3.0)), ((5.0, 6.0), (7.5, 6.0)), ((5.0, 2.0), (7.5, 2.0)), ((2.5, 9.0), (5.0, 9.0)), ((7.5, 4.0), (10, 4.0)), ((2.5, 8.0), (5.0, 8.0)), ((5.0, 5.0), (7.5, 5.0)), ((10, 4.0), (2.5, 3.0)), ((2.5, 6.0), (5.0, 6.0)), ((10, 2.0), (2.5, 1.0)), ((10, 7.0), (2.5, 6.0)), ((5.0, 8.0), (7.5, 8.0)), ((5.0, 7.0), (7.5, 7.0)), ((5.0, 9.0), (7.5, 9.0)), ((2.5, 10.0), (5.0, 10.0)), ((7.5, 3.0), (10, 3.0)), ((2.5, 3.0), (5.0, 3.0)), ((2.5, 2.0), (5.0, 2.0)), ((2.5, 8.0), (5.0, 8.0)), ((2.5, 3.0), (5.0, 3.0)), ((7.5, 2.0), (10, 2.0)), ((2.5, 1.0), (5.0, 1.0)), ((10, 9.0), (2.5, 8.0)), ((5.0, 9.0), (7.5, 9.0)), ((2.5, 6.0), (5.0, 6.0)), ((7.5, 8.0), (10, 8.0)), ((7.5, 5.0), (10, 5.0)), ((2.5, 7.0), (5.0, 7.0)), ] ) MUNSELL_HUE_TO_ANGLE: NDArray = np.array( [ [2.5, 1, 208.750], [2.5, 2, 153.750], [2.5, 3, 118.750], [2.5, 4, 63.750], [2.5, 5, 39.375], [2.5, 6, 16.875], [2.5, 7, 348.750], [2.5, 8, 300.000], [2.5, 9, 251.250], [2.5, 10, 236.250], [5.0, 1, 225.000], [5.0, 2, 160.000], [5.0, 3, 135.000], [5.0, 4, 70.000], [5.0, 5, 45.000], [5.0, 6, 22.500], [5.0, 7, 0.000], [5.0, 8, 315.000], [5.0, 9, 255.000], [5.0, 10, 240.000], [7.5, 1, 228.750], [7.5, 2, 176.250], [7.5, 3, 141.250], [7.5, 4, 86.250], [7.5, 5, 51.250], [7.5, 6, 28.125], [7.5, 7, 5.625], [7.5, 8, 326.250], [7.5, 9, 270.000], [7.5, 10, 243.750], [10.0, 1, 232.500], [10.0, 2, 192.500], [10.0, 3, 147.500], [10.0, 4, 102.500], [10.0, 5, 57.500], [10.0, 6, 33.750], [10.0, 7, 11.250], [10.0, 8, 337.500], [10.0, 9, 285.000], [10.0, 10, 247.500], ] ) MUNSELL_HUE_TO_ASTM_HUE: NDArray = np.array( [ [2.5, 0, 72.5], [2.5, 1, 62.5], [2.5, 2, 52.5], [2.5, 3, 42.5], [2.5, 4, 32.5], [2.5, 5, 22.5], [2.5, 6, 12.5], [2.5, 7, 2.5], [2.5, 8, 92.5], [2.5, 9, 82.5], [2.5, 10, 72.5], [5.0, 0, 75.0], [5.0, 1, 65.0], [5.0, 2, 55.0], [5.0, 3, 45.0], [5.0, 4, 35.0], [5.0, 5, 25.0], [5.0, 6, 15.0], [5.0, 7, 5.0], [5.0, 8, 95.0], [5.0, 9, 85.0], [5.0, 10, 75.0], [7.5, 0, 77.5], [7.5, 1, 67.5], [7.5, 2, 57.5], [7.5, 3, 47.5], [7.5, 4, 37.5], [7.5, 5, 27.5], [7.5, 6, 17.5], [7.5, 7, 7.5], [7.5, 8, 97.5], [7.5, 9, 87.5], [7.5, 10, 77.5], [10.0, 0, 80.0], [10.0, 1, 70.0], [10.0, 2, 60.0], [10.0, 3, 50.0], [10.0, 4, 40.0], [10.0, 5, 30.0], [10.0, 6, 20.0], [10.0, 7, 10.0], [10.0, 8, 100.0], [10.0, 9, 90.0], [10.0, 10, 80.0], ] ) MUNSELL_INTERPOLATION_METHODS: List = [ "Linear", "Linear", "Radial", "Linear", "Radial", "Linear", "Linear", "Linear", "Radial", "Radial", "Radial", "Linear", "Linear", "Linear", "Radial", "Radial", "Radial", "Linear", "Linear", "Linear", "Linear", "Linear", "Radial", "Linear", "Radial", "Radial", "Linear", "Linear", "Linear", "Radial", "Radial", "Radial", "Linear", "Radial", "Linear", "Linear", "Radial", "Linear", "Linear", "Linear", "Linear", "Linear", "Linear", "Linear", "Radial", "Radial", "Linear", "Linear", "Linear", "Linear", "Linear", "Linear", "Radial", "Radial", "Linear", "Linear", "Linear", "Linear", "Linear", "Radial", "Linear", "Radial", "Linear", "Radial", "Radial", "Linear", "Linear", "Radial", "Linear", "Linear", "Linear", "Linear", "Linear", "Radial", "Linear", "Radial", "Radial", "Linear", "Radial", "Linear", "Radial", "Radial", "Radial", "Linear", "Linear", "Linear", "Linear", "Linear", "Linear", "Linear", "Linear", "Linear", "Linear", "Radial", "Linear", "Linear", "Radial", "Linear", "Radial", "Linear", "Radial", ] MUNSELL_XY_FROM_RENOTATION_OVOID: List = [ [0.1832, 0.4414], [0.2419, 0.3985], [0.3564, 0.3279], [0.1557, 0.3517], [0.3861, 0.3767], [0.3441, 0.1698], [0.5433, 0.3027], [0.1702, 0.2768], [0.1303, 0.1639], [0.3015, 0.3052], [0.2562, 0.2709], [0.3100, 0.2750], [0.1671, 0.4089], [0.2543, 0.3220], [0.2312, 0.2899], [0.3621, 0.3349], [0.1601, 0.2028], [0.0784, 0.5761], [0.2699, 0.3120], [0.2501, 0.3118], [0.2929, 0.3303], [0.3132, 0.2032], [0.2511, 0.2031], [0.3161, 0.2691], [0.3422, 0.3648], [0.3745, 0.4004], [0.2445, 0.3914], [0.2965, 0.3293], [0.3076, 0.2416], [0.3032, 0.5748], [0.2982, 0.3003], [0.3679, 0.3585], [0.3389, 0.3079], [0.0982, 0.2828], [0.2511, 0.4107], [0.2711, 0.3455], [0.3815, 0.5093], [0.2763, 0.3607], [0.3382, 0.2496], [0.4774, 0.2969], [0.2758, 0.2208], [0.0828, 0.3108], [0.3298, 0.2869], [0.2969, 0.0979], [0.4190, 0.4791], [0.3622, 0.3861], [0.3099, 0.2502], [0.2718, 0.1604], [0.3045, 0.1905], [0.2731, 0.1738], [0.3682, 0.2983], [0.2862, 0.2260], [0.4240, 0.3302], [0.2657, 0.2528], [0.2559, 0.1730], [0.3491, 0.2872], [0.4073, 0.2235], [0.0794, 0.7385], [0.4001, 0.3263], [0.3546, 0.5490], [0.3270, 0.4288], [0.3943, 0.4264], [0.5130, 0.1893], [0.3806, 0.3294], [0.2311, 0.2010], [0.2816, 0.6563], [0.3990, 0.2708], [0.5660, 0.3795], [0.4581, 0.2549], [0.3495, 0.3226], [0.1340, 0.6871], [0.4574, 0.5062], [0.0329, 0.7358], [0.3699, 0.3586], [0.2419, 0.3352], [0.3050, 0.2967], [0.3100, 0.4018], [0.3470, 0.2259], [0.4184, 0.4568], [0.1341, 0.6420], [0.5456, 0.4040], [0.2080, 0.2789], [0.5071, 0.3777], [0.4617, 0.2506], [0.4875, 0.3123], [0.2922, 0.1106], [0.2638, 0.2624], [0.0925, 0.4275], [0.1188, 0.6918], [0.0476, 0.3458], [0.3711, 0.1449], [0.2005, 0.5759], [0.1326, 0.2784], [0.2671, 0.2998], [0.3490, 0.2570], [0.3038, 0.1500], [0.5422, 0.4141], [0.3515, 0.3024], [0.3850, 0.4120], [0.4320, 0.3118], ] class TestMunsellValuePriest1920(unittest.TestCase): """ Define :func:`colour.notation.munsell.munsell_value_Priest1920` definition unit tests methods. """ def test_munsell_value_Priest1920(self): """ Test :func:`colour.notation.munsell.munsell_value_Priest1920` definition. """ self.assertAlmostEqual( munsell_value_Priest1920(12.23634268), 3.498048410185314, places=7 ) self.assertAlmostEqual( munsell_value_Priest1920(22.89399987), 4.7847674833788947, places=7 ) self.assertAlmostEqual( munsell_value_Priest1920(6.29022535), 2.5080321668591092, places=7 ) def test_n_dimensional_munsell_value_Priest1920(self): """ Test :func:`colour.notation.munsell.munsell_value_Priest1920` definition n-dimensional arrays support. """ Y = 12.23634268 V = munsell_value_Priest1920(Y) V = np.tile(V, 6) Y = np.tile(Y, 6) np.testing.assert_array_almost_equal( munsell_value_Priest1920(Y), V, decimal=7 ) V = np.reshape(V, (2, 3)) Y = np.reshape(Y, (2, 3)) np.testing.assert_array_almost_equal( munsell_value_Priest1920(Y), V, decimal=7 ) V = np.reshape(V, (2, 3, 1)) Y = np.reshape(Y, (2, 3, 1)) np.testing.assert_array_almost_equal( munsell_value_Priest1920(Y), V, decimal=7 ) def test_domain_range_scale_munsell_value_Priest1920(self): """ Test :func:`colour.notation.munsell.munsell_value_Priest1920` definition domain and range scale support. """ Y = 12.23634268 V = munsell_value_Priest1920(Y) d_r = (("reference", 1, 1), ("1", 0.01, 0.1), ("100", 1, 10)) for scale, factor_a, factor_b in d_r: with domain_range_scale(scale): np.testing.assert_array_almost_equal( munsell_value_Priest1920(Y * factor_a), V * factor_b, decimal=7, ) @ignore_numpy_errors def test_nan_munsell_value_Priest1920(self): """ Test :func:`colour.notation.munsell.munsell_value_Priest1920` definition nan support. """ munsell_value_Priest1920( np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]) ) class TestMunsellValueMunsell1933(unittest.TestCase): """ Define :func:`colour.notation.munsell.munsell_value_Munsell1933` definition unit tests methods. """ def test_munsell_value_Munsell1933(self): """ Test :func:`colour.notation.munsell.munsell_value_Munsell1933` definition. """ self.assertAlmostEqual( munsell_value_Munsell1933(12.23634268), 4.1627702416858083, places=7, ) self.assertAlmostEqual( munsell_value_Munsell1933(22.89399987), 5.5914543020790592, places=7, ) self.assertAlmostEqual( munsell_value_Munsell1933(6.29022535), 3.0141971134091761, places=7 ) def test_n_dimensional_munsell_value_Munsell1933(self): """ Test :func:`colour.notation.munsell.munsell_value_Munsell1933` definition n-dimensional arrays support. """ Y = 12.23634268 V = munsell_value_Munsell1933(Y) V = np.tile(V, 6) Y = np.tile(Y, 6) np.testing.assert_array_almost_equal( munsell_value_Munsell1933(Y), V, decimal=7 ) V = np.reshape(V, (2, 3)) Y = np.reshape(Y, (2, 3)) np.testing.assert_array_almost_equal( munsell_value_Munsell1933(Y), V, decimal=7 ) V = np.reshape(V, (2, 3, 1)) Y = np.reshape(Y, (2, 3, 1)) np.testing.assert_array_almost_equal( munsell_value_Munsell1933(Y), V, decimal=7 ) def test_domain_range_scale_munsell_value_Munsell1933(self): """ Test :func:`colour.notation.munsell.munsell_value_Munsell1933` definition domain and range scale support. """ Y = 12.23634268 V = munsell_value_Munsell1933(Y) d_r = (("reference", 1, 1), ("1", 0.01, 0.1), ("100", 1, 10)) for scale, factor_a, factor_b in d_r: with domain_range_scale(scale): np.testing.assert_array_almost_equal( munsell_value_Munsell1933(Y * factor_a), V * factor_b, decimal=7, ) @ignore_numpy_errors def test_nan_munsell_value_Munsell1933(self): """ Test :func:`colour.notation.munsell.munsell_value_Munsell1933` definition nan support. """ munsell_value_Munsell1933( np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]) ) class TestMunsellValueMoon1943(unittest.TestCase): """ Define :func:`colour.notation.munsell.munsell_value_Moon1943` definition unit tests methods. """ def test_munsell_value_Moon1943(self): """ Test :func:`colour.notation.munsell.munsell_value_Moon1943` definition. """ self.assertAlmostEqual( munsell_value_Moon1943(12.23634268), 4.0688120634976421, places=7 ) self.assertAlmostEqual( munsell_value_Moon1943(22.89399987), 5.3133627855494412, places=7 ) self.assertAlmostEqual( munsell_value_Moon1943(6.29022535), 3.0645015037679695, places=7 ) def test_n_dimensional_munsell_value_Moon1943(self): """ Test :func:`colour.notation.munsell.munsell_value_Moon1943` definition n-dimensional arrays support. """ Y = 12.23634268 V = munsell_value_Moon1943(Y) V = np.tile(V, 6) Y = np.tile(Y, 6) np.testing.assert_array_almost_equal( munsell_value_Moon1943(Y), V, decimal=7 ) V = np.reshape(V, (2, 3)) Y = np.reshape(Y, (2, 3)) np.testing.assert_array_almost_equal( munsell_value_Moon1943(Y), V, decimal=7 ) V = np.reshape(V, (2, 3, 1)) Y = np.reshape(Y, (2, 3, 1)) np.testing.assert_array_almost_equal( munsell_value_Moon1943(Y), V, decimal=7 ) def test_domain_range_scale_munsell_value_Moon1943(self): """ Test :func:`colour.notation.munsell.munsell_value_Moon1943` definition domain and range scale support. """ Y = 12.23634268 V = munsell_value_Moon1943(Y) d_r = (("reference", 1, 1), ("1", 0.01, 0.1), ("100", 1, 10)) for scale, factor_a, factor_b in d_r: with domain_range_scale(scale): np.testing.assert_array_almost_equal( munsell_value_Moon1943(Y * factor_a), V * factor_b, decimal=7, ) @ignore_numpy_errors def test_nan_munsell_value_Moon1943(self): """ Test :func:`colour.notation.munsell.munsell_value_Moon1943` definition nan support. """ munsell_value_Moon1943( np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]) ) class TestMunsellValueSaunderson1944(unittest.TestCase): """ Define :func:`colour.notation.munsell.munsell_value_Saunderson1944` definition unit tests methods. """ def test_munsell_value_Saunderson1944(self): """ Test :func:`colour.notation.munsell.munsell_value_Saunderson1944` definition. """ self.assertAlmostEqual( munsell_value_Saunderson1944(12.23634268), 4.0444736723175119, places=7, ) self.assertAlmostEqual( munsell_value_Saunderson1944(22.89399987), 5.3783324022305923, places=7, ) self.assertAlmostEqual( munsell_value_Saunderson1944(6.29022535), 2.9089633927316823, places=7, ) def test_n_dimensional_munsell_value_Saunderson1944(self): """ Test :func:`colour.notation.munsell.munsell_value_Saunderson1944` definition n-dimensional arrays support. """ Y = 12.23634268 V = munsell_value_Saunderson1944(Y) V = np.tile(V, 6) Y = np.tile(Y, 6) np.testing.assert_array_almost_equal( munsell_value_Saunderson1944(Y), V, decimal=7 ) V = np.reshape(V, (2, 3)) Y = np.reshape(Y, (2, 3)) np.testing.assert_array_almost_equal( munsell_value_Saunderson1944(Y), V, decimal=7 ) V = np.reshape(V, (2, 3, 1)) Y = np.reshape(Y, (2, 3, 1)) np.testing.assert_array_almost_equal( munsell_value_Saunderson1944(Y), V, decimal=7 ) def test_domain_range_scale_munsell_value_Saunderson1944(self): """ Test :func:`colour.notation.munsell.munsell_value_Saunderson1944` definition domain and range scale support. """ Y = 12.23634268 V = munsell_value_Saunderson1944(Y) d_r = (("reference", 1, 1), ("1", 0.01, 0.1), ("100", 1, 10)) for scale, factor_a, factor_b in d_r: with domain_range_scale(scale): np.testing.assert_array_almost_equal( munsell_value_Saunderson1944(Y * factor_a), V * factor_b, decimal=7, ) @ignore_numpy_errors def test_nan_munsell_value_Saunderson1944(self): """ Test :func:`colour.notation.munsell.munsell_value_Saunderson1944` definition nan support. """ munsell_value_Saunderson1944( np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]) ) class TestMunsellValueLadd1955(unittest.TestCase): """ Define :func:`colour.notation.munsell.munsell_value_Ladd1955` definition unit tests methods. """ def test_munsell_value_Ladd1955(self): """ Test :func:`colour.notation.munsell.munsell_value_Ladd1955` definition. """ self.assertAlmostEqual( munsell_value_Ladd1955(12.23634268), 4.0511633044287088, places=7 ) self.assertAlmostEqual( munsell_value_Ladd1955(22.89399987), 5.3718647913936772, places=7 ) self.assertAlmostEqual( munsell_value_Ladd1955(6.29022535), 2.9198269939751613, places=7 ) def test_n_dimensional_munsell_value_Ladd1955(self): """ Test :func:`colour.notation.munsell.munsell_value_Ladd1955` definition n-dimensional arrays support. """ Y = 12.23634268 V = munsell_value_Ladd1955(Y) V = np.tile(V, 6) Y = np.tile(Y, 6) np.testing.assert_array_almost_equal( munsell_value_Ladd1955(Y), V, decimal=7 ) V = np.reshape(V, (2, 3)) Y = np.reshape(Y, (2, 3)) np.testing.assert_array_almost_equal( munsell_value_Ladd1955(Y), V, decimal=7 ) V = np.reshape(V, (2, 3, 1)) Y = np.reshape(Y, (2, 3, 1)) np.testing.assert_array_almost_equal( munsell_value_Ladd1955(Y), V, decimal=7 ) def test_domain_range_scale_munsell_value_Ladd1955(self): """ Test :func:`colour.notation.munsell.munsell_value_Ladd1955` definition domain and range scale support. """ Y = 12.23634268 V = munsell_value_Ladd1955(Y) d_r = (("reference", 1, 1), ("1", 0.01, 0.1), ("100", 1, 10)) for scale, factor_a, factor_b in d_r: with domain_range_scale(scale): np.testing.assert_array_almost_equal( munsell_value_Ladd1955(Y * factor_a), V * factor_b, decimal=7, ) @ignore_numpy_errors def test_nan_munsell_value_Ladd1955(self): """ Test :func:`colour.notation.munsell.munsell_value_Ladd1955` definition nan support. """ munsell_value_Ladd1955( np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]) ) class TestMunsellValueMcCamy1992(unittest.TestCase): """ Define :func:`colour.notation.munsell.munsell_value_McCamy1987` definition unit tests methods. """ def test_munsell_value_McCamy1987(self): """ Test :func:`colour.notation.munsell.munsell_value_McCamy1987` definition. """ self.assertAlmostEqual( munsell_value_McCamy1987(12.23634268), 4.081434853194113, places=7 ) self.assertAlmostEqual( munsell_value_McCamy1987(22.89399987), 5.394083970919982, places=7 ) self.assertAlmostEqual( munsell_value_McCamy1987(6.29022535), 2.9750160800320096, places=7 ) def test_n_dimensional_munsell_value_McCamy1987(self): """ Test :func:`colour.notation.munsell.munsell_value_McCamy1987` definition n-dimensional arrays support. """ Y = 12.23634268 V = munsell_value_McCamy1987(Y) V = np.tile(V, 6) Y = np.tile(Y, 6) np.testing.assert_array_almost_equal( munsell_value_McCamy1987(Y), V, decimal=7 ) V = np.reshape(V, (2, 3)) Y = np.reshape(Y, (2, 3)) np.testing.assert_array_almost_equal( munsell_value_McCamy1987(Y), V, decimal=7 ) V = np.reshape(V, (2, 3, 1)) Y = np.reshape(Y, (2, 3, 1)) np.testing.assert_array_almost_equal( munsell_value_McCamy1987(Y), V, decimal=7 ) def test_domain_range_scale_munsell_value_McCamy1987(self): """ Test :func:`colour.notation.munsell.munsell_value_McCamy1987` definition domain and range scale support. """ Y = 12.23634268 V = munsell_value_McCamy1987(Y) d_r = (("reference", 1, 1), ("1", 0.01, 0.1), ("100", 1, 10)) for scale, factor_a, factor_b in d_r: with domain_range_scale(scale): np.testing.assert_array_almost_equal( munsell_value_McCamy1987(Y * factor_a), V * factor_b, decimal=7, ) @ignore_numpy_errors def test_nan_munsell_value_McCamy1987(self): """ Test :func:`colour.notation.munsell.munsell_value_McCamy1987` definition nan support. """ munsell_value_McCamy1987( np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]) ) class TestMunsellValueASTMD1535(unittest.TestCase): """ Define :func:`colour.notation.munsell.munsell_value_ASTMD1535` definition unit tests methods. """ def test_munsell_value_ASTMD1535(self): """ Test :func:`colour.notation.munsell.munsell_value_ASTMD1535` definition. """ self.assertAlmostEqual( munsell_value_ASTMD1535(12.23634268), 4.0824437076525664, places=7 ) self.assertAlmostEqual( munsell_value_ASTMD1535(22.89399987), 5.3913268228155395, places=7 ) self.assertAlmostEqual( munsell_value_ASTMD1535(6.29022535), 2.9761930839606454, places=7 ) def test_n_dimensional_munsell_value_ASTMD1535(self): """ Test :func:`colour.notation.munsell.munsell_value_ASTMD1535` definition n-dimensional arrays support. """ Y = 12.23634268 V = munsell_value_ASTMD1535(Y) V = np.tile(V, 6) Y = np.tile(Y, 6) np.testing.assert_array_almost_equal( munsell_value_ASTMD1535(Y), V, decimal=7 ) V = np.reshape(V, (2, 3)) Y = np.reshape(Y, (2, 3)) np.testing.assert_array_almost_equal( munsell_value_ASTMD1535(Y), V, decimal=7 ) V = np.reshape(V, (2, 3, 1)) Y = np.reshape(Y, (2, 3, 1)) np.testing.assert_array_almost_equal( munsell_value_ASTMD1535(Y), V, decimal=7 ) def test_domain_range_scale_munsell_value_ASTMD1535(self): """ Test :func:`colour.notation.munsell.munsell_value_ASTMD1535` definition domain and range scale support. """ Y = 12.23634268 V = munsell_value_ASTMD1535(Y) d_r = (("reference", 1, 1), ("1", 0.01, 0.1), ("100", 1, 10)) for scale, factor_a, factor_b in d_r: with domain_range_scale(scale): np.testing.assert_array_almost_equal( munsell_value_ASTMD1535(Y * factor_a), V * factor_b, decimal=7, ) @ignore_numpy_errors def test_nan_munsell_value_ASTMD1535(self): """ Test :func:`colour.notation.munsell.munsell_value_ASTMD1535` definition nan support. """ munsell_value_ASTMD1535( np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]) ) class TestMunsellSpecification_to_xyY(unittest.TestCase): """ Define :func:`colour.notation.munsell.munsell_specification_to_xyY` definition unit tests methods. """ def test_munsell_specification_to_xyY(self): """ Test :func:`colour.notation.munsell.munsell_specification_to_xyY` definition. """ specification, xyY = ( as_float_array(list(MUNSELL_SPECIFICATIONS[..., 0])), as_float_array(list(MUNSELL_SPECIFICATIONS[..., 1])), ) np.testing.assert_array_almost_equal( munsell_specification_to_xyY(specification), xyY, decimal=7 ) specification, xyY = ( as_float_array(list(MUNSELL_GREYS_SPECIFICATIONS[..., 0])), as_float_array(list(MUNSELL_GREYS_SPECIFICATIONS[..., 1])), ) specification = np.squeeze(specification) nan_array = np.full(specification.shape, np.nan) specification = tstack( [nan_array, specification, nan_array, nan_array] ) np.testing.assert_array_almost_equal( munsell_specification_to_xyY(specification), xyY, decimal=7 ) def test_n_dimensional_munsell_specification_to_xyY(self): """ Test :func:`colour.notation.munsell.munsell_specification_to_xyY` definition n-dimensional arrays support. """ specification = np.array( [7.18927191, 5.34025196, 16.05861170, 3.00000000] ) xyY = munsell_specification_to_xyY(specification) specification = np.tile(specification, (6, 1)) xyY = np.tile(xyY, (6, 1)) np.testing.assert_array_almost_equal( munsell_specification_to_xyY(specification), xyY, decimal=7 ) specification = np.reshape(specification, (2, 3, 4)) xyY = np.reshape(xyY, (2, 3, 3)) np.testing.assert_array_almost_equal( munsell_specification_to_xyY(specification), xyY, decimal=7 ) specification = np.array([np.nan, 8.9, np.nan, np.nan]) xyY = munsell_specification_to_xyY(specification) specification = np.tile(specification, (6, 1)) xyY = np.tile(xyY, (6, 1)) np.testing.assert_array_almost_equal( munsell_specification_to_xyY(specification), xyY, decimal=7 ) specification = np.reshape(specification, (2, 3, 4)) xyY = np.reshape(xyY, (2, 3, 3)) np.testing.assert_array_almost_equal( munsell_specification_to_xyY(specification), xyY, decimal=7 ) def test_domain_range_scale_munsell_specification_to_xyY(self): """ Test :func:`colour.notation.munsell.munsell_specification_to_xyY` definition domain and range scale support. """ specification = np.array( [7.18927191, 5.34025196, 16.05861170, 3.00000000] ) xyY = munsell_specification_to_xyY(specification) d_r = ( ("reference", 1, 1), ("1", np.array([0.1, 0.1, 1 / 50, 0.1]), 1), ("100", np.array([10, 10, 2, 10]), np.array([1, 1, 100])), ) for scale, factor_a, factor_b in d_r: with domain_range_scale(scale): np.testing.assert_array_almost_equal( munsell_specification_to_xyY(specification * factor_a), xyY * factor_b, decimal=7, ) @ignore_numpy_errors def test_nan_munsell_specification_to_xyY(self): """ Test :func:`colour.notation.munsell.munsell_specification_to_xyY` definition nan support. """ cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan] cases = np.array(list(set(product(cases, repeat=4)))) for case in cases: try: munsell_specification_to_xyY(case) except (AssertionError, TypeError, ValueError): pass class TestMunsellColour_to_xyY(unittest.TestCase): """ Define :func:`colour.notation.munsell.munsell_colour_to_xyY` definition unit tests methods. """ def test_domain_range_scale_munsell_colour_to_xyY(self): """ Test :func:`colour.notation.munsell.munsell_colour_to_xyY` definition domain and range scale support. """ munsell_colour = "4.2YR 8.1/5.3" xyY = munsell_colour_to_xyY(munsell_colour) d_r = ( ("reference", 1), ("1", 1), ("100", np.array([1, 1, 100])), ) for scale, factor in d_r: with domain_range_scale(scale): np.testing.assert_array_almost_equal( munsell_colour_to_xyY(munsell_colour), xyY * factor, decimal=7, ) def test_n_dimensional_munsell_colour_to_xyY(self): """ Test :func:`colour.notation.munsell.munsell_colour_to_xyY` definition n-dimensional arrays support. """ munsell_colour = "4.2YR 8.1/5.3" xyY = munsell_colour_to_xyY(munsell_colour) munsell_colour = np.tile(munsell_colour, 6) xyY = np.tile(xyY, (6, 1)) np.testing.assert_array_almost_equal( munsell_colour_to_xyY(munsell_colour), xyY, decimal=7 ) munsell_colour = np.reshape(munsell_colour, (2, 3)) xyY = np.reshape(xyY, (2, 3, 3)) np.testing.assert_array_almost_equal( munsell_colour_to_xyY(munsell_colour), xyY, decimal=7 ) munsell_colour = "N8.9" xyY = munsell_colour_to_xyY(munsell_colour) munsell_colour = np.tile(munsell_colour, 6) xyY = np.tile(xyY, (6, 1)) np.testing.assert_array_almost_equal( munsell_colour_to_xyY(munsell_colour), xyY, decimal=7 ) munsell_colour = np.reshape(munsell_colour, (2, 3)) xyY = np.reshape(xyY, (2, 3, 3)) np.testing.assert_array_almost_equal( munsell_colour_to_xyY(munsell_colour), xyY, decimal=7 ) class TestxyY_to_munsell_specification(unittest.TestCase): """ Define :func:`colour.notation.munsell.xyY_to_munsell_specification` definition unit tests methods. """ def test_xyY_to_munsell_specification(self): """ Test :func:`colour.notation.munsell.xyY_to_munsell_specification` definition. """ specification, xyY = ( as_float_array(list(MUNSELL_SPECIFICATIONS[..., 0])), as_float_array(list(MUNSELL_SPECIFICATIONS[..., 1])), ) np.testing.assert_allclose( xyY_to_munsell_specification(xyY), specification, rtol=0.00001, atol=0.00001, ) specification, xyY = ( as_float_array(list(MUNSELL_GREYS_SPECIFICATIONS[..., 0])), as_float_array(list(MUNSELL_GREYS_SPECIFICATIONS[..., 1])), ) specification = np.squeeze(specification) nan_array = np.full(specification.shape, np.nan) specification = tstack( [nan_array, specification, nan_array, nan_array] ) np.testing.assert_allclose( xyY_to_munsell_specification(xyY), specification, rtol=0.00001, atol=0.00001, ) def test_n_dimensional_xyY_to_munsell_specification(self): """ Test :func:`colour.notation.munsell.xyY_to_munsell_specification` definition n-dimensional arrays support. """ xyY = [0.16623068, 0.45684550, 0.22399519] specification = xyY_to_munsell_specification(xyY) xyY = np.tile(xyY, (6, 1)) specification = np.tile(specification, (6, 1)) np.testing.assert_array_almost_equal( xyY_to_munsell_specification(xyY), specification, decimal=7 ) xyY = np.reshape(xyY, (2, 3, 3)) specification = np.reshape(specification, (2, 3, 4)) np.testing.assert_array_almost_equal( xyY_to_munsell_specification(xyY), specification, decimal=7 ) def test_raise_exception_xyY_to_munsell_specification(self): """ Test :func:`colour.notation.munsell.xyY_to_munsell_specification` definition raised exception. """ self.assertRaises( RuntimeError, xyY_to_munsell_specification, np.array([0.90615118, 0.57945103, 0.91984064]), ) def test_domain_range_scale_xyY_to_munsell_specification(self): """ Test :func:`colour.notation.munsell.xyY_to_munsell_specification` definition domain and range scale support. """ xyY = [0.16623068, 0.45684550, 0.22399519] specification = xyY_to_munsell_specification(xyY) d_r = ( ("reference", 1, 1), ("1", 1, np.array([0.1, 0.1, 1 / 50, 0.1])), ("100", np.array([1, 1, 100]), np.array([10, 10, 2, 10])), ) for scale, factor_a, factor_b in d_r: with domain_range_scale(scale): np.testing.assert_allclose( xyY_to_munsell_specification(xyY * factor_a), specification * factor_b, rtol=0.00001, atol=0.00001, ) @ignore_numpy_errors def test_nan_xyY_to_munsell_specification(self): """ Test :func:`colour.notation.munsell.xyY_to_munsell_specification` definition nan support. """ cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan] cases = np.array(list(set(product(cases, repeat=3)))) for case in cases: try: xyY_to_munsell_specification(case) except (AssertionError, TypeError, ValueError): pass class TestxyY_to_munsell_colour(unittest.TestCase): """ Define :func:`colour.notation.munsell.xyY_to_munsell_colour` definition unit tests methods. """ def test_domain_range_scale_xyY_to_munsell_colour(self): """ Test :func:`colour.notation.munsell.xyY_to_munsell_colour` definition domain and range scale support. """ xyY = np.array([0.38736945, 0.35751656, 0.59362000]) munsell_colour = xyY_to_munsell_colour(xyY) d_r = ( ("reference", 1), ("1", 1), ("100", np.array([1, 1, 100])), ) for scale, factor in d_r: with domain_range_scale(scale): self.assertEqual( xyY_to_munsell_colour(xyY * factor), munsell_colour ) def test_n_dimensional_xyY_to_munsell_colour(self): """ Test :func:`colour.notation.munsell.xyY_to_munsell_colour` definition n-dimensional arrays support. """ xyY = [0.16623068, 0.45684550, 0.22399519] munsell_colour = xyY_to_munsell_colour(xyY) xyY = np.tile(xyY, (6, 1)) munsell_colour = np.tile(munsell_colour, 6) np.testing.assert_equal(xyY_to_munsell_colour(xyY), munsell_colour) xyY = np.reshape(xyY, (2, 3, 3)) munsell_colour = np.reshape(munsell_colour, (2, 3)) np.testing.assert_equal(xyY_to_munsell_colour(xyY), munsell_colour) xyY = list(CCS_ILLUMINANT_MUNSELL) + [1.0] munsell_colour = xyY_to_munsell_colour(xyY) xyY = np.tile(xyY, (6, 1)) munsell_colour = np.tile(munsell_colour, 6) np.testing.assert_equal(xyY_to_munsell_colour(xyY), munsell_colour) xyY = np.reshape(xyY, (2, 3, 3)) munsell_colour = np.reshape(munsell_colour, (2, 3)) np.testing.assert_equal(xyY_to_munsell_colour(xyY), munsell_colour) class TestParseMunsellColour(unittest.TestCase): """ Define :func:`colour.notation.munsell.parse_munsell_colour` definition unit tests methods. """ def test_parse_munsell_colour(self): """ Test :func:`colour.notation.munsell.is_grey_munsell_colour` definition. """ np.testing.assert_array_almost_equal( parse_munsell_colour("N5.2"), np.array([np.nan, 5.2, np.nan, np.nan]), decimal=7, ) np.testing.assert_array_almost_equal( parse_munsell_colour("0YR 2.0/4.0"), np.array([0.0, 2.0, 4.0, 6]), decimal=7, ) np.testing.assert_array_almost_equal( parse_munsell_colour("4.2YR 8.1/5.3"), np.array([4.2, 8.1, 5.3, 6]), decimal=7, ) def test_raise_exception_parse_munsell_colour(self): """ Test :func:`colour.notation.munsell.is_grey_munsell_colour` definition raised exception. """ self.assertRaises(ValueError, parse_munsell_colour, "4.2YQ 8.1/5.3") class TestIsGreyMunsellColour(unittest.TestCase): """ Define :func:`colour.notation.munsell.is_grey_munsell_colour` definition unit tests methods. """ def test_is_grey_munsell_colour(self): """ Test :func:`colour.notation.munsell.is_grey_munsell_colour` definition. """ self.assertTrue(is_grey_munsell_colour(5.2)) self.assertFalse(is_grey_munsell_colour(np.array([0.0, 2.0, 4.0, 6]))) self.assertFalse(is_grey_munsell_colour(np.array([4.2, 8.1, 5.3, 6]))) self.assertTrue( is_grey_munsell_colour(np.array([np.nan, 0.5, np.nan, np.nan])) ) class TestNormaliseMunsellSpecification(unittest.TestCase): """ Define :func:`colour.notation.munsell.normalise_munsell_specification` definition unit tests methods. """ def test_normalise_munsell_specification(self): """ Test :func:`colour.notation.munsell.normalise_munsell_specification` definition. """ np.testing.assert_array_almost_equal( normalise_munsell_specification((0.0, 2.0, 4.0, 6)), np.array([10.0, 2.0, 4.0, 7]), decimal=7, ) np.testing.assert_array_almost_equal( normalise_munsell_specification((0.0, 2.0, 4.0, 8)), np.array([10.0, 2.0, 4.0, 9]), decimal=7, ) np.testing.assert_array_almost_equal( normalise_munsell_specification((0, 2.0, 4.0, 10)), np.array([10.0, 2.0, 4.0, 1]), decimal=7, ) np.testing.assert_array_almost_equal( normalise_munsell_specification(0.5), np.array([np.nan, 0.5, np.nan, np.nan]), decimal=7, ) class TestMunsellColourToMunsellSpecification(unittest.TestCase): """ Define :func:`colour.notation.munsell.\ munsell_colour_to_munsell_specification` definition unit tests methods. """ def test_munsell_colour_to_munsell_specification(self): """ Test :func:`colour.notation.munsell.\ munsell_colour_to_munsell_specification` definition. """ np.testing.assert_array_almost_equal( munsell_colour_to_munsell_specification("0.0YR 2.0/4.0"), np.array([10.0, 2.0, 4.0, 7]), decimal=7, ) np.testing.assert_array_almost_equal( munsell_colour_to_munsell_specification("0.0RP 2.0/4.0"), np.array([10.0, 2.0, 4.0, 9]), decimal=7, ) np.testing.assert_array_almost_equal( munsell_colour_to_munsell_specification("10.0B 2.0/4.0"), np.array([10.0, 2.0, 4.0, 1]), decimal=7, ) np.testing.assert_array_almost_equal( munsell_colour_to_munsell_specification("N5.2"), np.array([np.nan, 5.2, np.nan, np.nan]), decimal=7, ) np.testing.assert_array_almost_equal( munsell_colour_to_munsell_specification("0.0YR 2.0/0.0"), np.array([np.nan, 2.0, np.nan, np.nan]), decimal=7, ) class TestMunsellSpecificationToMunsellColour(unittest.TestCase): """ Define :func:`colour.notation.munsell.\ munsell_specification_to_munsell_colour` definition unit tests methods. """ def test_munsell_specification_to_munsell_colour(self): """ Test :func:`colour.notation.munsell.\ munsell_specification_to_munsell_colour` definition. """ self.assertEqual( munsell_specification_to_munsell_colour( np.array([10.0, 2.0, 4.0, 7]) ), "10.0R 2.0/4.0", ) self.assertEqual( munsell_specification_to_munsell_colour( np.array([10.0, 2.0, 4.0, 9]) ), "10.0P 2.0/4.0", ) self.assertEqual( munsell_specification_to_munsell_colour( np.array([10.0, 2.0, 4.0, 1]) ), "10.0B 2.0/4.0", ) self.assertEqual( munsell_specification_to_munsell_colour( np.array([np.nan, 5.2, np.nan, np.nan]) ), "N5.2", ) self.assertEqual( munsell_specification_to_munsell_colour( np.array([0.0, 2.0, 4.0, 7]) ), "10.0RP 2.0/4.0", ) self.assertEqual( munsell_specification_to_munsell_colour( np.array([10.0, 0.0, 4.0, 7]) ), "N0.0", ) class Test_xyY_fromRenotation(unittest.TestCase): """ Define :func:`colour.notation.munsell.xyY_from_renotation` definition unit tests methods. """ def test_xyY_from_renotation(self): """ Test :func:`colour.notation.munsell.xyY_from_renotation` definition. """ np.testing.assert_array_equal( xyY_from_renotation((2.5, 0.2, 2.0, 4)), np.array([0.713, 1.414, 0.237]), ) np.testing.assert_array_equal( xyY_from_renotation((5.0, 0.2, 2.0, 4)), np.array([0.449, 1.145, 0.237]), ) np.testing.assert_array_equal( xyY_from_renotation((7.5, 0.2, 2.0, 4)), np.array([0.262, 0.837, 0.237]), ) class TestIsSpecificationInRenotation(unittest.TestCase): """ Define :func:`colour.notation.munsell.is_specification_in_renotation` definition unit tests methods. """ def test_is_specification_in_renotation(self): """ Test :func:`colour.notation.munsell.is_specification_in_renotation` definition. """ self.assertTrue( is_specification_in_renotation(np.array([2.5, 0.2, 2.0, 4])) ) self.assertTrue( is_specification_in_renotation(np.array([5.0, 0.2, 2.0, 4])) ) self.assertFalse( is_specification_in_renotation(np.array([25.0, 0.2, 2.0, 4])) ) class TestBoundingHuesFromRenotation(unittest.TestCase): """ Define :func:`colour.notation.munsell.bounding_hues_from_renotation` definition unit tests methods. """ def test_bounding_hues_from_renotation(self): """ Test :func:`colour.notation.munsell.bounding_hues_from_renotation` definition. """ for i, (specification, _xyY) in enumerate(MUNSELL_SPECIFICATIONS): hue, _value, _chroma, code = specification np.testing.assert_array_equal( bounding_hues_from_renotation([hue, code]), MUNSELL_BOUNDING_HUES[i], ) class TestHueToHueAngle(unittest.TestCase): """ Define :func:`colour.notation.munsell.hue_to_hue_angle` definition unit tests methods. """ def test_hue_to_hue_angle(self): """Test :func:`colour.notation.munsell.hue_to_hue_angle` definition.""" for hue, code, angle in MUNSELL_HUE_TO_ANGLE: self.assertEqual(hue_to_hue_angle([hue, code]), angle) class TestHueAngleToHue(unittest.TestCase): """ Define :func:`colour.notation.munsell.hue_angle_to_hue` definition unit tests methods. """ def test_hue_angle_to_hue(self): """Test :func:`colour.notation.munsell.hue_angle_to_hue` definition.""" for hue, code, angle in MUNSELL_HUE_TO_ANGLE: np.testing.assert_array_equal(hue_angle_to_hue(angle), (hue, code)) class TestHueTo_ASTM_hue(unittest.TestCase): """ Define :func:`colour.notation.munsell.hue_to_ASTM_hue` definition unit tests methods. """ def test_hue_to_ASTM_hue(self): """Test :func:`colour.notation.munsell.hue_to_ASTM_hue` definition.""" for hue, code, angle in MUNSELL_HUE_TO_ASTM_HUE: self.assertEqual(hue_to_ASTM_hue([hue, code]), angle) class TestInterpolationMethodFromRenotationOvoid(unittest.TestCase): """ Define :func:`colour.notation.munsell.\ interpolation_method_from_renotation_ovoid` definition unit tests methods. """ def test_interpolation_method_from_renotation_ovoid(self): """ Test :func:`colour.notation.munsell.\ interpolation_method_from_renotation_ovoid` definition. """ for i, (specification, _xyY) in enumerate(MUNSELL_EVEN_SPECIFICATIONS): self.assertEqual( interpolation_method_from_renotation_ovoid(specification), MUNSELL_INTERPOLATION_METHODS[i], ) self.assertIsNone( interpolation_method_from_renotation_ovoid( np.array([np.nan, 5.2, np.nan, np.nan]) ) ) self.assertIsNone( interpolation_method_from_renotation_ovoid( np.array([2.5, 10.0, 2.0, 4]) ) ) class Test_xy_fromRenotationOvoid(unittest.TestCase): """ Define :func:`colour.notation.munsell.xy_from_renotation_ovoid` definition unit tests methods. """ def test_xy_from_renotation_ovoid(self): """ Test :func:`colour.notation.munsell.xy_from_renotation_ovoid` definition. """ for i, (specification, _xyY) in enumerate(MUNSELL_EVEN_SPECIFICATIONS): if is_specification_in_renotation(specification): np.testing.assert_array_almost_equal( xy_from_renotation_ovoid(specification), MUNSELL_XY_FROM_RENOTATION_OVOID[i], decimal=7, ) class TestLCHabToMunsellSpecification(unittest.TestCase): """ Define :func:`colour.notation.munsell.LCHab_to_munsell_specification` definition unit tests methods. """ def test_LCHab_to_munsell_specification(self): """ Test :func:`colour.notation.munsell.LCHab_to_munsell_specification` definition. """ np.testing.assert_array_almost_equal( LCHab_to_munsell_specification( np.array([100.00000000, 21.57210357, 272.22819350]) ), np.array([5.618942638888882, 10.0, 4.314420714000000, 10]), decimal=7, ) np.testing.assert_array_almost_equal( LCHab_to_munsell_specification( np.array([100.00000000, 426.67945353, 72.39590835]) ), np.array([0.109974541666666, 10.0, 85.335890706000001, 5]), decimal=7, ) np.testing.assert_array_almost_equal( LCHab_to_munsell_specification( np.array([100.00000000, 74.05216981, 276.45318193]) ), np.array([6.792550536111119, 10.0, 14.810433961999999, 10]), decimal=7, ) np.testing.assert_array_almost_equal( LCHab_to_munsell_specification( np.array([100.00000000, 21.57210357, 0.00000000]) ), np.array([10.000000000000000, 10.0, 4.314420714000000, 8]), decimal=7, ) np.testing.assert_array_almost_equal( LCHab_to_munsell_specification( np.array([100.00000000, 21.57210357, 36.00000000]) ), np.array([10.000000000000000, 10.0, 4.314420714000000, 7]), decimal=7, ) class TestMaximumChromaFromRenotation(unittest.TestCase): """ Define :func:`colour.notation.munsell.maximum_chroma_from_renotation` definition unit tests methods. """ def test_maximum_chroma_from_renotation(self): """ Test :func:`colour.notation.munsell.maximum_chroma_from_renotation` definition. """ self.assertEqual(maximum_chroma_from_renotation([2.5, 5, 5]), 14.0) self.assertEqual( maximum_chroma_from_renotation([8.675, 1.225, 10]), 48.0 ) self.assertEqual( maximum_chroma_from_renotation([6.875, 3.425, 1]), 16.0 ) class TestMunsellSpecification_to_xy(unittest.TestCase): """ Define :func:`colour.notation.munsell.munsell_specification_to_xy` definition unit tests methods. """ def test_munsell_specification_to_xy(self): """ Test :func:`colour.notation.munsell.munsell_specification_to_xy` definition. """ for specification, xyY in MUNSELL_EVEN_SPECIFICATIONS: np.testing.assert_array_almost_equal( munsell_specification_to_xy(specification), xyY[0:2], decimal=7 ) for specification, xyY in MUNSELL_GREYS_SPECIFICATIONS: np.testing.assert_array_almost_equal( munsell_specification_to_xy(specification[0]), xyY[0:2], decimal=7, ) if __name__ == "__main__": unittest.main()
bsd-3-clause
d4911a2912b07bf9ebfa946a55a17592
30.588377
79
0.525307
2.806131
false
true
false
false
colour-science/colour
colour/notation/datasets/munsell/all.py
1
317316
""" Munsell Renotation System Dataset - All Munsell Colours ======================================================= Defines the *Munsell Renotation System* *All* datasets. Those are *all* published *Munsell* colours, including the extrapolated colors. Notes ----- - The Munsell Renotation data commonly available within the *all.dat*, *experimental.dat* and *real.dat* files features *CIE xyY* colourspace values that are scaled by a :math:`1 / 0.975 \\simeq 1.02568` factor. If you are performing conversions using *Munsell* *Colorlab* specification, e.g. *2.5R 9/2*, according to *ASTM D1535-08e1* method, you should not scale the output :math:`Y` Luminance. However, if you use directly the *CIE xyY* colourspace values from the Munsell Renotation data data, you should scale the :math:`Y` Luminance before conversions by a :math:`0.975` factor. *ASTM D1535-08e1* states that:: The coefficients of this equation are obtained from the 1943 equation by multiplying each coefficient by 0.975, the reflectance factor of magnesium oxide with respect to the perfect reflecting diffuser, and rounding to ve digits of precision. - Chromaticities assume *CIE Illuminant C*, approximately 6700K, as neutral origin for both the hue and chroma loci. References ---------- - :cite:`MunsellColorSciencec` : Munsell Color Science. (n.d.). Munsell Colours Data. Retrieved August 20, 2014, from http://www.cis.rit.edu/research/mcsl2/online/munsell.php """ from __future__ import annotations import numpy as np from colour.hints import Tuple __author__ = "Colour Developers" __copyright__ = "Copyright 2013 Colour Developers" __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" __maintainer__ = "Colour Developers" __email__ = "colour-developers@colour-science.org" __status__ = "Production" __all__ = [ "MUNSELL_COLOURS_ALL", ] MUNSELL_COLOURS_ALL: Tuple = ( (("2.5GY", 0.2, 2.0), np.array([0.7130, 1.4140, 0.2370])), (("5GY", 0.2, 2.0), np.array([0.4490, 1.1450, 0.2370])), (("7.5GY", 0.2, 2.0), np.array([0.2620, 0.8370, 0.2370])), (("7.5GY", 0.2, 4.0), np.array([-0.0780, 2.1600, 0.2370])), (("10GY", 0.2, 2.0), np.array([0.1850, 0.6760, 0.2370])), (("10GY", 0.2, 4.0), np.array([-0.2570, 1.2330, 0.2370])), (("2.5G", 0.2, 2.0), np.array([0.1440, 0.5840, 0.2370])), (("2.5G", 0.2, 4.0), np.array([-0.2350, 0.8910, 0.2370])), (("5G", 0.2, 2.0), np.array([0.1170, 0.5160, 0.2370])), (("5G", 0.2, 4.0), np.array([-0.2090, 0.7190, 0.2370])), (("7.5G", 0.2, 2.0), np.array([0.0970, 0.4580, 0.2370])), (("7.5G", 0.2, 4.0), np.array([-0.1810, 0.5750, 0.2370])), (("10G", 0.2, 2.0), np.array([0.0800, 0.3970, 0.2370])), (("10G", 0.2, 4.0), np.array([-0.1370, 0.4250, 0.2370])), (("2.5BG", 0.2, 2.0), np.array([0.0680, 0.3320, 0.2370])), (("2.5BG", 0.2, 4.0), np.array([-0.1000, 0.3250, 0.2370])), (("5BG", 0.2, 2.0), np.array([0.0660, 0.2610, 0.2370])), (("5BG", 0.2, 4.0), np.array([-0.0480, 0.2230, 0.2370])), (("7.5BG", 0.2, 2.0), np.array([0.0720, 0.2260, 0.2370])), (("7.5BG", 0.2, 4.0), np.array([-0.0160, 0.1810, 0.2370])), (("10BG", 0.2, 2.0), np.array([0.0850, 0.1950, 0.2370])), (("10BG", 0.2, 4.0), np.array([0.0150, 0.1480, 0.2370])), (("2.5B", 0.2, 2.0), np.array([0.0970, 0.1770, 0.2370])), (("2.5B", 0.2, 4.0), np.array([0.0390, 0.1280, 0.2370])), (("5B", 0.2, 2.0), np.array([0.1110, 0.1640, 0.2370])), (("5B", 0.2, 4.0), np.array([0.0630, 0.1140, 0.2370])), (("7.5B", 0.2, 2.0), np.array([0.1210, 0.1570, 0.2370])), (("7.5B", 0.2, 4.0), np.array([0.0740, 0.1090, 0.2370])), (("10B", 0.2, 2.0), np.array([0.1330, 0.1490, 0.2370])), (("10B", 0.2, 4.0), np.array([0.0880, 0.1020, 0.2370])), (("10B", 0.2, 6.0), np.array([0.0630, 0.0740, 0.2370])), (("2.5PB", 0.2, 2.0), np.array([0.1470, 0.1430, 0.2370])), (("2.5PB", 0.2, 4.0), np.array([0.1090, 0.0940, 0.2370])), (("2.5PB", 0.2, 6.0), np.array([0.0870, 0.0670, 0.2370])), (("5PB", 0.2, 2.0), np.array([0.1650, 0.1360, 0.2370])), (("5PB", 0.2, 4.0), np.array([0.1330, 0.0900, 0.2370])), (("5PB", 0.2, 6.0), np.array([0.1150, 0.0620, 0.2370])), (("5PB", 0.2, 8.0), np.array([0.1040, 0.0450, 0.2370])), (("5PB", 0.2, 10.0), np.array([0.0960, 0.0320, 0.2370])), (("5PB", 0.2, 12.0), np.array([0.0860, 0.0180, 0.2370])), (("7.5PB", 0.2, 2.0), np.array([0.1920, 0.1300, 0.2370])), (("7.5PB", 0.2, 4.0), np.array([0.1710, 0.0870, 0.2370])), (("7.5PB", 0.2, 6.0), np.array([0.1590, 0.0610, 0.2370])), (("7.5PB", 0.2, 8.0), np.array([0.1520, 0.0450, 0.2370])), (("7.5PB", 0.2, 10.0), np.array([0.1480, 0.0340, 0.2370])), (("7.5PB", 0.2, 12.0), np.array([0.1450, 0.0250, 0.2370])), (("7.5PB", 0.2, 14.0), np.array([0.1420, 0.0180, 0.2370])), (("7.5PB", 0.2, 16.0), np.array([0.1390, 0.0120, 0.2370])), (("7.5PB", 0.2, 18.0), np.array([0.1370, 0.0060, 0.2370])), (("7.5PB", 0.2, 20.0), np.array([0.1360, 0.0000, 0.2370])), (("10PB", 0.2, 2.0), np.array([0.2270, 0.1260, 0.2370])), (("10PB", 0.2, 4.0), np.array([0.2130, 0.0880, 0.2370])), (("10PB", 0.2, 6.0), np.array([0.2060, 0.0640, 0.2370])), (("10PB", 0.2, 8.0), np.array([0.2020, 0.0490, 0.2370])), (("10PB", 0.2, 10.0), np.array([0.2000, 0.0400, 0.2370])), (("10PB", 0.2, 12.0), np.array([0.1980, 0.0310, 0.2370])), (("10PB", 0.2, 14.0), np.array([0.1960, 0.0240, 0.2370])), (("10PB", 0.2, 16.0), np.array([0.1950, 0.0180, 0.2370])), (("10PB", 0.2, 18.0), np.array([0.1930, 0.0120, 0.2370])), (("10PB", 0.2, 20.0), np.array([0.1920, 0.0060, 0.2370])), (("2.5P", 0.2, 2.0), np.array([0.2500, 0.1270, 0.2370])), (("2.5P", 0.2, 4.0), np.array([0.2410, 0.0900, 0.2370])), (("2.5P", 0.2, 6.0), np.array([0.2360, 0.0670, 0.2370])), (("2.5P", 0.2, 8.0), np.array([0.2320, 0.0520, 0.2370])), (("2.5P", 0.2, 10.0), np.array([0.2310, 0.0430, 0.2370])), (("2.5P", 0.2, 12.0), np.array([0.2290, 0.0350, 0.2370])), (("2.5P", 0.2, 14.0), np.array([0.2280, 0.0280, 0.2370])), (("2.5P", 0.2, 16.0), np.array([0.2270, 0.0220, 0.2370])), (("2.5P", 0.2, 18.0), np.array([0.2260, 0.0160, 0.2370])), (("5P", 0.2, 2.0), np.array([0.2750, 0.1290, 0.2370])), (("5P", 0.2, 4.0), np.array([0.2690, 0.0930, 0.2370])), (("5P", 0.2, 6.0), np.array([0.2660, 0.0720, 0.2370])), (("5P", 0.2, 8.0), np.array([0.2640, 0.0560, 0.2370])), (("5P", 0.2, 10.0), np.array([0.2630, 0.0470, 0.2370])), (("5P", 0.2, 12.0), np.array([0.2630, 0.0390, 0.2370])), (("5P", 0.2, 14.0), np.array([0.2620, 0.0320, 0.2370])), (("7.5P", 0.2, 2.0), np.array([0.2880, 0.1310, 0.2370])), (("7.5P", 0.2, 4.0), np.array([0.2830, 0.0940, 0.2370])), (("7.5P", 0.2, 6.0), np.array([0.2800, 0.0740, 0.2370])), (("7.5P", 0.2, 8.0), np.array([0.2770, 0.0580, 0.2370])), (("7.5P", 0.2, 10.0), np.array([0.2760, 0.0490, 0.2370])), (("7.5P", 0.2, 12.0), np.array([0.2750, 0.0400, 0.2370])), (("10P", 0.2, 2.0), np.array([0.3000, 0.1340, 0.2370])), (("10P", 0.2, 4.0), np.array([0.2960, 0.0970, 0.2370])), (("10P", 0.2, 6.0), np.array([0.2930, 0.0750, 0.2370])), (("10P", 0.2, 8.0), np.array([0.2910, 0.0600, 0.2370])), (("10P", 0.2, 10.0), np.array([0.2900, 0.0510, 0.2370])), (("2.5RP", 0.2, 2.0), np.array([0.3150, 0.1370, 0.2370])), (("2.5RP", 0.2, 4.0), np.array([0.3130, 0.1000, 0.2370])), (("2.5RP", 0.2, 6.0), np.array([0.3120, 0.0780, 0.2370])), (("2.5RP", 0.2, 8.0), np.array([0.3100, 0.0640, 0.2370])), (("2.5RP", 0.2, 10.0), np.array([0.3100, 0.0530, 0.2370])), (("5RP", 0.2, 2.0), np.array([0.3370, 0.1430, 0.2370])), (("5RP", 0.2, 4.0), np.array([0.3410, 0.1060, 0.2370])), (("5RP", 0.2, 6.0), np.array([0.3420, 0.0840, 0.2370])), (("5RP", 0.2, 8.0), np.array([0.3420, 0.0690, 0.2370])), (("7.5RP", 0.2, 2.0), np.array([0.3700, 0.1520, 0.2370])), (("7.5RP", 0.2, 4.0), np.array([0.3810, 0.1150, 0.2370])), (("7.5RP", 0.2, 6.0), np.array([0.3880, 0.0930, 0.2370])), (("7.5RP", 0.2, 8.0), np.array([0.3930, 0.0770, 0.2370])), (("10RP", 0.2, 2.0), np.array([0.4040, 0.1640, 0.2370])), (("10RP", 0.2, 4.0), np.array([0.4240, 0.1250, 0.2370])), (("10RP", 0.2, 6.0), np.array([0.4350, 0.1030, 0.2370])), (("2.5R", 0.2, 2.0), np.array([0.4510, 0.1830, 0.2370])), (("2.5R", 0.2, 4.0), np.array([0.4880, 0.1420, 0.2370])), (("2.5R", 0.2, 6.0), np.array([0.5100, 0.1190, 0.2370])), (("5R", 0.2, 2.0), np.array([0.5010, 0.2040, 0.2370])), (("5R", 0.2, 4.0), np.array([0.5560, 0.1590, 0.2370])), (("7.5R", 0.2, 2.0), np.array([0.5430, 0.2240, 0.2370])), (("7.5R", 0.2, 4.0), np.array([0.6260, 0.1780, 0.2370])), (("10R", 0.2, 2.0), np.array([0.5920, 0.2460, 0.2370])), (("10R", 0.2, 4.0), np.array([0.6960, 0.1980, 0.2370])), (("2.5YR", 0.2, 2.0), np.array([0.6790, 0.2900, 0.2370])), (("2.5YR", 0.2, 4.0), np.array([0.8430, 0.2450, 0.2370])), (("5YR", 0.2, 2.0), np.array([0.8370, 0.3750, 0.2370])), (("5YR", 0.2, 4.0), np.array([1.1740, 0.3550, 0.2370])), (("7.5YR", 0.2, 2.0), np.array([1.0000, 0.4800, 0.2370])), (("10YR", 0.2, 2.0), np.array([1.2900, 0.7400, 0.2370])), (("2.5Y", 0.2, 2.0), np.array([1.4300, 0.9700, 0.2370])), (("5Y", 0.2, 2.0), np.array([1.4950, 1.2840, 0.2370])), (("7.5Y", 0.2, 2.0), np.array([1.4340, 1.4590, 0.2370])), (("10Y", 0.4, 2.0), np.array([0.5420, 0.6700, 0.4670])), (("2.5GY", 0.4, 2.0), np.array([0.4230, 0.5900, 0.4670])), (("2.5GY", 0.4, 4.0), np.array([0.7350, 1.8200, 0.4670])), (("5GY", 0.4, 2.0), np.array([0.3580, 0.5280, 0.4670])), (("5GY", 0.4, 4.0), np.array([0.3230, 1.4670, 0.4670])), (("7.5GY", 0.4, 2.0), np.array([0.3120, 0.4820, 0.4670])), (("7.5GY", 0.4, 4.0), np.array([0.1280, 1.1410, 0.4670])), (("10GY", 0.4, 2.0), np.array([0.2770, 0.4450, 0.4670])), (("10GY", 0.4, 4.0), np.array([0.0410, 0.9060, 0.4670])), (("2.5G", 0.4, 2.0), np.array([0.2580, 0.4230, 0.4670])), (("2.5G", 0.4, 4.0), np.array([0.0050, 0.7430, 0.4670])), (("5G", 0.4, 2.0), np.array([0.2390, 0.3990, 0.4670])), (("5G", 0.4, 4.0), np.array([-0.0110, 0.6040, 0.4670])), (("7.5G", 0.4, 2.0), np.array([0.2260, 0.3800, 0.4670])), (("7.5G", 0.4, 4.0), np.array([-0.0110, 0.5010, 0.4670])), (("10G", 0.4, 2.0), np.array([0.2130, 0.3610, 0.4670])), (("10G", 0.4, 4.0), np.array([-0.0040, 0.4050, 0.4670])), (("2.5BG", 0.4, 2.0), np.array([0.1960, 0.3320, 0.4670])), (("2.5BG", 0.4, 4.0), np.array([0.0080, 0.3340, 0.4670])), (("5BG", 0.4, 2.0), np.array([0.1800, 0.2980, 0.4670])), (("5BG", 0.4, 4.0), np.array([0.0310, 0.2590, 0.4670])), (("7.5BG", 0.4, 2.0), np.array([0.1730, 0.2750, 0.4670])), (("7.5BG", 0.4, 4.0), np.array([0.0510, 0.2200, 0.4670])), (("7.5BG", 0.4, 6.0), np.array([-0.0050, 0.1930, 0.4670])), (("10BG", 0.4, 2.0), np.array([0.1690, 0.2490, 0.4670])), (("10BG", 0.4, 4.0), np.array([0.0740, 0.1870, 0.4670])), (("10BG", 0.4, 6.0), np.array([0.0320, 0.1490, 0.4670])), (("2.5B", 0.4, 2.0), np.array([0.1690, 0.2360, 0.4670])), (("2.5B", 0.4, 4.0), np.array([0.0870, 0.1720, 0.4670])), (("2.5B", 0.4, 6.0), np.array([0.0480, 0.1340, 0.4670])), (("5B", 0.4, 2.0), np.array([0.1720, 0.2230, 0.4670])), (("5B", 0.4, 4.0), np.array([0.1020, 0.1590, 0.4670])), (("5B", 0.4, 6.0), np.array([0.0670, 0.1190, 0.4670])), (("7.5B", 0.4, 2.0), np.array([0.1760, 0.2130, 0.4670])), (("7.5B", 0.4, 4.0), np.array([0.1130, 0.1510, 0.4670])), (("7.5B", 0.4, 6.0), np.array([0.0810, 0.1110, 0.4670])), (("10B", 0.4, 2.0), np.array([0.1830, 0.2030, 0.4670])), (("10B", 0.4, 4.0), np.array([0.1260, 0.1450, 0.4670])), (("10B", 0.4, 6.0), np.array([0.0930, 0.1050, 0.4670])), (("10B", 0.4, 8.0), np.array([0.0670, 0.0670, 0.4670])), (("2.5PB", 0.4, 2.0), np.array([0.1900, 0.1960, 0.4670])), (("2.5PB", 0.4, 4.0), np.array([0.1410, 0.1390, 0.4670])), (("2.5PB", 0.4, 6.0), np.array([0.1130, 0.0980, 0.4670])), (("2.5PB", 0.4, 8.0), np.array([0.0930, 0.0650, 0.4670])), (("5PB", 0.4, 2.0), np.array([0.2020, 0.1880, 0.4670])), (("5PB", 0.4, 4.0), np.array([0.1610, 0.1340, 0.4670])), (("5PB", 0.4, 6.0), np.array([0.1350, 0.0950, 0.4670])), (("5PB", 0.4, 8.0), np.array([0.1160, 0.0660, 0.4670])), (("5PB", 0.4, 10.0), np.array([0.1070, 0.0530, 0.4670])), (("5PB", 0.4, 12.0), np.array([0.0990, 0.0420, 0.4670])), (("5PB", 0.4, 14.0), np.array([0.0960, 0.0360, 0.4670])), (("5PB", 0.4, 16.0), np.array([0.0940, 0.0300, 0.4670])), (("5PB", 0.4, 18.0), np.array([0.0910, 0.0250, 0.4670])), (("5PB", 0.4, 20.0), np.array([0.0860, 0.0180, 0.4670])), (("7.5PB", 0.4, 2.0), np.array([0.2200, 0.1800, 0.4670])), (("7.5PB", 0.4, 4.0), np.array([0.1920, 0.1300, 0.4670])), (("7.5PB", 0.4, 6.0), np.array([0.1750, 0.0950, 0.4670])), (("7.5PB", 0.4, 8.0), np.array([0.1650, 0.0720, 0.4670])), (("7.5PB", 0.4, 10.0), np.array([0.1600, 0.0580, 0.4670])), (("7.5PB", 0.4, 12.0), np.array([0.1550, 0.0460, 0.4670])), (("7.5PB", 0.4, 14.0), np.array([0.1520, 0.0400, 0.4670])), (("7.5PB", 0.4, 16.0), np.array([0.1500, 0.0320, 0.4670])), (("7.5PB", 0.4, 18.0), np.array([0.1470, 0.0260, 0.4670])), (("7.5PB", 0.4, 20.0), np.array([0.1450, 0.0200, 0.4670])), (("7.5PB", 0.4, 22.0), np.array([0.1430, 0.0160, 0.4670])), (("7.5PB", 0.4, 24.0), np.array([0.1410, 0.0100, 0.4670])), (("7.5PB", 0.4, 26.0), np.array([0.1390, 0.0050, 0.4670])), (("7.5PB", 0.4, 28.0), np.array([0.1370, 0.0010, 0.4670])), (("10PB", 0.4, 2.0), np.array([0.2410, 0.1760, 0.4670])), (("10PB", 0.4, 4.0), np.array([0.2230, 0.1310, 0.4670])), (("10PB", 0.4, 6.0), np.array([0.2120, 0.1000, 0.4670])), (("10PB", 0.4, 8.0), np.array([0.2060, 0.0780, 0.4670])), (("10PB", 0.4, 10.0), np.array([0.2020, 0.0620, 0.4670])), (("10PB", 0.4, 12.0), np.array([0.1990, 0.0500, 0.4670])), (("10PB", 0.4, 14.0), np.array([0.1970, 0.0430, 0.4670])), (("10PB", 0.4, 16.0), np.array([0.1950, 0.0360, 0.4670])), (("10PB", 0.4, 18.0), np.array([0.1930, 0.0290, 0.4670])), (("10PB", 0.4, 20.0), np.array([0.1920, 0.0240, 0.4670])), (("10PB", 0.4, 22.0), np.array([0.1910, 0.0180, 0.4670])), (("10PB", 0.4, 24.0), np.array([0.1900, 0.0130, 0.4670])), (("10PB", 0.4, 26.0), np.array([0.1880, 0.0080, 0.4670])), (("10PB", 0.4, 28.0), np.array([0.1870, 0.0040, 0.4670])), (("2.5P", 0.4, 2.0), np.array([0.2590, 0.1770, 0.4670])), (("2.5P", 0.4, 4.0), np.array([0.2460, 0.1340, 0.4670])), (("2.5P", 0.4, 6.0), np.array([0.2380, 0.1040, 0.4670])), (("2.5P", 0.4, 8.0), np.array([0.2330, 0.0820, 0.4670])), (("2.5P", 0.4, 10.0), np.array([0.2300, 0.0640, 0.4670])), (("2.5P", 0.4, 12.0), np.array([0.2270, 0.0540, 0.4670])), (("2.5P", 0.4, 14.0), np.array([0.2260, 0.0450, 0.4670])), (("2.5P", 0.4, 16.0), np.array([0.2240, 0.0380, 0.4670])), (("2.5P", 0.4, 18.0), np.array([0.2230, 0.0310, 0.4670])), (("2.5P", 0.4, 20.0), np.array([0.2220, 0.0260, 0.4670])), (("2.5P", 0.4, 22.0), np.array([0.2200, 0.0200, 0.4670])), (("2.5P", 0.4, 24.0), np.array([0.2190, 0.0160, 0.4670])), (("2.5P", 0.4, 26.0), np.array([0.2180, 0.0100, 0.4670])), (("5P", 0.4, 2.0), np.array([0.2810, 0.1820, 0.4670])), (("5P", 0.4, 4.0), np.array([0.2720, 0.1380, 0.4670])), (("5P", 0.4, 6.0), np.array([0.2650, 0.1100, 0.4670])), (("5P", 0.4, 8.0), np.array([0.2600, 0.0870, 0.4670])), (("5P", 0.4, 10.0), np.array([0.2570, 0.0690, 0.4670])), (("5P", 0.4, 12.0), np.array([0.2530, 0.0570, 0.4670])), (("5P", 0.4, 14.0), np.array([0.2520, 0.0480, 0.4670])), (("5P", 0.4, 16.0), np.array([0.2500, 0.0400, 0.4670])), (("5P", 0.4, 18.0), np.array([0.2480, 0.0340, 0.4670])), (("5P", 0.4, 20.0), np.array([0.2470, 0.0280, 0.4670])), (("7.5P", 0.4, 2.0), np.array([0.2960, 0.1850, 0.4670])), (("7.5P", 0.4, 4.0), np.array([0.2890, 0.1420, 0.4670])), (("7.5P", 0.4, 6.0), np.array([0.2840, 0.1140, 0.4670])), (("7.5P", 0.4, 8.0), np.array([0.2800, 0.0910, 0.4670])), (("7.5P", 0.4, 10.0), np.array([0.2760, 0.0720, 0.4670])), (("7.5P", 0.4, 12.0), np.array([0.2730, 0.0590, 0.4670])), (("7.5P", 0.4, 14.0), np.array([0.2720, 0.0490, 0.4670])), (("7.5P", 0.4, 16.0), np.array([0.2700, 0.0420, 0.4670])), (("7.5P", 0.4, 18.0), np.array([0.2690, 0.0340, 0.4670])), (("10P", 0.4, 2.0), np.array([0.3090, 0.1890, 0.4670])), (("10P", 0.4, 4.0), np.array([0.3040, 0.1460, 0.4670])), (("10P", 0.4, 6.0), np.array([0.3020, 0.1190, 0.4670])), (("10P", 0.4, 8.0), np.array([0.2980, 0.0950, 0.4670])), (("10P", 0.4, 10.0), np.array([0.2960, 0.0730, 0.4670])), (("10P", 0.4, 12.0), np.array([0.2940, 0.0610, 0.4670])), (("10P", 0.4, 14.0), np.array([0.2930, 0.0520, 0.4670])), (("10P", 0.4, 16.0), np.array([0.2910, 0.0430, 0.4670])), (("2.5RP", 0.4, 2.0), np.array([0.3200, 0.1930, 0.4670])), (("2.5RP", 0.4, 4.0), np.array([0.3200, 0.1510, 0.4670])), (("2.5RP", 0.4, 6.0), np.array([0.3200, 0.1230, 0.4670])), (("2.5RP", 0.4, 8.0), np.array([0.3200, 0.1000, 0.4670])), (("2.5RP", 0.4, 10.0), np.array([0.3200, 0.0780, 0.4670])), (("2.5RP", 0.4, 12.0), np.array([0.3200, 0.0650, 0.4670])), (("2.5RP", 0.4, 14.0), np.array([0.3200, 0.0540, 0.4670])), (("5RP", 0.4, 2.0), np.array([0.3370, 0.1990, 0.4670])), (("5RP", 0.4, 4.0), np.array([0.3440, 0.1580, 0.4670])), (("5RP", 0.4, 6.0), np.array([0.3480, 0.1310, 0.4670])), (("5RP", 0.4, 8.0), np.array([0.3500, 0.1060, 0.4670])), (("5RP", 0.4, 10.0), np.array([0.3530, 0.0820, 0.4670])), (("5RP", 0.4, 12.0), np.array([0.3530, 0.0700, 0.4670])), (("7.5RP", 0.4, 2.0), np.array([0.3600, 0.2090, 0.4670])), (("7.5RP", 0.4, 4.0), np.array([0.3740, 0.1690, 0.4670])), (("7.5RP", 0.4, 6.0), np.array([0.3840, 0.1410, 0.4670])), (("7.5RP", 0.4, 8.0), np.array([0.3910, 0.1170, 0.4670])), (("7.5RP", 0.4, 10.0), np.array([0.3980, 0.0900, 0.4670])), (("10RP", 0.4, 2.0), np.array([0.3810, 0.2200, 0.4670])), (("10RP", 0.4, 4.0), np.array([0.4060, 0.1810, 0.4670])), (("10RP", 0.4, 6.0), np.array([0.4230, 0.1530, 0.4670])), (("10RP", 0.4, 8.0), np.array([0.4370, 0.1280, 0.4670])), (("10RP", 0.4, 10.0), np.array([0.4540, 0.0980, 0.4670])), (("2.5R", 0.4, 2.0), np.array([0.4110, 0.2360, 0.4670])), (("2.5R", 0.4, 4.0), np.array([0.4500, 0.1980, 0.4670])), (("2.5R", 0.4, 6.0), np.array([0.4770, 0.1700, 0.4670])), (("2.5R", 0.4, 8.0), np.array([0.5010, 0.1430, 0.4670])), (("2.5R", 0.4, 10.0), np.array([0.5290, 0.1130, 0.4670])), (("5R", 0.4, 2.0), np.array([0.4410, 0.2550, 0.4670])), (("5R", 0.4, 4.0), np.array([0.4980, 0.2190, 0.4670])), (("5R", 0.4, 6.0), np.array([0.5370, 0.1900, 0.4670])), (("5R", 0.4, 8.0), np.array([0.5750, 0.1610, 0.4670])), (("7.5R", 0.4, 2.0), np.array([0.4660, 0.2720, 0.4670])), (("7.5R", 0.4, 4.0), np.array([0.5390, 0.2380, 0.4670])), (("7.5R", 0.4, 6.0), np.array([0.5880, 0.2080, 0.4670])), (("7.5R", 0.4, 8.0), np.array([0.6350, 0.1760, 0.4670])), (("10R", 0.4, 2.0), np.array([0.4900, 0.2890, 0.4670])), (("10R", 0.4, 4.0), np.array([0.5820, 0.2580, 0.4670])), (("10R", 0.4, 6.0), np.array([0.6490, 0.2290, 0.4670])), (("10R", 0.4, 8.0), np.array([0.7060, 0.1960, 0.4670])), (("2.5YR", 0.4, 2.0), np.array([0.5340, 0.3240, 0.4670])), (("2.5YR", 0.4, 4.0), np.array([0.6650, 0.2980, 0.4670])), (("2.5YR", 0.4, 6.0), np.array([0.7550, 0.2700, 0.4670])), (("2.5YR", 0.4, 8.0), np.array([0.8440, 0.2410, 0.4670])), (("5YR", 0.4, 2.0), np.array([0.5850, 0.3670, 0.4670])), (("5YR", 0.4, 4.0), np.array([0.7750, 0.3620, 0.4670])), (("5YR", 0.4, 6.0), np.array([0.8890, 0.3440, 0.4670])), (("7.5YR", 0.4, 2.0), np.array([0.6380, 0.4200, 0.4670])), (("7.5YR", 0.4, 4.0), np.array([0.9080, 0.4520, 0.4670])), (("10YR", 0.4, 2.0), np.array([0.6980, 0.4990, 0.4670])), (("2.5Y", 0.4, 2.0), np.array([0.7290, 0.5880, 0.4670])), (("5Y", 0.4, 2.0), np.array([0.7210, 0.6560, 0.4670])), (("7.5Y", 0.4, 2.0), np.array([0.6590, 0.7000, 0.4670])), (("10Y", 0.6, 2.0), np.array([0.4320, 0.5010, 0.6990])), (("10Y", 0.6, 4.0), np.array([0.9020, 1.2230, 0.6990])), (("2.5GY", 0.6, 2.0), np.array([0.3770, 0.4680, 0.6990])), (("2.5GY", 0.6, 4.0), np.array([0.6030, 1.1690, 0.6990])), (("5GY", 0.6, 2.0), np.array([0.3420, 0.4420, 0.6990])), (("5GY", 0.6, 4.0), np.array([0.4100, 0.9950, 0.6990])), (("7.5GY", 0.6, 2.0), np.array([0.3150, 0.4200, 0.6990])), (("7.5GY", 0.6, 4.0), np.array([0.2740, 0.7920, 0.6990])), (("7.5GY", 0.6, 6.0), np.array([-0.0450, 1.4590, 0.6990])), (("10GY", 0.6, 2.0), np.array([0.2920, 0.3990, 0.6990])), (("10GY", 0.6, 4.0), np.array([0.2080, 0.6520, 0.6990])), (("10GY", 0.6, 6.0), np.array([-0.1280, 1.1250, 0.6990])), (("2.5G", 0.6, 2.0), np.array([0.2810, 0.3880, 0.6990])), (("2.5G", 0.6, 4.0), np.array([0.1750, 0.5610, 0.6990])), (("2.5G", 0.6, 6.0), np.array([-0.1430, 0.8890, 0.6990])), (("5G", 0.6, 2.0), np.array([0.2700, 0.3760, 0.6990])), (("5G", 0.6, 4.0), np.array([0.1520, 0.4930, 0.6990])), (("5G", 0.6, 6.0), np.array([-0.1280, 0.6820, 0.6990])), (("7.5G", 0.6, 2.0), np.array([0.2590, 0.3630, 0.6990])), (("7.5G", 0.6, 4.0), np.array([0.1370, 0.4400, 0.6990])), (("7.5G", 0.6, 6.0), np.array([-0.1020, 0.5410, 0.6990])), (("10G", 0.6, 2.0), np.array([0.2470, 0.3490, 0.6990])), (("10G", 0.6, 4.0), np.array([0.1240, 0.3890, 0.6990])), (("10G", 0.6, 6.0), np.array([-0.0680, 0.4250, 0.6990])), (("2.5BG", 0.6, 2.0), np.array([0.2360, 0.3340, 0.6990])), (("2.5BG", 0.6, 4.0), np.array([0.1170, 0.3410, 0.6990])), (("2.5BG", 0.6, 6.0), np.array([-0.0360, 0.3340, 0.6990])), (("5BG", 0.6, 2.0), np.array([0.2210, 0.3110, 0.6990])), (("5BG", 0.6, 4.0), np.array([0.1120, 0.2840, 0.6990])), (("5BG", 0.6, 6.0), np.array([0.0090, 0.2430, 0.6990])), (("7.5BG", 0.6, 2.0), np.array([0.2130, 0.2950, 0.6990])), (("7.5BG", 0.6, 4.0), np.array([0.1130, 0.2540, 0.6990])), (("7.5BG", 0.6, 6.0), np.array([0.0300, 0.2110, 0.6990])), (("10BG", 0.6, 2.0), np.array([0.2060, 0.2760, 0.6990])), (("10BG", 0.6, 4.0), np.array([0.1160, 0.2210, 0.6990])), (("10BG", 0.6, 6.0), np.array([0.0520, 0.1760, 0.6990])), (("2.5B", 0.6, 2.0), np.array([0.2020, 0.2600, 0.6990])), (("2.5B", 0.6, 4.0), np.array([0.1230, 0.2020, 0.6990])), (("2.5B", 0.6, 6.0), np.array([0.0710, 0.1570, 0.6990])), (("2.5B", 0.6, 8.0), np.array([0.0170, 0.1110, 0.6990])), (("5B", 0.6, 2.0), np.array([0.2020, 0.2450, 0.6990])), (("5B", 0.6, 4.0), np.array([0.1340, 0.1870, 0.6990])), (("5B", 0.6, 6.0), np.array([0.0880, 0.1450, 0.6990])), (("5B", 0.6, 8.0), np.array([0.0440, 0.1000, 0.6990])), (("7.5B", 0.6, 2.0), np.array([0.2040, 0.2350, 0.6990])), (("7.5B", 0.6, 4.0), np.array([0.1430, 0.1780, 0.6990])), (("7.5B", 0.6, 6.0), np.array([0.0990, 0.1360, 0.6990])), (("7.5B", 0.6, 8.0), np.array([0.0600, 0.0960, 0.6990])), (("10B", 0.6, 2.0), np.array([0.2090, 0.2270, 0.6990])), (("10B", 0.6, 4.0), np.array([0.1530, 0.1720, 0.6990])), (("10B", 0.6, 6.0), np.array([0.1150, 0.1280, 0.6990])), (("10B", 0.6, 8.0), np.array([0.0840, 0.0910, 0.6990])), (("2.5PB", 0.6, 2.0), np.array([0.2150, 0.2210, 0.6990])), (("2.5PB", 0.6, 4.0), np.array([0.1660, 0.1650, 0.6990])), (("2.5PB", 0.6, 6.0), np.array([0.1310, 0.1220, 0.6990])), (("2.5PB", 0.6, 8.0), np.array([0.1060, 0.0900, 0.6990])), (("2.5PB", 0.6, 10.0), np.array([0.0890, 0.0680, 0.6990])), (("2.5PB", 0.6, 12.0), np.array([0.0790, 0.0550, 0.6990])), (("5PB", 0.6, 2.0), np.array([0.2230, 0.2150, 0.6990])), (("5PB", 0.6, 4.0), np.array([0.1820, 0.1600, 0.6990])), (("5PB", 0.6, 6.0), np.array([0.1520, 0.1180, 0.6990])), (("5PB", 0.6, 8.0), np.array([0.1310, 0.0880, 0.6990])), (("5PB", 0.6, 10.0), np.array([0.1180, 0.0690, 0.6990])), (("5PB", 0.6, 12.0), np.array([0.1100, 0.0570, 0.6990])), (("5PB", 0.6, 14.0), np.array([0.1040, 0.0480, 0.6990])), (("5PB", 0.6, 16.0), np.array([0.0990, 0.0400, 0.6990])), (("5PB", 0.6, 18.0), np.array([0.0930, 0.0320, 0.6990])), (("5PB", 0.6, 20.0), np.array([0.0880, 0.0240, 0.6990])), (("5PB", 0.6, 22.0), np.array([0.0840, 0.0180, 0.6990])), (("7.5PB", 0.6, 2.0), np.array([0.2390, 0.2080, 0.6990])), (("7.5PB", 0.6, 4.0), np.array([0.2080, 0.1550, 0.6990])), (("7.5PB", 0.6, 6.0), np.array([0.1880, 0.1170, 0.6990])), (("7.5PB", 0.6, 8.0), np.array([0.1760, 0.0920, 0.6990])), (("7.5PB", 0.6, 10.0), np.array([0.1680, 0.0740, 0.6990])), (("7.5PB", 0.6, 12.0), np.array([0.1630, 0.0620, 0.6990])), (("7.5PB", 0.6, 14.0), np.array([0.1590, 0.0530, 0.6990])), (("7.5PB", 0.6, 16.0), np.array([0.1560, 0.0450, 0.6990])), (("7.5PB", 0.6, 18.0), np.array([0.1530, 0.0370, 0.6990])), (("7.5PB", 0.6, 20.0), np.array([0.1500, 0.0300, 0.6990])), (("7.5PB", 0.6, 22.0), np.array([0.1480, 0.0250, 0.6990])), (("7.5PB", 0.6, 24.0), np.array([0.1460, 0.0200, 0.6990])), (("7.5PB", 0.6, 26.0), np.array([0.1440, 0.0140, 0.6990])), (("7.5PB", 0.6, 28.0), np.array([0.1420, 0.0080, 0.6990])), (("7.5PB", 0.6, 30.0), np.array([0.1400, 0.0040, 0.6990])), (("10PB", 0.6, 2.0), np.array([0.2570, 0.2040, 0.6990])), (("10PB", 0.6, 4.0), np.array([0.2370, 0.1570, 0.6990])), (("10PB", 0.6, 6.0), np.array([0.2250, 0.1240, 0.6990])), (("10PB", 0.6, 8.0), np.array([0.2160, 0.0980, 0.6990])), (("10PB", 0.6, 10.0), np.array([0.2110, 0.0820, 0.6990])), (("10PB", 0.6, 12.0), np.array([0.2080, 0.0700, 0.6990])), (("10PB", 0.6, 14.0), np.array([0.2040, 0.0580, 0.6990])), (("10PB", 0.6, 16.0), np.array([0.2020, 0.0500, 0.6990])), (("10PB", 0.6, 18.0), np.array([0.2000, 0.0420, 0.6990])), (("10PB", 0.6, 20.0), np.array([0.1980, 0.0350, 0.6990])), (("10PB", 0.6, 22.0), np.array([0.1960, 0.0290, 0.6990])), (("10PB", 0.6, 24.0), np.array([0.1950, 0.0240, 0.6990])), (("10PB", 0.6, 26.0), np.array([0.1940, 0.0180, 0.6990])), (("10PB", 0.6, 28.0), np.array([0.1920, 0.0120, 0.6990])), (("10PB", 0.6, 30.0), np.array([0.1900, 0.0060, 0.6990])), (("2.5P", 0.6, 2.0), np.array([0.2720, 0.2050, 0.6990])), (("2.5P", 0.6, 4.0), np.array([0.2580, 0.1600, 0.6990])), (("2.5P", 0.6, 6.0), np.array([0.2500, 0.1290, 0.6990])), (("2.5P", 0.6, 8.0), np.array([0.2440, 0.1040, 0.6990])), (("2.5P", 0.6, 10.0), np.array([0.2400, 0.0880, 0.6990])), (("2.5P", 0.6, 12.0), np.array([0.2380, 0.0750, 0.6990])), (("2.5P", 0.6, 14.0), np.array([0.2350, 0.0600, 0.6990])), (("2.5P", 0.6, 16.0), np.array([0.2330, 0.0530, 0.6990])), (("2.5P", 0.6, 18.0), np.array([0.2320, 0.0440, 0.6990])), (("2.5P", 0.6, 20.0), np.array([0.2300, 0.0380, 0.6990])), (("2.5P", 0.6, 22.0), np.array([0.2290, 0.0320, 0.6990])), (("2.5P", 0.6, 24.0), np.array([0.2280, 0.0270, 0.6990])), (("2.5P", 0.6, 26.0), np.array([0.2270, 0.0210, 0.6990])), (("2.5P", 0.6, 28.0), np.array([0.2260, 0.0140, 0.6990])), (("5P", 0.6, 2.0), np.array([0.2870, 0.2070, 0.6990])), (("5P", 0.6, 4.0), np.array([0.2800, 0.1660, 0.6990])), (("5P", 0.6, 6.0), np.array([0.2740, 0.1360, 0.6990])), (("5P", 0.6, 8.0), np.array([0.2700, 0.1100, 0.6990])), (("5P", 0.6, 10.0), np.array([0.2680, 0.0940, 0.6990])), (("5P", 0.6, 12.0), np.array([0.2660, 0.0800, 0.6990])), (("5P", 0.6, 14.0), np.array([0.2640, 0.0650, 0.6990])), (("5P", 0.6, 16.0), np.array([0.2630, 0.0560, 0.6990])), (("5P", 0.6, 18.0), np.array([0.2620, 0.0460, 0.6990])), (("5P", 0.6, 20.0), np.array([0.2610, 0.0410, 0.6990])), (("5P", 0.6, 22.0), np.array([0.2600, 0.0340, 0.6990])), (("5P", 0.6, 24.0), np.array([0.2600, 0.0300, 0.6990])), (("7.5P", 0.6, 2.0), np.array([0.3010, 0.2110, 0.6990])), (("7.5P", 0.6, 4.0), np.array([0.2960, 0.1700, 0.6990])), (("7.5P", 0.6, 6.0), np.array([0.2920, 0.1410, 0.6990])), (("7.5P", 0.6, 8.0), np.array([0.2880, 0.1150, 0.6990])), (("7.5P", 0.6, 10.0), np.array([0.2840, 0.0980, 0.6990])), (("7.5P", 0.6, 12.0), np.array([0.2810, 0.0830, 0.6990])), (("7.5P", 0.6, 14.0), np.array([0.2790, 0.0670, 0.6990])), (("7.5P", 0.6, 16.0), np.array([0.2770, 0.0560, 0.6990])), (("7.5P", 0.6, 18.0), np.array([0.2760, 0.0490, 0.6990])), (("7.5P", 0.6, 20.0), np.array([0.2750, 0.0420, 0.6990])), (("10P", 0.6, 2.0), np.array([0.3110, 0.2140, 0.6990])), (("10P", 0.6, 4.0), np.array([0.3080, 0.1740, 0.6990])), (("10P", 0.6, 6.0), np.array([0.3060, 0.1450, 0.6990])), (("10P", 0.6, 8.0), np.array([0.3040, 0.1190, 0.6990])), (("10P", 0.6, 10.0), np.array([0.3020, 0.1010, 0.6990])), (("10P", 0.6, 12.0), np.array([0.3010, 0.0870, 0.6990])), (("10P", 0.6, 14.0), np.array([0.2990, 0.0690, 0.6990])), (("10P", 0.6, 16.0), np.array([0.2980, 0.0600, 0.6990])), (("10P", 0.6, 18.0), np.array([0.2970, 0.0510, 0.6990])), (("2.5RP", 0.6, 2.0), np.array([0.3220, 0.2180, 0.6990])), (("2.5RP", 0.6, 4.0), np.array([0.3240, 0.1790, 0.6990])), (("2.5RP", 0.6, 6.0), np.array([0.3250, 0.1510, 0.6990])), (("2.5RP", 0.6, 8.0), np.array([0.3260, 0.1250, 0.6990])), (("2.5RP", 0.6, 10.0), np.array([0.3260, 0.1060, 0.6990])), (("2.5RP", 0.6, 12.0), np.array([0.3260, 0.0920, 0.6990])), (("2.5RP", 0.6, 14.0), np.array([0.3260, 0.0730, 0.6990])), (("2.5RP", 0.6, 16.0), np.array([0.3250, 0.0620, 0.6990])), (("5RP", 0.6, 2.0), np.array([0.3370, 0.2260, 0.6990])), (("5RP", 0.6, 4.0), np.array([0.3470, 0.1890, 0.6990])), (("5RP", 0.6, 6.0), np.array([0.3540, 0.1590, 0.6990])), (("5RP", 0.6, 8.0), np.array([0.3590, 0.1350, 0.6990])), (("5RP", 0.6, 10.0), np.array([0.3630, 0.1140, 0.6990])), (("5RP", 0.6, 12.0), np.array([0.3660, 0.0990, 0.6990])), (("5RP", 0.6, 14.0), np.array([0.3700, 0.0800, 0.6990])), (("5RP", 0.6, 16.0), np.array([0.3730, 0.0680, 0.6990])), (("7.5RP", 0.6, 2.0), np.array([0.3550, 0.2360, 0.6990])), (("7.5RP", 0.6, 4.0), np.array([0.3730, 0.2000, 0.6990])), (("7.5RP", 0.6, 6.0), np.array([0.3870, 0.1700, 0.6990])), (("7.5RP", 0.6, 8.0), np.array([0.3970, 0.1460, 0.6990])), (("7.5RP", 0.6, 10.0), np.array([0.4060, 0.1240, 0.6990])), (("7.5RP", 0.6, 12.0), np.array([0.4130, 0.1060, 0.6990])), (("7.5RP", 0.6, 14.0), np.array([0.4210, 0.0870, 0.6990])), (("10RP", 0.6, 2.0), np.array([0.3720, 0.2470, 0.6990])), (("10RP", 0.6, 4.0), np.array([0.3990, 0.2110, 0.6990])), (("10RP", 0.6, 6.0), np.array([0.4190, 0.1820, 0.6990])), (("10RP", 0.6, 8.0), np.array([0.4340, 0.1580, 0.6990])), (("10RP", 0.6, 10.0), np.array([0.4470, 0.1350, 0.6990])), (("10RP", 0.6, 12.0), np.array([0.4590, 0.1140, 0.6990])), (("2.5R", 0.6, 2.0), np.array([0.3910, 0.2600, 0.6990])), (("2.5R", 0.6, 4.0), np.array([0.4320, 0.2270, 0.6990])), (("2.5R", 0.6, 6.0), np.array([0.4640, 0.2000, 0.6990])), (("2.5R", 0.6, 8.0), np.array([0.4890, 0.1760, 0.6990])), (("2.5R", 0.6, 10.0), np.array([0.5110, 0.1540, 0.6990])), (("2.5R", 0.6, 12.0), np.array([0.5370, 0.1260, 0.6990])), (("5R", 0.6, 2.0), np.array([0.4110, 0.2740, 0.6990])), (("5R", 0.6, 4.0), np.array([0.4690, 0.2460, 0.6990])), (("5R", 0.6, 6.0), np.array([0.5140, 0.2210, 0.6990])), (("5R", 0.6, 8.0), np.array([0.5510, 0.1970, 0.6990])), (("5R", 0.6, 10.0), np.array([0.5860, 0.1760, 0.6990])), (("7.5R", 0.6, 2.0), np.array([0.4310, 0.2900, 0.6990])), (("7.5R", 0.6, 4.0), np.array([0.5020, 0.2640, 0.6990])), (("7.5R", 0.6, 6.0), np.array([0.5580, 0.2400, 0.6990])), (("7.5R", 0.6, 8.0), np.array([0.6040, 0.2140, 0.6990])), (("7.5R", 0.6, 10.0), np.array([0.6400, 0.1920, 0.6990])), (("10R", 0.6, 2.0), np.array([0.4470, 0.3050, 0.6990])), (("10R", 0.6, 4.0), np.array([0.5370, 0.2840, 0.6990])), (("10R", 0.6, 6.0), np.array([0.6050, 0.2610, 0.6990])), (("10R", 0.6, 8.0), np.array([0.6600, 0.2350, 0.6990])), (("10R", 0.6, 10.0), np.array([0.7040, 0.2140, 0.6990])), (("2.5YR", 0.6, 2.0), np.array([0.4740, 0.3320, 0.6990])), (("2.5YR", 0.6, 4.0), np.array([0.6030, 0.3220, 0.6990])), (("2.5YR", 0.6, 6.0), np.array([0.6930, 0.3030, 0.6990])), (("2.5YR", 0.6, 8.0), np.array([0.7870, 0.2820, 0.6990])), (("2.5YR", 0.6, 10.0), np.array([0.8460, 0.2660, 0.6990])), (("5YR", 0.6, 2.0), np.array([0.5050, 0.3670, 0.6990])), (("5YR", 0.6, 4.0), np.array([0.6730, 0.3710, 0.6990])), (("5YR", 0.6, 6.0), np.array([0.8050, 0.3620, 0.6990])), (("5YR", 0.6, 8.0), np.array([0.9300, 0.3470, 0.6990])), (("7.5YR", 0.6, 2.0), np.array([0.5260, 0.3970, 0.6990])), (("7.5YR", 0.6, 4.0), np.array([0.7640, 0.4410, 0.6990])), (("10YR", 0.6, 2.0), np.array([0.5510, 0.4440, 0.6990])), (("10YR", 0.6, 4.0), np.array([0.8990, 0.5870, 0.6990])), (("2.5Y", 0.6, 2.0), np.array([0.5630, 0.4910, 0.6990])), (("2.5Y", 0.6, 4.0), np.array([0.9950, 0.7340, 0.6990])), (("5Y", 0.6, 2.0), np.array([0.5480, 0.5260, 0.6990])), (("7.5Y", 0.6, 2.0), np.array([0.5020, 0.5310, 0.6990])), (("7.5Y", 0.6, 4.0), np.array([1.0440, 1.0740, 0.6990])), (("10Y", 0.8, 2.0), np.array([0.3970, 0.4480, 0.9430])), (("10Y", 0.8, 4.0), np.array([0.7610, 0.9980, 0.9430])), (("2.5GY", 0.8, 2.0), np.array([0.3630, 0.4250, 0.9430])), (("2.5GY", 0.8, 4.0), np.array([0.5560, 0.9070, 0.9430])), (("5GY", 0.8, 2.0), np.array([0.3360, 0.4100, 0.9430])), (("5GY", 0.8, 4.0), np.array([0.4000, 0.7380, 0.9430])), (("5GY", 0.8, 6.0), np.array([0.4250, 1.2660, 0.9430])), (("7.5GY", 0.8, 2.0), np.array([0.3140, 0.3940, 0.9430])), (("7.5GY", 0.8, 4.0), np.array([0.3050, 0.6130, 0.9430])), (("7.5GY", 0.8, 6.0), np.array([0.2370, 0.9690, 0.9430])), (("7.5GY", 0.8, 8.0), np.array([-0.1190, 1.6320, 0.9430])), (("10GY", 0.8, 2.0), np.array([0.2980, 0.3810, 0.9430])), (("10GY", 0.8, 4.0), np.array([0.2540, 0.5370, 0.9430])), (("10GY", 0.8, 6.0), np.array([0.1500, 0.7910, 0.9430])), (("10GY", 0.8, 8.0), np.array([-0.1560, 1.2200, 0.9430])), (("2.5G", 0.8, 2.0), np.array([0.2870, 0.3710, 0.9430])), (("2.5G", 0.8, 4.0), np.array([0.2250, 0.4880, 0.9430])), (("2.5G", 0.8, 6.0), np.array([0.1020, 0.6600, 0.9430])), (("2.5G", 0.8, 8.0), np.array([-0.2130, 0.9670, 0.9430])), (("5G", 0.8, 2.0), np.array([0.2800, 0.3630, 0.9430])), (("5G", 0.8, 4.0), np.array([0.2050, 0.4470, 0.9430])), (("5G", 0.8, 6.0), np.array([0.0820, 0.5530, 0.9430])), (("5G", 0.8, 8.0), np.array([-0.1850, 0.7370, 0.9430])), (("7.5G", 0.8, 2.0), np.array([0.2720, 0.3550, 0.9430])), (("7.5G", 0.8, 4.0), np.array([0.1910, 0.4140, 0.9430])), (("7.5G", 0.8, 6.0), np.array([0.0730, 0.4760, 0.9430])), (("7.5G", 0.8, 8.0), np.array([-0.1430, 0.5610, 0.9430])), (("10G", 0.8, 2.0), np.array([0.2650, 0.3460, 0.9430])), (("10G", 0.8, 4.0), np.array([0.1780, 0.3820, 0.9430])), (("10G", 0.8, 6.0), np.array([0.0700, 0.4080, 0.9430])), (("10G", 0.8, 8.0), np.array([-0.1000, 0.4280, 0.9430])), (("2.5BG", 0.8, 2.0), np.array([0.2530, 0.3320, 0.9430])), (("2.5BG", 0.8, 4.0), np.array([0.1630, 0.3420, 0.9430])), (("2.5BG", 0.8, 6.0), np.array([0.0700, 0.3410, 0.9430])), (("2.5BG", 0.8, 8.0), np.array([-0.0620, 0.3300, 0.9430])), (("5BG", 0.8, 2.0), np.array([0.2410, 0.3150, 0.9430])), (("5BG", 0.8, 4.0), np.array([0.1500, 0.2990, 0.9430])), (("5BG", 0.8, 6.0), np.array([0.0720, 0.2750, 0.9430])), (("5BG", 0.8, 8.0), np.array([-0.0180, 0.2390, 0.9430])), (("7.5BG", 0.8, 2.0), np.array([0.2300, 0.2960, 0.9430])), (("7.5BG", 0.8, 4.0), np.array([0.1450, 0.2640, 0.9430])), (("7.5BG", 0.8, 6.0), np.array([0.0770, 0.2330, 0.9430])), (("7.5BG", 0.8, 8.0), np.array([0.0080, 0.1980, 0.9430])), (("10BG", 0.8, 2.0), np.array([0.2230, 0.2800, 0.9430])), (("10BG", 0.8, 4.0), np.array([0.1460, 0.2370, 0.9430])), (("10BG", 0.8, 6.0), np.array([0.0860, 0.1990, 0.9430])), (("10BG", 0.8, 8.0), np.array([0.0330, 0.1640, 0.9430])), (("2.5B", 0.8, 2.0), np.array([0.2200, 0.2710, 0.9430])), (("2.5B", 0.8, 4.0), np.array([0.1490, 0.2220, 0.9430])), (("2.5B", 0.8, 6.0), np.array([0.0940, 0.1810, 0.9430])), (("2.5B", 0.8, 8.0), np.array([0.0480, 0.1470, 0.9430])), (("5B", 0.8, 2.0), np.array([0.2180, 0.2580, 0.9430])), (("5B", 0.8, 4.0), np.array([0.1540, 0.2070, 0.9430])), (("5B", 0.8, 6.0), np.array([0.1060, 0.1630, 0.9430])), (("5B", 0.8, 8.0), np.array([0.0690, 0.1270, 0.9430])), (("7.5B", 0.8, 2.0), np.array([0.2200, 0.2490, 0.9430])), (("7.5B", 0.8, 4.0), np.array([0.1600, 0.1960, 0.9430])), (("7.5B", 0.8, 6.0), np.array([0.1150, 0.1530, 0.9430])), (("7.5B", 0.8, 8.0), np.array([0.0820, 0.1200, 0.9430])), (("7.5B", 0.8, 10.0), np.array([0.0490, 0.0890, 0.9430])), (("10B", 0.8, 2.0), np.array([0.2220, 0.2410, 0.9430])), (("10B", 0.8, 4.0), np.array([0.1680, 0.1870, 0.9430])), (("10B", 0.8, 6.0), np.array([0.1280, 0.1450, 0.9430])), (("10B", 0.8, 8.0), np.array([0.0970, 0.1120, 0.9430])), (("10B", 0.8, 10.0), np.array([0.0710, 0.0830, 0.9430])), (("2.5PB", 0.8, 2.0), np.array([0.2250, 0.2340, 0.9430])), (("2.5PB", 0.8, 4.0), np.array([0.1780, 0.1810, 0.9430])), (("2.5PB", 0.8, 6.0), np.array([0.1420, 0.1380, 0.9430])), (("2.5PB", 0.8, 8.0), np.array([0.1170, 0.1050, 0.9430])), (("2.5PB", 0.8, 10.0), np.array([0.0980, 0.0810, 0.9430])), (("2.5PB", 0.8, 12.0), np.array([0.0820, 0.0580, 0.9430])), (("5PB", 0.8, 2.0), np.array([0.2340, 0.2260, 0.9430])), (("5PB", 0.8, 4.0), np.array([0.1920, 0.1740, 0.9430])), (("5PB", 0.8, 6.0), np.array([0.1600, 0.1320, 0.9430])), (("5PB", 0.8, 8.0), np.array([0.1390, 0.1020, 0.9430])), (("5PB", 0.8, 10.0), np.array([0.1230, 0.0830, 0.9430])), (("5PB", 0.8, 12.0), np.array([0.1090, 0.0600, 0.9430])), (("5PB", 0.8, 14.0), np.array([0.0990, 0.0450, 0.9430])), (("5PB", 0.8, 16.0), np.array([0.0920, 0.0340, 0.9430])), (("5PB", 0.8, 18.0), np.array([0.0870, 0.0260, 0.9430])), (("5PB", 0.8, 20.0), np.array([0.0810, 0.0180, 0.9430])), (("7.5PB", 0.8, 2.0), np.array([0.2470, 0.2210, 0.9430])), (("7.5PB", 0.8, 4.0), np.array([0.2160, 0.1700, 0.9430])), (("7.5PB", 0.8, 6.0), np.array([0.1940, 0.1310, 0.9430])), (("7.5PB", 0.8, 8.0), np.array([0.1790, 0.1040, 0.9430])), (("7.5PB", 0.8, 10.0), np.array([0.1700, 0.0890, 0.9430])), (("7.5PB", 0.8, 12.0), np.array([0.1620, 0.0720, 0.9430])), (("7.5PB", 0.8, 14.0), np.array([0.1550, 0.0560, 0.9430])), (("7.5PB", 0.8, 16.0), np.array([0.1500, 0.0460, 0.9430])), (("7.5PB", 0.8, 18.0), np.array([0.1470, 0.0390, 0.9430])), (("7.5PB", 0.8, 20.0), np.array([0.1440, 0.0320, 0.9430])), (("7.5PB", 0.8, 22.0), np.array([0.1400, 0.0250, 0.9430])), (("7.5PB", 0.8, 24.0), np.array([0.1370, 0.0180, 0.9430])), (("7.5PB", 0.8, 26.0), np.array([0.1350, 0.0130, 0.9430])), (("7.5PB", 0.8, 28.0), np.array([0.1330, 0.0090, 0.9430])), (("7.5PB", 0.8, 30.0), np.array([0.1310, 0.0050, 0.9430])), (("7.5PB", 0.8, 32.0), np.array([0.1300, 0.0020, 0.9430])), (("7.5PB", 0.8, 34.0), np.array([0.1290, -0.0010, 0.9430])), (("7.5PB", 0.8, 36.0), np.array([0.1280, -0.0040, 0.9430])), (("10PB", 0.8, 2.0), np.array([0.2630, 0.2190, 0.9430])), (("10PB", 0.8, 4.0), np.array([0.2420, 0.1700, 0.9430])), (("10PB", 0.8, 6.0), np.array([0.2290, 0.1370, 0.9430])), (("10PB", 0.8, 8.0), np.array([0.2200, 0.1120, 0.9430])), (("10PB", 0.8, 10.0), np.array([0.2150, 0.0970, 0.9430])), (("10PB", 0.8, 12.0), np.array([0.2100, 0.0810, 0.9430])), (("10PB", 0.8, 14.0), np.array([0.2060, 0.0680, 0.9430])), (("10PB", 0.8, 16.0), np.array([0.2030, 0.0570, 0.9430])), (("10PB", 0.8, 18.0), np.array([0.2000, 0.0500, 0.9430])), (("10PB", 0.8, 20.0), np.array([0.1990, 0.0430, 0.9430])), (("10PB", 0.8, 22.0), np.array([0.1970, 0.0360, 0.9430])), (("10PB", 0.8, 24.0), np.array([0.1960, 0.0300, 0.9430])), (("10PB", 0.8, 26.0), np.array([0.1940, 0.0260, 0.9430])), (("10PB", 0.8, 28.0), np.array([0.1930, 0.0210, 0.9430])), (("10PB", 0.8, 30.0), np.array([0.1920, 0.0180, 0.9430])), (("10PB", 0.8, 32.0), np.array([0.1910, 0.0140, 0.9430])), (("10PB", 0.8, 34.0), np.array([0.1900, 0.0100, 0.9430])), (("10PB", 0.8, 36.0), np.array([0.1890, 0.0080, 0.9430])), (("2.5P", 0.8, 2.0), np.array([0.2770, 0.2200, 0.9430])), (("2.5P", 0.8, 4.0), np.array([0.2640, 0.1740, 0.9430])), (("2.5P", 0.8, 6.0), np.array([0.2550, 0.1440, 0.9430])), (("2.5P", 0.8, 8.0), np.array([0.2480, 0.1200, 0.9430])), (("2.5P", 0.8, 10.0), np.array([0.2450, 0.1050, 0.9430])), (("2.5P", 0.8, 12.0), np.array([0.2420, 0.0900, 0.9430])), (("2.5P", 0.8, 14.0), np.array([0.2380, 0.0760, 0.9430])), (("2.5P", 0.8, 16.0), np.array([0.2360, 0.0640, 0.9430])), (("2.5P", 0.8, 18.0), np.array([0.2350, 0.0570, 0.9430])), (("2.5P", 0.8, 20.0), np.array([0.2330, 0.0500, 0.9430])), (("2.5P", 0.8, 22.0), np.array([0.2320, 0.0440, 0.9430])), (("2.5P", 0.8, 24.0), np.array([0.2310, 0.0380, 0.9430])), (("2.5P", 0.8, 26.0), np.array([0.2300, 0.0340, 0.9430])), (("2.5P", 0.8, 28.0), np.array([0.2280, 0.0280, 0.9430])), (("2.5P", 0.8, 30.0), np.array([0.2280, 0.0260, 0.9430])), (("2.5P", 0.8, 32.0), np.array([0.2270, 0.0220, 0.9430])), (("2.5P", 0.8, 34.0), np.array([0.2270, 0.0190, 0.9430])), (("2.5P", 0.8, 36.0), np.array([0.2270, 0.0150, 0.9430])), (("5P", 0.8, 2.0), np.array([0.2920, 0.2240, 0.9430])), (("5P", 0.8, 4.0), np.array([0.2830, 0.1790, 0.9430])), (("5P", 0.8, 6.0), np.array([0.2790, 0.1510, 0.9430])), (("5P", 0.8, 8.0), np.array([0.2750, 0.1270, 0.9430])), (("5P", 0.8, 10.0), np.array([0.2690, 0.1120, 0.9430])), (("5P", 0.8, 12.0), np.array([0.2660, 0.0950, 0.9430])), (("5P", 0.8, 14.0), np.array([0.2630, 0.0800, 0.9430])), (("5P", 0.8, 16.0), np.array([0.2620, 0.0690, 0.9430])), (("5P", 0.8, 18.0), np.array([0.2600, 0.0620, 0.9430])), (("5P", 0.8, 20.0), np.array([0.2580, 0.0560, 0.9430])), (("5P", 0.8, 22.0), np.array([0.2570, 0.0490, 0.9430])), (("5P", 0.8, 24.0), np.array([0.2560, 0.0440, 0.9430])), (("5P", 0.8, 26.0), np.array([0.2560, 0.0390, 0.9430])), (("5P", 0.8, 28.0), np.array([0.2550, 0.0350, 0.9430])), (("5P", 0.8, 30.0), np.array([0.2540, 0.0300, 0.9430])), (("7.5P", 0.8, 2.0), np.array([0.3040, 0.2280, 0.9430])), (("7.5P", 0.8, 4.0), np.array([0.2980, 0.1840, 0.9430])), (("7.5P", 0.8, 6.0), np.array([0.2940, 0.1560, 0.9430])), (("7.5P", 0.8, 8.0), np.array([0.2910, 0.1320, 0.9430])), (("7.5P", 0.8, 10.0), np.array([0.2900, 0.1180, 0.9430])), (("7.5P", 0.8, 12.0), np.array([0.2870, 0.1010, 0.9430])), (("7.5P", 0.8, 14.0), np.array([0.2840, 0.0840, 0.9430])), (("7.5P", 0.8, 16.0), np.array([0.2830, 0.0720, 0.9430])), (("7.5P", 0.8, 18.0), np.array([0.2810, 0.0660, 0.9430])), (("7.5P", 0.8, 20.0), np.array([0.2800, 0.0600, 0.9430])), (("7.5P", 0.8, 22.0), np.array([0.2790, 0.0540, 0.9430])), (("7.5P", 0.8, 24.0), np.array([0.2780, 0.0490, 0.9430])), (("7.5P", 0.8, 26.0), np.array([0.2780, 0.0440, 0.9430])), (("10P", 0.8, 2.0), np.array([0.3120, 0.2320, 0.9430])), (("10P", 0.8, 4.0), np.array([0.3100, 0.1890, 0.9430])), (("10P", 0.8, 6.0), np.array([0.3090, 0.1620, 0.9430])), (("10P", 0.8, 8.0), np.array([0.3080, 0.1370, 0.9430])), (("10P", 0.8, 10.0), np.array([0.3070, 0.1230, 0.9430])), (("10P", 0.8, 12.0), np.array([0.3060, 0.1060, 0.9430])), (("10P", 0.8, 14.0), np.array([0.3040, 0.0890, 0.9430])), (("10P", 0.8, 16.0), np.array([0.3030, 0.0780, 0.9430])), (("10P", 0.8, 18.0), np.array([0.3020, 0.0710, 0.9430])), (("10P", 0.8, 20.0), np.array([0.3020, 0.0650, 0.9430])), (("10P", 0.8, 22.0), np.array([0.3020, 0.0590, 0.9430])), (("10P", 0.8, 24.0), np.array([0.3020, 0.0530, 0.9430])), (("2.5RP", 0.8, 2.0), np.array([0.3220, 0.2360, 0.9430])), (("2.5RP", 0.8, 4.0), np.array([0.3260, 0.1950, 0.9430])), (("2.5RP", 0.8, 6.0), np.array([0.3280, 0.1680, 0.9430])), (("2.5RP", 0.8, 8.0), np.array([0.3290, 0.1440, 0.9430])), (("2.5RP", 0.8, 10.0), np.array([0.3290, 0.1290, 0.9430])), (("2.5RP", 0.8, 12.0), np.array([0.3300, 0.1110, 0.9430])), (("2.5RP", 0.8, 14.0), np.array([0.3300, 0.0930, 0.9430])), (("2.5RP", 0.8, 16.0), np.array([0.3310, 0.0840, 0.9430])), (("2.5RP", 0.8, 18.0), np.array([0.3310, 0.0770, 0.9430])), (("2.5RP", 0.8, 20.0), np.array([0.3310, 0.0700, 0.9430])), (("2.5RP", 0.8, 22.0), np.array([0.3310, 0.0650, 0.9430])), (("5RP", 0.8, 2.0), np.array([0.3360, 0.2430, 0.9430])), (("5RP", 0.8, 4.0), np.array([0.3470, 0.2060, 0.9430])), (("5RP", 0.8, 6.0), np.array([0.3550, 0.1790, 0.9430])), (("5RP", 0.8, 8.0), np.array([0.3620, 0.1540, 0.9430])), (("5RP", 0.8, 10.0), np.array([0.3660, 0.1390, 0.9430])), (("5RP", 0.8, 12.0), np.array([0.3700, 0.1200, 0.9430])), (("5RP", 0.8, 14.0), np.array([0.3730, 0.1050, 0.9430])), (("5RP", 0.8, 16.0), np.array([0.3760, 0.0940, 0.9430])), (("5RP", 0.8, 18.0), np.array([0.3780, 0.0860, 0.9430])), (("5RP", 0.8, 20.0), np.array([0.3790, 0.0810, 0.9430])), (("7.5RP", 0.8, 2.0), np.array([0.3500, 0.2510, 0.9430])), (("7.5RP", 0.8, 4.0), np.array([0.3690, 0.2170, 0.9430])), (("7.5RP", 0.8, 6.0), np.array([0.3840, 0.1900, 0.9430])), (("7.5RP", 0.8, 8.0), np.array([0.3970, 0.1650, 0.9430])), (("7.5RP", 0.8, 10.0), np.array([0.4050, 0.1490, 0.9430])), (("7.5RP", 0.8, 12.0), np.array([0.4130, 0.1320, 0.9430])), (("7.5RP", 0.8, 14.0), np.array([0.4210, 0.1150, 0.9430])), (("7.5RP", 0.8, 16.0), np.array([0.4270, 0.1040, 0.9430])), (("10RP", 0.8, 2.0), np.array([0.3650, 0.2610, 0.9430])), (("10RP", 0.8, 4.0), np.array([0.3930, 0.2300, 0.9430])), (("10RP", 0.8, 6.0), np.array([0.4150, 0.2030, 0.9430])), (("10RP", 0.8, 8.0), np.array([0.4350, 0.1770, 0.9430])), (("10RP", 0.8, 10.0), np.array([0.4470, 0.1600, 0.9430])), (("10RP", 0.8, 12.0), np.array([0.4590, 0.1430, 0.9430])), (("10RP", 0.8, 14.0), np.array([0.4700, 0.1270, 0.9430])), (("2.5R", 0.8, 2.0), np.array([0.3810, 0.2720, 0.9430])), (("2.5R", 0.8, 4.0), np.array([0.4210, 0.2450, 0.9430])), (("2.5R", 0.8, 6.0), np.array([0.4550, 0.2190, 0.9430])), (("2.5R", 0.8, 8.0), np.array([0.4830, 0.1950, 0.9430])), (("2.5R", 0.8, 10.0), np.array([0.5020, 0.1770, 0.9430])), (("2.5R", 0.8, 12.0), np.array([0.5210, 0.1590, 0.9430])), (("2.5R", 0.8, 14.0), np.array([0.5360, 0.1430, 0.9430])), (("5R", 0.8, 2.0), np.array([0.3990, 0.2860, 0.9430])), (("5R", 0.8, 4.0), np.array([0.4500, 0.2610, 0.9430])), (("5R", 0.8, 6.0), np.array([0.4960, 0.2370, 0.9430])), (("5R", 0.8, 8.0), np.array([0.5360, 0.2140, 0.9430])), (("5R", 0.8, 10.0), np.array([0.5650, 0.1970, 0.9430])), (("5R", 0.8, 12.0), np.array([0.5910, 0.1800, 0.9430])), (("7.5R", 0.8, 2.0), np.array([0.4110, 0.2970, 0.9430])), (("7.5R", 0.8, 4.0), np.array([0.4770, 0.2760, 0.9430])), (("7.5R", 0.8, 6.0), np.array([0.5340, 0.2550, 0.9430])), (("7.5R", 0.8, 8.0), np.array([0.5840, 0.2340, 0.9430])), (("7.5R", 0.8, 10.0), np.array([0.6240, 0.2160, 0.9430])), (("7.5R", 0.8, 12.0), np.array([0.6600, 0.1990, 0.9430])), (("10R", 0.8, 2.0), np.array([0.4230, 0.3090, 0.9430])), (("10R", 0.8, 4.0), np.array([0.5080, 0.2960, 0.9430])), (("10R", 0.8, 6.0), np.array([0.5780, 0.2800, 0.9430])), (("10R", 0.8, 8.0), np.array([0.6350, 0.2590, 0.9430])), (("10R", 0.8, 10.0), np.array([0.6850, 0.2400, 0.9430])), (("10R", 0.8, 12.0), np.array([0.7250, 0.2180, 0.9430])), (("2.5YR", 0.8, 2.0), np.array([0.4450, 0.3330, 0.9430])), (("2.5YR", 0.8, 4.0), np.array([0.5580, 0.3300, 0.9430])), (("2.5YR", 0.8, 6.0), np.array([0.6370, 0.3200, 0.9430])), (("2.5YR", 0.8, 8.0), np.array([0.7150, 0.3060, 0.9430])), (("2.5YR", 0.8, 10.0), np.array([0.8020, 0.2880, 0.9430])), (("2.5YR", 0.8, 12.0), np.array([0.8750, 0.2730, 0.9430])), (("5YR", 0.8, 2.0), np.array([0.4630, 0.3610, 0.9430])), (("5YR", 0.8, 4.0), np.array([0.6120, 0.3760, 0.9430])), (("5YR", 0.8, 6.0), np.array([0.7210, 0.3760, 0.9430])), (("5YR", 0.8, 8.0), np.array([0.8260, 0.3720, 0.9430])), (("7.5YR", 0.8, 2.0), np.array([0.4750, 0.3860, 0.9430])), (("7.5YR", 0.8, 4.0), np.array([0.6630, 0.4300, 0.9430])), (("7.5YR", 0.8, 6.0), np.array([0.8170, 0.4500, 0.9430])), (("10YR", 0.8, 2.0), np.array([0.4810, 0.4110, 0.9430])), (("10YR", 0.8, 4.0), np.array([0.7490, 0.5340, 0.9430])), (("2.5Y", 0.8, 2.0), np.array([0.4790, 0.4390, 0.9430])), (("2.5Y", 0.8, 4.0), np.array([0.8200, 0.6400, 0.9430])), (("5Y", 0.8, 2.0), np.array([0.4650, 0.4570, 0.9430])), (("5Y", 0.8, 4.0), np.array([0.8910, 0.7900, 0.9430])), (("7.5Y", 0.8, 2.0), np.array([0.4340, 0.4600, 0.9430])), (("7.5Y", 0.8, 4.0), np.array([0.8800, 0.9360, 0.9430])), (("10Y", 1.0, 2.0), np.array([0.3802, 0.4212, 1.2100])), (("10Y", 1.0, 4.0), np.array([0.5010, 0.6000, 1.2100])), (("2.5GY", 1.0, 2.0), np.array([0.3540, 0.4088, 1.2100])), (("2.5GY", 1.0, 4.0), np.array([0.4390, 0.6150, 1.2100])), (("2.5GY", 1.0, 6.0), np.array([0.4800, 0.7230, 1.2100])), (("5GY", 1.0, 2.0), np.array([0.3359, 0.3982, 1.2100])), (("5GY", 1.0, 4.0), np.array([0.3765, 0.5942, 1.2100])), (("5GY", 1.0, 6.0), np.array([0.3980, 0.7400, 1.2100])), (("7.5GY", 1.0, 2.0), np.array([0.3154, 0.3840, 1.2100])), (("7.5GY", 1.0, 4.0), np.array([0.3133, 0.5380, 1.2100])), (("7.5GY", 1.0, 6.0), np.array([0.2900, 0.7060, 1.2100])), (("7.5GY", 1.0, 8.0), np.array([0.2350, 0.9440, 1.2100])), (("10GY", 1.0, 2.0), np.array([0.3006, 0.3720, 1.2100])), (("10GY", 1.0, 4.0), np.array([0.2722, 0.4903, 1.2100])), (("10GY", 1.0, 6.0), np.array([0.2232, 0.6392, 1.2100])), (("10GY", 1.0, 8.0), np.array([0.1100, 0.8830, 1.2100])), (("10GY", 1.0, 10.0), np.array([-0.0130, 1.0650, 1.2100])), (("2.5G", 1.0, 2.0), np.array([0.2910, 0.3634, 1.2100])), (("2.5G", 1.0, 4.0), np.array([0.2454, 0.4489, 1.2100])), (("2.5G", 1.0, 6.0), np.array([0.1711, 0.5619, 1.2100])), (("2.5G", 1.0, 8.0), np.array([0.0620, 0.6896, 1.2100])), (("2.5G", 1.0, 10.0), np.array([-0.0220, 0.7760, 1.2100])), (("5G", 1.0, 2.0), np.array([0.2833, 0.3564, 1.2100])), (("5G", 1.0, 4.0), np.array([0.2290, 0.4218, 1.2100])), (("5G", 1.0, 6.0), np.array([0.1468, 0.4996, 1.2100])), (("5G", 1.0, 8.0), np.array([0.0559, 0.5710, 1.2100])), (("5G", 1.0, 10.0), np.array([-0.0200, 0.6200, 1.2100])), (("7.5G", 1.0, 2.0), np.array([0.2758, 0.3484, 1.2100])), (("7.5G", 1.0, 4.0), np.array([0.2159, 0.3967, 1.2100])), (("7.5G", 1.0, 6.0), np.array([0.1344, 0.4505, 1.2100])), (("7.5G", 1.0, 8.0), np.array([0.0530, 0.4943, 1.2100])), (("7.5G", 1.0, 10.0), np.array([-0.0200, 0.5280, 1.2100])), (("10G", 1.0, 2.0), np.array([0.2689, 0.3407, 1.2100])), (("10G", 1.0, 4.0), np.array([0.2040, 0.3724, 1.2100])), (("10G", 1.0, 6.0), np.array([0.1249, 0.4019, 1.2100])), (("10G", 1.0, 8.0), np.array([0.0511, 0.4158, 1.2100])), (("10G", 1.0, 10.0), np.array([-0.0180, 0.4240, 1.2100])), (("2.5BG", 1.0, 2.0), np.array([0.2600, 0.3289, 1.2100])), (("2.5BG", 1.0, 4.0), np.array([0.1883, 0.3406, 1.2100])), (("2.5BG", 1.0, 6.0), np.array([0.1169, 0.3452, 1.2100])), (("2.5BG", 1.0, 8.0), np.array([0.0476, 0.3458, 1.2100])), (("2.5BG", 1.0, 10.0), np.array([-0.0170, 0.3440, 1.2100])), (("5BG", 1.0, 2.0), np.array([0.2500, 0.3141, 1.2100])), (("5BG", 1.0, 4.0), np.array([0.1753, 0.3021, 1.2100])), (("5BG", 1.0, 6.0), np.array([0.1093, 0.2860, 1.2100])), (("5BG", 1.0, 8.0), np.array([0.0460, 0.2640, 1.2100])), (("5BG", 1.0, 10.0), np.array([-0.0140, 0.2370, 1.2100])), (("7.5BG", 1.0, 2.0), np.array([0.2430, 0.3023, 1.2100])), (("7.5BG", 1.0, 4.0), np.array([0.1702, 0.2768, 1.2100])), (("7.5BG", 1.0, 6.0), np.array([0.1059, 0.2485, 1.2100])), (("7.5BG", 1.0, 8.0), np.array([0.0500, 0.2180, 1.2100])), (("10BG", 1.0, 2.0), np.array([0.2362, 0.2882, 1.2100])), (("10BG", 1.0, 4.0), np.array([0.1658, 0.2496, 1.2100])), (("10BG", 1.0, 6.0), np.array([0.1074, 0.2129, 1.2100])), (("10BG", 1.0, 8.0), np.array([0.0600, 0.1800, 1.2100])), (("2.5B", 1.0, 2.0), np.array([0.2322, 0.2781, 1.2100])), (("2.5B", 1.0, 4.0), np.array([0.1649, 0.2324, 1.2100])), (("2.5B", 1.0, 6.0), np.array([0.1118, 0.1908, 1.2100])), (("2.5B", 1.0, 8.0), np.array([0.0710, 0.1550, 1.2100])), (("5B", 1.0, 2.0), np.array([0.2291, 0.2677, 1.2100])), (("5B", 1.0, 4.0), np.array([0.1667, 0.2168, 1.2100])), (("5B", 1.0, 6.0), np.array([0.1212, 0.1745, 1.2100])), (("5B", 1.0, 8.0), np.array([0.0840, 0.1390, 1.2100])), (("5B", 1.0, 10.0), np.array([0.0550, 0.1030, 1.2100])), (("7.5B", 1.0, 2.0), np.array([0.2291, 0.2579, 1.2100])), (("7.5B", 1.0, 4.0), np.array([0.1716, 0.2048, 1.2100])), (("7.5B", 1.0, 6.0), np.array([0.1303, 0.1639, 1.2100])), (("7.5B", 1.0, 8.0), np.array([0.0968, 0.1280, 1.2100])), (("7.5B", 1.0, 10.0), np.array([0.0710, 0.0970, 1.2100])), (("10B", 1.0, 2.0), np.array([0.2309, 0.2491, 1.2100])), (("10B", 1.0, 4.0), np.array([0.1783, 0.1974, 1.2100])), (("10B", 1.0, 6.0), np.array([0.1392, 0.1563, 1.2100])), (("10B", 1.0, 8.0), np.array([0.1077, 0.1218, 1.2100])), (("10B", 1.0, 10.0), np.array([0.0840, 0.0940, 1.2100])), (("2.5PB", 1.0, 2.0), np.array([0.2360, 0.2420, 1.2100])), (("2.5PB", 1.0, 4.0), np.array([0.1895, 0.1911, 1.2100])), (("2.5PB", 1.0, 6.0), np.array([0.1539, 0.1491, 1.2100])), (("2.5PB", 1.0, 8.0), np.array([0.1273, 0.1157, 1.2100])), (("2.5PB", 1.0, 10.0), np.array([0.1060, 0.0900, 1.2100])), (("2.5PB", 1.0, 12.0), np.array([0.0910, 0.0680, 1.2100])), (("2.5PB", 1.0, 14.0), np.array([0.0780, 0.0560, 1.2100])), (("5PB", 1.0, 2.0), np.array([0.2427, 0.2368, 1.2100])), (("5PB", 1.0, 4.0), np.array([0.2012, 0.1867, 1.2100])), (("5PB", 1.0, 6.0), np.array([0.1678, 0.1447, 1.2100])), (("5PB", 1.0, 8.0), np.array([0.1447, 0.1124, 1.2100])), (("5PB", 1.0, 10.0), np.array([0.1285, 0.0870, 1.2100])), (("5PB", 1.0, 12.0), np.array([0.1170, 0.0700, 1.2100])), (("5PB", 1.0, 14.0), np.array([0.1120, 0.0600, 1.2100])), (("5PB", 1.0, 16.0), np.array([0.1060, 0.0500, 1.2100])), (("5PB", 1.0, 18.0), np.array([0.1040, 0.0440, 1.2100])), (("5PB", 1.0, 20.0), np.array([0.1000, 0.0380, 1.2100])), (("5PB", 1.0, 22.0), np.array([0.0980, 0.0340, 1.2100])), (("5PB", 1.0, 24.0), np.array([0.0960, 0.0300, 1.2100])), (("5PB", 1.0, 26.0), np.array([0.0950, 0.0270, 1.2100])), (("5PB", 1.0, 28.0), np.array([0.0940, 0.0240, 1.2100])), (("5PB", 1.0, 30.0), np.array([0.0930, 0.0220, 1.2100])), (("5PB", 1.0, 32.0), np.array([0.0920, 0.0200, 1.2100])), (("5PB", 1.0, 34.0), np.array([0.0910, 0.0180, 1.2100])), (("5PB", 1.0, 36.0), np.array([0.0900, 0.0160, 1.2100])), (("5PB", 1.0, 38.0), np.array([0.0890, 0.0140, 1.2100])), (("5PB", 1.0, 40.0), np.array([0.0880, 0.0120, 1.2100])), (("5PB", 1.0, 42.0), np.array([0.0880, 0.0100, 1.2100])), (("5PB", 1.0, 44.0), np.array([0.0870, 0.0080, 1.2100])), (("7.5PB", 1.0, 2.0), np.array([0.2547, 0.2310, 1.2100])), (("7.5PB", 1.0, 4.0), np.array([0.2232, 0.1821, 1.2100])), (("7.5PB", 1.0, 6.0), np.array([0.2000, 0.1422, 1.2100])), (("7.5PB", 1.0, 8.0), np.array([0.1872, 0.1141, 1.2100])), (("7.5PB", 1.0, 10.0), np.array([0.1804, 0.0950, 1.2100])), (("7.5PB", 1.0, 12.0), np.array([0.1763, 0.0804, 1.2100])), (("7.5PB", 1.0, 14.0), np.array([0.1738, 0.0688, 1.2100])), (("7.5PB", 1.0, 16.0), np.array([0.1720, 0.0583, 1.2100])), (("7.5PB", 1.0, 18.0), np.array([0.1709, 0.0518, 1.2100])), (("7.5PB", 1.0, 20.0), np.array([0.1701, 0.0454, 1.2100])), (("7.5PB", 1.0, 22.0), np.array([0.1696, 0.0402, 1.2100])), (("7.5PB", 1.0, 24.0), np.array([0.1691, 0.0352, 1.2100])), (("7.5PB", 1.0, 26.0), np.array([0.1689, 0.0309, 1.2100])), (("7.5PB", 1.0, 28.0), np.array([0.1686, 0.0270, 1.2100])), (("7.5PB", 1.0, 30.0), np.array([0.1684, 0.0234, 1.2100])), (("7.5PB", 1.0, 32.0), np.array([0.1682, 0.0202, 1.2100])), (("7.5PB", 1.0, 34.0), np.array([0.1682, 0.0180, 1.2100])), (("7.5PB", 1.0, 36.0), np.array([0.1681, 0.0160, 1.2100])), (("7.5PB", 1.0, 38.0), np.array([0.1680, 0.0140, 1.2100])), (("7.5PB", 1.0, 40.0), np.array([0.1680, 0.0120, 1.2100])), (("7.5PB", 1.0, 42.0), np.array([0.1680, 0.0100, 1.2100])), (("7.5PB", 1.0, 44.0), np.array([0.1680, 0.0080, 1.2100])), (("7.5PB", 1.0, 46.0), np.array([0.1680, 0.0060, 1.2100])), (("7.5PB", 1.0, 48.0), np.array([0.1680, 0.0040, 1.2100])), (("10PB", 1.0, 2.0), np.array([0.2677, 0.2280, 1.2100])), (("10PB", 1.0, 4.0), np.array([0.2459, 0.1828, 1.2100])), (("10PB", 1.0, 6.0), np.array([0.2290, 0.1470, 1.2100])), (("10PB", 1.0, 8.0), np.array([0.2190, 0.1228, 1.2100])), (("10PB", 1.0, 10.0), np.array([0.2120, 0.1029, 1.2100])), (("10PB", 1.0, 12.0), np.array([0.2070, 0.0869, 1.2100])), (("10PB", 1.0, 14.0), np.array([0.2038, 0.0745, 1.2100])), (("10PB", 1.0, 16.0), np.array([0.2008, 0.0638, 1.2100])), (("10PB", 1.0, 18.0), np.array([0.1991, 0.0564, 1.2100])), (("10PB", 1.0, 20.0), np.array([0.1976, 0.0493, 1.2100])), (("10PB", 1.0, 22.0), np.array([0.1965, 0.0436, 1.2100])), (("10PB", 1.0, 24.0), np.array([0.1952, 0.0380, 1.2100])), (("10PB", 1.0, 26.0), np.array([0.1942, 0.0326, 1.2100])), (("10PB", 1.0, 28.0), np.array([0.1936, 0.0281, 1.2100])), (("10PB", 1.0, 30.0), np.array([0.1928, 0.0240, 1.2100])), (("10PB", 1.0, 32.0), np.array([0.1930, 0.0210, 1.2100])), (("10PB", 1.0, 34.0), np.array([0.1930, 0.0190, 1.2100])), (("10PB", 1.0, 36.0), np.array([0.1930, 0.0160, 1.2100])), (("10PB", 1.0, 38.0), np.array([0.1930, 0.0140, 1.2100])), (("10PB", 1.0, 40.0), np.array([0.1930, 0.0130, 1.2100])), (("10PB", 1.0, 42.0), np.array([0.1920, 0.0110, 1.2100])), (("10PB", 1.0, 44.0), np.array([0.1920, 0.0090, 1.2100])), (("10PB", 1.0, 46.0), np.array([0.1920, 0.0070, 1.2100])), (("10PB", 1.0, 48.0), np.array([0.1920, 0.0050, 1.2100])), (("2.5P", 1.0, 2.0), np.array([0.2808, 0.2296, 1.2100])), (("2.5P", 1.0, 4.0), np.array([0.2668, 0.1874, 1.2100])), (("2.5P", 1.0, 6.0), np.array([0.2570, 0.1559, 1.2100])), (("2.5P", 1.0, 8.0), np.array([0.2496, 0.1303, 1.2100])), (("2.5P", 1.0, 10.0), np.array([0.2441, 0.1112, 1.2100])), (("2.5P", 1.0, 12.0), np.array([0.2394, 0.0940, 1.2100])), (("2.5P", 1.0, 14.0), np.array([0.2361, 0.0810, 1.2100])), (("2.5P", 1.0, 16.0), np.array([0.2331, 0.0696, 1.2100])), (("2.5P", 1.0, 18.0), np.array([0.2312, 0.0618, 1.2100])), (("2.5P", 1.0, 20.0), np.array([0.2295, 0.0542, 1.2100])), (("2.5P", 1.0, 22.0), np.array([0.2279, 0.0473, 1.2100])), (("2.5P", 1.0, 24.0), np.array([0.2266, 0.0418, 1.2100])), (("2.5P", 1.0, 26.0), np.array([0.2251, 0.0355, 1.2100])), (("2.5P", 1.0, 28.0), np.array([0.2250, 0.0310, 1.2100])), (("2.5P", 1.0, 30.0), np.array([0.2240, 0.0260, 1.2100])), (("2.5P", 1.0, 32.0), np.array([0.2240, 0.0220, 1.2100])), (("2.5P", 1.0, 34.0), np.array([0.2230, 0.0200, 1.2100])), (("2.5P", 1.0, 36.0), np.array([0.2220, 0.0180, 1.2100])), (("2.5P", 1.0, 38.0), np.array([0.2220, 0.0150, 1.2100])), (("2.5P", 1.0, 40.0), np.array([0.2220, 0.0130, 1.2100])), (("2.5P", 1.0, 42.0), np.array([0.2220, 0.0110, 1.2100])), (("5P", 1.0, 2.0), np.array([0.2936, 0.2330, 1.2100])), (("5P", 1.0, 4.0), np.array([0.2854, 0.1927, 1.2100])), (("5P", 1.0, 6.0), np.array([0.2794, 0.1628, 1.2100])), (("5P", 1.0, 8.0), np.array([0.2742, 0.1375, 1.2100])), (("5P", 1.0, 10.0), np.array([0.2701, 0.1178, 1.2100])), (("5P", 1.0, 12.0), np.array([0.2670, 0.1006, 1.2100])), (("5P", 1.0, 14.0), np.array([0.2645, 0.0863, 1.2100])), (("5P", 1.0, 16.0), np.array([0.2625, 0.0746, 1.2100])), (("5P", 1.0, 18.0), np.array([0.2612, 0.0667, 1.2100])), (("5P", 1.0, 20.0), np.array([0.2601, 0.0586, 1.2100])), (("5P", 1.0, 22.0), np.array([0.2590, 0.0509, 1.2100])), (("5P", 1.0, 24.0), np.array([0.2580, 0.0460, 1.2100])), (("5P", 1.0, 26.0), np.array([0.2580, 0.0390, 1.2100])), (("5P", 1.0, 28.0), np.array([0.2570, 0.0340, 1.2100])), (("5P", 1.0, 30.0), np.array([0.2560, 0.0280, 1.2100])), (("5P", 1.0, 32.0), np.array([0.2560, 0.0240, 1.2100])), (("7.5P", 1.0, 2.0), np.array([0.3030, 0.2361, 1.2100])), (("7.5P", 1.0, 4.0), np.array([0.2991, 0.1974, 1.2100])), (("7.5P", 1.0, 6.0), np.array([0.2960, 0.1682, 1.2100])), (("7.5P", 1.0, 8.0), np.array([0.2932, 0.1429, 1.2100])), (("7.5P", 1.0, 10.0), np.array([0.2905, 0.1229, 1.2100])), (("7.5P", 1.0, 12.0), np.array([0.2884, 0.1059, 1.2100])), (("7.5P", 1.0, 14.0), np.array([0.2868, 0.0903, 1.2100])), (("7.5P", 1.0, 16.0), np.array([0.2852, 0.0790, 1.2100])), (("7.5P", 1.0, 18.0), np.array([0.2841, 0.0706, 1.2100])), (("7.5P", 1.0, 20.0), np.array([0.2831, 0.0625, 1.2100])), (("7.5P", 1.0, 22.0), np.array([0.2820, 0.0550, 1.2100])), (("7.5P", 1.0, 24.0), np.array([0.2820, 0.0490, 1.2100])), (("7.5P", 1.0, 26.0), np.array([0.2810, 0.0420, 1.2100])), (("10P", 1.0, 2.0), np.array([0.3132, 0.2404, 1.2100])), (("10P", 1.0, 4.0), np.array([0.3132, 0.2032, 1.2100])), (("10P", 1.0, 6.0), np.array([0.3126, 0.1737, 1.2100])), (("10P", 1.0, 8.0), np.array([0.3114, 0.1481, 1.2100])), (("10P", 1.0, 10.0), np.array([0.3102, 0.1282, 1.2100])), (("10P", 1.0, 12.0), np.array([0.3094, 0.1110, 1.2100])), (("10P", 1.0, 14.0), np.array([0.3084, 0.0952, 1.2100])), (("10P", 1.0, 16.0), np.array([0.3078, 0.0839, 1.2100])), (("10P", 1.0, 18.0), np.array([0.3069, 0.0748, 1.2100])), (("10P", 1.0, 20.0), np.array([0.3070, 0.0660, 1.2100])), (("10P", 1.0, 22.0), np.array([0.3060, 0.0580, 1.2100])), (("10P", 1.0, 24.0), np.array([0.3050, 0.0510, 1.2100])), (("2.5RP", 1.0, 2.0), np.array([0.3240, 0.2459, 1.2100])), (("2.5RP", 1.0, 4.0), np.array([0.3290, 0.2095, 1.2100])), (("2.5RP", 1.0, 6.0), np.array([0.3321, 0.1811, 1.2100])), (("2.5RP", 1.0, 8.0), np.array([0.3342, 0.1551, 1.2100])), (("2.5RP", 1.0, 10.0), np.array([0.3354, 0.1351, 1.2100])), (("2.5RP", 1.0, 12.0), np.array([0.3361, 0.1181, 1.2100])), (("2.5RP", 1.0, 14.0), np.array([0.3368, 0.1020, 1.2100])), (("2.5RP", 1.0, 16.0), np.array([0.3368, 0.0902, 1.2100])), (("2.5RP", 1.0, 18.0), np.array([0.3370, 0.0800, 1.2100])), (("2.5RP", 1.0, 20.0), np.array([0.3360, 0.0700, 1.2100])), (("2.5RP", 1.0, 22.0), np.array([0.3360, 0.0610, 1.2100])), (("5RP", 1.0, 2.0), np.array([0.3378, 0.2542, 1.2100])), (("5RP", 1.0, 4.0), np.array([0.3503, 0.2196, 1.2100])), (("5RP", 1.0, 6.0), np.array([0.3588, 0.1920, 1.2100])), (("5RP", 1.0, 8.0), np.array([0.3660, 0.1662, 1.2100])), (("5RP", 1.0, 10.0), np.array([0.3727, 0.1458, 1.2100])), (("5RP", 1.0, 12.0), np.array([0.3772, 0.1283, 1.2100])), (("5RP", 1.0, 14.0), np.array([0.3811, 0.1138, 1.2100])), (("5RP", 1.0, 16.0), np.array([0.3840, 0.1020, 1.2100])), (("5RP", 1.0, 18.0), np.array([0.3860, 0.0920, 1.2100])), (("5RP", 1.0, 20.0), np.array([0.3890, 0.0790, 1.2100])), (("7.5RP", 1.0, 2.0), np.array([0.3498, 0.2617, 1.2100])), (("7.5RP", 1.0, 4.0), np.array([0.3705, 0.2300, 1.2100])), (("7.5RP", 1.0, 6.0), np.array([0.3865, 0.2036, 1.2100])), (("7.5RP", 1.0, 8.0), np.array([0.4005, 0.1793, 1.2100])), (("7.5RP", 1.0, 10.0), np.array([0.4132, 0.1580, 1.2100])), (("7.5RP", 1.0, 12.0), np.array([0.4240, 0.1400, 1.2100])), (("7.5RP", 1.0, 14.0), np.array([0.4330, 0.1250, 1.2100])), (("7.5RP", 1.0, 16.0), np.array([0.4400, 0.1130, 1.2100])), (("10RP", 1.0, 2.0), np.array([0.3629, 0.2710, 1.2100])), (("10RP", 1.0, 4.0), np.array([0.3920, 0.2423, 1.2100])), (("10RP", 1.0, 6.0), np.array([0.4151, 0.2169, 1.2100])), (("10RP", 1.0, 8.0), np.array([0.4357, 0.1921, 1.2100])), (("10RP", 1.0, 10.0), np.array([0.4521, 0.1710, 1.2100])), (("10RP", 1.0, 12.0), np.array([0.4668, 0.1514, 1.2100])), (("10RP", 1.0, 14.0), np.array([0.4790, 0.1360, 1.2100])), (("10RP", 1.0, 16.0), np.array([0.4880, 0.1240, 1.2100])), (("2.5R", 1.0, 2.0), np.array([0.3768, 0.2816, 1.2100])), (("2.5R", 1.0, 4.0), np.array([0.4166, 0.2569, 1.2100])), (("2.5R", 1.0, 6.0), np.array([0.4515, 0.2329, 1.2100])), (("2.5R", 1.0, 8.0), np.array([0.4812, 0.2103, 1.2100])), (("2.5R", 1.0, 10.0), np.array([0.5058, 0.1900, 1.2100])), (("2.5R", 1.0, 12.0), np.array([0.5330, 0.1690, 1.2100])), (("2.5R", 1.0, 14.0), np.array([0.5480, 0.1560, 1.2100])), (("5R", 1.0, 2.0), np.array([0.3908, 0.2929, 1.2100])), (("5R", 1.0, 4.0), np.array([0.4420, 0.2728, 1.2100])), (("5R", 1.0, 6.0), np.array([0.4885, 0.2515, 1.2100])), (("5R", 1.0, 8.0), np.array([0.5282, 0.2297, 1.2100])), (("5R", 1.0, 10.0), np.array([0.5604, 0.2100, 1.2100])), (("5R", 1.0, 12.0), np.array([0.5950, 0.1870, 1.2100])), (("7.5R", 1.0, 2.0), np.array([0.4020, 0.3034, 1.2100])), (("7.5R", 1.0, 4.0), np.array([0.4660, 0.2888, 1.2100])), (("7.5R", 1.0, 6.0), np.array([0.5235, 0.2698, 1.2100])), (("7.5R", 1.0, 8.0), np.array([0.5722, 0.2487, 1.2100])), (("7.5R", 1.0, 10.0), np.array([0.6111, 0.2290, 1.2100])), (("7.5R", 1.0, 12.0), np.array([0.6540, 0.2040, 1.2100])), (("10R", 1.0, 2.0), np.array([0.4128, 0.3154, 1.2100])), (("10R", 1.0, 4.0), np.array([0.4933, 0.3068, 1.2100])), (("10R", 1.0, 6.0), np.array([0.5584, 0.2921, 1.2100])), (("10R", 1.0, 8.0), np.array([0.6178, 0.2713, 1.2100])), (("10R", 1.0, 10.0), np.array([0.6661, 0.2499, 1.2100])), (("10R", 1.0, 12.0), np.array([0.7110, 0.2270, 1.2100])), (("2.5YR", 1.0, 2.0), np.array([0.4258, 0.3344, 1.2100])), (("2.5YR", 1.0, 4.0), np.array([0.5311, 0.3371, 1.2100])), (("2.5YR", 1.0, 6.0), np.array([0.6048, 0.3270, 1.2100])), (("2.5YR", 1.0, 8.0), np.array([0.6721, 0.3058, 1.2100])), (("2.5YR", 1.0, 10.0), np.array([0.7270, 0.2790, 1.2100])), (("2.5YR", 1.0, 12.0), np.array([0.7780, 0.2480, 1.2100])), (("5YR", 1.0, 2.0), np.array([0.4377, 0.3580, 1.2100])), (("5YR", 1.0, 4.0), np.array([0.5660, 0.3795, 1.2100])), (("5YR", 1.0, 6.0), np.array([0.6560, 0.3840, 1.2100])), (("5YR", 1.0, 8.0), np.array([0.7360, 0.3850, 1.2100])), (("5YR", 1.0, 10.0), np.array([0.8290, 0.3850, 1.2100])), (("7.5YR", 1.0, 2.0), np.array([0.4430, 0.3775, 1.2100])), (("7.5YR", 1.0, 4.0), np.array([0.5850, 0.4220, 1.2100])), (("7.5YR", 1.0, 6.0), np.array([0.6850, 0.4420, 1.2100])), (("10YR", 1.0, 2.0), np.array([0.4446, 0.3982, 1.2100])), (("10YR", 1.0, 4.0), np.array([0.5910, 0.4640, 1.2100])), (("2.5Y", 1.0, 2.0), np.array([0.4362, 0.4177, 1.2100])), (("2.5Y", 1.0, 4.0), np.array([0.5810, 0.5050, 1.2100])), (("5Y", 1.0, 2.0), np.array([0.4230, 0.4265, 1.2100])), (("5Y", 1.0, 4.0), np.array([0.5650, 0.5430, 1.2100])), (("7.5Y", 1.0, 2.0), np.array([0.4042, 0.4287, 1.2100])), (("7.5Y", 1.0, 4.0), np.array([0.5430, 0.5700, 1.2100])), (("10Y", 2.0, 2.0), np.array([0.3556, 0.3848, 3.1260])), (("10Y", 2.0, 4.0), np.array([0.4188, 0.4789, 3.1260])), (("10Y", 2.0, 6.0), np.array([0.4820, 0.5760, 3.1260])), (("2.5GY", 2.0, 2.0), np.array([0.3421, 0.3803, 3.1260])), (("2.5GY", 2.0, 4.0), np.array([0.3881, 0.4752, 3.1260])), (("2.5GY", 2.0, 6.0), np.array([0.4340, 0.5900, 3.1260])), (("2.5GY", 2.0, 8.0), np.array([0.4760, 0.7160, 3.1260])), (("5GY", 2.0, 2.0), np.array([0.3309, 0.3743, 3.1260])), (("5GY", 2.0, 4.0), np.array([0.3582, 0.4650, 3.1260])), (("5GY", 2.0, 6.0), np.array([0.3839, 0.5748, 3.1260])), (("5GY", 2.0, 8.0), np.array([0.4090, 0.7100, 3.1260])), (("5GY", 2.0, 10.0), np.array([0.4180, 0.8250, 3.1260])), (("7.5GY", 2.0, 2.0), np.array([0.3165, 0.3650, 3.1260])), (("7.5GY", 2.0, 4.0), np.array([0.3248, 0.4457, 3.1260])), (("7.5GY", 2.0, 6.0), np.array([0.3260, 0.5379, 3.1260])), (("7.5GY", 2.0, 8.0), np.array([0.3160, 0.6509, 3.1260])), (("7.5GY", 2.0, 10.0), np.array([0.2970, 0.7680, 3.1260])), (("7.5GY", 2.0, 12.0), np.array([0.2740, 0.8790, 3.1260])), (("7.5GY", 2.0, 14.0), np.array([0.2430, 1.0100, 3.1260])), (("10GY", 2.0, 2.0), np.array([0.3069, 0.3580, 3.1260])), (("10GY", 2.0, 4.0), np.array([0.2986, 0.4240, 3.1260])), (("10GY", 2.0, 6.0), np.array([0.2852, 0.4972, 3.1260])), (("10GY", 2.0, 8.0), np.array([0.2628, 0.5837, 3.1260])), (("10GY", 2.0, 10.0), np.array([0.2307, 0.6814, 3.1260])), (("10GY", 2.0, 12.0), np.array([0.1907, 0.7798, 3.1260])), (("10GY", 2.0, 14.0), np.array([0.1410, 0.8760, 3.1260])), (("10GY", 2.0, 16.0), np.array([0.0610, 0.9980, 3.1260])), (("10GY", 2.0, 18.0), np.array([-0.0300, 1.1100, 3.1260])), (("2.5G", 2.0, 2.0), np.array([0.2978, 0.3507, 3.1260])), (("2.5G", 2.0, 4.0), np.array([0.2763, 0.3998, 3.1260])), (("2.5G", 2.0, 6.0), np.array([0.2493, 0.4522, 3.1260])), (("2.5G", 2.0, 8.0), np.array([0.2192, 0.5042, 3.1260])), (("2.5G", 2.0, 10.0), np.array([0.1773, 0.5698, 3.1260])), (("2.5G", 2.0, 12.0), np.array([0.1307, 0.6308, 3.1260])), (("2.5G", 2.0, 14.0), np.array([0.0820, 0.6860, 3.1260])), (("2.5G", 2.0, 16.0), np.array([0.0329, 0.7358, 3.1260])), (("2.5G", 2.0, 18.0), np.array([-0.0200, 0.7880, 3.1260])), (("5G", 2.0, 2.0), np.array([0.2918, 0.3450, 3.1260])), (("5G", 2.0, 4.0), np.array([0.2640, 0.3845, 3.1260])), (("5G", 2.0, 6.0), np.array([0.2318, 0.4231, 3.1260])), (("5G", 2.0, 8.0), np.array([0.1979, 0.4583, 3.1260])), (("5G", 2.0, 10.0), np.array([0.1560, 0.4981, 3.1260])), (("5G", 2.0, 12.0), np.array([0.1120, 0.5358, 3.1260])), (("5G", 2.0, 14.0), np.array([0.0688, 0.5691, 3.1260])), (("5G", 2.0, 16.0), np.array([0.0277, 0.5986, 3.1260])), (("5G", 2.0, 18.0), np.array([-0.0150, 0.6250, 3.1260])), (("7.5G", 2.0, 2.0), np.array([0.2869, 0.3400, 3.1260])), (("7.5G", 2.0, 4.0), np.array([0.2540, 0.3705, 3.1260])), (("7.5G", 2.0, 6.0), np.array([0.2200, 0.3983, 3.1260])), (("7.5G", 2.0, 8.0), np.array([0.1842, 0.4244, 3.1260])), (("7.5G", 2.0, 10.0), np.array([0.1442, 0.4505, 3.1260])), (("7.5G", 2.0, 12.0), np.array([0.1022, 0.4759, 3.1260])), (("7.5G", 2.0, 14.0), np.array([0.0629, 0.4973, 3.1260])), (("7.5G", 2.0, 16.0), np.array([0.0276, 0.5153, 3.1260])), (("7.5G", 2.0, 18.0), np.array([-0.0100, 0.5320, 3.1260])), (("10G", 2.0, 2.0), np.array([0.2820, 0.3341, 3.1260])), (("10G", 2.0, 4.0), np.array([0.2442, 0.3559, 3.1260])), (("10G", 2.0, 6.0), np.array([0.2092, 0.3739, 3.1260])), (("10G", 2.0, 8.0), np.array([0.1705, 0.3911, 3.1260])), (("10G", 2.0, 10.0), np.array([0.1321, 0.4059, 3.1260])), (("10G", 2.0, 12.0), np.array([0.0934, 0.4183, 3.1260])), (("10G", 2.0, 14.0), np.array([0.0599, 0.4270, 3.1260])), (("10G", 2.0, 16.0), np.array([0.0285, 0.4327, 3.1260])), (("10G", 2.0, 18.0), np.array([-0.0070, 0.4410, 3.1260])), (("2.5BG", 2.0, 2.0), np.array([0.2765, 0.3271, 3.1260])), (("2.5BG", 2.0, 4.0), np.array([0.2343, 0.3378, 3.1260])), (("2.5BG", 2.0, 6.0), np.array([0.1971, 0.3452, 3.1260])), (("2.5BG", 2.0, 8.0), np.array([0.1557, 0.3517, 3.1260])), (("2.5BG", 2.0, 10.0), np.array([0.1190, 0.3551, 3.1260])), (("2.5BG", 2.0, 12.0), np.array([0.0851, 0.3576, 3.1260])), (("2.5BG", 2.0, 14.0), np.array([0.0555, 0.3588, 3.1260])), (("2.5BG", 2.0, 16.0), np.array([0.0290, 0.3590, 3.1260])), (("2.5BG", 2.0, 18.0), np.array([-0.0020, 0.3600, 3.1260])), (("5BG", 2.0, 2.0), np.array([0.2697, 0.3175, 3.1260])), (("5BG", 2.0, 4.0), np.array([0.2234, 0.3150, 3.1260])), (("5BG", 2.0, 6.0), np.array([0.1843, 0.3110, 3.1260])), (("5BG", 2.0, 8.0), np.array([0.1405, 0.3037, 3.1260])), (("5BG", 2.0, 10.0), np.array([0.1050, 0.2956, 3.1260])), (("5BG", 2.0, 12.0), np.array([0.0769, 0.2880, 3.1260])), (("5BG", 2.0, 14.0), np.array([0.0510, 0.2800, 3.1260])), (("5BG", 2.0, 16.0), np.array([0.0280, 0.2740, 3.1260])), (("7.5BG", 2.0, 2.0), np.array([0.2651, 0.3098, 3.1260])), (("7.5BG", 2.0, 4.0), np.array([0.2162, 0.2981, 3.1260])), (("7.5BG", 2.0, 6.0), np.array([0.1747, 0.2853, 3.1260])), (("7.5BG", 2.0, 8.0), np.array([0.1325, 0.2710, 3.1260])), (("7.5BG", 2.0, 10.0), np.array([0.0991, 0.2582, 3.1260])), (("7.5BG", 2.0, 12.0), np.array([0.0724, 0.2478, 3.1260])), (("7.5BG", 2.0, 14.0), np.array([0.0500, 0.2370, 3.1260])), (("7.5BG", 2.0, 16.0), np.array([0.0280, 0.2280, 3.1260])), (("10BG", 2.0, 2.0), np.array([0.2606, 0.3010, 3.1260])), (("10BG", 2.0, 4.0), np.array([0.2096, 0.2790, 3.1260])), (("10BG", 2.0, 6.0), np.array([0.1669, 0.2570, 3.1260])), (("10BG", 2.0, 8.0), np.array([0.1258, 0.2331, 3.1260])), (("10BG", 2.0, 10.0), np.array([0.0929, 0.2133, 3.1260])), (("10BG", 2.0, 12.0), np.array([0.0680, 0.1940, 3.1260])), (("10BG", 2.0, 14.0), np.array([0.0500, 0.1810, 3.1260])), (("2.5B", 2.0, 2.0), np.array([0.2578, 0.2940, 3.1260])), (("2.5B", 2.0, 4.0), np.array([0.2060, 0.2649, 3.1260])), (("2.5B", 2.0, 6.0), np.array([0.1621, 0.2358, 3.1260])), (("2.5B", 2.0, 8.0), np.array([0.1230, 0.2076, 3.1260])), (("2.5B", 2.0, 10.0), np.array([0.0911, 0.1828, 3.1260])), (("2.5B", 2.0, 12.0), np.array([0.0670, 0.1650, 3.1260])), (("5B", 2.0, 2.0), np.array([0.2559, 0.2874, 3.1260])), (("5B", 2.0, 4.0), np.array([0.2048, 0.2518, 3.1260])), (("5B", 2.0, 6.0), np.array([0.1617, 0.2162, 3.1260])), (("5B", 2.0, 8.0), np.array([0.1245, 0.1827, 3.1260])), (("5B", 2.0, 10.0), np.array([0.0965, 0.1558, 3.1260])), (("5B", 2.0, 12.0), np.array([0.0770, 0.1360, 3.1260])), (("7.5B", 2.0, 2.0), np.array([0.2545, 0.2799, 3.1260])), (("7.5B", 2.0, 4.0), np.array([0.2063, 0.2400, 3.1260])), (("7.5B", 2.0, 6.0), np.array([0.1658, 0.2026, 3.1260])), (("7.5B", 2.0, 8.0), np.array([0.1313, 0.1692, 3.1260])), (("7.5B", 2.0, 10.0), np.array([0.1051, 0.1422, 3.1260])), (("7.5B", 2.0, 12.0), np.array([0.0880, 0.1240, 3.1260])), (("7.5B", 2.0, 14.0), np.array([0.0700, 0.1060, 3.1260])), (("10B", 2.0, 2.0), np.array([0.2558, 0.2725, 3.1260])), (("10B", 2.0, 4.0), np.array([0.2102, 0.2313, 3.1260])), (("10B", 2.0, 6.0), np.array([0.1716, 0.1937, 3.1260])), (("10B", 2.0, 8.0), np.array([0.1396, 0.1603, 3.1260])), (("10B", 2.0, 10.0), np.array([0.1157, 0.1346, 3.1260])), (("10B", 2.0, 12.0), np.array([0.0990, 0.1150, 3.1260])), (("10B", 2.0, 14.0), np.array([0.0830, 0.0970, 3.1260])), (("2.5PB", 2.0, 2.0), np.array([0.2592, 0.2675, 3.1260])), (("2.5PB", 2.0, 4.0), np.array([0.2175, 0.2245, 3.1260])), (("2.5PB", 2.0, 6.0), np.array([0.1825, 0.1857, 3.1260])), (("2.5PB", 2.0, 8.0), np.array([0.1540, 0.1530, 3.1260])), (("2.5PB", 2.0, 10.0), np.array([0.1332, 0.1278, 3.1260])), (("2.5PB", 2.0, 12.0), np.array([0.1166, 0.1076, 3.1260])), (("2.5PB", 2.0, 14.0), np.array([0.1020, 0.0890, 3.1260])), (("2.5PB", 2.0, 16.0), np.array([0.0920, 0.0760, 3.1260])), (("2.5PB", 2.0, 18.0), np.array([0.0840, 0.0640, 3.1260])), (("5PB", 2.0, 2.0), np.array([0.2638, 0.2624, 3.1260])), (("5PB", 2.0, 4.0), np.array([0.2263, 0.2192, 3.1260])), (("5PB", 2.0, 6.0), np.array([0.1942, 0.1811, 3.1260])), (("5PB", 2.0, 8.0), np.array([0.1685, 0.1491, 3.1260])), (("5PB", 2.0, 10.0), np.array([0.1500, 0.1240, 3.1260])), (("5PB", 2.0, 12.0), np.array([0.1363, 0.1048, 3.1260])), (("5PB", 2.0, 14.0), np.array([0.1253, 0.0873, 3.1260])), (("5PB", 2.0, 16.0), np.array([0.1170, 0.0740, 3.1260])), (("5PB", 2.0, 18.0), np.array([0.1110, 0.0640, 3.1260])), (("5PB", 2.0, 20.0), np.array([0.1080, 0.0580, 3.1260])), (("5PB", 2.0, 22.0), np.array([0.1040, 0.0520, 3.1260])), (("5PB", 2.0, 24.0), np.array([0.1000, 0.0460, 3.1260])), (("5PB", 2.0, 26.0), np.array([0.0980, 0.0420, 3.1260])), (("5PB", 2.0, 28.0), np.array([0.0970, 0.0400, 3.1260])), (("5PB", 2.0, 30.0), np.array([0.0960, 0.0380, 3.1260])), (("5PB", 2.0, 32.0), np.array([0.0950, 0.0360, 3.1260])), (("5PB", 2.0, 34.0), np.array([0.0930, 0.0330, 3.1260])), (("5PB", 2.0, 36.0), np.array([0.0920, 0.0310, 3.1260])), (("5PB", 2.0, 38.0), np.array([0.0900, 0.0280, 3.1260])), (("5PB", 2.0, 40.0), np.array([0.0890, 0.0250, 3.1260])), (("5PB", 2.0, 42.0), np.array([0.0870, 0.0220, 3.1260])), (("5PB", 2.0, 44.0), np.array([0.0860, 0.0190, 3.1260])), (("5PB", 2.0, 46.0), np.array([0.0840, 0.0160, 3.1260])), (("7.5PB", 2.0, 2.0), np.array([0.2712, 0.2582, 3.1260])), (("7.5PB", 2.0, 4.0), np.array([0.2420, 0.2148, 3.1260])), (("7.5PB", 2.0, 6.0), np.array([0.2189, 0.1790, 3.1260])), (("7.5PB", 2.0, 8.0), np.array([0.2005, 0.1495, 3.1260])), (("7.5PB", 2.0, 10.0), np.array([0.1882, 0.1258, 3.1260])), (("7.5PB", 2.0, 12.0), np.array([0.1813, 0.1094, 3.1260])), (("7.5PB", 2.0, 14.0), np.array([0.1762, 0.0955, 3.1260])), (("7.5PB", 2.0, 16.0), np.array([0.1728, 0.0839, 3.1260])), (("7.5PB", 2.0, 18.0), np.array([0.1701, 0.0742, 3.1260])), (("7.5PB", 2.0, 20.0), np.array([0.1685, 0.0666, 3.1260])), (("7.5PB", 2.0, 22.0), np.array([0.1670, 0.0594, 3.1260])), (("7.5PB", 2.0, 24.0), np.array([0.1660, 0.0538, 3.1260])), (("7.5PB", 2.0, 26.0), np.array([0.1653, 0.0492, 3.1260])), (("7.5PB", 2.0, 28.0), np.array([0.1647, 0.0451, 3.1260])), (("7.5PB", 2.0, 30.0), np.array([0.1640, 0.0409, 3.1260])), (("7.5PB", 2.0, 32.0), np.array([0.1635, 0.0373, 3.1260])), (("7.5PB", 2.0, 34.0), np.array([0.1630, 0.0340, 3.1260])), (("7.5PB", 2.0, 36.0), np.array([0.1628, 0.0310, 3.1260])), (("7.5PB", 2.0, 38.0), np.array([0.1623, 0.0280, 3.1260])), (("7.5PB", 2.0, 40.0), np.array([0.1620, 0.0250, 3.1260])), (("7.5PB", 2.0, 42.0), np.array([0.1620, 0.0220, 3.1260])), (("7.5PB", 2.0, 44.0), np.array([0.1620, 0.0190, 3.1260])), (("7.5PB", 2.0, 46.0), np.array([0.1610, 0.0160, 3.1260])), (("7.5PB", 2.0, 48.0), np.array([0.1610, 0.0130, 3.1260])), (("7.5PB", 2.0, 50.0), np.array([0.1600, 0.0100, 3.1260])), (("10PB", 2.0, 2.0), np.array([0.2803, 0.2567, 3.1260])), (("10PB", 2.0, 4.0), np.array([0.2600, 0.2162, 3.1260])), (("10PB", 2.0, 6.0), np.array([0.2440, 0.1840, 3.1260])), (("10PB", 2.0, 8.0), np.array([0.2294, 0.1551, 3.1260])), (("10PB", 2.0, 10.0), np.array([0.2200, 0.1330, 3.1260])), (("10PB", 2.0, 12.0), np.array([0.2139, 0.1170, 3.1260])), (("10PB", 2.0, 14.0), np.array([0.2087, 0.1026, 3.1260])), (("10PB", 2.0, 16.0), np.array([0.2052, 0.0910, 3.1260])), (("10PB", 2.0, 18.0), np.array([0.2021, 0.0808, 3.1260])), (("10PB", 2.0, 20.0), np.array([0.1998, 0.0718, 3.1260])), (("10PB", 2.0, 22.0), np.array([0.1978, 0.0643, 3.1260])), (("10PB", 2.0, 24.0), np.array([0.1962, 0.0578, 3.1260])), (("10PB", 2.0, 26.0), np.array([0.1949, 0.0520, 3.1260])), (("10PB", 2.0, 28.0), np.array([0.1937, 0.0471, 3.1260])), (("10PB", 2.0, 30.0), np.array([0.1925, 0.0420, 3.1260])), (("10PB", 2.0, 32.0), np.array([0.1918, 0.0379, 3.1260])), (("10PB", 2.0, 34.0), np.array([0.1911, 0.0344, 3.1260])), (("10PB", 2.0, 36.0), np.array([0.1900, 0.0310, 3.1260])), (("10PB", 2.0, 38.0), np.array([0.1900, 0.0280, 3.1260])), (("10PB", 2.0, 40.0), np.array([0.1900, 0.0250, 3.1260])), (("10PB", 2.0, 42.0), np.array([0.1890, 0.0220, 3.1260])), (("10PB", 2.0, 44.0), np.array([0.1890, 0.0190, 3.1260])), (("10PB", 2.0, 46.0), np.array([0.1890, 0.0160, 3.1260])), (("10PB", 2.0, 48.0), np.array([0.1880, 0.0130, 3.1260])), (("10PB", 2.0, 50.0), np.array([0.1880, 0.0100, 3.1260])), (("2.5P", 2.0, 2.0), np.array([0.2892, 0.2583, 3.1260])), (("2.5P", 2.0, 4.0), np.array([0.2758, 0.2208, 3.1260])), (("2.5P", 2.0, 6.0), np.array([0.2661, 0.1921, 3.1260])), (("2.5P", 2.0, 8.0), np.array([0.2570, 0.1635, 3.1260])), (("2.5P", 2.0, 10.0), np.array([0.2501, 0.1422, 3.1260])), (("2.5P", 2.0, 12.0), np.array([0.2449, 0.1245, 3.1260])), (("2.5P", 2.0, 14.0), np.array([0.2406, 0.1100, 3.1260])), (("2.5P", 2.0, 16.0), np.array([0.2372, 0.0980, 3.1260])), (("2.5P", 2.0, 18.0), np.array([0.2345, 0.0873, 3.1260])), (("2.5P", 2.0, 20.0), np.array([0.2320, 0.0779, 3.1260])), (("2.5P", 2.0, 22.0), np.array([0.2298, 0.0696, 3.1260])), (("2.5P", 2.0, 24.0), np.array([0.2277, 0.0621, 3.1260])), (("2.5P", 2.0, 26.0), np.array([0.2260, 0.0555, 3.1260])), (("2.5P", 2.0, 28.0), np.array([0.2245, 0.0491, 3.1260])), (("2.5P", 2.0, 30.0), np.array([0.2231, 0.0432, 3.1260])), (("2.5P", 2.0, 32.0), np.array([0.2220, 0.0380, 3.1260])), (("2.5P", 2.0, 34.0), np.array([0.2210, 0.0350, 3.1260])), (("2.5P", 2.0, 36.0), np.array([0.2200, 0.0310, 3.1260])), (("2.5P", 2.0, 38.0), np.array([0.2190, 0.0280, 3.1260])), (("2.5P", 2.0, 40.0), np.array([0.2190, 0.0250, 3.1260])), (("2.5P", 2.0, 42.0), np.array([0.2180, 0.0220, 3.1260])), (("2.5P", 2.0, 44.0), np.array([0.2170, 0.0190, 3.1260])), (("5P", 2.0, 2.0), np.array([0.2984, 0.2612, 3.1260])), (("5P", 2.0, 4.0), np.array([0.2908, 0.2261, 3.1260])), (("5P", 2.0, 6.0), np.array([0.2850, 0.1992, 3.1260])), (("5P", 2.0, 8.0), np.array([0.2791, 0.1707, 3.1260])), (("5P", 2.0, 10.0), np.array([0.2748, 0.1500, 3.1260])), (("5P", 2.0, 12.0), np.array([0.2709, 0.1320, 3.1260])), (("5P", 2.0, 14.0), np.array([0.2676, 0.1163, 3.1260])), (("5P", 2.0, 16.0), np.array([0.2652, 0.1045, 3.1260])), (("5P", 2.0, 18.0), np.array([0.2632, 0.0935, 3.1260])), (("5P", 2.0, 20.0), np.array([0.2612, 0.0838, 3.1260])), (("5P", 2.0, 22.0), np.array([0.2597, 0.0750, 3.1260])), (("5P", 2.0, 24.0), np.array([0.2582, 0.0669, 3.1260])), (("5P", 2.0, 26.0), np.array([0.2569, 0.0594, 3.1260])), (("5P", 2.0, 28.0), np.array([0.2559, 0.0525, 3.1260])), (("5P", 2.0, 30.0), np.array([0.2550, 0.0450, 3.1260])), (("5P", 2.0, 32.0), np.array([0.2540, 0.0390, 3.1260])), (("5P", 2.0, 34.0), np.array([0.2530, 0.0350, 3.1260])), (("5P", 2.0, 36.0), np.array([0.2520, 0.0310, 3.1260])), (("7.5P", 2.0, 2.0), np.array([0.3071, 0.2647, 3.1260])), (("7.5P", 2.0, 4.0), np.array([0.3048, 0.2321, 3.1260])), (("7.5P", 2.0, 6.0), np.array([0.3025, 0.2058, 3.1260])), (("7.5P", 2.0, 8.0), np.array([0.3000, 0.1781, 3.1260])), (("7.5P", 2.0, 10.0), np.array([0.2979, 0.1569, 3.1260])), (("7.5P", 2.0, 12.0), np.array([0.2956, 0.1392, 3.1260])), (("7.5P", 2.0, 14.0), np.array([0.2938, 0.1235, 3.1260])), (("7.5P", 2.0, 16.0), np.array([0.2922, 0.1106, 3.1260])), (("7.5P", 2.0, 18.0), np.array([0.2912, 0.0995, 3.1260])), (("7.5P", 2.0, 20.0), np.array([0.2902, 0.0901, 3.1260])), (("7.5P", 2.0, 22.0), np.array([0.2890, 0.0799, 3.1260])), (("7.5P", 2.0, 24.0), np.array([0.2882, 0.0719, 3.1260])), (("7.5P", 2.0, 26.0), np.array([0.2870, 0.0640, 3.1260])), (("7.5P", 2.0, 28.0), np.array([0.2860, 0.0550, 3.1260])), (("7.5P", 2.0, 30.0), np.array([0.2840, 0.0460, 3.1260])), (("10P", 2.0, 2.0), np.array([0.3161, 0.2691, 3.1260])), (("10P", 2.0, 4.0), np.array([0.3189, 0.2390, 3.1260])), (("10P", 2.0, 6.0), np.array([0.3207, 0.2132, 3.1260])), (("10P", 2.0, 8.0), np.array([0.3219, 0.1862, 3.1260])), (("10P", 2.0, 10.0), np.array([0.3230, 0.1659, 3.1260])), (("10P", 2.0, 12.0), np.array([0.3233, 0.1477, 3.1260])), (("10P", 2.0, 14.0), np.array([0.3235, 0.1317, 3.1260])), (("10P", 2.0, 16.0), np.array([0.3235, 0.1181, 3.1260])), (("10P", 2.0, 18.0), np.array([0.3233, 0.1063, 3.1260])), (("10P", 2.0, 20.0), np.array([0.3231, 0.0962, 3.1260])), (("10P", 2.0, 22.0), np.array([0.3230, 0.0861, 3.1260])), (("10P", 2.0, 24.0), np.array([0.3220, 0.0760, 3.1260])), (("10P", 2.0, 26.0), np.array([0.3220, 0.0680, 3.1260])), (("10P", 2.0, 28.0), np.array([0.3220, 0.0580, 3.1260])), (("2.5RP", 2.0, 2.0), np.array([0.3279, 0.2754, 3.1260])), (("2.5RP", 2.0, 4.0), np.array([0.3382, 0.2496, 3.1260])), (("2.5RP", 2.0, 6.0), np.array([0.3470, 0.2259, 3.1260])), (("2.5RP", 2.0, 8.0), np.array([0.3555, 0.2003, 3.1260])), (("2.5RP", 2.0, 10.0), np.array([0.3617, 0.1800, 3.1260])), (("2.5RP", 2.0, 12.0), np.array([0.3668, 0.1618, 3.1260])), (("2.5RP", 2.0, 14.0), np.array([0.3711, 0.1449, 3.1260])), (("2.5RP", 2.0, 16.0), np.array([0.3748, 0.1310, 3.1260])), (("2.5RP", 2.0, 18.0), np.array([0.3778, 0.1188, 3.1260])), (("2.5RP", 2.0, 20.0), np.array([0.3802, 0.1080, 3.1260])), (("2.5RP", 2.0, 22.0), np.array([0.3830, 0.0960, 3.1260])), (("2.5RP", 2.0, 24.0), np.array([0.3860, 0.0860, 3.1260])), (("2.5RP", 2.0, 26.0), np.array([0.3880, 0.0760, 3.1260])), (("5RP", 2.0, 2.0), np.array([0.3383, 0.2829, 3.1260])), (("5RP", 2.0, 4.0), np.array([0.3558, 0.2597, 3.1260])), (("5RP", 2.0, 6.0), np.array([0.3708, 0.2380, 3.1260])), (("5RP", 2.0, 8.0), np.array([0.3858, 0.2140, 3.1260])), (("5RP", 2.0, 10.0), np.array([0.3971, 0.1939, 3.1260])), (("5RP", 2.0, 12.0), np.array([0.4080, 0.1764, 3.1260])), (("5RP", 2.0, 14.0), np.array([0.4180, 0.1598, 3.1260])), (("5RP", 2.0, 16.0), np.array([0.4269, 0.1454, 3.1260])), (("5RP", 2.0, 18.0), np.array([0.4338, 0.1340, 3.1260])), (("5RP", 2.0, 20.0), np.array([0.4420, 0.1210, 3.1260])), (("5RP", 2.0, 22.0), np.array([0.4480, 0.1100, 3.1260])), (("7.5RP", 2.0, 2.0), np.array([0.3459, 0.2892, 3.1260])), (("7.5RP", 2.0, 4.0), np.array([0.3702, 0.2683, 3.1260])), (("7.5RP", 2.0, 6.0), np.array([0.3918, 0.2490, 3.1260])), (("7.5RP", 2.0, 8.0), np.array([0.4137, 0.2276, 3.1260])), (("7.5RP", 2.0, 10.0), np.array([0.4321, 0.2082, 3.1260])), (("7.5RP", 2.0, 12.0), np.array([0.4481, 0.1903, 3.1260])), (("7.5RP", 2.0, 14.0), np.array([0.4624, 0.1737, 3.1260])), (("7.5RP", 2.0, 16.0), np.array([0.4744, 0.1595, 3.1260])), (("7.5RP", 2.0, 18.0), np.array([0.4850, 0.1460, 3.1260])), (("7.5RP", 2.0, 20.0), np.array([0.4970, 0.1320, 3.1260])), (("10RP", 2.0, 2.0), np.array([0.3532, 0.2957, 3.1260])), (("10RP", 2.0, 4.0), np.array([0.3850, 0.2778, 3.1260])), (("10RP", 2.0, 6.0), np.array([0.4139, 0.2608, 3.1260])), (("10RP", 2.0, 8.0), np.array([0.4428, 0.2419, 3.1260])), (("10RP", 2.0, 10.0), np.array([0.4678, 0.2237, 3.1260])), (("10RP", 2.0, 12.0), np.array([0.4911, 0.2060, 3.1260])), (("10RP", 2.0, 14.0), np.array([0.5129, 0.1888, 3.1260])), (("10RP", 2.0, 16.0), np.array([0.5310, 0.1740, 3.1260])), (("10RP", 2.0, 18.0), np.array([0.5460, 0.1610, 3.1260])), (("2.5R", 2.0, 2.0), np.array([0.3614, 0.3033, 3.1260])), (("2.5R", 2.0, 4.0), np.array([0.4021, 0.2900, 3.1260])), (("2.5R", 2.0, 6.0), np.array([0.4390, 0.2760, 3.1260])), (("2.5R", 2.0, 8.0), np.array([0.4776, 0.2593, 3.1260])), (("2.5R", 2.0, 10.0), np.array([0.5122, 0.2428, 3.1260])), (("2.5R", 2.0, 12.0), np.array([0.5438, 0.2254, 3.1260])), (("2.5R", 2.0, 14.0), np.array([0.5734, 0.2083, 3.1260])), (("2.5R", 2.0, 16.0), np.array([0.6010, 0.1920, 3.1260])), (("5R", 2.0, 2.0), np.array([0.3692, 0.3111, 3.1260])), (("5R", 2.0, 4.0), np.array([0.4184, 0.3032, 3.1260])), (("5R", 2.0, 6.0), np.array([0.4642, 0.2934, 3.1260])), (("5R", 2.0, 8.0), np.array([0.5143, 0.2800, 3.1260])), (("5R", 2.0, 10.0), np.array([0.5557, 0.2633, 3.1260])), (("5R", 2.0, 12.0), np.array([0.5930, 0.2465, 3.1260])), (("5R", 2.0, 14.0), np.array([0.6302, 0.2287, 3.1260])), (("5R", 2.0, 16.0), np.array([0.6590, 0.2120, 3.1260])), (("7.5R", 2.0, 2.0), np.array([0.3751, 0.3181, 3.1260])), (("7.5R", 2.0, 4.0), np.array([0.4335, 0.3169, 3.1260])), (("7.5R", 2.0, 6.0), np.array([0.4875, 0.3123, 3.1260])), (("7.5R", 2.0, 8.0), np.array([0.5433, 0.3027, 3.1260])), (("7.5R", 2.0, 10.0), np.array([0.5952, 0.2874, 3.1260])), (("7.5R", 2.0, 12.0), np.array([0.6392, 0.2704, 3.1260])), (("7.5R", 2.0, 14.0), np.array([0.6791, 0.2520, 3.1260])), (("7.5R", 2.0, 16.0), np.array([0.7140, 0.2340, 3.1260])), (("10R", 2.0, 2.0), np.array([0.3811, 0.3274, 3.1260])), (("10R", 2.0, 4.0), np.array([0.4481, 0.3330, 3.1260])), (("10R", 2.0, 6.0), np.array([0.5095, 0.3331, 3.1260])), (("10R", 2.0, 8.0), np.array([0.5713, 0.3259, 3.1260])), (("10R", 2.0, 10.0), np.array([0.6247, 0.3120, 3.1260])), (("10R", 2.0, 12.0), np.array([0.6732, 0.2937, 3.1260])), (("10R", 2.0, 14.0), np.array([0.7165, 0.2734, 3.1260])), (("10R", 2.0, 16.0), np.array([0.7520, 0.2540, 3.1260])), (("2.5YR", 2.0, 2.0), np.array([0.3852, 0.3365, 3.1260])), (("2.5YR", 2.0, 4.0), np.array([0.4598, 0.3508, 3.1260])), (("2.5YR", 2.0, 6.0), np.array([0.5280, 0.3581, 3.1260])), (("2.5YR", 2.0, 8.0), np.array([0.5995, 0.3590, 3.1260])), (("2.5YR", 2.0, 10.0), np.array([0.6590, 0.3500, 3.1260])), (("2.5YR", 2.0, 12.0), np.array([0.7180, 0.3400, 3.1260])), (("2.5YR", 2.0, 14.0), np.array([0.7790, 0.3230, 3.1260])), (("2.5YR", 2.0, 16.0), np.array([0.8240, 0.3090, 3.1260])), (("5YR", 2.0, 2.0), np.array([0.3880, 0.3476, 3.1260])), (("5YR", 2.0, 4.0), np.array([0.4674, 0.3738, 3.1260])), (("5YR", 2.0, 6.0), np.array([0.5426, 0.3925, 3.1260])), (("5YR", 2.0, 8.0), np.array([0.6200, 0.4060, 3.1260])), (("5YR", 2.0, 10.0), np.array([0.6840, 0.4150, 3.1260])), (("7.5YR", 2.0, 2.0), np.array([0.3889, 0.3590, 3.1260])), (("7.5YR", 2.0, 4.0), np.array([0.4690, 0.3964, 3.1260])), (("7.5YR", 2.0, 6.0), np.array([0.5475, 0.4271, 3.1260])), (("7.5YR", 2.0, 8.0), np.array([0.6200, 0.4560, 3.1260])), (("10YR", 2.0, 2.0), np.array([0.3872, 0.3688, 3.1260])), (("10YR", 2.0, 4.0), np.array([0.4676, 0.4168, 3.1260])), (("10YR", 2.0, 6.0), np.array([0.5450, 0.4580, 3.1260])), (("10YR", 2.0, 8.0), np.array([0.6120, 0.4930, 3.1260])), (("2.5Y", 2.0, 2.0), np.array([0.3825, 0.3785, 3.1260])), (("2.5Y", 2.0, 4.0), np.array([0.4627, 0.4392, 3.1260])), (("2.5Y", 2.0, 6.0), np.array([0.5380, 0.4860, 3.1260])), (("2.5Y", 2.0, 8.0), np.array([0.6040, 0.5260, 3.1260])), (("5Y", 2.0, 2.0), np.array([0.3757, 0.3839, 3.1260])), (("5Y", 2.0, 4.0), np.array([0.4543, 0.4573, 3.1260])), (("5Y", 2.0, 6.0), np.array([0.5260, 0.5190, 3.1260])), (("7.5Y", 2.0, 2.0), np.array([0.3660, 0.3858, 3.1260])), (("7.5Y", 2.0, 4.0), np.array([0.4401, 0.4723, 3.1260])), (("7.5Y", 2.0, 6.0), np.array([0.5100, 0.5470, 3.1260])), (("10Y", 3.0, 2.0), np.array([0.3513, 0.3789, 6.5500])), (("10Y", 3.0, 4.0), np.array([0.3961, 0.4452, 6.5500])), (("10Y", 3.0, 6.0), np.array([0.4345, 0.5026, 6.5500])), (("10Y", 3.0, 8.0), np.array([0.4700, 0.5550, 6.5500])), (("2.5GY", 3.0, 2.0), np.array([0.3412, 0.3768, 6.5500])), (("2.5GY", 3.0, 4.0), np.array([0.3772, 0.4484, 6.5500])), (("2.5GY", 3.0, 6.0), np.array([0.4069, 0.5110, 6.5500])), (("2.5GY", 3.0, 8.0), np.array([0.4320, 0.5760, 6.5500])), (("2.5GY", 3.0, 10.0), np.array([0.4550, 0.6380, 6.5500])), (("5GY", 3.0, 2.0), np.array([0.3319, 0.3729, 6.5500])), (("5GY", 3.0, 4.0), np.array([0.3554, 0.4429, 6.5500])), (("5GY", 3.0, 6.0), np.array([0.3750, 0.5109, 6.5500])), (("5GY", 3.0, 8.0), np.array([0.3924, 0.5832, 6.5500])), (("5GY", 3.0, 10.0), np.array([0.4040, 0.6500, 6.5500])), (("5GY", 3.0, 12.0), np.array([0.4130, 0.7180, 6.5500])), (("7.5GY", 3.0, 2.0), np.array([0.3180, 0.3644, 6.5500])), (("7.5GY", 3.0, 4.0), np.array([0.3270, 0.4288, 6.5500])), (("7.5GY", 3.0, 6.0), np.array([0.3333, 0.4967, 6.5500])), (("7.5GY", 3.0, 8.0), np.array([0.3341, 0.5700, 6.5500])), (("7.5GY", 3.0, 10.0), np.array([0.3266, 0.6448, 6.5500])), (("7.5GY", 3.0, 12.0), np.array([0.3150, 0.7200, 6.5500])), (("7.5GY", 3.0, 14.0), np.array([0.3000, 0.7930, 6.5500])), (("10GY", 3.0, 2.0), np.array([0.3088, 0.3578, 6.5500])), (("10GY", 3.0, 4.0), np.array([0.3053, 0.4123, 6.5500])), (("10GY", 3.0, 6.0), np.array([0.2992, 0.4717, 6.5500])), (("10GY", 3.0, 8.0), np.array([0.2887, 0.5361, 6.5500])), (("10GY", 3.0, 10.0), np.array([0.2724, 0.6026, 6.5500])), (("10GY", 3.0, 12.0), np.array([0.2531, 0.6700, 6.5500])), (("10GY", 3.0, 14.0), np.array([0.2283, 0.7423, 6.5500])), (("10GY", 3.0, 16.0), np.array([0.2020, 0.8070, 6.5500])), (("10GY", 3.0, 18.0), np.array([0.1680, 0.8800, 6.5500])), (("10GY", 3.0, 20.0), np.array([0.1300, 0.9480, 6.5500])), (("10GY", 3.0, 22.0), np.array([0.0890, 1.0140, 6.5500])), (("10GY", 3.0, 24.0), np.array([0.0460, 1.0780, 6.5500])), (("2.5G", 3.0, 2.0), np.array([0.2999, 0.3500, 6.5500])), (("2.5G", 3.0, 4.0), np.array([0.2836, 0.3915, 6.5500])), (("2.5G", 3.0, 6.0), np.array([0.2642, 0.4342, 6.5500])), (("2.5G", 3.0, 8.0), np.array([0.2435, 0.4752, 6.5500])), (("2.5G", 3.0, 10.0), np.array([0.2170, 0.5211, 6.5500])), (("2.5G", 3.0, 12.0), np.array([0.1902, 0.5642, 6.5500])), (("2.5G", 3.0, 14.0), np.array([0.1626, 0.6052, 6.5500])), (("2.5G", 3.0, 16.0), np.array([0.1341, 0.6420, 6.5500])), (("2.5G", 3.0, 18.0), np.array([0.1049, 0.6766, 6.5500])), (("2.5G", 3.0, 20.0), np.array([0.0720, 0.7127, 6.5500])), (("2.5G", 3.0, 22.0), np.array([0.0390, 0.7468, 6.5500])), (("2.5G", 3.0, 24.0), np.array([0.0090, 0.7760, 6.5500])), (("5G", 3.0, 2.0), np.array([0.2935, 0.3439, 6.5500])), (("5G", 3.0, 4.0), np.array([0.2711, 0.3780, 6.5500])), (("5G", 3.0, 6.0), np.array([0.2471, 0.4100, 6.5500])), (("5G", 3.0, 8.0), np.array([0.2228, 0.4380, 6.5500])), (("5G", 3.0, 10.0), np.array([0.1935, 0.4682, 6.5500])), (("5G", 3.0, 12.0), np.array([0.1660, 0.4948, 6.5500])), (("5G", 3.0, 14.0), np.array([0.1382, 0.5197, 6.5500])), (("5G", 3.0, 16.0), np.array([0.1120, 0.5414, 6.5500])), (("5G", 3.0, 18.0), np.array([0.0882, 0.5605, 6.5500])), (("5G", 3.0, 20.0), np.array([0.0620, 0.5802, 6.5500])), (("5G", 3.0, 22.0), np.array([0.0340, 0.6011, 6.5500])), (("5G", 3.0, 24.0), np.array([0.0040, 0.6220, 6.5500])), (("7.5G", 3.0, 2.0), np.array([0.2890, 0.3391, 6.5500])), (("7.5G", 3.0, 4.0), np.array([0.2618, 0.3667, 6.5500])), (("7.5G", 3.0, 6.0), np.array([0.2346, 0.3901, 6.5500])), (("7.5G", 3.0, 8.0), np.array([0.2088, 0.4101, 6.5500])), (("7.5G", 3.0, 10.0), np.array([0.1800, 0.4310, 6.5500])), (("7.5G", 3.0, 12.0), np.array([0.1516, 0.4505, 6.5500])), (("7.5G", 3.0, 14.0), np.array([0.1262, 0.4667, 6.5500])), (("7.5G", 3.0, 16.0), np.array([0.1023, 0.4818, 6.5500])), (("7.5G", 3.0, 18.0), np.array([0.0798, 0.4954, 6.5500])), (("7.5G", 3.0, 20.0), np.array([0.0568, 0.5082, 6.5500])), (("7.5G", 3.0, 22.0), np.array([0.0332, 0.5206, 6.5500])), (("7.5G", 3.0, 24.0), np.array([0.0060, 0.5340, 6.5500])), (("10G", 3.0, 2.0), np.array([0.2844, 0.3337, 6.5500])), (("10G", 3.0, 4.0), np.array([0.2525, 0.3537, 6.5500])), (("10G", 3.0, 6.0), np.array([0.2240, 0.3699, 6.5500])), (("10G", 3.0, 8.0), np.array([0.1970, 0.3841, 6.5500])), (("10G", 3.0, 10.0), np.array([0.1688, 0.3974, 6.5500])), (("10G", 3.0, 12.0), np.array([0.1411, 0.4095, 6.5500])), (("10G", 3.0, 14.0), np.array([0.1161, 0.4192, 6.5500])), (("10G", 3.0, 16.0), np.array([0.0925, 0.4275, 6.5500])), (("10G", 3.0, 18.0), np.array([0.0718, 0.4340, 6.5500])), (("10G", 3.0, 20.0), np.array([0.0528, 0.4393, 6.5500])), (("10G", 3.0, 22.0), np.array([0.0333, 0.4444, 6.5500])), (("10G", 3.0, 24.0), np.array([0.0090, 0.4500, 6.5500])), (("2.5BG", 3.0, 2.0), np.array([0.2799, 0.3271, 6.5500])), (("2.5BG", 3.0, 4.0), np.array([0.2437, 0.3386, 6.5500])), (("2.5BG", 3.0, 6.0), np.array([0.2132, 0.3468, 6.5500])), (("2.5BG", 3.0, 8.0), np.array([0.1845, 0.3531, 6.5500])), (("2.5BG", 3.0, 10.0), np.array([0.1552, 0.3580, 6.5500])), (("2.5BG", 3.0, 12.0), np.array([0.1288, 0.3620, 6.5500])), (("2.5BG", 3.0, 14.0), np.array([0.1051, 0.3648, 6.5500])), (("2.5BG", 3.0, 16.0), np.array([0.0843, 0.3667, 6.5500])), (("2.5BG", 3.0, 18.0), np.array([0.0648, 0.3682, 6.5500])), (("2.5BG", 3.0, 20.0), np.array([0.0482, 0.3695, 6.5500])), (("2.5BG", 3.0, 22.0), np.array([0.0320, 0.3700, 6.5500])), (("2.5BG", 3.0, 24.0), np.array([0.0120, 0.3710, 6.5500])), (("5BG", 3.0, 2.0), np.array([0.2742, 0.3192, 6.5500])), (("5BG", 3.0, 4.0), np.array([0.2343, 0.3200, 6.5500])), (("5BG", 3.0, 6.0), np.array([0.2020, 0.3188, 6.5500])), (("5BG", 3.0, 8.0), np.array([0.1703, 0.3159, 6.5500])), (("5BG", 3.0, 10.0), np.array([0.1410, 0.3118, 6.5500])), (("5BG", 3.0, 12.0), np.array([0.1158, 0.3071, 6.5500])), (("5BG", 3.0, 14.0), np.array([0.0940, 0.3027, 6.5500])), (("5BG", 3.0, 16.0), np.array([0.0735, 0.2979, 6.5500])), (("5BG", 3.0, 18.0), np.array([0.0580, 0.2940, 6.5500])), (("5BG", 3.0, 20.0), np.array([0.0430, 0.2910, 6.5500])), (("5BG", 3.0, 22.0), np.array([0.0280, 0.2860, 6.5500])), (("7.5BG", 3.0, 2.0), np.array([0.2699, 0.3120, 6.5500])), (("7.5BG", 3.0, 4.0), np.array([0.2272, 0.3041, 6.5500])), (("7.5BG", 3.0, 6.0), np.array([0.1928, 0.2958, 6.5500])), (("7.5BG", 3.0, 8.0), np.array([0.1620, 0.2872, 6.5500])), (("7.5BG", 3.0, 10.0), np.array([0.1326, 0.2784, 6.5500])), (("7.5BG", 3.0, 12.0), np.array([0.1086, 0.2706, 6.5500])), (("7.5BG", 3.0, 14.0), np.array([0.0874, 0.2627, 6.5500])), (("7.5BG", 3.0, 16.0), np.array([0.0691, 0.2559, 6.5500])), (("7.5BG", 3.0, 18.0), np.array([0.0530, 0.2490, 6.5500])), (("7.5BG", 3.0, 20.0), np.array([0.0390, 0.2420, 6.5500])), (("10BG", 3.0, 2.0), np.array([0.2660, 0.3050, 6.5500])), (("10BG", 3.0, 4.0), np.array([0.2221, 0.2886, 6.5500])), (("10BG", 3.0, 6.0), np.array([0.1861, 0.2722, 6.5500])), (("10BG", 3.0, 8.0), np.array([0.1551, 0.2571, 6.5500])), (("10BG", 3.0, 10.0), np.array([0.1250, 0.2411, 6.5500])), (("10BG", 3.0, 12.0), np.array([0.1018, 0.2281, 6.5500])), (("10BG", 3.0, 14.0), np.array([0.0798, 0.2151, 6.5500])), (("10BG", 3.0, 16.0), np.array([0.0650, 0.2060, 6.5500])), (("10BG", 3.0, 18.0), np.array([0.0530, 0.1990, 6.5500])), (("2.5B", 3.0, 2.0), np.array([0.2636, 0.2983, 6.5500])), (("2.5B", 3.0, 4.0), np.array([0.2183, 0.2748, 6.5500])), (("2.5B", 3.0, 6.0), np.array([0.1826, 0.2536, 6.5500])), (("2.5B", 3.0, 8.0), np.array([0.1511, 0.2331, 6.5500])), (("2.5B", 3.0, 10.0), np.array([0.1220, 0.2132, 6.5500])), (("2.5B", 3.0, 12.0), np.array([0.0989, 0.1963, 6.5500])), (("2.5B", 3.0, 14.0), np.array([0.0800, 0.1800, 6.5500])), (("2.5B", 3.0, 16.0), np.array([0.0650, 0.1700, 6.5500])), (("5B", 3.0, 2.0), np.array([0.2617, 0.2921, 6.5500])), (("5B", 3.0, 4.0), np.array([0.2176, 0.2632, 6.5500])), (("5B", 3.0, 6.0), np.array([0.1835, 0.2375, 6.5500])), (("5B", 3.0, 8.0), np.array([0.1527, 0.2119, 6.5500])), (("5B", 3.0, 10.0), np.array([0.1259, 0.1879, 6.5500])), (("5B", 3.0, 12.0), np.array([0.1042, 0.1681, 6.5500])), (("5B", 3.0, 14.0), np.array([0.0860, 0.1500, 6.5500])), (("5B", 3.0, 16.0), np.array([0.0710, 0.1370, 6.5500])), (("7.5B", 3.0, 2.0), np.array([0.2616, 0.2857, 6.5500])), (("7.5B", 3.0, 4.0), np.array([0.2200, 0.2536, 6.5500])), (("7.5B", 3.0, 6.0), np.array([0.1875, 0.2258, 6.5500])), (("7.5B", 3.0, 8.0), np.array([0.1583, 0.1987, 6.5500])), (("7.5B", 3.0, 10.0), np.array([0.1343, 0.1756, 6.5500])), (("7.5B", 3.0, 12.0), np.array([0.1131, 0.1542, 6.5500])), (("7.5B", 3.0, 14.0), np.array([0.0950, 0.1360, 6.5500])), (("7.5B", 3.0, 16.0), np.array([0.0830, 0.1230, 6.5500])), (("10B", 3.0, 2.0), np.array([0.2631, 0.2801, 6.5500])), (("10B", 3.0, 4.0), np.array([0.2246, 0.2467, 6.5500])), (("10B", 3.0, 6.0), np.array([0.1933, 0.2173, 6.5500])), (("10B", 3.0, 8.0), np.array([0.1658, 0.1905, 6.5500])), (("10B", 3.0, 10.0), np.array([0.1432, 0.1675, 6.5500])), (("10B", 3.0, 12.0), np.array([0.1228, 0.1460, 6.5500])), (("10B", 3.0, 14.0), np.array([0.1065, 0.1285, 6.5500])), (("10B", 3.0, 16.0), np.array([0.0950, 0.1150, 6.5500])), (("10B", 3.0, 18.0), np.array([0.0840, 0.1000, 6.5500])), (("2.5PB", 3.0, 2.0), np.array([0.2663, 0.2756, 6.5500])), (("2.5PB", 3.0, 4.0), np.array([0.2312, 0.2405, 6.5500])), (("2.5PB", 3.0, 6.0), np.array([0.2022, 0.2101, 6.5500])), (("2.5PB", 3.0, 8.0), np.array([0.1780, 0.1833, 6.5500])), (("2.5PB", 3.0, 10.0), np.array([0.1576, 0.1600, 6.5500])), (("2.5PB", 3.0, 12.0), np.array([0.1398, 0.1395, 6.5500])), (("2.5PB", 3.0, 14.0), np.array([0.1251, 0.1218, 6.5500])), (("2.5PB", 3.0, 16.0), np.array([0.1130, 0.1070, 6.5500])), (("2.5PB", 3.0, 18.0), np.array([0.1020, 0.0930, 6.5500])), (("2.5PB", 3.0, 20.0), np.array([0.0950, 0.0830, 6.5500])), (("2.5PB", 3.0, 22.0), np.array([0.0880, 0.0730, 6.5500])), (("5PB", 3.0, 2.0), np.array([0.2708, 0.2719, 6.5500])), (("5PB", 3.0, 4.0), np.array([0.2393, 0.2361, 6.5500])), (("5PB", 3.0, 6.0), np.array([0.2122, 0.2052, 6.5500])), (("5PB", 3.0, 8.0), np.array([0.1908, 0.1799, 6.5500])), (("5PB", 3.0, 10.0), np.array([0.1718, 0.1562, 6.5500])), (("5PB", 3.0, 12.0), np.array([0.1557, 0.1356, 6.5500])), (("5PB", 3.0, 14.0), np.array([0.1431, 0.1184, 6.5500])), (("5PB", 3.0, 16.0), np.array([0.1318, 0.1024, 6.5500])), (("5PB", 3.0, 18.0), np.array([0.1228, 0.0895, 6.5500])), (("5PB", 3.0, 20.0), np.array([0.1170, 0.0800, 6.5500])), (("5PB", 3.0, 22.0), np.array([0.1120, 0.0720, 6.5500])), (("5PB", 3.0, 24.0), np.array([0.1070, 0.0640, 6.5500])), (("5PB", 3.0, 26.0), np.array([0.1040, 0.0590, 6.5500])), (("5PB", 3.0, 28.0), np.array([0.1020, 0.0540, 6.5500])), (("5PB", 3.0, 30.0), np.array([0.0990, 0.0500, 6.5500])), (("5PB", 3.0, 32.0), np.array([0.0970, 0.0450, 6.5500])), (("5PB", 3.0, 34.0), np.array([0.0950, 0.0420, 6.5500])), (("5PB", 3.0, 36.0), np.array([0.0940, 0.0400, 6.5500])), (("5PB", 3.0, 38.0), np.array([0.0920, 0.0370, 6.5500])), (("5PB", 3.0, 40.0), np.array([0.0910, 0.0340, 6.5500])), (("5PB", 3.0, 42.0), np.array([0.0900, 0.0320, 6.5500])), (("5PB", 3.0, 44.0), np.array([0.0890, 0.0300, 6.5500])), (("5PB", 3.0, 46.0), np.array([0.0880, 0.0280, 6.5500])), (("5PB", 3.0, 48.0), np.array([0.0870, 0.0250, 6.5500])), (("5PB", 3.0, 50.0), np.array([0.0860, 0.0220, 6.5500])), (("7.5PB", 3.0, 2.0), np.array([0.2777, 0.2687, 6.5500])), (("7.5PB", 3.0, 4.0), np.array([0.2520, 0.2319, 6.5500])), (("7.5PB", 3.0, 6.0), np.array([0.2311, 0.2010, 6.5500])), (("7.5PB", 3.0, 8.0), np.array([0.2149, 0.1761, 6.5500])), (("7.5PB", 3.0, 10.0), np.array([0.2005, 0.1536, 6.5500])), (("7.5PB", 3.0, 12.0), np.array([0.1903, 0.1353, 6.5500])), (("7.5PB", 3.0, 14.0), np.array([0.1824, 0.1188, 6.5500])), (("7.5PB", 3.0, 16.0), np.array([0.1765, 0.1048, 6.5500])), (("7.5PB", 3.0, 18.0), np.array([0.1730, 0.0948, 6.5500])), (("7.5PB", 3.0, 20.0), np.array([0.1702, 0.0867, 6.5500])), (("7.5PB", 3.0, 22.0), np.array([0.1677, 0.0782, 6.5500])), (("7.5PB", 3.0, 24.0), np.array([0.1658, 0.0711, 6.5500])), (("7.5PB", 3.0, 26.0), np.array([0.1642, 0.0655, 6.5500])), (("7.5PB", 3.0, 28.0), np.array([0.1632, 0.0609, 6.5500])), (("7.5PB", 3.0, 30.0), np.array([0.1621, 0.0556, 6.5500])), (("7.5PB", 3.0, 32.0), np.array([0.1612, 0.0511, 6.5500])), (("7.5PB", 3.0, 34.0), np.array([0.1608, 0.0480, 6.5500])), (("7.5PB", 3.0, 36.0), np.array([0.1590, 0.0440, 6.5500])), (("7.5PB", 3.0, 38.0), np.array([0.1580, 0.0400, 6.5500])), (("7.5PB", 3.0, 40.0), np.array([0.1580, 0.0370, 6.5500])), (("7.5PB", 3.0, 42.0), np.array([0.1570, 0.0340, 6.5500])), (("7.5PB", 3.0, 44.0), np.array([0.1570, 0.0310, 6.5500])), (("7.5PB", 3.0, 46.0), np.array([0.1570, 0.0280, 6.5500])), (("7.5PB", 3.0, 48.0), np.array([0.1560, 0.0250, 6.5500])), (("7.5PB", 3.0, 50.0), np.array([0.1560, 0.0220, 6.5500])), (("10PB", 3.0, 2.0), np.array([0.2847, 0.2670, 6.5500])), (("10PB", 3.0, 4.0), np.array([0.2660, 0.2319, 6.5500])), (("10PB", 3.0, 6.0), np.array([0.2511, 0.2031, 6.5500])), (("10PB", 3.0, 8.0), np.array([0.2387, 0.1786, 6.5500])), (("10PB", 3.0, 10.0), np.array([0.2278, 0.1565, 6.5500])), (("10PB", 3.0, 12.0), np.array([0.2206, 0.1407, 6.5500])), (("10PB", 3.0, 14.0), np.array([0.2142, 0.1250, 6.5500])), (("10PB", 3.0, 16.0), np.array([0.2092, 0.1118, 6.5500])), (("10PB", 3.0, 18.0), np.array([0.2060, 0.1020, 6.5500])), (("10PB", 3.0, 20.0), np.array([0.2030, 0.0930, 6.5500])), (("10PB", 3.0, 22.0), np.array([0.2004, 0.0847, 6.5500])), (("10PB", 3.0, 24.0), np.array([0.1982, 0.0772, 6.5500])), (("10PB", 3.0, 26.0), np.array([0.1963, 0.0708, 6.5500])), (("10PB", 3.0, 28.0), np.array([0.1950, 0.0650, 6.5500])), (("10PB", 3.0, 30.0), np.array([0.1938, 0.0599, 6.5500])), (("10PB", 3.0, 32.0), np.array([0.1926, 0.0542, 6.5500])), (("10PB", 3.0, 34.0), np.array([0.1918, 0.0503, 6.5500])), (("10PB", 3.0, 36.0), np.array([0.1900, 0.0460, 6.5500])), (("10PB", 3.0, 38.0), np.array([0.1900, 0.0420, 6.5500])), (("10PB", 3.0, 40.0), np.array([0.1890, 0.0380, 6.5500])), (("10PB", 3.0, 42.0), np.array([0.1890, 0.0340, 6.5500])), (("10PB", 3.0, 44.0), np.array([0.1880, 0.0310, 6.5500])), (("10PB", 3.0, 46.0), np.array([0.1880, 0.0280, 6.5500])), (("10PB", 3.0, 48.0), np.array([0.1880, 0.0250, 6.5500])), (("10PB", 3.0, 50.0), np.array([0.1880, 0.0220, 6.5500])), (("2.5P", 3.0, 2.0), np.array([0.2922, 0.2680, 6.5500])), (("2.5P", 3.0, 4.0), np.array([0.2792, 0.2342, 6.5500])), (("2.5P", 3.0, 6.0), np.array([0.2691, 0.2072, 6.5500])), (("2.5P", 3.0, 8.0), np.array([0.2615, 0.1845, 6.5500])), (("2.5P", 3.0, 10.0), np.array([0.2548, 0.1638, 6.5500])), (("2.5P", 3.0, 12.0), np.array([0.2498, 0.1480, 6.5500])), (("2.5P", 3.0, 14.0), np.array([0.2449, 0.1325, 6.5500])), (("2.5P", 3.0, 16.0), np.array([0.2410, 0.1198, 6.5500])), (("2.5P", 3.0, 18.0), np.array([0.2380, 0.1094, 6.5500])), (("2.5P", 3.0, 20.0), np.array([0.2354, 0.1003, 6.5500])), (("2.5P", 3.0, 22.0), np.array([0.2329, 0.0911, 6.5500])), (("2.5P", 3.0, 24.0), np.array([0.2305, 0.0832, 6.5500])), (("2.5P", 3.0, 26.0), np.array([0.2286, 0.0765, 6.5500])), (("2.5P", 3.0, 28.0), np.array([0.2268, 0.0698, 6.5500])), (("2.5P", 3.0, 30.0), np.array([0.2252, 0.0638, 6.5500])), (("2.5P", 3.0, 32.0), np.array([0.2242, 0.0587, 6.5500])), (("2.5P", 3.0, 34.0), np.array([0.2230, 0.0543, 6.5500])), (("2.5P", 3.0, 36.0), np.array([0.2220, 0.0480, 6.5500])), (("2.5P", 3.0, 38.0), np.array([0.2210, 0.0440, 6.5500])), (("2.5P", 3.0, 40.0), np.array([0.2200, 0.0400, 6.5500])), (("2.5P", 3.0, 42.0), np.array([0.2200, 0.0350, 6.5500])), (("2.5P", 3.0, 44.0), np.array([0.2190, 0.0320, 6.5500])), (("2.5P", 3.0, 46.0), np.array([0.2180, 0.0280, 6.5500])), (("5P", 3.0, 2.0), np.array([0.2997, 0.2700, 6.5500])), (("5P", 3.0, 4.0), np.array([0.2928, 0.2386, 6.5500])), (("5P", 3.0, 6.0), np.array([0.2870, 0.2135, 6.5500])), (("5P", 3.0, 8.0), np.array([0.2819, 0.1910, 6.5500])), (("5P", 3.0, 10.0), np.array([0.2772, 0.1707, 6.5500])), (("5P", 3.0, 12.0), np.array([0.2739, 0.1539, 6.5500])), (("5P", 3.0, 14.0), np.array([0.2707, 0.1397, 6.5500])), (("5P", 3.0, 16.0), np.array([0.2680, 0.1272, 6.5500])), (("5P", 3.0, 18.0), np.array([0.2657, 0.1163, 6.5500])), (("5P", 3.0, 20.0), np.array([0.2639, 0.1074, 6.5500])), (("5P", 3.0, 22.0), np.array([0.2620, 0.0978, 6.5500])), (("5P", 3.0, 24.0), np.array([0.2602, 0.0891, 6.5500])), (("5P", 3.0, 26.0), np.array([0.2590, 0.0822, 6.5500])), (("5P", 3.0, 28.0), np.array([0.2579, 0.0750, 6.5500])), (("5P", 3.0, 30.0), np.array([0.2568, 0.0690, 6.5500])), (("5P", 3.0, 32.0), np.array([0.2557, 0.0630, 6.5500])), (("5P", 3.0, 34.0), np.array([0.2550, 0.0560, 6.5500])), (("5P", 3.0, 36.0), np.array([0.2540, 0.0510, 6.5500])), (("5P", 3.0, 38.0), np.array([0.2530, 0.0460, 6.5500])), (("5P", 3.0, 40.0), np.array([0.2520, 0.0410, 6.5500])), (("5P", 3.0, 42.0), np.array([0.2510, 0.0360, 6.5500])), (("7.5P", 3.0, 2.0), np.array([0.3088, 0.2740, 6.5500])), (("7.5P", 3.0, 4.0), np.array([0.3072, 0.2448, 6.5500])), (("7.5P", 3.0, 6.0), np.array([0.3057, 0.2208, 6.5500])), (("7.5P", 3.0, 8.0), np.array([0.3037, 0.1981, 6.5500])), (("7.5P", 3.0, 10.0), np.array([0.3020, 0.1794, 6.5500])), (("7.5P", 3.0, 12.0), np.array([0.3003, 0.1618, 6.5500])), (("7.5P", 3.0, 14.0), np.array([0.2992, 0.1475, 6.5500])), (("7.5P", 3.0, 16.0), np.array([0.2981, 0.1356, 6.5500])), (("7.5P", 3.0, 18.0), np.array([0.2969, 0.1239, 6.5500])), (("7.5P", 3.0, 20.0), np.array([0.2961, 0.1151, 6.5500])), (("7.5P", 3.0, 22.0), np.array([0.2953, 0.1057, 6.5500])), (("7.5P", 3.0, 24.0), np.array([0.2944, 0.0967, 6.5500])), (("7.5P", 3.0, 26.0), np.array([0.2938, 0.0892, 6.5500])), (("7.5P", 3.0, 28.0), np.array([0.2930, 0.0812, 6.5500])), (("7.5P", 3.0, 30.0), np.array([0.2922, 0.0750, 6.5500])), (("7.5P", 3.0, 32.0), np.array([0.2920, 0.0670, 6.5500])), (("7.5P", 3.0, 34.0), np.array([0.2910, 0.0600, 6.5500])), (("7.5P", 3.0, 36.0), np.array([0.2900, 0.0540, 6.5500])), (("7.5P", 3.0, 38.0), np.array([0.2890, 0.0480, 6.5500])), (("10P", 3.0, 2.0), np.array([0.3170, 0.2790, 6.5500])), (("10P", 3.0, 4.0), np.array([0.3214, 0.2517, 6.5500])), (("10P", 3.0, 6.0), np.array([0.3243, 0.2293, 6.5500])), (("10P", 3.0, 8.0), np.array([0.3269, 0.2075, 6.5500])), (("10P", 3.0, 10.0), np.array([0.3286, 0.1889, 6.5500])), (("10P", 3.0, 12.0), np.array([0.3301, 0.1715, 6.5500])), (("10P", 3.0, 14.0), np.array([0.3309, 0.1572, 6.5500])), (("10P", 3.0, 16.0), np.array([0.3320, 0.1456, 6.5500])), (("10P", 3.0, 18.0), np.array([0.3329, 0.1332, 6.5500])), (("10P", 3.0, 20.0), np.array([0.3332, 0.1240, 6.5500])), (("10P", 3.0, 22.0), np.array([0.3340, 0.1146, 6.5500])), (("10P", 3.0, 24.0), np.array([0.3341, 0.1055, 6.5500])), (("10P", 3.0, 26.0), np.array([0.3343, 0.0978, 6.5500])), (("10P", 3.0, 28.0), np.array([0.3350, 0.0880, 6.5500])), (("10P", 3.0, 30.0), np.array([0.3350, 0.0810, 6.5500])), (("10P", 3.0, 32.0), np.array([0.3350, 0.0720, 6.5500])), (("10P", 3.0, 34.0), np.array([0.3350, 0.0630, 6.5500])), (("2.5RP", 3.0, 2.0), np.array([0.3272, 0.2861, 6.5500])), (("2.5RP", 3.0, 4.0), np.array([0.3400, 0.2624, 6.5500])), (("2.5RP", 3.0, 6.0), np.array([0.3501, 0.2425, 6.5500])), (("2.5RP", 3.0, 8.0), np.array([0.3598, 0.2233, 6.5500])), (("2.5RP", 3.0, 10.0), np.array([0.3681, 0.2054, 6.5500])), (("2.5RP", 3.0, 12.0), np.array([0.3754, 0.1898, 6.5500])), (("2.5RP", 3.0, 14.0), np.array([0.3818, 0.1758, 6.5500])), (("2.5RP", 3.0, 16.0), np.array([0.3876, 0.1629, 6.5500])), (("2.5RP", 3.0, 18.0), np.array([0.3929, 0.1506, 6.5500])), (("2.5RP", 3.0, 20.0), np.array([0.3969, 0.1413, 6.5500])), (("2.5RP", 3.0, 22.0), np.array([0.4018, 0.1304, 6.5500])), (("2.5RP", 3.0, 24.0), np.array([0.4050, 0.1220, 6.5500])), (("2.5RP", 3.0, 26.0), np.array([0.4080, 0.1140, 6.5500])), (("2.5RP", 3.0, 28.0), np.array([0.4140, 0.1020, 6.5500])), (("2.5RP", 3.0, 30.0), np.array([0.4170, 0.0940, 6.5500])), (("5RP", 3.0, 2.0), np.array([0.3370, 0.2940, 6.5500])), (("5RP", 3.0, 4.0), np.array([0.3586, 0.2742, 6.5500])), (("5RP", 3.0, 6.0), np.array([0.3765, 0.2569, 6.5500])), (("5RP", 3.0, 8.0), np.array([0.3930, 0.2395, 6.5500])), (("5RP", 3.0, 10.0), np.array([0.4073, 0.2235, 6.5500])), (("5RP", 3.0, 12.0), np.array([0.4199, 0.2089, 6.5500])), (("5RP", 3.0, 14.0), np.array([0.4313, 0.1944, 6.5500])), (("5RP", 3.0, 16.0), np.array([0.4418, 0.1809, 6.5500])), (("5RP", 3.0, 18.0), np.array([0.4503, 0.1695, 6.5500])), (("5RP", 3.0, 20.0), np.array([0.4577, 0.1593, 6.5500])), (("5RP", 3.0, 22.0), np.array([0.4670, 0.1450, 6.5500])), (("5RP", 3.0, 24.0), np.array([0.4720, 0.1360, 6.5500])), (("5RP", 3.0, 26.0), np.array([0.4790, 0.1270, 6.5500])), (("7.5RP", 3.0, 2.0), np.array([0.3450, 0.3001, 6.5500])), (("7.5RP", 3.0, 4.0), np.array([0.3739, 0.2851, 6.5500])), (("7.5RP", 3.0, 6.0), np.array([0.3990, 0.2708, 6.5500])), (("7.5RP", 3.0, 8.0), np.array([0.4234, 0.2556, 6.5500])), (("7.5RP", 3.0, 10.0), np.array([0.4445, 0.2419, 6.5500])), (("7.5RP", 3.0, 12.0), np.array([0.4654, 0.2273, 6.5500])), (("7.5RP", 3.0, 14.0), np.array([0.4831, 0.2140, 6.5500])), (("7.5RP", 3.0, 16.0), np.array([0.4991, 0.2011, 6.5500])), (("7.5RP", 3.0, 18.0), np.array([0.5130, 0.1893, 6.5500])), (("7.5RP", 3.0, 20.0), np.array([0.5280, 0.1780, 6.5500])), (("7.5RP", 3.0, 22.0), np.array([0.5420, 0.1650, 6.5500])), (("10RP", 3.0, 2.0), np.array([0.3526, 0.3068, 6.5500])), (("10RP", 3.0, 4.0), np.array([0.3889, 0.2969, 6.5500])), (("10RP", 3.0, 6.0), np.array([0.4218, 0.2864, 6.5500])), (("10RP", 3.0, 8.0), np.array([0.4552, 0.2741, 6.5500])), (("10RP", 3.0, 10.0), np.array([0.4851, 0.2618, 6.5500])), (("10RP", 3.0, 12.0), np.array([0.5139, 0.2489, 6.5500])), (("10RP", 3.0, 14.0), np.array([0.5380, 0.2369, 6.5500])), (("10RP", 3.0, 16.0), np.array([0.5628, 0.2241, 6.5500])), (("10RP", 3.0, 18.0), np.array([0.5840, 0.2120, 6.5500])), (("10RP", 3.0, 20.0), np.array([0.6020, 0.2000, 6.5500])), (("2.5R", 3.0, 2.0), np.array([0.3591, 0.3130, 6.5500])), (("2.5R", 3.0, 4.0), np.array([0.4021, 0.3076, 6.5500])), (("2.5R", 3.0, 6.0), np.array([0.4409, 0.3009, 6.5500])), (("2.5R", 3.0, 8.0), np.array([0.4821, 0.2918, 6.5500])), (("2.5R", 3.0, 10.0), np.array([0.5191, 0.2811, 6.5500])), (("2.5R", 3.0, 12.0), np.array([0.5536, 0.2691, 6.5500])), (("2.5R", 3.0, 14.0), np.array([0.5828, 0.2579, 6.5500])), (("2.5R", 3.0, 16.0), np.array([0.6116, 0.2456, 6.5500])), (("2.5R", 3.0, 18.0), np.array([0.6400, 0.2320, 6.5500])), (("2.5R", 3.0, 20.0), np.array([0.6670, 0.2170, 6.5500])), (("5R", 3.0, 2.0), np.array([0.3645, 0.3190, 6.5500])), (("5R", 3.0, 4.0), np.array([0.4148, 0.3190, 6.5500])), (("5R", 3.0, 6.0), np.array([0.4592, 0.3168, 6.5500])), (("5R", 3.0, 8.0), np.array([0.5064, 0.3114, 6.5500])), (("5R", 3.0, 10.0), np.array([0.5500, 0.3024, 6.5500])), (("5R", 3.0, 12.0), np.array([0.5884, 0.2904, 6.5500])), (("5R", 3.0, 14.0), np.array([0.6204, 0.2789, 6.5500])), (("5R", 3.0, 16.0), np.array([0.6520, 0.2660, 6.5500])), (("5R", 3.0, 18.0), np.array([0.6820, 0.2510, 6.5500])), (("5R", 3.0, 20.0), np.array([0.7100, 0.2340, 6.5500])), (("7.5R", 3.0, 2.0), np.array([0.3690, 0.3248, 6.5500])), (("7.5R", 3.0, 4.0), np.array([0.4240, 0.3302, 6.5500])), (("7.5R", 3.0, 6.0), np.array([0.4738, 0.3316, 6.5500])), (("7.5R", 3.0, 8.0), np.array([0.5251, 0.3297, 6.5500])), (("7.5R", 3.0, 10.0), np.array([0.5730, 0.3240, 6.5500])), (("7.5R", 3.0, 12.0), np.array([0.6158, 0.3129, 6.5500])), (("7.5R", 3.0, 14.0), np.array([0.6492, 0.3012, 6.5500])), (("7.5R", 3.0, 16.0), np.array([0.6817, 0.2872, 6.5500])), (("7.5R", 3.0, 18.0), np.array([0.7140, 0.2710, 6.5500])), (("7.5R", 3.0, 20.0), np.array([0.7470, 0.2510, 6.5500])), (("10R", 3.0, 2.0), np.array([0.3728, 0.3314, 6.5500])), (("10R", 3.0, 4.0), np.array([0.4308, 0.3412, 6.5500])), (("10R", 3.0, 6.0), np.array([0.4854, 0.3467, 6.5500])), (("10R", 3.0, 8.0), np.array([0.5393, 0.3477, 6.5500])), (("10R", 3.0, 10.0), np.array([0.5871, 0.3440, 6.5500])), (("10R", 3.0, 12.0), np.array([0.6322, 0.3361, 6.5500])), (("10R", 3.0, 14.0), np.array([0.6703, 0.3249, 6.5500])), (("10R", 3.0, 16.0), np.array([0.7030, 0.3140, 6.5500])), (("10R", 3.0, 18.0), np.array([0.7390, 0.3020, 6.5500])), (("10R", 3.0, 20.0), np.array([0.7780, 0.2860, 6.5500])), (("2.5YR", 3.0, 2.0), np.array([0.3757, 0.3391, 6.5500])), (("2.5YR", 3.0, 4.0), np.array([0.4360, 0.3563, 6.5500])), (("2.5YR", 3.0, 6.0), np.array([0.4954, 0.3692, 6.5500])), (("2.5YR", 3.0, 8.0), np.array([0.5475, 0.3771, 6.5500])), (("2.5YR", 3.0, 10.0), np.array([0.5941, 0.3818, 6.5500])), (("2.5YR", 3.0, 12.0), np.array([0.6370, 0.3810, 6.5500])), (("2.5YR", 3.0, 14.0), np.array([0.6740, 0.3790, 6.5500])), (("2.5YR", 3.0, 16.0), np.array([0.7080, 0.3740, 6.5500])), (("5YR", 3.0, 2.0), np.array([0.3771, 0.3476, 6.5500])), (("5YR", 3.0, 4.0), np.array([0.4376, 0.3715, 6.5500])), (("5YR", 3.0, 6.0), np.array([0.4966, 0.3908, 6.5500])), (("5YR", 3.0, 8.0), np.array([0.5456, 0.4040, 6.5500])), (("5YR", 3.0, 10.0), np.array([0.5900, 0.4140, 6.5500])), (("5YR", 3.0, 12.0), np.array([0.6290, 0.4230, 6.5500])), (("7.5YR", 3.0, 2.0), np.array([0.3771, 0.3549, 6.5500])), (("7.5YR", 3.0, 4.0), np.array([0.4378, 0.3865, 6.5500])), (("7.5YR", 3.0, 6.0), np.array([0.4930, 0.4116, 6.5500])), (("7.5YR", 3.0, 8.0), np.array([0.5390, 0.4306, 6.5500])), (("7.5YR", 3.0, 10.0), np.array([0.5810, 0.4480, 6.5500])), (("10YR", 3.0, 2.0), np.array([0.3747, 0.3630, 6.5500])), (("10YR", 3.0, 4.0), np.array([0.4341, 0.4018, 6.5500])), (("10YR", 3.0, 6.0), np.array([0.4872, 0.4326, 6.5500])), (("10YR", 3.0, 8.0), np.array([0.5305, 0.4559, 6.5500])), (("10YR", 3.0, 10.0), np.array([0.5720, 0.4750, 6.5500])), (("2.5Y", 3.0, 2.0), np.array([0.3703, 0.3700, 6.5500])), (("2.5Y", 3.0, 4.0), np.array([0.4277, 0.4166, 6.5500])), (("2.5Y", 3.0, 6.0), np.array([0.4784, 0.4531, 6.5500])), (("2.5Y", 3.0, 8.0), np.array([0.5210, 0.4820, 6.5500])), (("2.5Y", 3.0, 10.0), np.array([0.5600, 0.5050, 6.5500])), (("5Y", 3.0, 2.0), np.array([0.3646, 0.3748, 6.5500])), (("5Y", 3.0, 4.0), np.array([0.4191, 0.4283, 6.5500])), (("5Y", 3.0, 6.0), np.array([0.4670, 0.4711, 6.5500])), (("5Y", 3.0, 8.0), np.array([0.5090, 0.5090, 6.5500])), (("7.5Y", 3.0, 2.0), np.array([0.3589, 0.3778, 6.5500])), (("7.5Y", 3.0, 4.0), np.array([0.4086, 0.4379, 6.5500])), (("7.5Y", 3.0, 6.0), np.array([0.4526, 0.4889, 6.5500])), (("7.5Y", 3.0, 8.0), np.array([0.4920, 0.5350, 6.5500])), (("10Y", 4.0, 2.0), np.array([0.3476, 0.3732, 12.0000])), (("10Y", 4.0, 4.0), np.array([0.3871, 0.4321, 12.0000])), (("10Y", 4.0, 6.0), np.array([0.4190, 0.4795, 12.0000])), (("10Y", 4.0, 8.0), np.array([0.4430, 0.5153, 12.0000])), (("10Y", 4.0, 10.0), np.array([0.4620, 0.5430, 12.0000])), (("10Y", 4.0, 12.0), np.array([0.4730, 0.5620, 12.0000])), (("2.5GY", 4.0, 2.0), np.array([0.3382, 0.3706, 12.0000])), (("2.5GY", 4.0, 4.0), np.array([0.3708, 0.4329, 12.0000])), (("2.5GY", 4.0, 6.0), np.array([0.3968, 0.4857, 12.0000])), (("2.5GY", 4.0, 8.0), np.array([0.4174, 0.5300, 12.0000])), (("2.5GY", 4.0, 10.0), np.array([0.4330, 0.5680, 12.0000])), (("2.5GY", 4.0, 12.0), np.array([0.4430, 0.5940, 12.0000])), (("5GY", 4.0, 2.0), np.array([0.3312, 0.3678, 12.0000])), (("5GY", 4.0, 4.0), np.array([0.3538, 0.4284, 12.0000])), (("5GY", 4.0, 6.0), np.array([0.3718, 0.4852, 12.0000])), (("5GY", 4.0, 8.0), np.array([0.3868, 0.5384, 12.0000])), (("5GY", 4.0, 10.0), np.array([0.3983, 0.5850, 12.0000])), (("5GY", 4.0, 12.0), np.array([0.4070, 0.6190, 12.0000])), (("5GY", 4.0, 14.0), np.array([0.4150, 0.6590, 12.0000])), (("7.5GY", 4.0, 2.0), np.array([0.3185, 0.3604, 12.0000])), (("7.5GY", 4.0, 4.0), np.array([0.3281, 0.4157, 12.0000])), (("7.5GY", 4.0, 6.0), np.array([0.3355, 0.4739, 12.0000])), (("7.5GY", 4.0, 8.0), np.array([0.3400, 0.5348, 12.0000])), (("7.5GY", 4.0, 10.0), np.array([0.3395, 0.5913, 12.0000])), (("7.5GY", 4.0, 12.0), np.array([0.3348, 0.6468, 12.0000])), (("7.5GY", 4.0, 14.0), np.array([0.3270, 0.6980, 12.0000])), (("7.5GY", 4.0, 16.0), np.array([0.3150, 0.7570, 12.0000])), (("7.5GY", 4.0, 18.0), np.array([0.3030, 0.8090, 12.0000])), (("10GY", 4.0, 2.0), np.array([0.3109, 0.3550, 12.0000])), (("10GY", 4.0, 4.0), np.array([0.3100, 0.4018, 12.0000])), (("10GY", 4.0, 6.0), np.array([0.3069, 0.4550, 12.0000])), (("10GY", 4.0, 8.0), np.array([0.3008, 0.5095, 12.0000])), (("10GY", 4.0, 10.0), np.array([0.2908, 0.5672, 12.0000])), (("10GY", 4.0, 12.0), np.array([0.2758, 0.6282, 12.0000])), (("10GY", 4.0, 14.0), np.array([0.2590, 0.6858, 12.0000])), (("10GY", 4.0, 16.0), np.array([0.2422, 0.7360, 12.0000])), (("10GY", 4.0, 18.0), np.array([0.2210, 0.7930, 12.0000])), (("10GY", 4.0, 20.0), np.array([0.1920, 0.8600, 12.0000])), (("10GY", 4.0, 22.0), np.array([0.1650, 0.9170, 12.0000])), (("10GY", 4.0, 24.0), np.array([0.1420, 0.9640, 12.0000])), (("10GY", 4.0, 26.0), np.array([0.1060, 1.0280, 12.0000])), (("10GY", 4.0, 28.0), np.array([0.0580, 1.1000, 12.0000])), (("2.5G", 4.0, 2.0), np.array([0.3012, 0.3470, 12.0000])), (("2.5G", 4.0, 4.0), np.array([0.2891, 0.3821, 12.0000])), (("2.5G", 4.0, 6.0), np.array([0.2735, 0.4215, 12.0000])), (("2.5G", 4.0, 8.0), np.array([0.2561, 0.4597, 12.0000])), (("2.5G", 4.0, 10.0), np.array([0.2355, 0.5006, 12.0000])), (("2.5G", 4.0, 12.0), np.array([0.2128, 0.5425, 12.0000])), (("2.5G", 4.0, 14.0), np.array([0.1909, 0.5779, 12.0000])), (("2.5G", 4.0, 16.0), np.array([0.1682, 0.6111, 12.0000])), (("2.5G", 4.0, 18.0), np.array([0.1446, 0.6431, 12.0000])), (("2.5G", 4.0, 20.0), np.array([0.1230, 0.6706, 12.0000])), (("2.5G", 4.0, 22.0), np.array([0.1009, 0.6975, 12.0000])), (("2.5G", 4.0, 24.0), np.array([0.0760, 0.7250, 12.0000])), (("2.5G", 4.0, 26.0), np.array([0.0528, 0.7502, 12.0000])), (("2.5G", 4.0, 28.0), np.array([0.0280, 0.7800, 12.0000])), (("2.5G", 4.0, 30.0), np.array([-0.0050, 0.8160, 12.0000])), (("5G", 4.0, 2.0), np.array([0.2959, 0.3417, 12.0000])), (("5G", 4.0, 4.0), np.array([0.2781, 0.3704, 12.0000])), (("5G", 4.0, 6.0), np.array([0.2581, 0.3992, 12.0000])), (("5G", 4.0, 8.0), np.array([0.2359, 0.4266, 12.0000])), (("5G", 4.0, 10.0), np.array([0.2115, 0.4532, 12.0000])), (("5G", 4.0, 12.0), np.array([0.1843, 0.4807, 12.0000])), (("5G", 4.0, 14.0), np.array([0.1627, 0.5015, 12.0000])), (("5G", 4.0, 16.0), np.array([0.1402, 0.5214, 12.0000])), (("5G", 4.0, 18.0), np.array([0.1188, 0.5400, 12.0000])), (("5G", 4.0, 20.0), np.array([0.1018, 0.5543, 12.0000])), (("5G", 4.0, 22.0), np.array([0.0841, 0.5684, 12.0000])), (("5G", 4.0, 24.0), np.array([0.0614, 0.5857, 12.0000])), (("5G", 4.0, 26.0), np.array([0.0407, 0.6010, 12.0000])), (("5G", 4.0, 28.0), np.array([0.0200, 0.6180, 12.0000])), (("5G", 4.0, 30.0), np.array([-0.0030, 0.6320, 12.0000])), (("7.5G", 4.0, 2.0), np.array([0.2919, 0.3371, 12.0000])), (("7.5G", 4.0, 4.0), np.array([0.2702, 0.3602, 12.0000])), (("7.5G", 4.0, 6.0), np.array([0.2467, 0.3822, 12.0000])), (("7.5G", 4.0, 8.0), np.array([0.2232, 0.4022, 12.0000])), (("7.5G", 4.0, 10.0), np.array([0.1989, 0.4219, 12.0000])), (("7.5G", 4.0, 12.0), np.array([0.1706, 0.4419, 12.0000])), (("7.5G", 4.0, 14.0), np.array([0.1500, 0.4562, 12.0000])), (("7.5G", 4.0, 16.0), np.array([0.1293, 0.4703, 12.0000])), (("7.5G", 4.0, 18.0), np.array([0.1086, 0.4842, 12.0000])), (("7.5G", 4.0, 20.0), np.array([0.0928, 0.4942, 12.0000])), (("7.5G", 4.0, 22.0), np.array([0.0770, 0.5040, 12.0000])), (("7.5G", 4.0, 24.0), np.array([0.0581, 0.5151, 12.0000])), (("7.5G", 4.0, 26.0), np.array([0.0392, 0.5258, 12.0000])), (("7.5G", 4.0, 28.0), np.array([0.0200, 0.5360, 12.0000])), (("7.5G", 4.0, 30.0), np.array([0.0020, 0.5460, 12.0000])), (("10G", 4.0, 2.0), np.array([0.2880, 0.3327, 12.0000])), (("10G", 4.0, 4.0), np.array([0.2628, 0.3498, 12.0000])), (("10G", 4.0, 6.0), np.array([0.2374, 0.3655, 12.0000])), (("10G", 4.0, 8.0), np.array([0.2124, 0.3799, 12.0000])), (("10G", 4.0, 10.0), np.array([0.1876, 0.3933, 12.0000])), (("10G", 4.0, 12.0), np.array([0.1602, 0.4070, 12.0000])), (("10G", 4.0, 14.0), np.array([0.1398, 0.4168, 12.0000])), (("10G", 4.0, 16.0), np.array([0.1212, 0.4245, 12.0000])), (("10G", 4.0, 18.0), np.array([0.1006, 0.4330, 12.0000])), (("10G", 4.0, 20.0), np.array([0.0850, 0.4388, 12.0000])), (("10G", 4.0, 22.0), np.array([0.0702, 0.4440, 12.0000])), (("10G", 4.0, 24.0), np.array([0.0553, 0.4492, 12.0000])), (("10G", 4.0, 26.0), np.array([0.0400, 0.4545, 12.0000])), (("10G", 4.0, 28.0), np.array([0.0230, 0.4600, 12.0000])), (("10G", 4.0, 30.0), np.array([0.0080, 0.4650, 12.0000])), (("2.5BG", 4.0, 2.0), np.array([0.2840, 0.3270, 12.0000])), (("2.5BG", 4.0, 4.0), np.array([0.2552, 0.3375, 12.0000])), (("2.5BG", 4.0, 6.0), np.array([0.2278, 0.3463, 12.0000])), (("2.5BG", 4.0, 8.0), np.array([0.2006, 0.3540, 12.0000])), (("2.5BG", 4.0, 10.0), np.array([0.1738, 0.3600, 12.0000])), (("2.5BG", 4.0, 12.0), np.array([0.1492, 0.3649, 12.0000])), (("2.5BG", 4.0, 14.0), np.array([0.1283, 0.3688, 12.0000])), (("2.5BG", 4.0, 16.0), np.array([0.1102, 0.3720, 12.0000])), (("2.5BG", 4.0, 18.0), np.array([0.0915, 0.3754, 12.0000])), (("2.5BG", 4.0, 20.0), np.array([0.0768, 0.3773, 12.0000])), (("2.5BG", 4.0, 22.0), np.array([0.0636, 0.3788, 12.0000])), (("2.5BG", 4.0, 24.0), np.array([0.0510, 0.3800, 12.0000])), (("2.5BG", 4.0, 26.0), np.array([0.0380, 0.3820, 12.0000])), (("2.5BG", 4.0, 28.0), np.array([0.0250, 0.3830, 12.0000])), (("5BG", 4.0, 2.0), np.array([0.2799, 0.3208, 12.0000])), (("5BG", 4.0, 4.0), np.array([0.2480, 0.3232, 12.0000])), (("5BG", 4.0, 6.0), np.array([0.2182, 0.3240, 12.0000])), (("5BG", 4.0, 8.0), np.array([0.1890, 0.3234, 12.0000])), (("5BG", 4.0, 10.0), np.array([0.1618, 0.3219, 12.0000])), (("5BG", 4.0, 12.0), np.array([0.1379, 0.3198, 12.0000])), (("5BG", 4.0, 14.0), np.array([0.1170, 0.3170, 12.0000])), (("5BG", 4.0, 16.0), np.array([0.0992, 0.3141, 12.0000])), (("5BG", 4.0, 18.0), np.array([0.0828, 0.3108, 12.0000])), (("5BG", 4.0, 20.0), np.array([0.0675, 0.3075, 12.0000])), (("5BG", 4.0, 22.0), np.array([0.0560, 0.3050, 12.0000])), (("5BG", 4.0, 24.0), np.array([0.0470, 0.3040, 12.0000])), (("5BG", 4.0, 26.0), np.array([0.0360, 0.3030, 12.0000])), (("7.5BG", 4.0, 2.0), np.array([0.2764, 0.3148, 12.0000])), (("7.5BG", 4.0, 4.0), np.array([0.2429, 0.3108, 12.0000])), (("7.5BG", 4.0, 6.0), np.array([0.2113, 0.3052, 12.0000])), (("7.5BG", 4.0, 8.0), np.array([0.1815, 0.2985, 12.0000])), (("7.5BG", 4.0, 10.0), np.array([0.1540, 0.2910, 12.0000])), (("7.5BG", 4.0, 12.0), np.array([0.1298, 0.2840, 12.0000])), (("7.5BG", 4.0, 14.0), np.array([0.1092, 0.2774, 12.0000])), (("7.5BG", 4.0, 16.0), np.array([0.0922, 0.2718, 12.0000])), (("7.5BG", 4.0, 18.0), np.array([0.0768, 0.2667, 12.0000])), (("7.5BG", 4.0, 20.0), np.array([0.0650, 0.2620, 12.0000])), (("7.5BG", 4.0, 22.0), np.array([0.0540, 0.2580, 12.0000])), (("7.5BG", 4.0, 24.0), np.array([0.0450, 0.2550, 12.0000])), (("10BG", 4.0, 2.0), np.array([0.2740, 0.3091, 12.0000])), (("10BG", 4.0, 4.0), np.array([0.2384, 0.2984, 12.0000])), (("10BG", 4.0, 6.0), np.array([0.2065, 0.2863, 12.0000])), (("10BG", 4.0, 8.0), np.array([0.1760, 0.2730, 12.0000])), (("10BG", 4.0, 10.0), np.array([0.1480, 0.2600, 12.0000])), (("10BG", 4.0, 12.0), np.array([0.1248, 0.2484, 12.0000])), (("10BG", 4.0, 14.0), np.array([0.1033, 0.2376, 12.0000])), (("10BG", 4.0, 16.0), np.array([0.0888, 0.2298, 12.0000])), (("10BG", 4.0, 18.0), np.array([0.0730, 0.2210, 12.0000])), (("10BG", 4.0, 20.0), np.array([0.0620, 0.2140, 12.0000])), (("10BG", 4.0, 22.0), np.array([0.0510, 0.2070, 12.0000])), (("2.5B", 4.0, 2.0), np.array([0.2727, 0.3038, 12.0000])), (("2.5B", 4.0, 4.0), np.array([0.2360, 0.2872, 12.0000])), (("2.5B", 4.0, 6.0), np.array([0.2048, 0.2708, 12.0000])), (("2.5B", 4.0, 8.0), np.array([0.1737, 0.2524, 12.0000])), (("2.5B", 4.0, 10.0), np.array([0.1463, 0.2354, 12.0000])), (("2.5B", 4.0, 12.0), np.array([0.1247, 0.2209, 12.0000])), (("2.5B", 4.0, 14.0), np.array([0.1027, 0.2057, 12.0000])), (("2.5B", 4.0, 16.0), np.array([0.0900, 0.1973, 12.0000])), (("2.5B", 4.0, 18.0), np.array([0.0730, 0.1840, 12.0000])), (("2.5B", 4.0, 20.0), np.array([0.0620, 0.1770, 12.0000])), (("5B", 4.0, 2.0), np.array([0.2723, 0.2992, 12.0000])), (("5B", 4.0, 4.0), np.array([0.2363, 0.2782, 12.0000])), (("5B", 4.0, 6.0), np.array([0.2060, 0.2572, 12.0000])), (("5B", 4.0, 8.0), np.array([0.1759, 0.2345, 12.0000])), (("5B", 4.0, 10.0), np.array([0.1512, 0.2148, 12.0000])), (("5B", 4.0, 12.0), np.array([0.1299, 0.1963, 12.0000])), (("5B", 4.0, 14.0), np.array([0.1098, 0.1785, 12.0000])), (("5B", 4.0, 16.0), np.array([0.0940, 0.1630, 12.0000])), (("5B", 4.0, 18.0), np.array([0.0790, 0.1500, 12.0000])), (("7.5B", 4.0, 2.0), np.array([0.2733, 0.2947, 12.0000])), (("7.5B", 4.0, 4.0), np.array([0.2388, 0.2704, 12.0000])), (("7.5B", 4.0, 6.0), np.array([0.2102, 0.2470, 12.0000])), (("7.5B", 4.0, 8.0), np.array([0.1821, 0.2232, 12.0000])), (("7.5B", 4.0, 10.0), np.array([0.1601, 0.2028, 12.0000])), (("7.5B", 4.0, 12.0), np.array([0.1393, 0.1837, 12.0000])), (("7.5B", 4.0, 14.0), np.array([0.1204, 0.1655, 12.0000])), (("7.5B", 4.0, 16.0), np.array([0.1020, 0.1490, 12.0000])), (("7.5B", 4.0, 18.0), np.array([0.0910, 0.1380, 12.0000])), (("10B", 4.0, 2.0), np.array([0.2753, 0.2910, 12.0000])), (("10B", 4.0, 4.0), np.array([0.2429, 0.2648, 12.0000])), (("10B", 4.0, 6.0), np.array([0.2157, 0.2407, 12.0000])), (("10B", 4.0, 8.0), np.array([0.1893, 0.2160, 12.0000])), (("10B", 4.0, 10.0), np.array([0.1681, 0.1954, 12.0000])), (("10B", 4.0, 12.0), np.array([0.1487, 0.1760, 12.0000])), (("10B", 4.0, 14.0), np.array([0.1310, 0.1580, 12.0000])), (("10B", 4.0, 16.0), np.array([0.1155, 0.1416, 12.0000])), (("10B", 4.0, 18.0), np.array([0.1030, 0.1280, 12.0000])), (("10B", 4.0, 20.0), np.array([0.0920, 0.1170, 12.0000])), (("2.5PB", 4.0, 2.0), np.array([0.2782, 0.2876, 12.0000])), (("2.5PB", 4.0, 4.0), np.array([0.2487, 0.2597, 12.0000])), (("2.5PB", 4.0, 6.0), np.array([0.2235, 0.2343, 12.0000])), (("2.5PB", 4.0, 8.0), np.array([0.1995, 0.2094, 12.0000])), (("2.5PB", 4.0, 10.0), np.array([0.1805, 0.1888, 12.0000])), (("2.5PB", 4.0, 12.0), np.array([0.1634, 0.1698, 12.0000])), (("2.5PB", 4.0, 14.0), np.array([0.1473, 0.1513, 12.0000])), (("2.5PB", 4.0, 16.0), np.array([0.1336, 0.1349, 12.0000])), (("2.5PB", 4.0, 18.0), np.array([0.1218, 0.1208, 12.0000])), (("2.5PB", 4.0, 20.0), np.array([0.1120, 0.1080, 12.0000])), (("2.5PB", 4.0, 22.0), np.array([0.1040, 0.0960, 12.0000])), (("2.5PB", 4.0, 24.0), np.array([0.0980, 0.0890, 12.0000])), (("5PB", 4.0, 2.0), np.array([0.2816, 0.2842, 12.0000])), (("5PB", 4.0, 4.0), np.array([0.2562, 0.2560, 12.0000])), (("5PB", 4.0, 6.0), np.array([0.2325, 0.2300, 12.0000])), (("5PB", 4.0, 8.0), np.array([0.2103, 0.2050, 12.0000])), (("5PB", 4.0, 10.0), np.array([0.1925, 0.1843, 12.0000])), (("5PB", 4.0, 12.0), np.array([0.1773, 0.1659, 12.0000])), (("5PB", 4.0, 14.0), np.array([0.1627, 0.1479, 12.0000])), (("5PB", 4.0, 16.0), np.array([0.1504, 0.1317, 12.0000])), (("5PB", 4.0, 18.0), np.array([0.1392, 0.1167, 12.0000])), (("5PB", 4.0, 20.0), np.array([0.1288, 0.1027, 12.0000])), (("5PB", 4.0, 22.0), np.array([0.1220, 0.0920, 12.0000])), (("5PB", 4.0, 24.0), np.array([0.1180, 0.0840, 12.0000])), (("5PB", 4.0, 26.0), np.array([0.1150, 0.0780, 12.0000])), (("5PB", 4.0, 28.0), np.array([0.1110, 0.0730, 12.0000])), (("5PB", 4.0, 30.0), np.array([0.1080, 0.0680, 12.0000])), (("5PB", 4.0, 32.0), np.array([0.1060, 0.0640, 12.0000])), (("5PB", 4.0, 34.0), np.array([0.1040, 0.0600, 12.0000])), (("5PB", 4.0, 36.0), np.array([0.1020, 0.0550, 12.0000])), (("5PB", 4.0, 38.0), np.array([0.0980, 0.0480, 12.0000])), (("5PB", 4.0, 40.0), np.array([0.0960, 0.0440, 12.0000])), (("7.5PB", 4.0, 2.0), np.array([0.2861, 0.2819, 12.0000])), (("7.5PB", 4.0, 4.0), np.array([0.2657, 0.2528, 12.0000])), (("7.5PB", 4.0, 6.0), np.array([0.2471, 0.2266, 12.0000])), (("7.5PB", 4.0, 8.0), np.array([0.2304, 0.2023, 12.0000])), (("7.5PB", 4.0, 10.0), np.array([0.2158, 0.1811, 12.0000])), (("7.5PB", 4.0, 12.0), np.array([0.2037, 0.1629, 12.0000])), (("7.5PB", 4.0, 14.0), np.array([0.1941, 0.1468, 12.0000])), (("7.5PB", 4.0, 16.0), np.array([0.1861, 0.1316, 12.0000])), (("7.5PB", 4.0, 18.0), np.array([0.1798, 0.1185, 12.0000])), (("7.5PB", 4.0, 20.0), np.array([0.1742, 0.1058, 12.0000])), (("7.5PB", 4.0, 22.0), np.array([0.1713, 0.0980, 12.0000])), (("7.5PB", 4.0, 24.0), np.array([0.1684, 0.0899, 12.0000])), (("7.5PB", 4.0, 26.0), np.array([0.1659, 0.0825, 12.0000])), (("7.5PB", 4.0, 28.0), np.array([0.1640, 0.0770, 12.0000])), (("7.5PB", 4.0, 30.0), np.array([0.1620, 0.0720, 12.0000])), (("7.5PB", 4.0, 32.0), np.array([0.1600, 0.0660, 12.0000])), (("7.5PB", 4.0, 34.0), np.array([0.1580, 0.0600, 12.0000])), (("7.5PB", 4.0, 36.0), np.array([0.1570, 0.0540, 12.0000])), (("7.5PB", 4.0, 38.0), np.array([0.1550, 0.0490, 12.0000])), (("7.5PB", 4.0, 40.0), np.array([0.1530, 0.0440, 12.0000])), (("10PB", 4.0, 2.0), np.array([0.2911, 0.2804, 12.0000])), (("10PB", 4.0, 4.0), np.array([0.2759, 0.2522, 12.0000])), (("10PB", 4.0, 6.0), np.array([0.2618, 0.2263, 12.0000])), (("10PB", 4.0, 8.0), np.array([0.2497, 0.2038, 12.0000])), (("10PB", 4.0, 10.0), np.array([0.2388, 0.1837, 12.0000])), (("10PB", 4.0, 12.0), np.array([0.2298, 0.1659, 12.0000])), (("10PB", 4.0, 14.0), np.array([0.2220, 0.1503, 12.0000])), (("10PB", 4.0, 16.0), np.array([0.2170, 0.1373, 12.0000])), (("10PB", 4.0, 18.0), np.array([0.2120, 0.1256, 12.0000])), (("10PB", 4.0, 20.0), np.array([0.2075, 0.1140, 12.0000])), (("10PB", 4.0, 22.0), np.array([0.2048, 0.1064, 12.0000])), (("10PB", 4.0, 24.0), np.array([0.2020, 0.0985, 12.0000])), (("10PB", 4.0, 26.0), np.array([0.1994, 0.0904, 12.0000])), (("10PB", 4.0, 28.0), np.array([0.1971, 0.0840, 12.0000])), (("10PB", 4.0, 30.0), np.array([0.1952, 0.0778, 12.0000])), (("10PB", 4.0, 32.0), np.array([0.1920, 0.0710, 12.0000])), (("10PB", 4.0, 34.0), np.array([0.1910, 0.0640, 12.0000])), (("10PB", 4.0, 36.0), np.array([0.1890, 0.0580, 12.0000])), (("10PB", 4.0, 38.0), np.array([0.1870, 0.0520, 12.0000])), (("10PB", 4.0, 40.0), np.array([0.1840, 0.0460, 12.0000])), (("2.5P", 4.0, 2.0), np.array([0.2962, 0.2807, 12.0000])), (("2.5P", 4.0, 4.0), np.array([0.2855, 0.2531, 12.0000])), (("2.5P", 4.0, 6.0), np.array([0.2763, 0.2300, 12.0000])), (("2.5P", 4.0, 8.0), np.array([0.2685, 0.2089, 12.0000])), (("2.5P", 4.0, 10.0), np.array([0.2619, 0.1903, 12.0000])), (("2.5P", 4.0, 12.0), np.array([0.2559, 0.1730, 12.0000])), (("2.5P", 4.0, 14.0), np.array([0.2509, 0.1585, 12.0000])), (("2.5P", 4.0, 16.0), np.array([0.2467, 0.1452, 12.0000])), (("2.5P", 4.0, 18.0), np.array([0.2430, 0.1332, 12.0000])), (("2.5P", 4.0, 20.0), np.array([0.2394, 0.1221, 12.0000])), (("2.5P", 4.0, 22.0), np.array([0.2371, 0.1143, 12.0000])), (("2.5P", 4.0, 24.0), np.array([0.2348, 0.1062, 12.0000])), (("2.5P", 4.0, 26.0), np.array([0.2322, 0.0978, 12.0000])), (("2.5P", 4.0, 28.0), np.array([0.2302, 0.0909, 12.0000])), (("2.5P", 4.0, 30.0), np.array([0.2285, 0.0847, 12.0000])), (("2.5P", 4.0, 32.0), np.array([0.2265, 0.0774, 12.0000])), (("2.5P", 4.0, 34.0), np.array([0.2240, 0.0700, 12.0000])), (("2.5P", 4.0, 36.0), np.array([0.2220, 0.0640, 12.0000])), (("2.5P", 4.0, 38.0), np.array([0.2200, 0.0570, 12.0000])), (("2.5P", 4.0, 40.0), np.array([0.2180, 0.0510, 12.0000])), (("5P", 4.0, 2.0), np.array([0.3022, 0.2825, 12.0000])), (("5P", 4.0, 4.0), np.array([0.2958, 0.2565, 12.0000])), (("5P", 4.0, 6.0), np.array([0.2903, 0.2347, 12.0000])), (("5P", 4.0, 8.0), np.array([0.2855, 0.2150, 12.0000])), (("5P", 4.0, 10.0), np.array([0.2814, 0.1967, 12.0000])), (("5P", 4.0, 12.0), np.array([0.2778, 0.1808, 12.0000])), (("5P", 4.0, 14.0), np.array([0.2747, 0.1660, 12.0000])), (("5P", 4.0, 16.0), np.array([0.2718, 0.1520, 12.0000])), (("5P", 4.0, 18.0), np.array([0.2693, 0.1408, 12.0000])), (("5P", 4.0, 20.0), np.array([0.2670, 0.1300, 12.0000])), (("5P", 4.0, 22.0), np.array([0.2652, 0.1218, 12.0000])), (("5P", 4.0, 24.0), np.array([0.2635, 0.1132, 12.0000])), (("5P", 4.0, 26.0), np.array([0.2618, 0.1052, 12.0000])), (("5P", 4.0, 28.0), np.array([0.2600, 0.0971, 12.0000])), (("5P", 4.0, 30.0), np.array([0.2588, 0.0907, 12.0000])), (("5P", 4.0, 32.0), np.array([0.2574, 0.0833, 12.0000])), (("5P", 4.0, 34.0), np.array([0.2560, 0.0740, 12.0000])), (("5P", 4.0, 36.0), np.array([0.2550, 0.0690, 12.0000])), (("5P", 4.0, 38.0), np.array([0.2540, 0.0630, 12.0000])), (("5P", 4.0, 40.0), np.array([0.2540, 0.0560, 12.0000])), (("7.5P", 4.0, 2.0), np.array([0.3093, 0.2859, 12.0000])), (("7.5P", 4.0, 4.0), np.array([0.3084, 0.2622, 12.0000])), (("7.5P", 4.0, 6.0), np.array([0.3076, 0.2416, 12.0000])), (("7.5P", 4.0, 8.0), np.array([0.3066, 0.2228, 12.0000])), (("7.5P", 4.0, 10.0), np.array([0.3056, 0.2060, 12.0000])), (("7.5P", 4.0, 12.0), np.array([0.3045, 0.1905, 12.0000])), (("7.5P", 4.0, 14.0), np.array([0.3035, 0.1755, 12.0000])), (("7.5P", 4.0, 16.0), np.array([0.3028, 0.1621, 12.0000])), (("7.5P", 4.0, 18.0), np.array([0.3016, 0.1500, 12.0000])), (("7.5P", 4.0, 20.0), np.array([0.3010, 0.1396, 12.0000])), (("7.5P", 4.0, 22.0), np.array([0.3001, 0.1306, 12.0000])), (("7.5P", 4.0, 24.0), np.array([0.2993, 0.1225, 12.0000])), (("7.5P", 4.0, 26.0), np.array([0.2986, 0.1135, 12.0000])), (("7.5P", 4.0, 28.0), np.array([0.2979, 0.1062, 12.0000])), (("7.5P", 4.0, 30.0), np.array([0.2969, 0.0979, 12.0000])), (("7.5P", 4.0, 32.0), np.array([0.2962, 0.0906, 12.0000])), (("7.5P", 4.0, 34.0), np.array([0.2950, 0.0820, 12.0000])), (("7.5P", 4.0, 36.0), np.array([0.2950, 0.0750, 12.0000])), (("7.5P", 4.0, 38.0), np.array([0.2940, 0.0690, 12.0000])), (("7.5P", 4.0, 40.0), np.array([0.2930, 0.0620, 12.0000])), (("10P", 4.0, 2.0), np.array([0.3162, 0.2902, 12.0000])), (("10P", 4.0, 4.0), np.array([0.3210, 0.2686, 12.0000])), (("10P", 4.0, 6.0), np.array([0.3248, 0.2493, 12.0000])), (("10P", 4.0, 8.0), np.array([0.3280, 0.2318, 12.0000])), (("10P", 4.0, 10.0), np.array([0.3306, 0.2162, 12.0000])), (("10P", 4.0, 12.0), np.array([0.3331, 0.2014, 12.0000])), (("10P", 4.0, 14.0), np.array([0.3351, 0.1875, 12.0000])), (("10P", 4.0, 16.0), np.array([0.3370, 0.1756, 12.0000])), (("10P", 4.0, 18.0), np.array([0.3386, 0.1626, 12.0000])), (("10P", 4.0, 20.0), np.array([0.3400, 0.1500, 12.0000])), (("10P", 4.0, 22.0), np.array([0.3411, 0.1424, 12.0000])), (("10P", 4.0, 24.0), np.array([0.3421, 0.1337, 12.0000])), (("10P", 4.0, 26.0), np.array([0.3428, 0.1248, 12.0000])), (("10P", 4.0, 28.0), np.array([0.3432, 0.1172, 12.0000])), (("10P", 4.0, 30.0), np.array([0.3440, 0.1080, 12.0000])), (("10P", 4.0, 32.0), np.array([0.3450, 0.1000, 12.0000])), (("10P", 4.0, 34.0), np.array([0.3460, 0.0930, 12.0000])), (("10P", 4.0, 36.0), np.array([0.3460, 0.0850, 12.0000])), (("10P", 4.0, 38.0), np.array([0.3470, 0.0780, 12.0000])), (("2.5RP", 4.0, 2.0), np.array([0.3231, 0.2951, 12.0000])), (("2.5RP", 4.0, 4.0), np.array([0.3340, 0.2770, 12.0000])), (("2.5RP", 4.0, 6.0), np.array([0.3442, 0.2595, 12.0000])), (("2.5RP", 4.0, 8.0), np.array([0.3533, 0.2438, 12.0000])), (("2.5RP", 4.0, 10.0), np.array([0.3608, 0.2301, 12.0000])), (("2.5RP", 4.0, 12.0), np.array([0.3683, 0.2162, 12.0000])), (("2.5RP", 4.0, 14.0), np.array([0.3748, 0.2039, 12.0000])), (("2.5RP", 4.0, 16.0), np.array([0.3807, 0.1923, 12.0000])), (("2.5RP", 4.0, 18.0), np.array([0.3865, 0.1802, 12.0000])), (("2.5RP", 4.0, 20.0), np.array([0.3926, 0.1679, 12.0000])), (("2.5RP", 4.0, 22.0), np.array([0.3967, 0.1593, 12.0000])), (("2.5RP", 4.0, 24.0), np.array([0.4011, 0.1504, 12.0000])), (("2.5RP", 4.0, 26.0), np.array([0.4048, 0.1428, 12.0000])), (("2.5RP", 4.0, 28.0), np.array([0.4090, 0.1340, 12.0000])), (("2.5RP", 4.0, 30.0), np.array([0.4140, 0.1220, 12.0000])), (("2.5RP", 4.0, 32.0), np.array([0.4170, 0.1150, 12.0000])), (("2.5RP", 4.0, 34.0), np.array([0.4190, 0.1080, 12.0000])), (("5RP", 4.0, 2.0), np.array([0.3310, 0.3010, 12.0000])), (("5RP", 4.0, 4.0), np.array([0.3491, 0.2872, 12.0000])), (("5RP", 4.0, 6.0), np.array([0.3671, 0.2733, 12.0000])), (("5RP", 4.0, 8.0), np.array([0.3833, 0.2600, 12.0000])), (("5RP", 4.0, 10.0), np.array([0.3960, 0.2489, 12.0000])), (("5RP", 4.0, 12.0), np.array([0.4104, 0.2361, 12.0000])), (("5RP", 4.0, 14.0), np.array([0.4225, 0.2249, 12.0000])), (("5RP", 4.0, 16.0), np.array([0.4339, 0.2139, 12.0000])), (("5RP", 4.0, 18.0), np.array([0.4455, 0.2023, 12.0000])), (("5RP", 4.0, 20.0), np.array([0.4571, 0.1906, 12.0000])), (("5RP", 4.0, 22.0), np.array([0.4656, 0.1821, 12.0000])), (("5RP", 4.0, 24.0), np.array([0.4730, 0.1720, 12.0000])), (("5RP", 4.0, 26.0), np.array([0.4820, 0.1620, 12.0000])), (("5RP", 4.0, 28.0), np.array([0.4890, 0.1540, 12.0000])), (("5RP", 4.0, 30.0), np.array([0.4990, 0.1430, 12.0000])), (("7.5RP", 4.0, 2.0), np.array([0.3371, 0.3061, 12.0000])), (("7.5RP", 4.0, 4.0), np.array([0.3612, 0.2963, 12.0000])), (("7.5RP", 4.0, 6.0), np.array([0.3850, 0.2859, 12.0000])), (("7.5RP", 4.0, 8.0), np.array([0.4072, 0.2750, 12.0000])), (("7.5RP", 4.0, 10.0), np.array([0.4259, 0.2651, 12.0000])), (("7.5RP", 4.0, 12.0), np.array([0.4450, 0.2541, 12.0000])), (("7.5RP", 4.0, 14.0), np.array([0.4629, 0.2437, 12.0000])), (("7.5RP", 4.0, 16.0), np.array([0.4799, 0.2329, 12.0000])), (("7.5RP", 4.0, 18.0), np.array([0.4965, 0.2217, 12.0000])), (("7.5RP", 4.0, 20.0), np.array([0.5130, 0.2101, 12.0000])), (("7.5RP", 4.0, 22.0), np.array([0.5230, 0.2020, 12.0000])), (("7.5RP", 4.0, 24.0), np.array([0.5360, 0.1920, 12.0000])), (("7.5RP", 4.0, 26.0), np.array([0.5490, 0.1810, 12.0000])), (("10RP", 4.0, 2.0), np.array([0.3417, 0.3106, 12.0000])), (("10RP", 4.0, 4.0), np.array([0.3715, 0.3042, 12.0000])), (("10RP", 4.0, 6.0), np.array([0.3999, 0.2972, 12.0000])), (("10RP", 4.0, 8.0), np.array([0.4282, 0.2890, 12.0000])), (("10RP", 4.0, 10.0), np.array([0.4528, 0.2811, 12.0000])), (("10RP", 4.0, 12.0), np.array([0.4789, 0.2717, 12.0000])), (("10RP", 4.0, 14.0), np.array([0.5020, 0.2623, 12.0000])), (("10RP", 4.0, 16.0), np.array([0.5234, 0.2530, 12.0000])), (("10RP", 4.0, 18.0), np.array([0.5466, 0.2424, 12.0000])), (("10RP", 4.0, 20.0), np.array([0.5674, 0.2319, 12.0000])), (("10RP", 4.0, 22.0), np.array([0.5820, 0.2240, 12.0000])), (("10RP", 4.0, 24.0), np.array([0.5980, 0.2140, 12.0000])), (("2.5R", 4.0, 2.0), np.array([0.3461, 0.3150, 12.0000])), (("2.5R", 4.0, 4.0), np.array([0.3806, 0.3125, 12.0000])), (("2.5R", 4.0, 6.0), np.array([0.4141, 0.3085, 12.0000])), (("2.5R", 4.0, 8.0), np.array([0.4472, 0.3031, 12.0000])), (("2.5R", 4.0, 10.0), np.array([0.4774, 0.2969, 12.0000])), (("2.5R", 4.0, 12.0), np.array([0.5072, 0.2897, 12.0000])), (("2.5R", 4.0, 14.0), np.array([0.5369, 0.2810, 12.0000])), (("2.5R", 4.0, 16.0), np.array([0.5620, 0.2724, 12.0000])), (("2.5R", 4.0, 18.0), np.array([0.5898, 0.2622, 12.0000])), (("2.5R", 4.0, 20.0), np.array([0.6150, 0.2530, 12.0000])), (("2.5R", 4.0, 22.0), np.array([0.6330, 0.2440, 12.0000])), (("2.5R", 4.0, 24.0), np.array([0.6540, 0.2360, 12.0000])), (("5R", 4.0, 2.0), np.array([0.3508, 0.3200, 12.0000])), (("5R", 4.0, 4.0), np.array([0.3916, 0.3223, 12.0000])), (("5R", 4.0, 6.0), np.array([0.4299, 0.3226, 12.0000])), (("5R", 4.0, 8.0), np.array([0.4690, 0.3209, 12.0000])), (("5R", 4.0, 10.0), np.array([0.5043, 0.3176, 12.0000])), (("5R", 4.0, 12.0), np.array([0.5385, 0.3129, 12.0000])), (("5R", 4.0, 14.0), np.array([0.5734, 0.3057, 12.0000])), (("5R", 4.0, 16.0), np.array([0.6039, 0.2978, 12.0000])), (("5R", 4.0, 18.0), np.array([0.6329, 0.2881, 12.0000])), (("5R", 4.0, 20.0), np.array([0.6580, 0.2780, 12.0000])), (("5R", 4.0, 22.0), np.array([0.6780, 0.2700, 12.0000])), (("5R", 4.0, 24.0), np.array([0.6990, 0.2600, 12.0000])), (("7.5R", 4.0, 2.0), np.array([0.3538, 0.3236, 12.0000])), (("7.5R", 4.0, 4.0), np.array([0.3990, 0.3300, 12.0000])), (("7.5R", 4.0, 6.0), np.array([0.4415, 0.3340, 12.0000])), (("7.5R", 4.0, 8.0), np.array([0.4850, 0.3359, 12.0000])), (("7.5R", 4.0, 10.0), np.array([0.5235, 0.3351, 12.0000])), (("7.5R", 4.0, 12.0), np.array([0.5603, 0.3321, 12.0000])), (("7.5R", 4.0, 14.0), np.array([0.5959, 0.3269, 12.0000])), (("7.5R", 4.0, 16.0), np.array([0.6260, 0.3192, 12.0000])), (("7.5R", 4.0, 18.0), np.array([0.6538, 0.3100, 12.0000])), (("7.5R", 4.0, 20.0), np.array([0.6806, 0.2988, 12.0000])), (("7.5R", 4.0, 22.0), np.array([0.7030, 0.2910, 12.0000])), (("7.5R", 4.0, 24.0), np.array([0.7260, 0.2800, 12.0000])), (("10R", 4.0, 2.0), np.array([0.3582, 0.3294, 12.0000])), (("10R", 4.0, 4.0), np.array([0.4078, 0.3412, 12.0000])), (("10R", 4.0, 6.0), np.array([0.4535, 0.3500, 12.0000])), (("10R", 4.0, 8.0), np.array([0.4995, 0.3557, 12.0000])), (("10R", 4.0, 10.0), np.array([0.5418, 0.3580, 12.0000])), (("10R", 4.0, 12.0), np.array([0.5801, 0.3588, 12.0000])), (("10R", 4.0, 14.0), np.array([0.6154, 0.3568, 12.0000])), (("10R", 4.0, 16.0), np.array([0.6409, 0.3533, 12.0000])), (("10R", 4.0, 18.0), np.array([0.6710, 0.3480, 12.0000])), (("10R", 4.0, 20.0), np.array([0.6980, 0.3440, 12.0000])), (("10R", 4.0, 22.0), np.array([0.7260, 0.3380, 12.0000])), (("10R", 4.0, 24.0), np.array([0.7560, 0.3320, 12.0000])), (("2.5YR", 4.0, 2.0), np.array([0.3624, 0.3367, 12.0000])), (("2.5YR", 4.0, 4.0), np.array([0.4141, 0.3539, 12.0000])), (("2.5YR", 4.0, 6.0), np.array([0.4612, 0.3674, 12.0000])), (("2.5YR", 4.0, 8.0), np.array([0.5071, 0.3777, 12.0000])), (("2.5YR", 4.0, 10.0), np.array([0.5475, 0.3856, 12.0000])), (("2.5YR", 4.0, 12.0), np.array([0.5809, 0.3910, 12.0000])), (("2.5YR", 4.0, 14.0), np.array([0.6140, 0.3960, 12.0000])), (("2.5YR", 4.0, 16.0), np.array([0.6390, 0.4000, 12.0000])), (("2.5YR", 4.0, 18.0), np.array([0.6690, 0.4040, 12.0000])), (("5YR", 4.0, 2.0), np.array([0.3651, 0.3442, 12.0000])), (("5YR", 4.0, 4.0), np.array([0.4187, 0.3679, 12.0000])), (("5YR", 4.0, 6.0), np.array([0.4651, 0.3859, 12.0000])), (("5YR", 4.0, 8.0), np.array([0.5070, 0.3994, 12.0000])), (("5YR", 4.0, 10.0), np.array([0.5432, 0.4097, 12.0000])), (("5YR", 4.0, 12.0), np.array([0.5729, 0.4169, 12.0000])), (("5YR", 4.0, 14.0), np.array([0.6030, 0.4230, 12.0000])), (("7.5YR", 4.0, 2.0), np.array([0.3662, 0.3504, 12.0000])), (("7.5YR", 4.0, 4.0), np.array([0.4208, 0.3809, 12.0000])), (("7.5YR", 4.0, 6.0), np.array([0.4655, 0.4029, 12.0000])), (("7.5YR", 4.0, 8.0), np.array([0.5038, 0.4204, 12.0000])), (("7.5YR", 4.0, 10.0), np.array([0.5356, 0.4342, 12.0000])), (("7.5YR", 4.0, 12.0), np.array([0.5590, 0.4450, 12.0000])), (("7.5YR", 4.0, 14.0), np.array([0.5870, 0.4560, 12.0000])), (("10YR", 4.0, 2.0), np.array([0.3660, 0.3590, 12.0000])), (("10YR", 4.0, 4.0), np.array([0.4189, 0.3948, 12.0000])), (("10YR", 4.0, 6.0), np.array([0.4618, 0.4213, 12.0000])), (("10YR", 4.0, 8.0), np.array([0.4965, 0.4414, 12.0000])), (("10YR", 4.0, 10.0), np.array([0.5250, 0.4573, 12.0000])), (("10YR", 4.0, 12.0), np.array([0.5450, 0.4680, 12.0000])), (("2.5Y", 4.0, 2.0), np.array([0.3633, 0.3654, 12.0000])), (("2.5Y", 4.0, 4.0), np.array([0.4138, 0.4076, 12.0000])), (("2.5Y", 4.0, 6.0), np.array([0.4542, 0.4391, 12.0000])), (("2.5Y", 4.0, 8.0), np.array([0.4865, 0.4625, 12.0000])), (("2.5Y", 4.0, 10.0), np.array([0.5120, 0.4800, 12.0000])), (("2.5Y", 4.0, 12.0), np.array([0.5290, 0.4920, 12.0000])), (("5Y", 4.0, 2.0), np.array([0.3590, 0.3701, 12.0000])), (("5Y", 4.0, 4.0), np.array([0.4069, 0.4188, 12.0000])), (("5Y", 4.0, 6.0), np.array([0.4451, 0.4550, 12.0000])), (("5Y", 4.0, 8.0), np.array([0.4745, 0.4810, 12.0000])), (("5Y", 4.0, 10.0), np.array([0.4960, 0.5030, 12.0000])), (("5Y", 4.0, 12.0), np.array([0.5120, 0.5160, 12.0000])), (("7.5Y", 4.0, 2.0), np.array([0.3542, 0.3727, 12.0000])), (("7.5Y", 4.0, 4.0), np.array([0.3982, 0.4272, 12.0000])), (("7.5Y", 4.0, 6.0), np.array([0.4331, 0.4688, 12.0000])), (("7.5Y", 4.0, 8.0), np.array([0.4595, 0.4990, 12.0000])), (("7.5Y", 4.0, 10.0), np.array([0.4810, 0.5230, 12.0000])), (("7.5Y", 4.0, 12.0), np.array([0.4940, 0.5380, 12.0000])), (("10Y", 5.0, 2.0), np.array([0.3422, 0.3648, 19.7700])), (("10Y", 5.0, 4.0), np.array([0.3762, 0.4158, 19.7700])), (("10Y", 5.0, 6.0), np.array([0.4072, 0.4621, 19.7700])), (("10Y", 5.0, 8.0), np.array([0.4307, 0.4967, 19.7700])), (("10Y", 5.0, 10.0), np.array([0.4468, 0.5209, 19.7700])), (("10Y", 5.0, 12.0), np.array([0.4590, 0.5390, 19.7700])), (("10Y", 5.0, 14.0), np.array([0.4690, 0.5540, 19.7700])), (("2.5GY", 5.0, 2.0), np.array([0.3352, 0.3636, 19.7700])), (("2.5GY", 5.0, 4.0), np.array([0.3621, 0.4143, 19.7700])), (("2.5GY", 5.0, 6.0), np.array([0.3879, 0.4646, 19.7700])), (("2.5GY", 5.0, 8.0), np.array([0.4088, 0.5068, 19.7700])), (("2.5GY", 5.0, 10.0), np.array([0.4224, 0.5369, 19.7700])), (("2.5GY", 5.0, 12.0), np.array([0.4333, 0.5602, 19.7700])), (("2.5GY", 5.0, 14.0), np.array([0.4400, 0.5800, 19.7700])), (("5GY", 5.0, 2.0), np.array([0.3289, 0.3612, 19.7700])), (("5GY", 5.0, 4.0), np.array([0.3482, 0.4097, 19.7700])), (("5GY", 5.0, 6.0), np.array([0.3663, 0.4614, 19.7700])), (("5GY", 5.0, 8.0), np.array([0.3815, 0.5093, 19.7700])), (("5GY", 5.0, 10.0), np.array([0.3928, 0.5485, 19.7700])), (("5GY", 5.0, 12.0), np.array([0.4011, 0.5802, 19.7700])), (("5GY", 5.0, 14.0), np.array([0.4070, 0.6040, 19.7700])), (("5GY", 5.0, 16.0), np.array([0.4100, 0.6260, 19.7700])), (("7.5GY", 5.0, 2.0), np.array([0.3188, 0.3560, 19.7700])), (("7.5GY", 5.0, 4.0), np.array([0.3274, 0.3994, 19.7700])), (("7.5GY", 5.0, 6.0), np.array([0.3354, 0.4483, 19.7700])), (("7.5GY", 5.0, 8.0), np.array([0.3412, 0.4976, 19.7700])), (("7.5GY", 5.0, 10.0), np.array([0.3451, 0.5490, 19.7700])), (("7.5GY", 5.0, 12.0), np.array([0.3450, 0.5949, 19.7700])), (("7.5GY", 5.0, 14.0), np.array([0.3429, 0.6335, 19.7700])), (("7.5GY", 5.0, 16.0), np.array([0.3410, 0.6660, 19.7700])), (("7.5GY", 5.0, 18.0), np.array([0.3390, 0.6970, 19.7700])), (("7.5GY", 5.0, 20.0), np.array([0.3330, 0.7330, 19.7700])), (("10GY", 5.0, 2.0), np.array([0.3110, 0.3508, 19.7700])), (("10GY", 5.0, 4.0), np.array([0.3111, 0.3881, 19.7700])), (("10GY", 5.0, 6.0), np.array([0.3108, 0.4301, 19.7700])), (("10GY", 5.0, 8.0), np.array([0.3080, 0.4759, 19.7700])), (("10GY", 5.0, 10.0), np.array([0.3028, 0.5237, 19.7700])), (("10GY", 5.0, 12.0), np.array([0.2940, 0.5751, 19.7700])), (("10GY", 5.0, 14.0), np.array([0.2838, 0.6208, 19.7700])), (("10GY", 5.0, 16.0), np.array([0.2702, 0.6700, 19.7700])), (("10GY", 5.0, 18.0), np.array([0.2549, 0.7179, 19.7700])), (("10GY", 5.0, 20.0), np.array([0.2370, 0.7670, 19.7700])), (("10GY", 5.0, 22.0), np.array([0.2210, 0.8080, 19.7700])), (("10GY", 5.0, 24.0), np.array([0.2020, 0.8520, 19.7700])), (("10GY", 5.0, 26.0), np.array([0.1790, 0.8980, 19.7700])), (("10GY", 5.0, 28.0), np.array([0.1540, 0.9490, 19.7700])), (("10GY", 5.0, 30.0), np.array([0.1250, 1.0000, 19.7700])), (("10GY", 5.0, 32.0), np.array([0.0970, 1.0480, 19.7700])), (("2.5G", 5.0, 2.0), np.array([0.3030, 0.3445, 19.7700])), (("2.5G", 5.0, 4.0), np.array([0.2943, 0.3735, 19.7700])), (("2.5G", 5.0, 6.0), np.array([0.2841, 0.4045, 19.7700])), (("2.5G", 5.0, 8.0), np.array([0.2710, 0.4380, 19.7700])), (("2.5G", 5.0, 10.0), np.array([0.2565, 0.4705, 19.7700])), (("2.5G", 5.0, 12.0), np.array([0.2385, 0.5071, 19.7700])), (("2.5G", 5.0, 14.0), np.array([0.2211, 0.5411, 19.7700])), (("2.5G", 5.0, 16.0), np.array([0.2005, 0.5759, 19.7700])), (("2.5G", 5.0, 18.0), np.array([0.1782, 0.6095, 19.7700])), (("2.5G", 5.0, 20.0), np.array([0.1579, 0.6392, 19.7700])), (("2.5G", 5.0, 22.0), np.array([0.1377, 0.6674, 19.7700])), (("2.5G", 5.0, 24.0), np.array([0.1188, 0.6918, 19.7700])), (("2.5G", 5.0, 26.0), np.array([0.0992, 0.7155, 19.7700])), (("2.5G", 5.0, 28.0), np.array([0.0794, 0.7385, 19.7700])), (("2.5G", 5.0, 30.0), np.array([0.0550, 0.7660, 19.7700])), (("2.5G", 5.0, 32.0), np.array([0.0340, 0.7890, 19.7700])), (("5G", 5.0, 2.0), np.array([0.2978, 0.3392, 19.7700])), (("5G", 5.0, 4.0), np.array([0.2841, 0.3628, 19.7700])), (("5G", 5.0, 6.0), np.array([0.2690, 0.3860, 19.7700])), (("5G", 5.0, 8.0), np.array([0.2511, 0.4107, 19.7700])), (("5G", 5.0, 10.0), np.array([0.2329, 0.4331, 19.7700])), (("5G", 5.0, 12.0), np.array([0.2104, 0.4578, 19.7700])), (("5G", 5.0, 14.0), np.array([0.1912, 0.4773, 19.7700])), (("5G", 5.0, 16.0), np.array([0.1695, 0.4981, 19.7700])), (("5G", 5.0, 18.0), np.array([0.1489, 0.5171, 19.7700])), (("5G", 5.0, 20.0), np.array([0.1318, 0.5321, 19.7700])), (("5G", 5.0, 22.0), np.array([0.1144, 0.5463, 19.7700])), (("5G", 5.0, 24.0), np.array([0.0953, 0.5628, 19.7700])), (("5G", 5.0, 26.0), np.array([0.0784, 0.5761, 19.7700])), (("5G", 5.0, 28.0), np.array([0.0609, 0.5898, 19.7700])), (("5G", 5.0, 30.0), np.array([0.0400, 0.6050, 19.7700])), (("5G", 5.0, 32.0), np.array([0.0200, 0.6220, 19.7700])), (("7.5G", 5.0, 2.0), np.array([0.2945, 0.3355, 19.7700])), (("7.5G", 5.0, 4.0), np.array([0.2775, 0.3545, 19.7700])), (("7.5G", 5.0, 6.0), np.array([0.2598, 0.3724, 19.7700])), (("7.5G", 5.0, 8.0), np.array([0.2395, 0.3915, 19.7700])), (("7.5G", 5.0, 10.0), np.array([0.2200, 0.4082, 19.7700])), (("7.5G", 5.0, 12.0), np.array([0.1964, 0.4271, 19.7700])), (("7.5G", 5.0, 14.0), np.array([0.1776, 0.4415, 19.7700])), (("7.5G", 5.0, 16.0), np.array([0.1571, 0.4561, 19.7700])), (("7.5G", 5.0, 18.0), np.array([0.1372, 0.4705, 19.7700])), (("7.5G", 5.0, 20.0), np.array([0.1212, 0.4817, 19.7700])), (("7.5G", 5.0, 22.0), np.array([0.1050, 0.4927, 19.7700])), (("7.5G", 5.0, 24.0), np.array([0.0878, 0.5039, 19.7700])), (("7.5G", 5.0, 26.0), np.array([0.0730, 0.5131, 19.7700])), (("7.5G", 5.0, 28.0), np.array([0.0585, 0.5224, 19.7700])), (("7.5G", 5.0, 30.0), np.array([0.0410, 0.5320, 19.7700])), (("7.5G", 5.0, 32.0), np.array([0.0210, 0.5420, 19.7700])), (("10G", 5.0, 2.0), np.array([0.2910, 0.3310, 19.7700])), (("10G", 5.0, 4.0), np.array([0.2711, 0.3455, 19.7700])), (("10G", 5.0, 6.0), np.array([0.2519, 0.3587, 19.7700])), (("10G", 5.0, 8.0), np.array([0.2297, 0.3730, 19.7700])), (("10G", 5.0, 10.0), np.array([0.2095, 0.3853, 19.7700])), (("10G", 5.0, 12.0), np.array([0.1852, 0.3992, 19.7700])), (("10G", 5.0, 14.0), np.array([0.1671, 0.4089, 19.7700])), (("10G", 5.0, 16.0), np.array([0.1469, 0.4192, 19.7700])), (("10G", 5.0, 18.0), np.array([0.1275, 0.4288, 19.7700])), (("10G", 5.0, 20.0), np.array([0.1120, 0.4360, 19.7700])), (("10G", 5.0, 22.0), np.array([0.0958, 0.4428, 19.7700])), (("10G", 5.0, 24.0), np.array([0.0811, 0.4491, 19.7700])), (("10G", 5.0, 26.0), np.array([0.0690, 0.4542, 19.7700])), (("10G", 5.0, 28.0), np.array([0.0572, 0.4590, 19.7700])), (("10G", 5.0, 30.0), np.array([0.0410, 0.4660, 19.7700])), (("10G", 5.0, 32.0), np.array([0.0230, 0.4740, 19.7700])), (("2.5BG", 5.0, 2.0), np.array([0.2880, 0.3270, 19.7700])), (("2.5BG", 5.0, 4.0), np.array([0.2659, 0.3369, 19.7700])), (("2.5BG", 5.0, 6.0), np.array([0.2448, 0.3452, 19.7700])), (("2.5BG", 5.0, 8.0), np.array([0.2205, 0.3537, 19.7700])), (("2.5BG", 5.0, 10.0), np.array([0.1980, 0.3606, 19.7700])), (("2.5BG", 5.0, 12.0), np.array([0.1735, 0.3668, 19.7700])), (("2.5BG", 5.0, 14.0), np.array([0.1559, 0.3708, 19.7700])), (("2.5BG", 5.0, 16.0), np.array([0.1348, 0.3750, 19.7700])), (("2.5BG", 5.0, 18.0), np.array([0.1165, 0.3785, 19.7700])), (("2.5BG", 5.0, 20.0), np.array([0.1005, 0.3814, 19.7700])), (("2.5BG", 5.0, 22.0), np.array([0.0861, 0.3832, 19.7700])), (("2.5BG", 5.0, 24.0), np.array([0.0738, 0.3851, 19.7700])), (("2.5BG", 5.0, 26.0), np.array([0.0640, 0.3860, 19.7700])), (("2.5BG", 5.0, 28.0), np.array([0.0530, 0.3880, 19.7700])), (("2.5BG", 5.0, 30.0), np.array([0.0420, 0.3890, 19.7700])), (("2.5BG", 5.0, 32.0), np.array([0.0270, 0.3910, 19.7700])), (("5BG", 5.0, 2.0), np.array([0.2841, 0.3210, 19.7700])), (("5BG", 5.0, 4.0), np.array([0.2591, 0.3246, 19.7700])), (("5BG", 5.0, 6.0), np.array([0.2360, 0.3270, 19.7700])), (("5BG", 5.0, 8.0), np.array([0.2100, 0.3280, 19.7700])), (("5BG", 5.0, 10.0), np.array([0.1850, 0.3280, 19.7700])), (("5BG", 5.0, 12.0), np.array([0.1614, 0.3280, 19.7700])), (("5BG", 5.0, 14.0), np.array([0.1448, 0.3275, 19.7700])), (("5BG", 5.0, 16.0), np.array([0.1243, 0.3261, 19.7700])), (("5BG", 5.0, 18.0), np.array([0.1046, 0.3244, 19.7700])), (("5BG", 5.0, 20.0), np.array([0.0904, 0.3231, 19.7700])), (("5BG", 5.0, 22.0), np.array([0.0781, 0.3211, 19.7700])), (("5BG", 5.0, 24.0), np.array([0.0670, 0.3200, 19.7700])), (("5BG", 5.0, 26.0), np.array([0.0580, 0.3180, 19.7700])), (("5BG", 5.0, 28.0), np.array([0.0500, 0.3170, 19.7700])), (("5BG", 5.0, 30.0), np.array([0.0420, 0.3160, 19.7700])), (("7.5BG", 5.0, 2.0), np.array([0.2812, 0.3161, 19.7700])), (("7.5BG", 5.0, 4.0), np.array([0.2550, 0.3150, 19.7700])), (("7.5BG", 5.0, 6.0), np.array([0.2292, 0.3125, 19.7700])), (("7.5BG", 5.0, 8.0), np.array([0.2030, 0.3082, 19.7700])), (("7.5BG", 5.0, 10.0), np.array([0.1776, 0.3032, 19.7700])), (("7.5BG", 5.0, 12.0), np.array([0.1537, 0.2976, 19.7700])), (("7.5BG", 5.0, 14.0), np.array([0.1364, 0.2932, 19.7700])), (("7.5BG", 5.0, 16.0), np.array([0.1167, 0.2880, 19.7700])), (("7.5BG", 5.0, 18.0), np.array([0.0982, 0.2828, 19.7700])), (("7.5BG", 5.0, 20.0), np.array([0.0830, 0.2780, 19.7700])), (("7.5BG", 5.0, 22.0), np.array([0.0710, 0.2740, 19.7700])), (("7.5BG", 5.0, 24.0), np.array([0.0620, 0.2700, 19.7700])), (("7.5BG", 5.0, 26.0), np.array([0.0550, 0.2680, 19.7700])), (("10BG", 5.0, 2.0), np.array([0.2796, 0.3111, 19.7700])), (("10BG", 5.0, 4.0), np.array([0.2512, 0.3040, 19.7700])), (("10BG", 5.0, 6.0), np.array([0.2234, 0.2952, 19.7700])), (("10BG", 5.0, 8.0), np.array([0.1970, 0.2860, 19.7700])), (("10BG", 5.0, 10.0), np.array([0.1716, 0.2760, 19.7700])), (("10BG", 5.0, 12.0), np.array([0.1485, 0.2662, 19.7700])), (("10BG", 5.0, 14.0), np.array([0.1308, 0.2582, 19.7700])), (("10BG", 5.0, 16.0), np.array([0.1108, 0.2489, 19.7700])), (("10BG", 5.0, 18.0), np.array([0.0930, 0.2400, 19.7700])), (("10BG", 5.0, 20.0), np.array([0.0790, 0.2320, 19.7700])), (("10BG", 5.0, 22.0), np.array([0.0660, 0.2260, 19.7700])), (("10BG", 5.0, 24.0), np.array([0.0580, 0.2210, 19.7700])), (("2.5B", 5.0, 2.0), np.array([0.2791, 0.3071, 19.7700])), (("2.5B", 5.0, 4.0), np.array([0.2492, 0.2954, 19.7700])), (("2.5B", 5.0, 6.0), np.array([0.2210, 0.2823, 19.7700])), (("2.5B", 5.0, 8.0), np.array([0.1947, 0.2687, 19.7700])), (("2.5B", 5.0, 10.0), np.array([0.1697, 0.2549, 19.7700])), (("2.5B", 5.0, 12.0), np.array([0.1461, 0.2406, 19.7700])), (("2.5B", 5.0, 14.0), np.array([0.1283, 0.2292, 19.7700])), (("2.5B", 5.0, 16.0), np.array([0.1090, 0.2166, 19.7700])), (("2.5B", 5.0, 18.0), np.array([0.0940, 0.2060, 19.7700])), (("2.5B", 5.0, 20.0), np.array([0.0770, 0.1940, 19.7700])), (("5B", 5.0, 2.0), np.array([0.2794, 0.3032, 19.7700])), (("5B", 5.0, 4.0), np.array([0.2493, 0.2879, 19.7700])), (("5B", 5.0, 6.0), np.array([0.2215, 0.2701, 19.7700])), (("5B", 5.0, 8.0), np.array([0.1958, 0.2519, 19.7700])), (("5B", 5.0, 10.0), np.array([0.1729, 0.2347, 19.7700])), (("5B", 5.0, 12.0), np.array([0.1505, 0.2172, 19.7700])), (("5B", 5.0, 14.0), np.array([0.1320, 0.2021, 19.7700])), (("5B", 5.0, 16.0), np.array([0.1132, 0.1863, 19.7700])), (("5B", 5.0, 18.0), np.array([0.0980, 0.1720, 19.7700])), (("5B", 5.0, 20.0), np.array([0.0860, 0.1600, 19.7700])), (("7.5B", 5.0, 2.0), np.array([0.2803, 0.3000, 19.7700])), (("7.5B", 5.0, 4.0), np.array([0.2511, 0.2808, 19.7700])), (("7.5B", 5.0, 6.0), np.array([0.2248, 0.2612, 19.7700])), (("7.5B", 5.0, 8.0), np.array([0.2007, 0.2417, 19.7700])), (("7.5B", 5.0, 10.0), np.array([0.1792, 0.2230, 19.7700])), (("7.5B", 5.0, 12.0), np.array([0.1584, 0.2042, 19.7700])), (("7.5B", 5.0, 14.0), np.array([0.1404, 0.1878, 19.7700])), (("7.5B", 5.0, 16.0), np.array([0.1230, 0.1711, 19.7700])), (("7.5B", 5.0, 18.0), np.array([0.1090, 0.1570, 19.7700])), (("7.5B", 5.0, 20.0), np.array([0.0980, 0.1460, 19.7700])), (("10B", 5.0, 2.0), np.array([0.2821, 0.2966, 19.7700])), (("10B", 5.0, 4.0), np.array([0.2547, 0.2757, 19.7700])), (("10B", 5.0, 6.0), np.array([0.2299, 0.2548, 19.7700])), (("10B", 5.0, 8.0), np.array([0.2067, 0.2344, 19.7700])), (("10B", 5.0, 10.0), np.array([0.1860, 0.2149, 19.7700])), (("10B", 5.0, 12.0), np.array([0.1666, 0.1964, 19.7700])), (("10B", 5.0, 14.0), np.array([0.1492, 0.1797, 19.7700])), (("10B", 5.0, 16.0), np.array([0.1326, 0.1632, 19.7700])), (("10B", 5.0, 18.0), np.array([0.1203, 0.1505, 19.7700])), (("10B", 5.0, 20.0), np.array([0.1080, 0.1370, 19.7700])), (("10B", 5.0, 22.0), np.array([0.0960, 0.1260, 19.7700])), (("2.5PB", 5.0, 2.0), np.array([0.2847, 0.2942, 19.7700])), (("2.5PB", 5.0, 4.0), np.array([0.2600, 0.2720, 19.7700])), (("2.5PB", 5.0, 6.0), np.array([0.2365, 0.2488, 19.7700])), (("2.5PB", 5.0, 8.0), np.array([0.2157, 0.2278, 19.7700])), (("2.5PB", 5.0, 10.0), np.array([0.1968, 0.2078, 19.7700])), (("2.5PB", 5.0, 12.0), np.array([0.1793, 0.1894, 19.7700])), (("2.5PB", 5.0, 14.0), np.array([0.1642, 0.1728, 19.7700])), (("2.5PB", 5.0, 16.0), np.array([0.1495, 0.1559, 19.7700])), (("2.5PB", 5.0, 18.0), np.array([0.1363, 0.1410, 19.7700])), (("2.5PB", 5.0, 20.0), np.array([0.1240, 0.1280, 19.7700])), (("2.5PB", 5.0, 22.0), np.array([0.1140, 0.1160, 19.7700])), (("2.5PB", 5.0, 24.0), np.array([0.1030, 0.1040, 19.7700])), (("5PB", 5.0, 2.0), np.array([0.2882, 0.2923, 19.7700])), (("5PB", 5.0, 4.0), np.array([0.2662, 0.2687, 19.7700])), (("5PB", 5.0, 6.0), np.array([0.2447, 0.2449, 19.7700])), (("5PB", 5.0, 8.0), np.array([0.2255, 0.2239, 19.7700])), (("5PB", 5.0, 10.0), np.array([0.2080, 0.2041, 19.7700])), (("5PB", 5.0, 12.0), np.array([0.1918, 0.1858, 19.7700])), (("5PB", 5.0, 14.0), np.array([0.1773, 0.1689, 19.7700])), (("5PB", 5.0, 16.0), np.array([0.1638, 0.1521, 19.7700])), (("5PB", 5.0, 18.0), np.array([0.1518, 0.1365, 19.7700])), (("5PB", 5.0, 20.0), np.array([0.1420, 0.1230, 19.7700])), (("5PB", 5.0, 22.0), np.array([0.1340, 0.1130, 19.7700])), (("5PB", 5.0, 24.0), np.array([0.1240, 0.1000, 19.7700])), (("5PB", 5.0, 26.0), np.array([0.1160, 0.0890, 19.7700])), (("5PB", 5.0, 28.0), np.array([0.1090, 0.0790, 19.7700])), (("5PB", 5.0, 30.0), np.array([0.1040, 0.0700, 19.7700])), (("5PB", 5.0, 32.0), np.array([0.0970, 0.0620, 19.7700])), (("7.5PB", 5.0, 2.0), np.array([0.2918, 0.2908, 19.7700])), (("7.5PB", 5.0, 4.0), np.array([0.2739, 0.2666, 19.7700])), (("7.5PB", 5.0, 6.0), np.array([0.2563, 0.2417, 19.7700])), (("7.5PB", 5.0, 8.0), np.array([0.2417, 0.2204, 19.7700])), (("7.5PB", 5.0, 10.0), np.array([0.2285, 0.2020, 19.7700])), (("7.5PB", 5.0, 12.0), np.array([0.2157, 0.1830, 19.7700])), (("7.5PB", 5.0, 14.0), np.array([0.2042, 0.1661, 19.7700])), (("7.5PB", 5.0, 16.0), np.array([0.1945, 0.1511, 19.7700])), (("7.5PB", 5.0, 18.0), np.array([0.1862, 0.1365, 19.7700])), (("7.5PB", 5.0, 20.0), np.array([0.1794, 0.1239, 19.7700])), (("7.5PB", 5.0, 22.0), np.array([0.1750, 0.1140, 19.7700])), (("7.5PB", 5.0, 24.0), np.array([0.1700, 0.1030, 19.7700])), (("7.5PB", 5.0, 26.0), np.array([0.1650, 0.0940, 19.7700])), (("7.5PB", 5.0, 28.0), np.array([0.1620, 0.0860, 19.7700])), (("7.5PB", 5.0, 30.0), np.array([0.1580, 0.0780, 19.7700])), (("7.5PB", 5.0, 32.0), np.array([0.1540, 0.0700, 19.7700])), (("7.5PB", 5.0, 34.0), np.array([0.1500, 0.0620, 19.7700])), (("10PB", 5.0, 2.0), np.array([0.2959, 0.2905, 19.7700])), (("10PB", 5.0, 4.0), np.array([0.2821, 0.2659, 19.7700])), (("10PB", 5.0, 6.0), np.array([0.2686, 0.2412, 19.7700])), (("10PB", 5.0, 8.0), np.array([0.2572, 0.2211, 19.7700])), (("10PB", 5.0, 10.0), np.array([0.2478, 0.2030, 19.7700])), (("10PB", 5.0, 12.0), np.array([0.2384, 0.1857, 19.7700])), (("10PB", 5.0, 14.0), np.array([0.2299, 0.1698, 19.7700])), (("10PB", 5.0, 16.0), np.array([0.2224, 0.1555, 19.7700])), (("10PB", 5.0, 18.0), np.array([0.2174, 0.1444, 19.7700])), (("10PB", 5.0, 20.0), np.array([0.2121, 0.1329, 19.7700])), (("10PB", 5.0, 22.0), np.array([0.2082, 0.1225, 19.7700])), (("10PB", 5.0, 24.0), np.array([0.2040, 0.1130, 19.7700])), (("10PB", 5.0, 26.0), np.array([0.2000, 0.1030, 19.7700])), (("10PB", 5.0, 28.0), np.array([0.1970, 0.0950, 19.7700])), (("10PB", 5.0, 30.0), np.array([0.1930, 0.0860, 19.7700])), (("10PB", 5.0, 32.0), np.array([0.1890, 0.0780, 19.7700])), (("10PB", 5.0, 34.0), np.array([0.1860, 0.0710, 19.7700])), (("10PB", 5.0, 36.0), np.array([0.1830, 0.0630, 19.7700])), (("2.5P", 5.0, 2.0), np.array([0.3000, 0.2912, 19.7700])), (("2.5P", 5.0, 4.0), np.array([0.2898, 0.2667, 19.7700])), (("2.5P", 5.0, 6.0), np.array([0.2806, 0.2444, 19.7700])), (("2.5P", 5.0, 8.0), np.array([0.2728, 0.2240, 19.7700])), (("2.5P", 5.0, 10.0), np.array([0.2665, 0.2075, 19.7700])), (("2.5P", 5.0, 12.0), np.array([0.2608, 0.1913, 19.7700])), (("2.5P", 5.0, 14.0), np.array([0.2560, 0.1774, 19.7700])), (("2.5P", 5.0, 16.0), np.array([0.2515, 0.1644, 19.7700])), (("2.5P", 5.0, 18.0), np.array([0.2476, 0.1532, 19.7700])), (("2.5P", 5.0, 20.0), np.array([0.2438, 0.1419, 19.7700])), (("2.5P", 5.0, 22.0), np.array([0.2402, 0.1315, 19.7700])), (("2.5P", 5.0, 24.0), np.array([0.2372, 0.1223, 19.7700])), (("2.5P", 5.0, 26.0), np.array([0.2348, 0.1140, 19.7700])), (("2.5P", 5.0, 28.0), np.array([0.2310, 0.1040, 19.7700])), (("2.5P", 5.0, 30.0), np.array([0.2290, 0.0970, 19.7700])), (("2.5P", 5.0, 32.0), np.array([0.2260, 0.0880, 19.7700])), (("2.5P", 5.0, 34.0), np.array([0.2230, 0.0800, 19.7700])), (("2.5P", 5.0, 36.0), np.array([0.2210, 0.0720, 19.7700])), (("2.5P", 5.0, 38.0), np.array([0.2190, 0.0660, 19.7700])), (("5P", 5.0, 2.0), np.array([0.3045, 0.2928, 19.7700])), (("5P", 5.0, 4.0), np.array([0.2986, 0.2699, 19.7700])), (("5P", 5.0, 6.0), np.array([0.2932, 0.2487, 19.7700])), (("5P", 5.0, 8.0), np.array([0.2885, 0.2296, 19.7700])), (("5P", 5.0, 10.0), np.array([0.2845, 0.2137, 19.7700])), (("5P", 5.0, 12.0), np.array([0.2806, 0.1977, 19.7700])), (("5P", 5.0, 14.0), np.array([0.2775, 0.1847, 19.7700])), (("5P", 5.0, 16.0), np.array([0.2744, 0.1718, 19.7700])), (("5P", 5.0, 18.0), np.array([0.2718, 0.1604, 19.7700])), (("5P", 5.0, 20.0), np.array([0.2694, 0.1499, 19.7700])), (("5P", 5.0, 22.0), np.array([0.2673, 0.1398, 19.7700])), (("5P", 5.0, 24.0), np.array([0.2652, 0.1304, 19.7700])), (("5P", 5.0, 26.0), np.array([0.2635, 0.1224, 19.7700])), (("5P", 5.0, 28.0), np.array([0.2618, 0.1135, 19.7700])), (("5P", 5.0, 30.0), np.array([0.2590, 0.1050, 19.7700])), (("5P", 5.0, 32.0), np.array([0.2560, 0.0960, 19.7700])), (("5P", 5.0, 34.0), np.array([0.2550, 0.0880, 19.7700])), (("5P", 5.0, 36.0), np.array([0.2530, 0.0810, 19.7700])), (("5P", 5.0, 38.0), np.array([0.2520, 0.0750, 19.7700])), (("5P", 5.0, 40.0), np.array([0.2510, 0.0690, 19.7700])), (("7.5P", 5.0, 2.0), np.array([0.3103, 0.2959, 19.7700])), (("7.5P", 5.0, 4.0), np.array([0.3100, 0.2750, 19.7700])), (("7.5P", 5.0, 6.0), np.array([0.3093, 0.2555, 19.7700])), (("7.5P", 5.0, 8.0), np.array([0.3087, 0.2375, 19.7700])), (("7.5P", 5.0, 10.0), np.array([0.3080, 0.2230, 19.7700])), (("7.5P", 5.0, 12.0), np.array([0.3071, 0.2080, 19.7700])), (("7.5P", 5.0, 14.0), np.array([0.3068, 0.1951, 19.7700])), (("7.5P", 5.0, 16.0), np.array([0.3060, 0.1830, 19.7700])), (("7.5P", 5.0, 18.0), np.array([0.3052, 0.1711, 19.7700])), (("7.5P", 5.0, 20.0), np.array([0.3042, 0.1606, 19.7700])), (("7.5P", 5.0, 22.0), np.array([0.3038, 0.1500, 19.7700])), (("7.5P", 5.0, 24.0), np.array([0.3030, 0.1423, 19.7700])), (("7.5P", 5.0, 26.0), np.array([0.3022, 0.1331, 19.7700])), (("7.5P", 5.0, 28.0), np.array([0.3018, 0.1253, 19.7700])), (("7.5P", 5.0, 30.0), np.array([0.3010, 0.1170, 19.7700])), (("7.5P", 5.0, 32.0), np.array([0.3000, 0.1080, 19.7700])), (("7.5P", 5.0, 34.0), np.array([0.3000, 0.1000, 19.7700])), (("7.5P", 5.0, 36.0), np.array([0.2990, 0.0930, 19.7700])), (("7.5P", 5.0, 38.0), np.array([0.2980, 0.0880, 19.7700])), (("7.5P", 5.0, 40.0), np.array([0.2980, 0.0810, 19.7700])), (("10P", 5.0, 2.0), np.array([0.3148, 0.2986, 19.7700])), (("10P", 5.0, 4.0), np.array([0.3198, 0.2807, 19.7700])), (("10P", 5.0, 6.0), np.array([0.3243, 0.2630, 19.7700])), (("10P", 5.0, 8.0), np.array([0.3280, 0.2464, 19.7700])), (("10P", 5.0, 10.0), np.array([0.3308, 0.2328, 19.7700])), (("10P", 5.0, 12.0), np.array([0.3335, 0.2187, 19.7700])), (("10P", 5.0, 14.0), np.array([0.3360, 0.2066, 19.7700])), (("10P", 5.0, 16.0), np.array([0.3382, 0.1951, 19.7700])), (("10P", 5.0, 18.0), np.array([0.3401, 0.1840, 19.7700])), (("10P", 5.0, 20.0), np.array([0.3422, 0.1735, 19.7700])), (("10P", 5.0, 22.0), np.array([0.3437, 0.1644, 19.7700])), (("10P", 5.0, 24.0), np.array([0.3450, 0.1555, 19.7700])), (("10P", 5.0, 26.0), np.array([0.3468, 0.1460, 19.7700])), (("10P", 5.0, 28.0), np.array([0.3478, 0.1388, 19.7700])), (("10P", 5.0, 30.0), np.array([0.3490, 0.1308, 19.7700])), (("10P", 5.0, 32.0), np.array([0.3500, 0.1240, 19.7700])), (("10P", 5.0, 34.0), np.array([0.3510, 0.1150, 19.7700])), (("10P", 5.0, 36.0), np.array([0.3520, 0.1070, 19.7700])), (("10P", 5.0, 38.0), np.array([0.3530, 0.1020, 19.7700])), (("10P", 5.0, 40.0), np.array([0.3540, 0.0960, 19.7700])), (("2.5RP", 5.0, 2.0), np.array([0.3199, 0.3019, 19.7700])), (("2.5RP", 5.0, 4.0), np.array([0.3298, 0.2869, 19.7700])), (("2.5RP", 5.0, 6.0), np.array([0.3396, 0.2718, 19.7700])), (("2.5RP", 5.0, 8.0), np.array([0.3490, 0.2570, 19.7700])), (("2.5RP", 5.0, 10.0), np.array([0.3560, 0.2452, 19.7700])), (("2.5RP", 5.0, 12.0), np.array([0.3635, 0.2325, 19.7700])), (("2.5RP", 5.0, 14.0), np.array([0.3703, 0.2211, 19.7700])), (("2.5RP", 5.0, 16.0), np.array([0.3763, 0.2108, 19.7700])), (("2.5RP", 5.0, 18.0), np.array([0.3821, 0.2007, 19.7700])), (("2.5RP", 5.0, 20.0), np.array([0.3873, 0.1909, 19.7700])), (("2.5RP", 5.0, 22.0), np.array([0.3924, 0.1814, 19.7700])), (("2.5RP", 5.0, 24.0), np.array([0.3965, 0.1738, 19.7700])), (("2.5RP", 5.0, 26.0), np.array([0.4011, 0.1652, 19.7700])), (("2.5RP", 5.0, 28.0), np.array([0.4050, 0.1570, 19.7700])), (("2.5RP", 5.0, 30.0), np.array([0.4090, 0.1490, 19.7700])), (("2.5RP", 5.0, 32.0), np.array([0.4130, 0.1420, 19.7700])), (("2.5RP", 5.0, 34.0), np.array([0.4160, 0.1350, 19.7700])), (("2.5RP", 5.0, 36.0), np.array([0.4210, 0.1260, 19.7700])), (("5RP", 5.0, 2.0), np.array([0.3256, 0.3065, 19.7700])), (("5RP", 5.0, 4.0), np.array([0.3421, 0.2954, 19.7700])), (("5RP", 5.0, 6.0), np.array([0.3585, 0.2842, 19.7700])), (("5RP", 5.0, 8.0), np.array([0.3748, 0.2729, 19.7700])), (("5RP", 5.0, 10.0), np.array([0.3880, 0.2630, 19.7700])), (("5RP", 5.0, 12.0), np.array([0.4022, 0.2523, 19.7700])), (("5RP", 5.0, 14.0), np.array([0.4142, 0.2428, 19.7700])), (("5RP", 5.0, 16.0), np.array([0.4261, 0.2331, 19.7700])), (("5RP", 5.0, 18.0), np.array([0.4372, 0.2242, 19.7700])), (("5RP", 5.0, 20.0), np.array([0.4484, 0.2150, 19.7700])), (("5RP", 5.0, 22.0), np.array([0.4581, 0.2068, 19.7700])), (("5RP", 5.0, 24.0), np.array([0.4683, 0.1978, 19.7700])), (("5RP", 5.0, 26.0), np.array([0.4760, 0.1900, 19.7700])), (("5RP", 5.0, 28.0), np.array([0.4830, 0.1830, 19.7700])), (("5RP", 5.0, 30.0), np.array([0.4910, 0.1760, 19.7700])), (("5RP", 5.0, 32.0), np.array([0.4980, 0.1690, 19.7700])), (("7.5RP", 5.0, 2.0), np.array([0.3296, 0.3098, 19.7700])), (("7.5RP", 5.0, 4.0), np.array([0.3515, 0.3024, 19.7700])), (("7.5RP", 5.0, 6.0), np.array([0.3726, 0.2941, 19.7700])), (("7.5RP", 5.0, 8.0), np.array([0.3932, 0.2852, 19.7700])), (("7.5RP", 5.0, 10.0), np.array([0.4108, 0.2773, 19.7700])), (("7.5RP", 5.0, 12.0), np.array([0.4303, 0.2675, 19.7700])), (("7.5RP", 5.0, 14.0), np.array([0.4454, 0.2596, 19.7700])), (("7.5RP", 5.0, 16.0), np.array([0.4617, 0.2506, 19.7700])), (("7.5RP", 5.0, 18.0), np.array([0.4761, 0.2421, 19.7700])), (("7.5RP", 5.0, 20.0), np.array([0.4915, 0.2330, 19.7700])), (("7.5RP", 5.0, 22.0), np.array([0.5045, 0.2248, 19.7700])), (("7.5RP", 5.0, 24.0), np.array([0.5170, 0.2170, 19.7700])), (("7.5RP", 5.0, 26.0), np.array([0.5260, 0.2100, 19.7700])), (("7.5RP", 5.0, 28.0), np.array([0.5360, 0.2040, 19.7700])), (("7.5RP", 5.0, 30.0), np.array([0.5460, 0.1970, 19.7700])), (("10RP", 5.0, 2.0), np.array([0.3332, 0.3131, 19.7700])), (("10RP", 5.0, 4.0), np.array([0.3594, 0.3090, 19.7700])), (("10RP", 5.0, 6.0), np.array([0.3851, 0.3039, 19.7700])), (("10RP", 5.0, 8.0), np.array([0.4105, 0.2980, 19.7700])), (("10RP", 5.0, 10.0), np.array([0.4332, 0.2918, 19.7700])), (("10RP", 5.0, 12.0), np.array([0.4579, 0.2841, 19.7700])), (("10RP", 5.0, 14.0), np.array([0.4767, 0.2776, 19.7700])), (("10RP", 5.0, 16.0), np.array([0.4986, 0.2695, 19.7700])), (("10RP", 5.0, 18.0), np.array([0.5185, 0.2620, 19.7700])), (("10RP", 5.0, 20.0), np.array([0.5396, 0.2535, 19.7700])), (("10RP", 5.0, 22.0), np.array([0.5540, 0.2460, 19.7700])), (("10RP", 5.0, 24.0), np.array([0.5700, 0.2400, 19.7700])), (("10RP", 5.0, 26.0), np.array([0.5820, 0.2340, 19.7700])), (("10RP", 5.0, 28.0), np.array([0.5930, 0.2290, 19.7700])), (("2.5R", 5.0, 2.0), np.array([0.3360, 0.3158, 19.7700])), (("2.5R", 5.0, 4.0), np.array([0.3660, 0.3148, 19.7700])), (("2.5R", 5.0, 6.0), np.array([0.3960, 0.3130, 19.7700])), (("2.5R", 5.0, 8.0), np.array([0.4252, 0.3101, 19.7700])), (("2.5R", 5.0, 10.0), np.array([0.4533, 0.3058, 19.7700])), (("2.5R", 5.0, 12.0), np.array([0.4820, 0.3002, 19.7700])), (("2.5R", 5.0, 14.0), np.array([0.5047, 0.2950, 19.7700])), (("2.5R", 5.0, 16.0), np.array([0.5300, 0.2880, 19.7700])), (("2.5R", 5.0, 18.0), np.array([0.5540, 0.2804, 19.7700])), (("2.5R", 5.0, 20.0), np.array([0.5784, 0.2719, 19.7700])), (("2.5R", 5.0, 22.0), np.array([0.5930, 0.2650, 19.7700])), (("2.5R", 5.0, 24.0), np.array([0.6070, 0.2590, 19.7700])), (("2.5R", 5.0, 26.0), np.array([0.6200, 0.2530, 19.7700])), (("2.5R", 5.0, 28.0), np.array([0.6310, 0.2480, 19.7700])), (("5R", 5.0, 2.0), np.array([0.3392, 0.3192, 19.7700])), (("5R", 5.0, 4.0), np.array([0.3740, 0.3220, 19.7700])), (("5R", 5.0, 6.0), np.array([0.4078, 0.3238, 19.7700])), (("5R", 5.0, 8.0), np.array([0.4413, 0.3240, 19.7700])), (("5R", 5.0, 10.0), np.array([0.4747, 0.3227, 19.7700])), (("5R", 5.0, 12.0), np.array([0.5071, 0.3194, 19.7700])), (("5R", 5.0, 14.0), np.array([0.5341, 0.3158, 19.7700])), (("5R", 5.0, 16.0), np.array([0.5637, 0.3102, 19.7700])), (("5R", 5.0, 18.0), np.array([0.5918, 0.3038, 19.7700])), (("5R", 5.0, 20.0), np.array([0.6142, 0.2970, 19.7700])), (("5R", 5.0, 22.0), np.array([0.6340, 0.2900, 19.7700])), (("5R", 5.0, 24.0), np.array([0.6480, 0.2840, 19.7700])), (("5R", 5.0, 26.0), np.array([0.6620, 0.2790, 19.7700])), (("5R", 5.0, 28.0), np.array([0.6740, 0.2740, 19.7700])), (("7.5R", 5.0, 2.0), np.array([0.3425, 0.3229, 19.7700])), (("7.5R", 5.0, 4.0), np.array([0.3806, 0.3294, 19.7700])), (("7.5R", 5.0, 6.0), np.array([0.4180, 0.3348, 19.7700])), (("7.5R", 5.0, 8.0), np.array([0.4563, 0.3387, 19.7700])), (("7.5R", 5.0, 10.0), np.array([0.4927, 0.3399, 19.7700])), (("7.5R", 5.0, 12.0), np.array([0.5280, 0.3389, 19.7700])), (("7.5R", 5.0, 14.0), np.array([0.5590, 0.3370, 19.7700])), (("7.5R", 5.0, 16.0), np.array([0.5901, 0.3331, 19.7700])), (("7.5R", 5.0, 18.0), np.array([0.6161, 0.3277, 19.7700])), (("7.5R", 5.0, 20.0), np.array([0.6388, 0.3216, 19.7700])), (("7.5R", 5.0, 22.0), np.array([0.6610, 0.3170, 19.7700])), (("7.5R", 5.0, 24.0), np.array([0.6800, 0.3120, 19.7700])), (("7.5R", 5.0, 26.0), np.array([0.6920, 0.3070, 19.7700])), (("7.5R", 5.0, 28.0), np.array([0.7080, 0.3020, 19.7700])), (("10R", 5.0, 2.0), np.array([0.3465, 0.3278, 19.7700])), (("10R", 5.0, 4.0), np.array([0.3879, 0.3398, 19.7700])), (("10R", 5.0, 6.0), np.array([0.4299, 0.3499, 19.7700])), (("10R", 5.0, 8.0), np.array([0.4713, 0.3575, 19.7700])), (("10R", 5.0, 10.0), np.array([0.5113, 0.3630, 19.7700])), (("10R", 5.0, 12.0), np.array([0.5481, 0.3660, 19.7700])), (("10R", 5.0, 14.0), np.array([0.5771, 0.3664, 19.7700])), (("10R", 5.0, 16.0), np.array([0.6037, 0.3657, 19.7700])), (("10R", 5.0, 18.0), np.array([0.6297, 0.3642, 19.7700])), (("10R", 5.0, 20.0), np.array([0.6550, 0.3610, 19.7700])), (("10R", 5.0, 22.0), np.array([0.6800, 0.3570, 19.7700])), (("10R", 5.0, 24.0), np.array([0.7020, 0.3540, 19.7700])), (("10R", 5.0, 26.0), np.array([0.7210, 0.3500, 19.7700])), (("2.5YR", 5.0, 2.0), np.array([0.3506, 0.3337, 19.7700])), (("2.5YR", 5.0, 4.0), np.array([0.3925, 0.3494, 19.7700])), (("2.5YR", 5.0, 6.0), np.array([0.4365, 0.3640, 19.7700])), (("2.5YR", 5.0, 8.0), np.array([0.4795, 0.3758, 19.7700])), (("2.5YR", 5.0, 10.0), np.array([0.5175, 0.3844, 19.7700])), (("2.5YR", 5.0, 12.0), np.array([0.5482, 0.3909, 19.7700])), (("2.5YR", 5.0, 14.0), np.array([0.5731, 0.3953, 19.7700])), (("2.5YR", 5.0, 16.0), np.array([0.5933, 0.3989, 19.7700])), (("2.5YR", 5.0, 18.0), np.array([0.6170, 0.4020, 19.7700])), (("2.5YR", 5.0, 20.0), np.array([0.6360, 0.4060, 19.7700])), (("5YR", 5.0, 2.0), np.array([0.3530, 0.3395, 19.7700])), (("5YR", 5.0, 4.0), np.array([0.3968, 0.3614, 19.7700])), (("5YR", 5.0, 6.0), np.array([0.4420, 0.3808, 19.7700])), (("5YR", 5.0, 8.0), np.array([0.4830, 0.3960, 19.7700])), (("5YR", 5.0, 10.0), np.array([0.5161, 0.4064, 19.7700])), (("5YR", 5.0, 12.0), np.array([0.5422, 0.4141, 19.7700])), (("5YR", 5.0, 14.0), np.array([0.5642, 0.4201, 19.7700])), (("5YR", 5.0, 16.0), np.array([0.5840, 0.4250, 19.7700])), (("5YR", 5.0, 18.0), np.array([0.6010, 0.4290, 19.7700])), (("7.5YR", 5.0, 2.0), np.array([0.3540, 0.3445, 19.7700])), (("7.5YR", 5.0, 4.0), np.array([0.3991, 0.3714, 19.7700])), (("7.5YR", 5.0, 6.0), np.array([0.4440, 0.3954, 19.7700])), (("7.5YR", 5.0, 8.0), np.array([0.4820, 0.4141, 19.7700])), (("7.5YR", 5.0, 10.0), np.array([0.5108, 0.4276, 19.7700])), (("7.5YR", 5.0, 12.0), np.array([0.5335, 0.4378, 19.7700])), (("7.5YR", 5.0, 14.0), np.array([0.5506, 0.4450, 19.7700])), (("7.5YR", 5.0, 16.0), np.array([0.5680, 0.4530, 19.7700])), (("10YR", 5.0, 2.0), np.array([0.3546, 0.3514, 19.7700])), (("10YR", 5.0, 4.0), np.array([0.3995, 0.3840, 19.7700])), (("10YR", 5.0, 6.0), np.array([0.4428, 0.4128, 19.7700])), (("10YR", 5.0, 8.0), np.array([0.4770, 0.4338, 19.7700])), (("10YR", 5.0, 10.0), np.array([0.5025, 0.4489, 19.7700])), (("10YR", 5.0, 12.0), np.array([0.5211, 0.4600, 19.7700])), (("10YR", 5.0, 14.0), np.array([0.5390, 0.4680, 19.7700])), (("10YR", 5.0, 16.0), np.array([0.5520, 0.4770, 19.7700])), (("2.5Y", 5.0, 2.0), np.array([0.3534, 0.3570, 19.7700])), (("2.5Y", 5.0, 4.0), np.array([0.3968, 0.3954, 19.7700])), (("2.5Y", 5.0, 6.0), np.array([0.4380, 0.4292, 19.7700])), (("2.5Y", 5.0, 8.0), np.array([0.4685, 0.4524, 19.7700])), (("2.5Y", 5.0, 10.0), np.array([0.4905, 0.4683, 19.7700])), (("2.5Y", 5.0, 12.0), np.array([0.5082, 0.4812, 19.7700])), (("2.5Y", 5.0, 14.0), np.array([0.5230, 0.4910, 19.7700])), (("5Y", 5.0, 2.0), np.array([0.3500, 0.3620, 19.7700])), (("5Y", 5.0, 4.0), np.array([0.3915, 0.4057, 19.7700])), (("5Y", 5.0, 6.0), np.array([0.4302, 0.4435, 19.7700])), (("5Y", 5.0, 8.0), np.array([0.4579, 0.4692, 19.7700])), (("5Y", 5.0, 10.0), np.array([0.4777, 0.4876, 19.7700])), (("5Y", 5.0, 12.0), np.array([0.4932, 0.5019, 19.7700])), (("5Y", 5.0, 14.0), np.array([0.5070, 0.5120, 19.7700])), (("7.5Y", 5.0, 2.0), np.array([0.3470, 0.3640, 19.7700])), (("7.5Y", 5.0, 4.0), np.array([0.3850, 0.4120, 19.7700])), (("7.5Y", 5.0, 6.0), np.array([0.4199, 0.4551, 19.7700])), (("7.5Y", 5.0, 8.0), np.array([0.4450, 0.4850, 19.7700])), (("7.5Y", 5.0, 10.0), np.array([0.4632, 0.5057, 19.7700])), (("7.5Y", 5.0, 12.0), np.array([0.4767, 0.5208, 19.7700])), (("7.5Y", 5.0, 14.0), np.array([0.4890, 0.5350, 19.7700])), (("10Y", 6.0, 2.0), np.array([0.3398, 0.3611, 30.0300])), (("10Y", 6.0, 4.0), np.array([0.3679, 0.4033, 30.0300])), (("10Y", 6.0, 6.0), np.array([0.3960, 0.4452, 30.0300])), (("10Y", 6.0, 8.0), np.array([0.4201, 0.4812, 30.0300])), (("10Y", 6.0, 10.0), np.array([0.4372, 0.5068, 30.0300])), (("10Y", 6.0, 12.0), np.array([0.4488, 0.5237, 30.0300])), (("10Y", 6.0, 14.0), np.array([0.4593, 0.5392, 30.0300])), (("10Y", 6.0, 16.0), np.array([0.4650, 0.5460, 30.0300])), (("2.5GY", 6.0, 2.0), np.array([0.3342, 0.3607, 30.0300])), (("2.5GY", 6.0, 4.0), np.array([0.3572, 0.4038, 30.0300])), (("2.5GY", 6.0, 6.0), np.array([0.3799, 0.4470, 30.0300])), (("2.5GY", 6.0, 8.0), np.array([0.4006, 0.4885, 30.0300])), (("2.5GY", 6.0, 10.0), np.array([0.4159, 0.5190, 30.0300])), (("2.5GY", 6.0, 12.0), np.array([0.4269, 0.5414, 30.0300])), (("2.5GY", 6.0, 14.0), np.array([0.4354, 0.5594, 30.0300])), (("2.5GY", 6.0, 16.0), np.array([0.4390, 0.5680, 30.0300])), (("5GY", 6.0, 2.0), np.array([0.3288, 0.3592, 30.0300])), (("5GY", 6.0, 4.0), np.array([0.3461, 0.4008, 30.0300])), (("5GY", 6.0, 6.0), np.array([0.3622, 0.4438, 30.0300])), (("5GY", 6.0, 8.0), np.array([0.3772, 0.4880, 30.0300])), (("5GY", 6.0, 10.0), np.array([0.3891, 0.5264, 30.0300])), (("5GY", 6.0, 12.0), np.array([0.3980, 0.5564, 30.0300])), (("5GY", 6.0, 14.0), np.array([0.4042, 0.5788, 30.0300])), (("5GY", 6.0, 16.0), np.array([0.4090, 0.5940, 30.0300])), (("5GY", 6.0, 18.0), np.array([0.4130, 0.6070, 30.0300])), (("7.5GY", 6.0, 2.0), np.array([0.3193, 0.3550, 30.0300])), (("7.5GY", 6.0, 4.0), np.array([0.3275, 0.3922, 30.0300])), (("7.5GY", 6.0, 6.0), np.array([0.3351, 0.4321, 30.0300])), (("7.5GY", 6.0, 8.0), np.array([0.3418, 0.4768, 30.0300])), (("7.5GY", 6.0, 10.0), np.array([0.3463, 0.5196, 30.0300])), (("7.5GY", 6.0, 12.0), np.array([0.3488, 0.5596, 30.0300])), (("7.5GY", 6.0, 14.0), np.array([0.3498, 0.5985, 30.0300])), (("7.5GY", 6.0, 16.0), np.array([0.3498, 0.6282, 30.0300])), (("7.5GY", 6.0, 18.0), np.array([0.3490, 0.6500, 30.0300])), (("7.5GY", 6.0, 20.0), np.array([0.3480, 0.6670, 30.0300])), (("7.5GY", 6.0, 22.0), np.array([0.3470, 0.6880, 30.0300])), (("10GY", 6.0, 2.0), np.array([0.3112, 0.3496, 30.0300])), (("10GY", 6.0, 4.0), np.array([0.3124, 0.3822, 30.0300])), (("10GY", 6.0, 6.0), np.array([0.3128, 0.4175, 30.0300])), (("10GY", 6.0, 8.0), np.array([0.3116, 0.4563, 30.0300])), (("10GY", 6.0, 10.0), np.array([0.3086, 0.4949, 30.0300])), (("10GY", 6.0, 12.0), np.array([0.3037, 0.5358, 30.0300])), (("10GY", 6.0, 14.0), np.array([0.2962, 0.5802, 30.0300])), (("10GY", 6.0, 16.0), np.array([0.2872, 0.6199, 30.0300])), (("10GY", 6.0, 18.0), np.array([0.2763, 0.6616, 30.0300])), (("10GY", 6.0, 20.0), np.array([0.2648, 0.7004, 30.0300])), (("10GY", 6.0, 22.0), np.array([0.2530, 0.7380, 30.0300])), (("10GY", 6.0, 24.0), np.array([0.2380, 0.7820, 30.0300])), (("10GY", 6.0, 26.0), np.array([0.2250, 0.8200, 30.0300])), (("10GY", 6.0, 28.0), np.array([0.2080, 0.8630, 30.0300])), (("10GY", 6.0, 30.0), np.array([0.1880, 0.9050, 30.0300])), (("10GY", 6.0, 32.0), np.array([0.1710, 0.9390, 30.0300])), (("2.5G", 6.0, 2.0), np.array([0.3039, 0.3437, 30.0300])), (("2.5G", 6.0, 4.0), np.array([0.2967, 0.3695, 30.0300])), (("2.5G", 6.0, 6.0), np.array([0.2892, 0.3963, 30.0300])), (("2.5G", 6.0, 8.0), np.array([0.2799, 0.4239, 30.0300])), (("2.5G", 6.0, 10.0), np.array([0.2690, 0.4530, 30.0300])), (("2.5G", 6.0, 12.0), np.array([0.2574, 0.4814, 30.0300])), (("2.5G", 6.0, 14.0), np.array([0.2426, 0.5133, 30.0300])), (("2.5G", 6.0, 16.0), np.array([0.2278, 0.5430, 30.0300])), (("2.5G", 6.0, 18.0), np.array([0.2102, 0.5737, 30.0300])), (("2.5G", 6.0, 20.0), np.array([0.1922, 0.6035, 30.0300])), (("2.5G", 6.0, 22.0), np.array([0.1739, 0.6318, 30.0300])), (("2.5G", 6.0, 24.0), np.array([0.1536, 0.6605, 30.0300])), (("2.5G", 6.0, 26.0), np.array([0.1340, 0.6871, 30.0300])), (("2.5G", 6.0, 28.0), np.array([0.1145, 0.7122, 30.0300])), (("2.5G", 6.0, 30.0), np.array([0.0920, 0.7380, 30.0300])), (("2.5G", 6.0, 32.0), np.array([0.0690, 0.7640, 30.0300])), (("2.5G", 6.0, 34.0), np.array([0.0470, 0.7890, 30.0300])), (("5G", 6.0, 2.0), np.array([0.2988, 0.3382, 30.0300])), (("5G", 6.0, 4.0), np.array([0.2868, 0.3595, 30.0300])), (("5G", 6.0, 6.0), np.array([0.2748, 0.3795, 30.0300])), (("5G", 6.0, 8.0), np.array([0.2612, 0.3990, 30.0300])), (("5G", 6.0, 10.0), np.array([0.2466, 0.4181, 30.0300])), (("5G", 6.0, 12.0), np.array([0.2293, 0.4390, 30.0300])), (("5G", 6.0, 14.0), np.array([0.2130, 0.4571, 30.0300])), (("5G", 6.0, 16.0), np.array([0.1960, 0.4751, 30.0300])), (("5G", 6.0, 18.0), np.array([0.1785, 0.4924, 30.0300])), (("5G", 6.0, 20.0), np.array([0.1609, 0.5091, 30.0300])), (("5G", 6.0, 22.0), np.array([0.1432, 0.5252, 30.0300])), (("5G", 6.0, 24.0), np.array([0.1252, 0.5408, 30.0300])), (("5G", 6.0, 26.0), np.array([0.1079, 0.5560, 30.0300])), (("5G", 6.0, 28.0), np.array([0.0908, 0.5695, 30.0300])), (("5G", 6.0, 30.0), np.array([0.0710, 0.5860, 30.0300])), (("5G", 6.0, 32.0), np.array([0.0530, 0.5990, 30.0300])), (("5G", 6.0, 34.0), np.array([0.0310, 0.6140, 30.0300])), (("7.5G", 6.0, 2.0), np.array([0.2958, 0.3344, 30.0300])), (("7.5G", 6.0, 4.0), np.array([0.2807, 0.3522, 30.0300])), (("7.5G", 6.0, 6.0), np.array([0.2662, 0.3672, 30.0300])), (("7.5G", 6.0, 8.0), np.array([0.2510, 0.3829, 30.0300])), (("7.5G", 6.0, 10.0), np.array([0.2350, 0.3979, 30.0300])), (("7.5G", 6.0, 12.0), np.array([0.2171, 0.4138, 30.0300])), (("7.5G", 6.0, 14.0), np.array([0.2001, 0.4278, 30.0300])), (("7.5G", 6.0, 16.0), np.array([0.1832, 0.4414, 30.0300])), (("7.5G", 6.0, 18.0), np.array([0.1654, 0.4551, 30.0300])), (("7.5G", 6.0, 20.0), np.array([0.1485, 0.4677, 30.0300])), (("7.5G", 6.0, 22.0), np.array([0.1325, 0.4795, 30.0300])), (("7.5G", 6.0, 24.0), np.array([0.1159, 0.4910, 30.0300])), (("7.5G", 6.0, 26.0), np.array([0.1010, 0.5018, 30.0300])), (("7.5G", 6.0, 28.0), np.array([0.0858, 0.5127, 30.0300])), (("7.5G", 6.0, 30.0), np.array([0.0680, 0.5240, 30.0300])), (("7.5G", 6.0, 32.0), np.array([0.0520, 0.5350, 30.0300])), (("7.5G", 6.0, 34.0), np.array([0.0340, 0.5460, 30.0300])), (("10G", 6.0, 2.0), np.array([0.2929, 0.3303, 30.0300])), (("10G", 6.0, 4.0), np.array([0.2749, 0.3443, 30.0300])), (("10G", 6.0, 6.0), np.array([0.2591, 0.3558, 30.0300])), (("10G", 6.0, 8.0), np.array([0.2420, 0.3679, 30.0300])), (("10G", 6.0, 10.0), np.array([0.2247, 0.3796, 30.0300])), (("10G", 6.0, 12.0), np.array([0.2060, 0.3914, 30.0300])), (("10G", 6.0, 14.0), np.array([0.1895, 0.4015, 30.0300])), (("10G", 6.0, 16.0), np.array([0.1722, 0.4113, 30.0300])), (("10G", 6.0, 18.0), np.array([0.1551, 0.4208, 30.0300])), (("10G", 6.0, 20.0), np.array([0.1382, 0.4299, 30.0300])), (("10G", 6.0, 22.0), np.array([0.1230, 0.4378, 30.0300])), (("10G", 6.0, 24.0), np.array([0.1070, 0.4458, 30.0300])), (("10G", 6.0, 26.0), np.array([0.0941, 0.4520, 30.0300])), (("10G", 6.0, 28.0), np.array([0.0810, 0.4580, 30.0300])), (("10G", 6.0, 30.0), np.array([0.0660, 0.4650, 30.0300])), (("10G", 6.0, 32.0), np.array([0.0520, 0.4710, 30.0300])), (("10G", 6.0, 34.0), np.array([0.0350, 0.4800, 30.0300])), (("2.5BG", 6.0, 2.0), np.array([0.2902, 0.3268, 30.0300])), (("2.5BG", 6.0, 4.0), np.array([0.2702, 0.3369, 30.0300])), (("2.5BG", 6.0, 6.0), np.array([0.2526, 0.3448, 30.0300])), (("2.5BG", 6.0, 8.0), np.array([0.2332, 0.3522, 30.0300])), (("2.5BG", 6.0, 10.0), np.array([0.2148, 0.3584, 30.0300])), (("2.5BG", 6.0, 12.0), np.array([0.1954, 0.3645, 30.0300])), (("2.5BG", 6.0, 14.0), np.array([0.1779, 0.3699, 30.0300])), (("2.5BG", 6.0, 16.0), np.array([0.1600, 0.3748, 30.0300])), (("2.5BG", 6.0, 18.0), np.array([0.1428, 0.3790, 30.0300])), (("2.5BG", 6.0, 20.0), np.array([0.1269, 0.3829, 30.0300])), (("2.5BG", 6.0, 22.0), np.array([0.1120, 0.3860, 30.0300])), (("2.5BG", 6.0, 24.0), np.array([0.0960, 0.3890, 30.0300])), (("2.5BG", 6.0, 26.0), np.array([0.0830, 0.3920, 30.0300])), (("2.5BG", 6.0, 28.0), np.array([0.0740, 0.3940, 30.0300])), (("2.5BG", 6.0, 30.0), np.array([0.0620, 0.3970, 30.0300])), (("2.5BG", 6.0, 32.0), np.array([0.0500, 0.3980, 30.0300])), (("5BG", 6.0, 2.0), np.array([0.2872, 0.3219, 30.0300])), (("5BG", 6.0, 4.0), np.array([0.2648, 0.3262, 30.0300])), (("5BG", 6.0, 6.0), np.array([0.2441, 0.3290, 30.0300])), (("5BG", 6.0, 8.0), np.array([0.2236, 0.3311, 30.0300])), (("5BG", 6.0, 10.0), np.array([0.2037, 0.3329, 30.0300])), (("5BG", 6.0, 12.0), np.array([0.1844, 0.3337, 30.0300])), (("5BG", 6.0, 14.0), np.array([0.1662, 0.3343, 30.0300])), (("5BG", 6.0, 16.0), np.array([0.1491, 0.3345, 30.0300])), (("5BG", 6.0, 18.0), np.array([0.1325, 0.3345, 30.0300])), (("5BG", 6.0, 20.0), np.array([0.1168, 0.3344, 30.0300])), (("5BG", 6.0, 22.0), np.array([0.1010, 0.3320, 30.0300])), (("5BG", 6.0, 24.0), np.array([0.0860, 0.3320, 30.0300])), (("5BG", 6.0, 26.0), np.array([0.0750, 0.3310, 30.0300])), (("5BG", 6.0, 28.0), np.array([0.0680, 0.3300, 30.0300])), (("5BG", 6.0, 30.0), np.array([0.0600, 0.3300, 30.0300])), (("7.5BG", 6.0, 2.0), np.array([0.2849, 0.3172, 30.0300])), (("7.5BG", 6.0, 4.0), np.array([0.2604, 0.3169, 30.0300])), (("7.5BG", 6.0, 6.0), np.array([0.2384, 0.3155, 30.0300])), (("7.5BG", 6.0, 8.0), np.array([0.2171, 0.3138, 30.0300])), (("7.5BG", 6.0, 10.0), np.array([0.1961, 0.3110, 30.0300])), (("7.5BG", 6.0, 12.0), np.array([0.1762, 0.3081, 30.0300])), (("7.5BG", 6.0, 14.0), np.array([0.1585, 0.3052, 30.0300])), (("7.5BG", 6.0, 16.0), np.array([0.1408, 0.3017, 30.0300])), (("7.5BG", 6.0, 18.0), np.array([0.1248, 0.2981, 30.0300])), (("7.5BG", 6.0, 20.0), np.array([0.1080, 0.2940, 30.0300])), (("7.5BG", 6.0, 22.0), np.array([0.0920, 0.2900, 30.0300])), (("7.5BG", 6.0, 24.0), np.array([0.0780, 0.2870, 30.0300])), (("7.5BG", 6.0, 26.0), np.array([0.0680, 0.2830, 30.0300])), (("10BG", 6.0, 2.0), np.array([0.2837, 0.3132, 30.0300])), (("10BG", 6.0, 4.0), np.array([0.2578, 0.3078, 30.0300])), (("10BG", 6.0, 6.0), np.array([0.2335, 0.3015, 30.0300])), (("10BG", 6.0, 8.0), np.array([0.2116, 0.2950, 30.0300])), (("10BG", 6.0, 10.0), np.array([0.1909, 0.2881, 30.0300])), (("10BG", 6.0, 12.0), np.array([0.1698, 0.2802, 30.0300])), (("10BG", 6.0, 14.0), np.array([0.1518, 0.2729, 30.0300])), (("10BG", 6.0, 16.0), np.array([0.1337, 0.2651, 30.0300])), (("10BG", 6.0, 18.0), np.array([0.1181, 0.2581, 30.0300])), (("10BG", 6.0, 20.0), np.array([0.1010, 0.2510, 30.0300])), (("10BG", 6.0, 22.0), np.array([0.0860, 0.2440, 30.0300])), (("10BG", 6.0, 24.0), np.array([0.0720, 0.2370, 30.0300])), (("2.5B", 6.0, 2.0), np.array([0.2835, 0.3097, 30.0300])), (("2.5B", 6.0, 4.0), np.array([0.2571, 0.3008, 30.0300])), (("2.5B", 6.0, 6.0), np.array([0.2312, 0.2899, 30.0300])), (("2.5B", 6.0, 8.0), np.array([0.2080, 0.2789, 30.0300])), (("2.5B", 6.0, 10.0), np.array([0.1879, 0.2682, 30.0300])), (("2.5B", 6.0, 12.0), np.array([0.1660, 0.2561, 30.0300])), (("2.5B", 6.0, 14.0), np.array([0.1480, 0.2459, 30.0300])), (("2.5B", 6.0, 16.0), np.array([0.1294, 0.2348, 30.0300])), (("2.5B", 6.0, 18.0), np.array([0.1140, 0.2260, 30.0300])), (("2.5B", 6.0, 20.0), np.array([0.0990, 0.2160, 30.0300])), (("2.5B", 6.0, 22.0), np.array([0.0850, 0.2050, 30.0300])), (("5B", 6.0, 2.0), np.array([0.2842, 0.3063, 30.0300])), (("5B", 6.0, 4.0), np.array([0.2579, 0.2938, 30.0300])), (("5B", 6.0, 6.0), np.array([0.2320, 0.2789, 30.0300])), (("5B", 6.0, 8.0), np.array([0.2088, 0.2635, 30.0300])), (("5B", 6.0, 10.0), np.array([0.1883, 0.2487, 30.0300])), (("5B", 6.0, 12.0), np.array([0.1685, 0.2339, 30.0300])), (("5B", 6.0, 14.0), np.array([0.1496, 0.2193, 30.0300])), (("5B", 6.0, 16.0), np.array([0.1310, 0.2048, 30.0300])), (("5B", 6.0, 18.0), np.array([0.1170, 0.1920, 30.0300])), (("5B", 6.0, 20.0), np.array([0.1020, 0.1810, 30.0300])), (("7.5B", 6.0, 2.0), np.array([0.2854, 0.3037, 30.0300])), (("7.5B", 6.0, 4.0), np.array([0.2602, 0.2881, 30.0300])), (("7.5B", 6.0, 6.0), np.array([0.2352, 0.2708, 30.0300])), (("7.5B", 6.0, 8.0), np.array([0.2132, 0.2537, 30.0300])), (("7.5B", 6.0, 10.0), np.array([0.1934, 0.2374, 30.0300])), (("7.5B", 6.0, 12.0), np.array([0.1734, 0.2203, 30.0300])), (("7.5B", 6.0, 14.0), np.array([0.1556, 0.2043, 30.0300])), (("7.5B", 6.0, 16.0), np.array([0.1376, 0.1879, 30.0300])), (("7.5B", 6.0, 18.0), np.array([0.1230, 0.1740, 30.0300])), (("7.5B", 6.0, 20.0), np.array([0.1110, 0.1620, 30.0300])), (("7.5B", 6.0, 22.0), np.array([0.1000, 0.1510, 30.0300])), (("10B", 6.0, 2.0), np.array([0.2871, 0.3012, 30.0300])), (("10B", 6.0, 4.0), np.array([0.2637, 0.2840, 30.0300])), (("10B", 6.0, 6.0), np.array([0.2399, 0.2650, 30.0300])), (("10B", 6.0, 8.0), np.array([0.2189, 0.2468, 30.0300])), (("10B", 6.0, 10.0), np.array([0.2000, 0.2298, 30.0300])), (("10B", 6.0, 12.0), np.array([0.1803, 0.2114, 30.0300])), (("10B", 6.0, 14.0), np.array([0.1629, 0.1947, 30.0300])), (("10B", 6.0, 16.0), np.array([0.1454, 0.1778, 30.0300])), (("10B", 6.0, 18.0), np.array([0.1310, 0.1640, 30.0300])), (("10B", 6.0, 20.0), np.array([0.1200, 0.1530, 30.0300])), (("10B", 6.0, 22.0), np.array([0.1110, 0.1440, 30.0300])), (("10B", 6.0, 24.0), np.array([0.0990, 0.1330, 30.0300])), (("2.5PB", 6.0, 2.0), np.array([0.2897, 0.2991, 30.0300])), (("2.5PB", 6.0, 4.0), np.array([0.2684, 0.2804, 30.0300])), (("2.5PB", 6.0, 6.0), np.array([0.2465, 0.2599, 30.0300])), (("2.5PB", 6.0, 8.0), np.array([0.2274, 0.2406, 30.0300])), (("2.5PB", 6.0, 10.0), np.array([0.2095, 0.2225, 30.0300])), (("2.5PB", 6.0, 12.0), np.array([0.1913, 0.2038, 30.0300])), (("2.5PB", 6.0, 14.0), np.array([0.1754, 0.1868, 30.0300])), (("2.5PB", 6.0, 16.0), np.array([0.1590, 0.1690, 30.0300])), (("2.5PB", 6.0, 18.0), np.array([0.1480, 0.1560, 30.0300])), (("2.5PB", 6.0, 20.0), np.array([0.1370, 0.1440, 30.0300])), (("2.5PB", 6.0, 22.0), np.array([0.1270, 0.1340, 30.0300])), (("2.5PB", 6.0, 24.0), np.array([0.1170, 0.1230, 30.0300])), (("5PB", 6.0, 2.0), np.array([0.2923, 0.2978, 30.0300])), (("5PB", 6.0, 4.0), np.array([0.2734, 0.2778, 30.0300])), (("5PB", 6.0, 6.0), np.array([0.2533, 0.2558, 30.0300])), (("5PB", 6.0, 8.0), np.array([0.2360, 0.2365, 30.0300])), (("5PB", 6.0, 10.0), np.array([0.2197, 0.2188, 30.0300])), (("5PB", 6.0, 12.0), np.array([0.2026, 0.1999, 30.0300])), (("5PB", 6.0, 14.0), np.array([0.1873, 0.1822, 30.0300])), (("5PB", 6.0, 16.0), np.array([0.1710, 0.1640, 30.0300])), (("5PB", 6.0, 18.0), np.array([0.1620, 0.1530, 30.0300])), (("5PB", 6.0, 20.0), np.array([0.1510, 0.1400, 30.0300])), (("5PB", 6.0, 22.0), np.array([0.1430, 0.1290, 30.0300])), (("5PB", 6.0, 24.0), np.array([0.1350, 0.1180, 30.0300])), (("5PB", 6.0, 26.0), np.array([0.1260, 0.1070, 30.0300])), (("7.5PB", 6.0, 2.0), np.array([0.2955, 0.2963, 30.0300])), (("7.5PB", 6.0, 4.0), np.array([0.2798, 0.2752, 30.0300])), (("7.5PB", 6.0, 6.0), np.array([0.2638, 0.2531, 30.0300])), (("7.5PB", 6.0, 8.0), np.array([0.2505, 0.2347, 30.0300])), (("7.5PB", 6.0, 10.0), np.array([0.2378, 0.2168, 30.0300])), (("7.5PB", 6.0, 12.0), np.array([0.2241, 0.1975, 30.0300])), (("7.5PB", 6.0, 14.0), np.array([0.2119, 0.1799, 30.0300])), (("7.5PB", 6.0, 16.0), np.array([0.1990, 0.1630, 30.0300])), (("7.5PB", 6.0, 18.0), np.array([0.1920, 0.1510, 30.0300])), (("7.5PB", 6.0, 20.0), np.array([0.1850, 0.1390, 30.0300])), (("7.5PB", 6.0, 22.0), np.array([0.1790, 0.1280, 30.0300])), (("7.5PB", 6.0, 24.0), np.array([0.1730, 0.1180, 30.0300])), (("7.5PB", 6.0, 26.0), np.array([0.1660, 0.1050, 30.0300])), (("10PB", 6.0, 2.0), np.array([0.2988, 0.2961, 30.0300])), (("10PB", 6.0, 4.0), np.array([0.2863, 0.2747, 30.0300])), (("10PB", 6.0, 6.0), np.array([0.2740, 0.2533, 30.0300])), (("10PB", 6.0, 8.0), np.array([0.2637, 0.2352, 30.0300])), (("10PB", 6.0, 10.0), np.array([0.2540, 0.2176, 30.0300])), (("10PB", 6.0, 12.0), np.array([0.2440, 0.1998, 30.0300])), (("10PB", 6.0, 14.0), np.array([0.2352, 0.1839, 30.0300])), (("10PB", 6.0, 16.0), np.array([0.2265, 0.1671, 30.0300])), (("10PB", 6.0, 18.0), np.array([0.2210, 0.1560, 30.0300])), (("10PB", 6.0, 20.0), np.array([0.2140, 0.1430, 30.0300])), (("10PB", 6.0, 22.0), np.array([0.2080, 0.1320, 30.0300])), (("10PB", 6.0, 24.0), np.array([0.2040, 0.1230, 30.0300])), (("10PB", 6.0, 26.0), np.array([0.1990, 0.1110, 30.0300])), (("10PB", 6.0, 28.0), np.array([0.1940, 0.1010, 30.0300])), (("2.5P", 6.0, 2.0), np.array([0.3016, 0.2960, 30.0300])), (("2.5P", 6.0, 4.0), np.array([0.2932, 0.2759, 30.0300])), (("2.5P", 6.0, 6.0), np.array([0.2842, 0.2550, 30.0300])), (("2.5P", 6.0, 8.0), np.array([0.2770, 0.2372, 30.0300])), (("2.5P", 6.0, 10.0), np.array([0.2703, 0.2204, 30.0300])), (("2.5P", 6.0, 12.0), np.array([0.2647, 0.2052, 30.0300])), (("2.5P", 6.0, 14.0), np.array([0.2593, 0.1909, 30.0300])), (("2.5P", 6.0, 16.0), np.array([0.2548, 0.1768, 30.0300])), (("2.5P", 6.0, 18.0), np.array([0.2504, 0.1658, 30.0300])), (("2.5P", 6.0, 20.0), np.array([0.2460, 0.1530, 30.0300])), (("2.5P", 6.0, 22.0), np.array([0.2420, 0.1420, 30.0300])), (("2.5P", 6.0, 24.0), np.array([0.2390, 0.1320, 30.0300])), (("2.5P", 6.0, 26.0), np.array([0.2350, 0.1210, 30.0300])), (("2.5P", 6.0, 28.0), np.array([0.2310, 0.1120, 30.0300])), (("2.5P", 6.0, 30.0), np.array([0.2280, 0.1020, 30.0300])), (("2.5P", 6.0, 32.0), np.array([0.2250, 0.0930, 30.0300])), (("5P", 6.0, 2.0), np.array([0.3050, 0.2967, 30.0300])), (("5P", 6.0, 4.0), np.array([0.3001, 0.2778, 30.0300])), (("5P", 6.0, 6.0), np.array([0.2950, 0.2585, 30.0300])), (("5P", 6.0, 8.0), np.array([0.2905, 0.2421, 30.0300])), (("5P", 6.0, 10.0), np.array([0.2862, 0.2260, 30.0300])), (("5P", 6.0, 12.0), np.array([0.2829, 0.2121, 30.0300])), (("5P", 6.0, 14.0), np.array([0.2794, 0.1979, 30.0300])), (("5P", 6.0, 16.0), np.array([0.2761, 0.1852, 30.0300])), (("5P", 6.0, 18.0), np.array([0.2731, 0.1738, 30.0300])), (("5P", 6.0, 20.0), np.array([0.2702, 0.1621, 30.0300])), (("5P", 6.0, 22.0), np.array([0.2670, 0.1490, 30.0300])), (("5P", 6.0, 24.0), np.array([0.2650, 0.1400, 30.0300])), (("5P", 6.0, 26.0), np.array([0.2630, 0.1300, 30.0300])), (("5P", 6.0, 28.0), np.array([0.2600, 0.1200, 30.0300])), (("5P", 6.0, 30.0), np.array([0.2580, 0.1110, 30.0300])), (("5P", 6.0, 32.0), np.array([0.2560, 0.1030, 30.0300])), (("5P", 6.0, 34.0), np.array([0.2540, 0.0950, 30.0300])), (("5P", 6.0, 36.0), np.array([0.2520, 0.0890, 30.0300])), (("7.5P", 6.0, 2.0), np.array([0.3107, 0.2993, 30.0300])), (("7.5P", 6.0, 4.0), np.array([0.3107, 0.2831, 30.0300])), (("7.5P", 6.0, 6.0), np.array([0.3101, 0.2650, 30.0300])), (("7.5P", 6.0, 8.0), np.array([0.3099, 0.2502, 30.0300])), (("7.5P", 6.0, 10.0), np.array([0.3092, 0.2350, 30.0300])), (("7.5P", 6.0, 12.0), np.array([0.3090, 0.2222, 30.0300])), (("7.5P", 6.0, 14.0), np.array([0.3084, 0.2095, 30.0300])), (("7.5P", 6.0, 16.0), np.array([0.3080, 0.1976, 30.0300])), (("7.5P", 6.0, 18.0), np.array([0.3075, 0.1870, 30.0300])), (("7.5P", 6.0, 20.0), np.array([0.3069, 0.1745, 30.0300])), (("7.5P", 6.0, 22.0), np.array([0.3062, 0.1638, 30.0300])), (("7.5P", 6.0, 24.0), np.array([0.3058, 0.1547, 30.0300])), (("7.5P", 6.0, 26.0), np.array([0.3050, 0.1440, 30.0300])), (("7.5P", 6.0, 28.0), np.array([0.3040, 0.1360, 30.0300])), (("7.5P", 6.0, 30.0), np.array([0.3030, 0.1260, 30.0300])), (("7.5P", 6.0, 32.0), np.array([0.3020, 0.1180, 30.0300])), (("7.5P", 6.0, 34.0), np.array([0.3010, 0.1110, 30.0300])), (("7.5P", 6.0, 36.0), np.array([0.3010, 0.1050, 30.0300])), (("10P", 6.0, 2.0), np.array([0.3146, 0.3018, 30.0300])), (("10P", 6.0, 4.0), np.array([0.3181, 0.2871, 30.0300])), (("10P", 6.0, 6.0), np.array([0.3226, 0.2716, 30.0300])), (("10P", 6.0, 8.0), np.array([0.3259, 0.2584, 30.0300])), (("10P", 6.0, 10.0), np.array([0.3293, 0.2450, 30.0300])), (("10P", 6.0, 12.0), np.array([0.3321, 0.2329, 30.0300])), (("10P", 6.0, 14.0), np.array([0.3349, 0.2203, 30.0300])), (("10P", 6.0, 16.0), np.array([0.3370, 0.2095, 30.0300])), (("10P", 6.0, 18.0), np.array([0.3388, 0.1995, 30.0300])), (("10P", 6.0, 20.0), np.array([0.3409, 0.1882, 30.0300])), (("10P", 6.0, 22.0), np.array([0.3426, 0.1785, 30.0300])), (("10P", 6.0, 24.0), np.array([0.3441, 0.1698, 30.0300])), (("10P", 6.0, 26.0), np.array([0.3457, 0.1604, 30.0300])), (("10P", 6.0, 28.0), np.array([0.3470, 0.1510, 30.0300])), (("10P", 6.0, 30.0), np.array([0.3490, 0.1440, 30.0300])), (("10P", 6.0, 32.0), np.array([0.3500, 0.1360, 30.0300])), (("10P", 6.0, 34.0), np.array([0.3510, 0.1290, 30.0300])), (("10P", 6.0, 36.0), np.array([0.3520, 0.1230, 30.0300])), (("2.5RP", 6.0, 2.0), np.array([0.3188, 0.3048, 30.0300])), (("2.5RP", 6.0, 4.0), np.array([0.3272, 0.2929, 30.0300])), (("2.5RP", 6.0, 6.0), np.array([0.3362, 0.2799, 30.0300])), (("2.5RP", 6.0, 8.0), np.array([0.3437, 0.2688, 30.0300])), (("2.5RP", 6.0, 10.0), np.array([0.3509, 0.2578, 30.0300])), (("2.5RP", 6.0, 12.0), np.array([0.3582, 0.2462, 30.0300])), (("2.5RP", 6.0, 14.0), np.array([0.3652, 0.2355, 30.0300])), (("2.5RP", 6.0, 16.0), np.array([0.3718, 0.2251, 30.0300])), (("2.5RP", 6.0, 18.0), np.array([0.3773, 0.2158, 30.0300])), (("2.5RP", 6.0, 20.0), np.array([0.3833, 0.2056, 30.0300])), (("2.5RP", 6.0, 22.0), np.array([0.3877, 0.1978, 30.0300])), (("2.5RP", 6.0, 24.0), np.array([0.3927, 0.1892, 30.0300])), (("2.5RP", 6.0, 26.0), np.array([0.3970, 0.1810, 30.0300])), (("2.5RP", 6.0, 28.0), np.array([0.4010, 0.1740, 30.0300])), (("2.5RP", 6.0, 30.0), np.array([0.4060, 0.1660, 30.0300])), (("2.5RP", 6.0, 32.0), np.array([0.4100, 0.1590, 30.0300])), (("2.5RP", 6.0, 34.0), np.array([0.4130, 0.1530, 30.0300])), (("2.5RP", 6.0, 36.0), np.array([0.4160, 0.1480, 30.0300])), (("5RP", 6.0, 2.0), np.array([0.3232, 0.3085, 30.0300])), (("5RP", 6.0, 4.0), np.array([0.3371, 0.3001, 30.0300])), (("5RP", 6.0, 6.0), np.array([0.3520, 0.2904, 30.0300])), (("5RP", 6.0, 8.0), np.array([0.3648, 0.2820, 30.0300])), (("5RP", 6.0, 10.0), np.array([0.3769, 0.2738, 30.0300])), (("5RP", 6.0, 12.0), np.array([0.3900, 0.2646, 30.0300])), (("5RP", 6.0, 14.0), np.array([0.4023, 0.2552, 30.0300])), (("5RP", 6.0, 16.0), np.array([0.4136, 0.2467, 30.0300])), (("5RP", 6.0, 18.0), np.array([0.4245, 0.2382, 30.0300])), (("5RP", 6.0, 20.0), np.array([0.4368, 0.2283, 30.0300])), (("5RP", 6.0, 22.0), np.array([0.4449, 0.2219, 30.0300])), (("5RP", 6.0, 24.0), np.array([0.4520, 0.2150, 30.0300])), (("5RP", 6.0, 26.0), np.array([0.4620, 0.2070, 30.0300])), (("5RP", 6.0, 28.0), np.array([0.4680, 0.2010, 30.0300])), (("5RP", 6.0, 30.0), np.array([0.4740, 0.1960, 30.0300])), (("5RP", 6.0, 32.0), np.array([0.4810, 0.1890, 30.0300])), (("7.5RP", 6.0, 2.0), np.array([0.3261, 0.3113, 30.0300])), (("7.5RP", 6.0, 4.0), np.array([0.3439, 0.3056, 30.0300])), (("7.5RP", 6.0, 6.0), np.array([0.3635, 0.2987, 30.0300])), (("7.5RP", 6.0, 8.0), np.array([0.3791, 0.2929, 30.0300])), (("7.5RP", 6.0, 10.0), np.array([0.3960, 0.2860, 30.0300])), (("7.5RP", 6.0, 12.0), np.array([0.4125, 0.2784, 30.0300])), (("7.5RP", 6.0, 14.0), np.array([0.4285, 0.2705, 30.0300])), (("7.5RP", 6.0, 16.0), np.array([0.4448, 0.2622, 30.0300])), (("7.5RP", 6.0, 18.0), np.array([0.4581, 0.2549, 30.0300])), (("7.5RP", 6.0, 20.0), np.array([0.4735, 0.2464, 30.0300])), (("7.5RP", 6.0, 22.0), np.array([0.4860, 0.2400, 30.0300])), (("7.5RP", 6.0, 24.0), np.array([0.4960, 0.2330, 30.0300])), (("7.5RP", 6.0, 26.0), np.array([0.5050, 0.2270, 30.0300])), (("7.5RP", 6.0, 28.0), np.array([0.5130, 0.2210, 30.0300])), (("7.5RP", 6.0, 30.0), np.array([0.5190, 0.2160, 30.0300])), (("10RP", 6.0, 2.0), np.array([0.3292, 0.3141, 30.0300])), (("10RP", 6.0, 4.0), np.array([0.3508, 0.3112, 30.0300])), (("10RP", 6.0, 6.0), np.array([0.3740, 0.3074, 30.0300])), (("10RP", 6.0, 8.0), np.array([0.3930, 0.3038, 30.0300])), (("10RP", 6.0, 10.0), np.array([0.4150, 0.2989, 30.0300])), (("10RP", 6.0, 12.0), np.array([0.4360, 0.2936, 30.0300])), (("10RP", 6.0, 14.0), np.array([0.4552, 0.2881, 30.0300])), (("10RP", 6.0, 16.0), np.array([0.4781, 0.2812, 30.0300])), (("10RP", 6.0, 18.0), np.array([0.4961, 0.2751, 30.0300])), (("10RP", 6.0, 20.0), np.array([0.5130, 0.2680, 30.0300])), (("10RP", 6.0, 22.0), np.array([0.5270, 0.2620, 30.0300])), (("10RP", 6.0, 24.0), np.array([0.5410, 0.2560, 30.0300])), (("10RP", 6.0, 26.0), np.array([0.5520, 0.2500, 30.0300])), (("10RP", 6.0, 28.0), np.array([0.5630, 0.2460, 30.0300])), (("2.5R", 6.0, 2.0), np.array([0.3318, 0.3166, 30.0300])), (("2.5R", 6.0, 4.0), np.array([0.3566, 0.3163, 30.0300])), (("2.5R", 6.0, 6.0), np.array([0.3832, 0.3158, 30.0300])), (("2.5R", 6.0, 8.0), np.array([0.4065, 0.3144, 30.0300])), (("2.5R", 6.0, 10.0), np.array([0.4320, 0.3118, 30.0300])), (("2.5R", 6.0, 12.0), np.array([0.4568, 0.3082, 30.0300])), (("2.5R", 6.0, 14.0), np.array([0.4790, 0.3041, 30.0300])), (("2.5R", 6.0, 16.0), np.array([0.5041, 0.2983, 30.0300])), (("2.5R", 6.0, 18.0), np.array([0.5262, 0.2928, 30.0300])), (("2.5R", 6.0, 20.0), np.array([0.5450, 0.2880, 30.0300])), (("2.5R", 6.0, 22.0), np.array([0.5610, 0.2820, 30.0300])), (("2.5R", 6.0, 24.0), np.array([0.5740, 0.2760, 30.0300])), (("2.5R", 6.0, 26.0), np.array([0.5880, 0.2710, 30.0300])), (("2.5R", 6.0, 28.0), np.array([0.5970, 0.2650, 30.0300])), (("5R", 6.0, 2.0), np.array([0.3343, 0.3190, 30.0300])), (("5R", 6.0, 4.0), np.array([0.3628, 0.3221, 30.0300])), (("5R", 6.0, 6.0), np.array([0.3921, 0.3244, 30.0300])), (("5R", 6.0, 8.0), np.array([0.4187, 0.3251, 30.0300])), (("5R", 6.0, 10.0), np.array([0.4480, 0.3250, 30.0300])), (("5R", 6.0, 12.0), np.array([0.4760, 0.3234, 30.0300])), (("5R", 6.0, 14.0), np.array([0.5020, 0.3212, 30.0300])), (("5R", 6.0, 16.0), np.array([0.5297, 0.3179, 30.0300])), (("5R", 6.0, 18.0), np.array([0.5552, 0.3138, 30.0300])), (("5R", 6.0, 20.0), np.array([0.5750, 0.3090, 30.0300])), (("5R", 6.0, 22.0), np.array([0.5930, 0.3040, 30.0300])), (("5R", 6.0, 24.0), np.array([0.6070, 0.2990, 30.0300])), (("5R", 6.0, 26.0), np.array([0.6180, 0.2950, 30.0300])), (("5R", 6.0, 28.0), np.array([0.6320, 0.2890, 30.0300])), (("5R", 6.0, 30.0), np.array([0.6430, 0.2830, 30.0300])), (("7.5R", 6.0, 2.0), np.array([0.3381, 0.3228, 30.0300])), (("7.5R", 6.0, 4.0), np.array([0.3692, 0.3291, 30.0300])), (("7.5R", 6.0, 6.0), np.array([0.4000, 0.3340, 30.0300])), (("7.5R", 6.0, 8.0), np.array([0.4318, 0.3383, 30.0300])), (("7.5R", 6.0, 10.0), np.array([0.4655, 0.3412, 30.0300])), (("7.5R", 6.0, 12.0), np.array([0.4961, 0.3428, 30.0300])), (("7.5R", 6.0, 14.0), np.array([0.5265, 0.3431, 30.0300])), (("7.5R", 6.0, 16.0), np.array([0.5560, 0.3420, 30.0300])), (("7.5R", 6.0, 18.0), np.array([0.5829, 0.3396, 30.0300])), (("7.5R", 6.0, 20.0), np.array([0.6030, 0.3360, 30.0300])), (("7.5R", 6.0, 22.0), np.array([0.6250, 0.3330, 30.0300])), (("7.5R", 6.0, 24.0), np.array([0.6390, 0.3300, 30.0300])), (("7.5R", 6.0, 26.0), np.array([0.6520, 0.3260, 30.0300])), (("7.5R", 6.0, 28.0), np.array([0.6670, 0.3210, 30.0300])), (("7.5R", 6.0, 30.0), np.array([0.6790, 0.3160, 30.0300])), (("10R", 6.0, 2.0), np.array([0.3417, 0.3268, 30.0300])), (("10R", 6.0, 4.0), np.array([0.3768, 0.3381, 30.0300])), (("10R", 6.0, 6.0), np.array([0.4103, 0.3473, 30.0300])), (("10R", 6.0, 8.0), np.array([0.4449, 0.3550, 30.0300])), (("10R", 6.0, 10.0), np.array([0.4812, 0.3619, 30.0300])), (("10R", 6.0, 12.0), np.array([0.5150, 0.3667, 30.0300])), (("10R", 6.0, 14.0), np.array([0.5468, 0.3697, 30.0300])), (("10R", 6.0, 16.0), np.array([0.5741, 0.3713, 30.0300])), (("10R", 6.0, 18.0), np.array([0.6009, 0.3720, 30.0300])), (("10R", 6.0, 20.0), np.array([0.6240, 0.3710, 30.0300])), (("10R", 6.0, 22.0), np.array([0.6460, 0.3700, 30.0300])), (("10R", 6.0, 24.0), np.array([0.6640, 0.3700, 30.0300])), (("10R", 6.0, 26.0), np.array([0.6790, 0.3690, 30.0300])), (("10R", 6.0, 28.0), np.array([0.6960, 0.3680, 30.0300])), (("10R", 6.0, 30.0), np.array([0.7140, 0.3650, 30.0300])), (("2.5YR", 6.0, 2.0), np.array([0.3453, 0.3321, 30.0300])), (("2.5YR", 6.0, 4.0), np.array([0.3806, 0.3467, 30.0300])), (("2.5YR", 6.0, 6.0), np.array([0.4180, 0.3600, 30.0300])), (("2.5YR", 6.0, 8.0), np.array([0.4533, 0.3708, 30.0300])), (("2.5YR", 6.0, 10.0), np.array([0.4891, 0.3806, 30.0300])), (("2.5YR", 6.0, 12.0), np.array([0.5215, 0.3887, 30.0300])), (("2.5YR", 6.0, 14.0), np.array([0.5488, 0.3947, 30.0300])), (("2.5YR", 6.0, 16.0), np.array([0.5698, 0.3990, 30.0300])), (("2.5YR", 6.0, 18.0), np.array([0.5879, 0.4021, 30.0300])), (("2.5YR", 6.0, 20.0), np.array([0.6040, 0.4030, 30.0300])), (("2.5YR", 6.0, 22.0), np.array([0.6140, 0.4060, 30.0300])), (("5YR", 6.0, 2.0), np.array([0.3474, 0.3373, 30.0300])), (("5YR", 6.0, 4.0), np.array([0.3840, 0.3564, 30.0300])), (("5YR", 6.0, 6.0), np.array([0.4229, 0.3750, 30.0300])), (("5YR", 6.0, 8.0), np.array([0.4592, 0.3900, 30.0300])), (("5YR", 6.0, 10.0), np.array([0.4921, 0.4022, 30.0300])), (("5YR", 6.0, 12.0), np.array([0.5199, 0.4119, 30.0300])), (("5YR", 6.0, 14.0), np.array([0.5423, 0.4188, 30.0300])), (("5YR", 6.0, 16.0), np.array([0.5597, 0.4239, 30.0300])), (("5YR", 6.0, 18.0), np.array([0.5715, 0.4270, 30.0300])), (("5YR", 6.0, 20.0), np.array([0.5850, 0.4310, 30.0300])), (("7.5YR", 6.0, 2.0), np.array([0.3487, 0.3421, 30.0300])), (("7.5YR", 6.0, 4.0), np.array([0.3860, 0.3652, 30.0300])), (("7.5YR", 6.0, 6.0), np.array([0.4242, 0.3876, 30.0300])), (("7.5YR", 6.0, 8.0), np.array([0.4596, 0.4064, 30.0300])), (("7.5YR", 6.0, 10.0), np.array([0.4904, 0.4220, 30.0300])), (("7.5YR", 6.0, 12.0), np.array([0.5145, 0.4331, 30.0300])), (("7.5YR", 6.0, 14.0), np.array([0.5320, 0.4412, 30.0300])), (("7.5YR", 6.0, 16.0), np.array([0.5468, 0.4478, 30.0300])), (("7.5YR", 6.0, 18.0), np.array([0.5550, 0.4520, 30.0300])), (("7.5YR", 6.0, 20.0), np.array([0.5640, 0.4550, 30.0300])), (("10YR", 6.0, 2.0), np.array([0.3491, 0.3483, 30.0300])), (("10YR", 6.0, 4.0), np.array([0.3861, 0.3767, 30.0300])), (("10YR", 6.0, 6.0), np.array([0.4240, 0.4030, 30.0300])), (("10YR", 6.0, 8.0), np.array([0.4570, 0.4249, 30.0300])), (("10YR", 6.0, 10.0), np.array([0.4843, 0.4416, 30.0300])), (("10YR", 6.0, 12.0), np.array([0.5050, 0.4536, 30.0300])), (("10YR", 6.0, 14.0), np.array([0.5200, 0.4623, 30.0300])), (("10YR", 6.0, 16.0), np.array([0.5310, 0.4690, 30.0300])), (("10YR", 6.0, 18.0), np.array([0.5390, 0.4720, 30.0300])), (("2.5Y", 6.0, 2.0), np.array([0.3480, 0.3540, 30.0300])), (("2.5Y", 6.0, 4.0), np.array([0.3840, 0.3867, 30.0300])), (("2.5Y", 6.0, 6.0), np.array([0.4203, 0.4176, 30.0300])), (("2.5Y", 6.0, 8.0), np.array([0.4517, 0.4421, 30.0300])), (("2.5Y", 6.0, 10.0), np.array([0.4760, 0.4607, 30.0300])), (("2.5Y", 6.0, 12.0), np.array([0.4928, 0.4730, 30.0300])), (("2.5Y", 6.0, 14.0), np.array([0.5061, 0.4829, 30.0300])), (("2.5Y", 6.0, 16.0), np.array([0.5160, 0.4890, 30.0300])), (("2.5Y", 6.0, 18.0), np.array([0.5230, 0.4940, 30.0300])), (("5Y", 6.0, 2.0), np.array([0.3457, 0.3580, 30.0300])), (("5Y", 6.0, 4.0), np.array([0.3794, 0.3955, 30.0300])), (("5Y", 6.0, 6.0), np.array([0.4140, 0.4305, 30.0300])), (("5Y", 6.0, 8.0), np.array([0.4426, 0.4588, 30.0300])), (("5Y", 6.0, 10.0), np.array([0.4639, 0.4790, 30.0300])), (("5Y", 6.0, 12.0), np.array([0.4780, 0.4920, 30.0300])), (("5Y", 6.0, 14.0), np.array([0.4905, 0.5038, 30.0300])), (("5Y", 6.0, 16.0), np.array([0.4990, 0.5100, 30.0300])), (("7.5Y", 6.0, 2.0), np.array([0.3431, 0.3601, 30.0300])), (("7.5Y", 6.0, 4.0), np.array([0.3745, 0.4004, 30.0300])), (("7.5Y", 6.0, 6.0), np.array([0.4060, 0.4400, 30.0300])), (("7.5Y", 6.0, 8.0), np.array([0.4321, 0.4719, 30.0300])), (("7.5Y", 6.0, 10.0), np.array([0.4512, 0.4943, 30.0300])), (("7.5Y", 6.0, 12.0), np.array([0.4638, 0.5087, 30.0300])), (("7.5Y", 6.0, 14.0), np.array([0.4754, 0.5220, 30.0300])), (("7.5Y", 6.0, 16.0), np.array([0.4820, 0.5280, 30.0300])), (("10Y", 7.0, 2.0), np.array([0.3369, 0.3569, 43.0600])), (("10Y", 7.0, 4.0), np.array([0.3624, 0.3951, 43.0600])), (("10Y", 7.0, 6.0), np.array([0.3864, 0.4305, 43.0600])), (("10Y", 7.0, 8.0), np.array([0.4090, 0.4641, 43.0600])), (("10Y", 7.0, 10.0), np.array([0.4289, 0.4937, 43.0600])), (("10Y", 7.0, 12.0), np.array([0.4420, 0.5131, 43.0600])), (("10Y", 7.0, 14.0), np.array([0.4516, 0.5277, 43.0600])), (("10Y", 7.0, 16.0), np.array([0.4582, 0.5375, 43.0600])), (("10Y", 7.0, 18.0), np.array([0.4620, 0.5430, 43.0600])), (("2.5GY", 7.0, 2.0), np.array([0.3328, 0.3569, 43.0600])), (("2.5GY", 7.0, 4.0), np.array([0.3534, 0.3953, 43.0600])), (("2.5GY", 7.0, 6.0), np.array([0.3728, 0.4316, 43.0600])), (("2.5GY", 7.0, 8.0), np.array([0.3919, 0.4684, 43.0600])), (("2.5GY", 7.0, 10.0), np.array([0.4091, 0.5030, 43.0600])), (("2.5GY", 7.0, 12.0), np.array([0.4213, 0.5270, 43.0600])), (("2.5GY", 7.0, 14.0), np.array([0.4309, 0.5459, 43.0600])), (("2.5GY", 7.0, 16.0), np.array([0.4366, 0.5578, 43.0600])), (("2.5GY", 7.0, 18.0), np.array([0.4390, 0.5640, 43.0600])), (("5GY", 7.0, 2.0), np.array([0.3284, 0.3559, 43.0600])), (("5GY", 7.0, 4.0), np.array([0.3437, 0.3929, 43.0600])), (("5GY", 7.0, 6.0), np.array([0.3581, 0.4291, 43.0600])), (("5GY", 7.0, 8.0), np.array([0.3722, 0.4669, 43.0600])), (("5GY", 7.0, 10.0), np.array([0.3852, 0.5051, 43.0600])), (("5GY", 7.0, 12.0), np.array([0.3949, 0.5367, 43.0600])), (("5GY", 7.0, 14.0), np.array([0.4027, 0.5615, 43.0600])), (("5GY", 7.0, 16.0), np.array([0.4076, 0.5783, 43.0600])), (("5GY", 7.0, 18.0), np.array([0.4100, 0.5890, 43.0600])), (("5GY", 7.0, 20.0), np.array([0.4130, 0.6010, 43.0600])), (("7.5GY", 7.0, 2.0), np.array([0.3190, 0.3516, 43.0600])), (("7.5GY", 7.0, 4.0), np.array([0.3267, 0.3848, 43.0600])), (("7.5GY", 7.0, 6.0), np.array([0.3341, 0.4191, 43.0600])), (("7.5GY", 7.0, 8.0), np.array([0.3406, 0.4558, 43.0600])), (("7.5GY", 7.0, 10.0), np.array([0.3461, 0.4950, 43.0600])), (("7.5GY", 7.0, 12.0), np.array([0.3502, 0.5328, 43.0600])), (("7.5GY", 7.0, 14.0), np.array([0.3532, 0.5700, 43.0600])), (("7.5GY", 7.0, 16.0), np.array([0.3549, 0.6000, 43.0600])), (("7.5GY", 7.0, 18.0), np.array([0.3555, 0.6242, 43.0600])), (("7.5GY", 7.0, 20.0), np.array([0.3560, 0.6420, 43.0600])), (("7.5GY", 7.0, 22.0), np.array([0.3560, 0.6610, 43.0600])), (("7.5GY", 7.0, 24.0), np.array([0.3560, 0.6760, 43.0600])), (("10GY", 7.0, 2.0), np.array([0.3117, 0.3469, 43.0600])), (("10GY", 7.0, 4.0), np.array([0.3133, 0.3764, 43.0600])), (("10GY", 7.0, 6.0), np.array([0.3142, 0.4058, 43.0600])), (("10GY", 7.0, 8.0), np.array([0.3140, 0.4387, 43.0600])), (("10GY", 7.0, 10.0), np.array([0.3123, 0.4732, 43.0600])), (("10GY", 7.0, 12.0), np.array([0.3092, 0.5095, 43.0600])), (("10GY", 7.0, 14.0), np.array([0.3047, 0.5458, 43.0600])), (("10GY", 7.0, 16.0), np.array([0.2981, 0.5835, 43.0600])), (("10GY", 7.0, 18.0), np.array([0.2905, 0.6186, 43.0600])), (("10GY", 7.0, 20.0), np.array([0.2816, 0.6563, 43.0600])), (("10GY", 7.0, 22.0), np.array([0.2728, 0.6893, 43.0600])), (("10GY", 7.0, 24.0), np.array([0.2620, 0.7270, 43.0600])), (("10GY", 7.0, 26.0), np.array([0.2520, 0.7580, 43.0600])), (("10GY", 7.0, 28.0), np.array([0.2420, 0.7900, 43.0600])), (("10GY", 7.0, 30.0), np.array([0.2330, 0.8190, 43.0600])), (("10GY", 7.0, 32.0), np.array([0.2240, 0.8510, 43.0600])), (("2.5G", 7.0, 2.0), np.array([0.3047, 0.3413, 43.0600])), (("2.5G", 7.0, 4.0), np.array([0.2992, 0.3644, 43.0600])), (("2.5G", 7.0, 6.0), np.array([0.2933, 0.3873, 43.0600])), (("2.5G", 7.0, 8.0), np.array([0.2861, 0.4129, 43.0600])), (("2.5G", 7.0, 10.0), np.array([0.2775, 0.4395, 43.0600])), (("2.5G", 7.0, 12.0), np.array([0.2672, 0.4667, 43.0600])), (("2.5G", 7.0, 14.0), np.array([0.2568, 0.4931, 43.0600])), (("2.5G", 7.0, 16.0), np.array([0.2448, 0.5203, 43.0600])), (("2.5G", 7.0, 18.0), np.array([0.2328, 0.5467, 43.0600])), (("2.5G", 7.0, 20.0), np.array([0.2181, 0.5744, 43.0600])), (("2.5G", 7.0, 22.0), np.array([0.2029, 0.6017, 43.0600])), (("2.5G", 7.0, 24.0), np.array([0.1875, 0.6265, 43.0600])), (("2.5G", 7.0, 26.0), np.array([0.1689, 0.6549, 43.0600])), (("2.5G", 7.0, 28.0), np.array([0.1490, 0.6810, 43.0600])), (("2.5G", 7.0, 30.0), np.array([0.1260, 0.7090, 43.0600])), (("2.5G", 7.0, 32.0), np.array([0.1060, 0.7330, 43.0600])), (("2.5G", 7.0, 34.0), np.array([0.0810, 0.7590, 43.0600])), (("5G", 7.0, 2.0), np.array([0.3001, 0.3366, 43.0600])), (("5G", 7.0, 4.0), np.array([0.2902, 0.3548, 43.0600])), (("5G", 7.0, 6.0), np.array([0.2801, 0.3721, 43.0600])), (("5G", 7.0, 8.0), np.array([0.2687, 0.3901, 43.0600])), (("5G", 7.0, 10.0), np.array([0.2554, 0.4087, 43.0600])), (("5G", 7.0, 12.0), np.array([0.2416, 0.4267, 43.0600])), (("5G", 7.0, 14.0), np.array([0.2262, 0.4450, 43.0600])), (("5G", 7.0, 16.0), np.array([0.2111, 0.4616, 43.0600])), (("5G", 7.0, 18.0), np.array([0.1967, 0.4771, 43.0600])), (("5G", 7.0, 20.0), np.array([0.1805, 0.4933, 43.0600])), (("5G", 7.0, 22.0), np.array([0.1659, 0.5074, 43.0600])), (("5G", 7.0, 24.0), np.array([0.1521, 0.5200, 43.0600])), (("5G", 7.0, 26.0), np.array([0.1397, 0.5312, 43.0600])), (("5G", 7.0, 28.0), np.array([0.1230, 0.5460, 43.0600])), (("5G", 7.0, 30.0), np.array([0.1050, 0.5600, 43.0600])), (("5G", 7.0, 32.0), np.array([0.0880, 0.5730, 43.0600])), (("5G", 7.0, 34.0), np.array([0.0690, 0.5870, 43.0600])), (("7.5G", 7.0, 2.0), np.array([0.2972, 0.3333, 43.0600])), (("7.5G", 7.0, 4.0), np.array([0.2850, 0.3482, 43.0600])), (("7.5G", 7.0, 6.0), np.array([0.2728, 0.3622, 43.0600])), (("7.5G", 7.0, 8.0), np.array([0.2595, 0.3764, 43.0600])), (("7.5G", 7.0, 10.0), np.array([0.2445, 0.3914, 43.0600])), (("7.5G", 7.0, 12.0), np.array([0.2295, 0.4058, 43.0600])), (("7.5G", 7.0, 14.0), np.array([0.2139, 0.4199, 43.0600])), (("7.5G", 7.0, 16.0), np.array([0.1982, 0.4330, 43.0600])), (("7.5G", 7.0, 18.0), np.array([0.1841, 0.4448, 43.0600])), (("7.5G", 7.0, 20.0), np.array([0.1688, 0.4570, 43.0600])), (("7.5G", 7.0, 22.0), np.array([0.1539, 0.4683, 43.0600])), (("7.5G", 7.0, 24.0), np.array([0.1415, 0.4778, 43.0600])), (("7.5G", 7.0, 26.0), np.array([0.1303, 0.4858, 43.0600])), (("7.5G", 7.0, 28.0), np.array([0.1150, 0.4970, 43.0600])), (("7.5G", 7.0, 30.0), np.array([0.0990, 0.5070, 43.0600])), (("7.5G", 7.0, 32.0), np.array([0.0840, 0.5170, 43.0600])), (("7.5G", 7.0, 34.0), np.array([0.0690, 0.5270, 43.0600])), (("10G", 7.0, 2.0), np.array([0.2945, 0.3297, 43.0600])), (("10G", 7.0, 4.0), np.array([0.2803, 0.3415, 43.0600])), (("10G", 7.0, 6.0), np.array([0.2662, 0.3526, 43.0600])), (("10G", 7.0, 8.0), np.array([0.2513, 0.3635, 43.0600])), (("10G", 7.0, 10.0), np.array([0.2352, 0.3748, 43.0600])), (("10G", 7.0, 12.0), np.array([0.2195, 0.3854, 43.0600])), (("10G", 7.0, 14.0), np.array([0.2033, 0.3956, 43.0600])), (("10G", 7.0, 16.0), np.array([0.1881, 0.4049, 43.0600])), (("10G", 7.0, 18.0), np.array([0.1734, 0.4135, 43.0600])), (("10G", 7.0, 20.0), np.array([0.1589, 0.4220, 43.0600])), (("10G", 7.0, 22.0), np.array([0.1434, 0.4306, 43.0600])), (("10G", 7.0, 24.0), np.array([0.1310, 0.4377, 43.0600])), (("10G", 7.0, 26.0), np.array([0.1210, 0.4430, 43.0600])), (("10G", 7.0, 28.0), np.array([0.1080, 0.4490, 43.0600])), (("10G", 7.0, 30.0), np.array([0.0940, 0.4570, 43.0600])), (("10G", 7.0, 32.0), np.array([0.0830, 0.4630, 43.0600])), (("2.5BG", 7.0, 2.0), np.array([0.2927, 0.3269, 43.0600])), (("2.5BG", 7.0, 4.0), np.array([0.2764, 0.3354, 43.0600])), (("2.5BG", 7.0, 6.0), np.array([0.2608, 0.3430, 43.0600])), (("2.5BG", 7.0, 8.0), np.array([0.2439, 0.3508, 43.0600])), (("2.5BG", 7.0, 10.0), np.array([0.2264, 0.3576, 43.0600])), (("2.5BG", 7.0, 12.0), np.array([0.2102, 0.3636, 43.0600])), (("2.5BG", 7.0, 14.0), np.array([0.1932, 0.3694, 43.0600])), (("2.5BG", 7.0, 16.0), np.array([0.1788, 0.3739, 43.0600])), (("2.5BG", 7.0, 18.0), np.array([0.1626, 0.3788, 43.0600])), (("2.5BG", 7.0, 20.0), np.array([0.1490, 0.3827, 43.0600])), (("2.5BG", 7.0, 22.0), np.array([0.1334, 0.3870, 43.0600])), (("2.5BG", 7.0, 24.0), np.array([0.1220, 0.3900, 43.0600])), (("2.5BG", 7.0, 26.0), np.array([0.1110, 0.3920, 43.0600])), (("2.5BG", 7.0, 28.0), np.array([0.0990, 0.3940, 43.0600])), (("2.5BG", 7.0, 30.0), np.array([0.0880, 0.3970, 43.0600])), (("2.5BG", 7.0, 32.0), np.array([0.0790, 0.3980, 43.0600])), (("5BG", 7.0, 2.0), np.array([0.2898, 0.3225, 43.0600])), (("5BG", 7.0, 4.0), np.array([0.2712, 0.3269, 43.0600])), (("5BG", 7.0, 6.0), np.array([0.2543, 0.3302, 43.0600])), (("5BG", 7.0, 8.0), np.array([0.2354, 0.3335, 43.0600])), (("5BG", 7.0, 10.0), np.array([0.2163, 0.3361, 43.0600])), (("5BG", 7.0, 12.0), np.array([0.1997, 0.3379, 43.0600])), (("5BG", 7.0, 14.0), np.array([0.1838, 0.3390, 43.0600])), (("5BG", 7.0, 16.0), np.array([0.1675, 0.3401, 43.0600])), (("5BG", 7.0, 18.0), np.array([0.1515, 0.3410, 43.0600])), (("5BG", 7.0, 20.0), np.array([0.1380, 0.3412, 43.0600])), (("5BG", 7.0, 22.0), np.array([0.1220, 0.3400, 43.0600])), (("5BG", 7.0, 24.0), np.array([0.1100, 0.3400, 43.0600])), (("5BG", 7.0, 26.0), np.array([0.1010, 0.3400, 43.0600])), (("5BG", 7.0, 28.0), np.array([0.0920, 0.3400, 43.0600])), (("5BG", 7.0, 30.0), np.array([0.0830, 0.3390, 43.0600])), (("7.5BG", 7.0, 2.0), np.array([0.2878, 0.3182, 43.0600])), (("7.5BG", 7.0, 4.0), np.array([0.2671, 0.3189, 43.0600])), (("7.5BG", 7.0, 6.0), np.array([0.2490, 0.3186, 43.0600])), (("7.5BG", 7.0, 8.0), np.array([0.2292, 0.3178, 43.0600])), (("7.5BG", 7.0, 10.0), np.array([0.2094, 0.3165, 43.0600])), (("7.5BG", 7.0, 12.0), np.array([0.1914, 0.3148, 43.0600])), (("7.5BG", 7.0, 14.0), np.array([0.1751, 0.3129, 43.0600])), (("7.5BG", 7.0, 16.0), np.array([0.1584, 0.3101, 43.0600])), (("7.5BG", 7.0, 18.0), np.array([0.1427, 0.3076, 43.0600])), (("7.5BG", 7.0, 20.0), np.array([0.1300, 0.3050, 43.0600])), (("7.5BG", 7.0, 22.0), np.array([0.1140, 0.3020, 43.0600])), (("7.5BG", 7.0, 24.0), np.array([0.1020, 0.3000, 43.0600])), (("7.5BG", 7.0, 26.0), np.array([0.0940, 0.2980, 43.0600])), (("10BG", 7.0, 2.0), np.array([0.2869, 0.3143, 43.0600])), (("10BG", 7.0, 4.0), np.array([0.2642, 0.3109, 43.0600])), (("10BG", 7.0, 6.0), np.array([0.2448, 0.3069, 43.0600])), (("10BG", 7.0, 8.0), np.array([0.2235, 0.3014, 43.0600])), (("10BG", 7.0, 10.0), np.array([0.2035, 0.2956, 43.0600])), (("10BG", 7.0, 12.0), np.array([0.1841, 0.2892, 43.0600])), (("10BG", 7.0, 14.0), np.array([0.1671, 0.2832, 43.0600])), (("10BG", 7.0, 16.0), np.array([0.1489, 0.2768, 43.0600])), (("10BG", 7.0, 18.0), np.array([0.1340, 0.2710, 43.0600])), (("10BG", 7.0, 20.0), np.array([0.1220, 0.2660, 43.0600])), (("10BG", 7.0, 22.0), np.array([0.1080, 0.2600, 43.0600])), (("10BG", 7.0, 24.0), np.array([0.0940, 0.2530, 43.0600])), (("2.5B", 7.0, 2.0), np.array([0.2867, 0.3110, 43.0600])), (("2.5B", 7.0, 4.0), np.array([0.2629, 0.3038, 43.0600])), (("2.5B", 7.0, 6.0), np.array([0.2418, 0.2960, 43.0600])), (("2.5B", 7.0, 8.0), np.array([0.2208, 0.2871, 43.0600])), (("2.5B", 7.0, 10.0), np.array([0.1994, 0.2775, 43.0600])), (("2.5B", 7.0, 12.0), np.array([0.1797, 0.2672, 43.0600])), (("2.5B", 7.0, 14.0), np.array([0.1624, 0.2581, 43.0600])), (("2.5B", 7.0, 16.0), np.array([0.1435, 0.2472, 43.0600])), (("2.5B", 7.0, 18.0), np.array([0.1300, 0.2390, 43.0600])), (("2.5B", 7.0, 20.0), np.array([0.1170, 0.2310, 43.0600])), (("2.5B", 7.0, 22.0), np.array([0.1040, 0.2220, 43.0600])), (("5B", 7.0, 2.0), np.array([0.2875, 0.3078, 43.0600])), (("5B", 7.0, 4.0), np.array([0.2633, 0.2972, 43.0600])), (("5B", 7.0, 6.0), np.array([0.2410, 0.2854, 43.0600])), (("5B", 7.0, 8.0), np.array([0.2204, 0.2729, 43.0600])), (("5B", 7.0, 10.0), np.array([0.1986, 0.2579, 43.0600])), (("5B", 7.0, 12.0), np.array([0.1778, 0.2430, 43.0600])), (("5B", 7.0, 14.0), np.array([0.1615, 0.2307, 43.0600])), (("5B", 7.0, 16.0), np.array([0.1450, 0.2190, 43.0600])), (("5B", 7.0, 18.0), np.array([0.1280, 0.2060, 43.0600])), (("5B", 7.0, 20.0), np.array([0.1140, 0.1950, 43.0600])), (("7.5B", 7.0, 2.0), np.array([0.2888, 0.3058, 43.0600])), (("7.5B", 7.0, 4.0), np.array([0.2651, 0.2927, 43.0600])), (("7.5B", 7.0, 6.0), np.array([0.2436, 0.2787, 43.0600])), (("7.5B", 7.0, 8.0), np.array([0.2225, 0.2631, 43.0600])), (("7.5B", 7.0, 10.0), np.array([0.2016, 0.2466, 43.0600])), (("7.5B", 7.0, 12.0), np.array([0.1818, 0.2303, 43.0600])), (("7.5B", 7.0, 14.0), np.array([0.1650, 0.2160, 43.0600])), (("7.5B", 7.0, 16.0), np.array([0.1490, 0.2020, 43.0600])), (("7.5B", 7.0, 18.0), np.array([0.1320, 0.1870, 43.0600])), (("7.5B", 7.0, 20.0), np.array([0.1210, 0.1750, 43.0600])), (("10B", 7.0, 2.0), np.array([0.2908, 0.3039, 43.0600])), (("10B", 7.0, 4.0), np.array([0.2685, 0.2886, 43.0600])), (("10B", 7.0, 6.0), np.array([0.2478, 0.2728, 43.0600])), (("10B", 7.0, 8.0), np.array([0.2277, 0.2559, 43.0600])), (("10B", 7.0, 10.0), np.array([0.2078, 0.2382, 43.0600])), (("10B", 7.0, 12.0), np.array([0.1883, 0.2203, 43.0600])), (("10B", 7.0, 14.0), np.array([0.1720, 0.2060, 43.0600])), (("10B", 7.0, 16.0), np.array([0.1560, 0.1900, 43.0600])), (("10B", 7.0, 18.0), np.array([0.1410, 0.1760, 43.0600])), (("10B", 7.0, 20.0), np.array([0.1280, 0.1620, 43.0600])), (("2.5PB", 7.0, 2.0), np.array([0.2932, 0.3025, 43.0600])), (("2.5PB", 7.0, 4.0), np.array([0.2729, 0.2848, 43.0600])), (("2.5PB", 7.0, 6.0), np.array([0.2538, 0.2677, 43.0600])), (("2.5PB", 7.0, 8.0), np.array([0.2352, 0.2498, 43.0600])), (("2.5PB", 7.0, 10.0), np.array([0.2162, 0.2309, 43.0600])), (("2.5PB", 7.0, 12.0), np.array([0.1990, 0.2130, 43.0600])), (("2.5PB", 7.0, 14.0), np.array([0.1830, 0.1950, 43.0600])), (("2.5PB", 7.0, 16.0), np.array([0.1680, 0.1790, 43.0600])), (("2.5PB", 7.0, 18.0), np.array([0.1560, 0.1650, 43.0600])), (("5PB", 7.0, 2.0), np.array([0.2952, 0.3011, 43.0600])), (("5PB", 7.0, 4.0), np.array([0.2773, 0.2828, 43.0600])), (("5PB", 7.0, 6.0), np.array([0.2596, 0.2643, 43.0600])), (("5PB", 7.0, 8.0), np.array([0.2427, 0.2458, 43.0600])), (("5PB", 7.0, 10.0), np.array([0.2254, 0.2267, 43.0600])), (("5PB", 7.0, 12.0), np.array([0.2080, 0.2080, 43.0600])), (("5PB", 7.0, 14.0), np.array([0.1940, 0.1910, 43.0600])), (("5PB", 7.0, 16.0), np.array([0.1810, 0.1750, 43.0600])), (("5PB", 7.0, 18.0), np.array([0.1700, 0.1610, 43.0600])), (("7.5PB", 7.0, 2.0), np.array([0.2982, 0.3003, 43.0600])), (("7.5PB", 7.0, 4.0), np.array([0.2833, 0.2809, 43.0600])), (("7.5PB", 7.0, 6.0), np.array([0.2687, 0.2612, 43.0600])), (("7.5PB", 7.0, 8.0), np.array([0.2546, 0.2418, 43.0600])), (("7.5PB", 7.0, 10.0), np.array([0.2410, 0.2224, 43.0600])), (("7.5PB", 7.0, 12.0), np.array([0.2280, 0.2040, 43.0600])), (("7.5PB", 7.0, 14.0), np.array([0.2170, 0.1890, 43.0600])), (("7.5PB", 7.0, 16.0), np.array([0.2070, 0.1730, 43.0600])), (("7.5PB", 7.0, 18.0), np.array([0.1980, 0.1600, 43.0600])), (("7.5PB", 7.0, 20.0), np.array([0.1880, 0.1460, 43.0600])), (("10PB", 7.0, 2.0), np.array([0.3005, 0.3000, 43.0600])), (("10PB", 7.0, 4.0), np.array([0.2886, 0.2801, 43.0600])), (("10PB", 7.0, 6.0), np.array([0.2776, 0.2612, 43.0600])), (("10PB", 7.0, 8.0), np.array([0.2670, 0.2425, 43.0600])), (("10PB", 7.0, 10.0), np.array([0.2563, 0.2240, 43.0600])), (("10PB", 7.0, 12.0), np.array([0.2465, 0.2058, 43.0600])), (("10PB", 7.0, 14.0), np.array([0.2390, 0.1910, 43.0600])), (("10PB", 7.0, 16.0), np.array([0.2320, 0.1780, 43.0600])), (("10PB", 7.0, 18.0), np.array([0.2250, 0.1660, 43.0600])), (("10PB", 7.0, 20.0), np.array([0.2190, 0.1520, 43.0600])), (("10PB", 7.0, 22.0), np.array([0.2120, 0.1400, 43.0600])), (("2.5P", 7.0, 2.0), np.array([0.3031, 0.3000, 43.0600])), (("2.5P", 7.0, 4.0), np.array([0.2950, 0.2810, 43.0600])), (("2.5P", 7.0, 6.0), np.array([0.2873, 0.2633, 43.0600])), (("2.5P", 7.0, 8.0), np.array([0.2799, 0.2459, 43.0600])), (("2.5P", 7.0, 10.0), np.array([0.2729, 0.2289, 43.0600])), (("2.5P", 7.0, 12.0), np.array([0.2664, 0.2127, 43.0600])), (("2.5P", 7.0, 14.0), np.array([0.2610, 0.1980, 43.0600])), (("2.5P", 7.0, 16.0), np.array([0.2560, 0.1850, 43.0600])), (("2.5P", 7.0, 18.0), np.array([0.2520, 0.1760, 43.0600])), (("2.5P", 7.0, 20.0), np.array([0.2480, 0.1620, 43.0600])), (("2.5P", 7.0, 22.0), np.array([0.2440, 0.1500, 43.0600])), (("2.5P", 7.0, 24.0), np.array([0.2400, 0.1400, 43.0600])), (("5P", 7.0, 2.0), np.array([0.3059, 0.3010, 43.0600])), (("5P", 7.0, 4.0), np.array([0.3009, 0.2831, 43.0600])), (("5P", 7.0, 6.0), np.array([0.2961, 0.2663, 43.0600])), (("5P", 7.0, 8.0), np.array([0.2918, 0.2504, 43.0600])), (("5P", 7.0, 10.0), np.array([0.2872, 0.2343, 43.0600])), (("5P", 7.0, 12.0), np.array([0.2833, 0.2197, 43.0600])), (("5P", 7.0, 14.0), np.array([0.2801, 0.2068, 43.0600])), (("5P", 7.0, 16.0), np.array([0.2770, 0.1940, 43.0600])), (("5P", 7.0, 18.0), np.array([0.2740, 0.1820, 43.0600])), (("5P", 7.0, 20.0), np.array([0.2710, 0.1700, 43.0600])), (("5P", 7.0, 22.0), np.array([0.2680, 0.1580, 43.0600])), (("5P", 7.0, 24.0), np.array([0.2650, 0.1480, 43.0600])), (("5P", 7.0, 26.0), np.array([0.2620, 0.1370, 43.0600])), (("5P", 7.0, 28.0), np.array([0.2600, 0.1280, 43.0600])), (("7.5P", 7.0, 2.0), np.array([0.3109, 0.3037, 43.0600])), (("7.5P", 7.0, 4.0), np.array([0.3111, 0.2880, 43.0600])), (("7.5P", 7.0, 6.0), np.array([0.3111, 0.2730, 43.0600])), (("7.5P", 7.0, 8.0), np.array([0.3109, 0.2584, 43.0600])), (("7.5P", 7.0, 10.0), np.array([0.3108, 0.2442, 43.0600])), (("7.5P", 7.0, 12.0), np.array([0.3104, 0.2320, 43.0600])), (("7.5P", 7.0, 14.0), np.array([0.3101, 0.2192, 43.0600])), (("7.5P", 7.0, 16.0), np.array([0.3099, 0.2074, 43.0600])), (("7.5P", 7.0, 18.0), np.array([0.3093, 0.1962, 43.0600])), (("7.5P", 7.0, 20.0), np.array([0.3080, 0.1850, 43.0600])), (("7.5P", 7.0, 22.0), np.array([0.3080, 0.1740, 43.0600])), (("7.5P", 7.0, 24.0), np.array([0.3070, 0.1640, 43.0600])), (("7.5P", 7.0, 26.0), np.array([0.3060, 0.1540, 43.0600])), (("7.5P", 7.0, 28.0), np.array([0.3050, 0.1450, 43.0600])), (("7.5P", 7.0, 30.0), np.array([0.3040, 0.1360, 43.0600])), (("10P", 7.0, 2.0), np.array([0.3138, 0.3054, 43.0600])), (("10P", 7.0, 4.0), np.array([0.3181, 0.2920, 43.0600])), (("10P", 7.0, 6.0), np.array([0.3221, 0.2786, 43.0600])), (("10P", 7.0, 8.0), np.array([0.3256, 0.2654, 43.0600])), (("10P", 7.0, 10.0), np.array([0.3288, 0.2531, 43.0600])), (("10P", 7.0, 12.0), np.array([0.3314, 0.2423, 43.0600])), (("10P", 7.0, 14.0), np.array([0.3341, 0.2308, 43.0600])), (("10P", 7.0, 16.0), np.array([0.3368, 0.2192, 43.0600])), (("10P", 7.0, 18.0), np.array([0.3391, 0.2088, 43.0600])), (("10P", 7.0, 20.0), np.array([0.3410, 0.1988, 43.0600])), (("10P", 7.0, 22.0), np.array([0.3430, 0.1883, 43.0600])), (("10P", 7.0, 24.0), np.array([0.3440, 0.1790, 43.0600])), (("10P", 7.0, 26.0), np.array([0.3440, 0.1700, 43.0600])), (("10P", 7.0, 28.0), np.array([0.3450, 0.1620, 43.0600])), (("10P", 7.0, 30.0), np.array([0.3460, 0.1540, 43.0600])), (("2.5RP", 7.0, 2.0), np.array([0.3170, 0.3076, 43.0600])), (("2.5RP", 7.0, 4.0), np.array([0.3254, 0.2971, 43.0600])), (("2.5RP", 7.0, 6.0), np.array([0.3338, 0.2854, 43.0600])), (("2.5RP", 7.0, 8.0), np.array([0.3417, 0.2745, 43.0600])), (("2.5RP", 7.0, 10.0), np.array([0.3487, 0.2648, 43.0600])), (("2.5RP", 7.0, 12.0), np.array([0.3555, 0.2545, 43.0600])), (("2.5RP", 7.0, 14.0), np.array([0.3620, 0.2448, 43.0600])), (("2.5RP", 7.0, 16.0), np.array([0.3688, 0.2342, 43.0600])), (("2.5RP", 7.0, 18.0), np.array([0.3751, 0.2241, 43.0600])), (("2.5RP", 7.0, 20.0), np.array([0.3811, 0.2143, 43.0600])), (("2.5RP", 7.0, 22.0), np.array([0.3850, 0.2060, 43.0600])), (("2.5RP", 7.0, 24.0), np.array([0.3890, 0.2000, 43.0600])), (("2.5RP", 7.0, 26.0), np.array([0.3940, 0.1920, 43.0600])), (("2.5RP", 7.0, 28.0), np.array([0.3980, 0.1840, 43.0600])), (("2.5RP", 7.0, 30.0), np.array([0.4020, 0.1780, 43.0600])), (("5RP", 7.0, 2.0), np.array([0.3206, 0.3104, 43.0600])), (("5RP", 7.0, 4.0), np.array([0.3332, 0.3032, 43.0600])), (("5RP", 7.0, 6.0), np.array([0.3470, 0.2949, 43.0600])), (("5RP", 7.0, 8.0), np.array([0.3603, 0.2869, 43.0600])), (("5RP", 7.0, 10.0), np.array([0.3713, 0.2798, 43.0600])), (("5RP", 7.0, 12.0), np.array([0.3841, 0.2710, 43.0600])), (("5RP", 7.0, 14.0), np.array([0.3958, 0.2628, 43.0600])), (("5RP", 7.0, 16.0), np.array([0.4076, 0.2540, 43.0600])), (("5RP", 7.0, 18.0), np.array([0.4186, 0.2459, 43.0600])), (("5RP", 7.0, 20.0), np.array([0.4260, 0.2390, 43.0600])), (("5RP", 7.0, 22.0), np.array([0.4360, 0.2320, 43.0600])), (("5RP", 7.0, 24.0), np.array([0.4430, 0.2260, 43.0600])), (("5RP", 7.0, 26.0), np.array([0.4520, 0.2170, 43.0600])), (("5RP", 7.0, 28.0), np.array([0.4600, 0.2110, 43.0600])), (("7.5RP", 7.0, 2.0), np.array([0.3232, 0.3125, 43.0600])), (("7.5RP", 7.0, 4.0), np.array([0.3389, 0.3079, 43.0600])), (("7.5RP", 7.0, 6.0), np.array([0.3562, 0.3022, 43.0600])), (("7.5RP", 7.0, 8.0), np.array([0.3722, 0.2963, 43.0600])), (("7.5RP", 7.0, 10.0), np.array([0.3871, 0.2906, 43.0600])), (("7.5RP", 7.0, 12.0), np.array([0.4040, 0.2834, 43.0600])), (("7.5RP", 7.0, 14.0), np.array([0.4195, 0.2762, 43.0600])), (("7.5RP", 7.0, 16.0), np.array([0.4346, 0.2689, 43.0600])), (("7.5RP", 7.0, 18.0), np.array([0.4480, 0.2610, 43.0600])), (("7.5RP", 7.0, 20.0), np.array([0.4600, 0.2550, 43.0600])), (("7.5RP", 7.0, 22.0), np.array([0.4710, 0.2490, 43.0600])), (("7.5RP", 7.0, 24.0), np.array([0.4810, 0.2430, 43.0600])), (("7.5RP", 7.0, 26.0), np.array([0.4910, 0.2360, 43.0600])), (("10RP", 7.0, 2.0), np.array([0.3258, 0.3148, 43.0600])), (("10RP", 7.0, 4.0), np.array([0.3446, 0.3125, 43.0600])), (("10RP", 7.0, 6.0), np.array([0.3648, 0.3098, 43.0600])), (("10RP", 7.0, 8.0), np.array([0.3851, 0.3067, 43.0600])), (("10RP", 7.0, 10.0), np.array([0.4040, 0.3030, 43.0600])), (("10RP", 7.0, 12.0), np.array([0.4260, 0.2980, 43.0600])), (("10RP", 7.0, 14.0), np.array([0.4456, 0.2931, 43.0600])), (("10RP", 7.0, 16.0), np.array([0.4648, 0.2878, 43.0600])), (("10RP", 7.0, 18.0), np.array([0.4830, 0.2830, 43.0600])), (("10RP", 7.0, 20.0), np.array([0.4980, 0.2790, 43.0600])), (("10RP", 7.0, 22.0), np.array([0.5110, 0.2740, 43.0600])), (("10RP", 7.0, 24.0), np.array([0.5260, 0.2670, 43.0600])), (("2.5R", 7.0, 2.0), np.array([0.3284, 0.3170, 43.0600])), (("2.5R", 7.0, 4.0), np.array([0.3499, 0.3171, 43.0600])), (("2.5R", 7.0, 6.0), np.array([0.3728, 0.3170, 43.0600])), (("2.5R", 7.0, 8.0), np.array([0.3961, 0.3160, 43.0600])), (("2.5R", 7.0, 10.0), np.array([0.4183, 0.3144, 43.0600])), (("2.5R", 7.0, 12.0), np.array([0.4435, 0.3119, 43.0600])), (("2.5R", 7.0, 14.0), np.array([0.4660, 0.3082, 43.0600])), (("2.5R", 7.0, 16.0), np.array([0.4885, 0.3039, 43.0600])), (("2.5R", 7.0, 18.0), np.array([0.5070, 0.3000, 43.0600])), (("2.5R", 7.0, 20.0), np.array([0.5230, 0.2960, 43.0600])), (("2.5R", 7.0, 22.0), np.array([0.5360, 0.2910, 43.0600])), (("2.5R", 7.0, 24.0), np.array([0.5530, 0.2870, 43.0600])), (("5R", 7.0, 2.0), np.array([0.3306, 0.3190, 43.0600])), (("5R", 7.0, 4.0), np.array([0.3552, 0.3222, 43.0600])), (("5R", 7.0, 6.0), np.array([0.3805, 0.3244, 43.0600])), (("5R", 7.0, 8.0), np.array([0.4067, 0.3256, 43.0600])), (("5R", 7.0, 10.0), np.array([0.4320, 0.3260, 43.0600])), (("5R", 7.0, 12.0), np.array([0.4595, 0.3252, 43.0600])), (("5R", 7.0, 14.0), np.array([0.4848, 0.3238, 43.0600])), (("5R", 7.0, 16.0), np.array([0.5100, 0.3210, 43.0600])), (("5R", 7.0, 18.0), np.array([0.5300, 0.3180, 43.0600])), (("5R", 7.0, 20.0), np.array([0.5470, 0.3150, 43.0600])), (("5R", 7.0, 22.0), np.array([0.5630, 0.3110, 43.0600])), (("5R", 7.0, 24.0), np.array([0.5800, 0.3060, 43.0600])), (("7.5R", 7.0, 2.0), np.array([0.3335, 0.3220, 43.0600])), (("7.5R", 7.0, 4.0), np.array([0.3611, 0.3282, 43.0600])), (("7.5R", 7.0, 6.0), np.array([0.3888, 0.3336, 43.0600])), (("7.5R", 7.0, 8.0), np.array([0.4196, 0.3382, 43.0600])), (("7.5R", 7.0, 10.0), np.array([0.4470, 0.3413, 43.0600])), (("7.5R", 7.0, 12.0), np.array([0.4777, 0.3435, 43.0600])), (("7.5R", 7.0, 14.0), np.array([0.5059, 0.3450, 43.0600])), (("7.5R", 7.0, 16.0), np.array([0.5341, 0.3452, 43.0600])), (("7.5R", 7.0, 18.0), np.array([0.5540, 0.3430, 43.0600])), (("7.5R", 7.0, 20.0), np.array([0.5730, 0.3410, 43.0600])), (("7.5R", 7.0, 22.0), np.array([0.5920, 0.3380, 43.0600])), (("7.5R", 7.0, 24.0), np.array([0.6070, 0.3350, 43.0600])), (("7.5R", 7.0, 26.0), np.array([0.6220, 0.3320, 43.0600])), (("10R", 7.0, 2.0), np.array([0.3360, 0.3253, 43.0600])), (("10R", 7.0, 4.0), np.array([0.3671, 0.3360, 43.0600])), (("10R", 7.0, 6.0), np.array([0.3984, 0.3452, 43.0600])), (("10R", 7.0, 8.0), np.array([0.4308, 0.3533, 43.0600])), (("10R", 7.0, 10.0), np.array([0.4600, 0.3596, 43.0600])), (("10R", 7.0, 12.0), np.array([0.4930, 0.3659, 43.0600])), (("10R", 7.0, 14.0), np.array([0.5234, 0.3700, 43.0600])), (("10R", 7.0, 16.0), np.array([0.5519, 0.3729, 43.0600])), (("10R", 7.0, 18.0), np.array([0.5710, 0.3730, 43.0600])), (("10R", 7.0, 20.0), np.array([0.5920, 0.3740, 43.0600])), (("10R", 7.0, 22.0), np.array([0.6140, 0.3740, 43.0600])), (("10R", 7.0, 24.0), np.array([0.6300, 0.3720, 43.0600])), (("10R", 7.0, 26.0), np.array([0.6470, 0.3690, 43.0600])), (("2.5YR", 7.0, 2.0), np.array([0.3392, 0.3298, 43.0600])), (("2.5YR", 7.0, 4.0), np.array([0.3715, 0.3439, 43.0600])), (("2.5YR", 7.0, 6.0), np.array([0.4053, 0.3570, 43.0600])), (("2.5YR", 7.0, 8.0), np.array([0.4371, 0.3679, 43.0600])), (("2.5YR", 7.0, 10.0), np.array([0.4671, 0.3768, 43.0600])), (("2.5YR", 7.0, 12.0), np.array([0.5001, 0.3861, 43.0600])), (("2.5YR", 7.0, 14.0), np.array([0.5297, 0.3938, 43.0600])), (("2.5YR", 7.0, 16.0), np.array([0.5522, 0.3989, 43.0600])), (("2.5YR", 7.0, 18.0), np.array([0.5695, 0.4024, 43.0600])), (("2.5YR", 7.0, 20.0), np.array([0.5824, 0.4046, 43.0600])), (("2.5YR", 7.0, 22.0), np.array([0.5940, 0.4070, 43.0600])), (("2.5YR", 7.0, 24.0), np.array([0.6020, 0.4090, 43.0600])), (("5YR", 7.0, 2.0), np.array([0.3421, 0.3349, 43.0600])), (("5YR", 7.0, 4.0), np.array([0.3750, 0.3530, 43.0600])), (("5YR", 7.0, 6.0), np.array([0.4091, 0.3701, 43.0600])), (("5YR", 7.0, 8.0), np.array([0.4402, 0.3842, 43.0600])), (("5YR", 7.0, 10.0), np.array([0.4711, 0.3972, 43.0600])), (("5YR", 7.0, 12.0), np.array([0.5007, 0.4081, 43.0600])), (("5YR", 7.0, 14.0), np.array([0.5252, 0.4168, 43.0600])), (("5YR", 7.0, 16.0), np.array([0.5437, 0.4228, 43.0600])), (("5YR", 7.0, 18.0), np.array([0.5564, 0.4267, 43.0600])), (("5YR", 7.0, 20.0), np.array([0.5657, 0.4298, 43.0600])), (("5YR", 7.0, 22.0), np.array([0.5750, 0.4340, 43.0600])), (("7.5YR", 7.0, 2.0), np.array([0.3437, 0.3397, 43.0600])), (("7.5YR", 7.0, 4.0), np.array([0.3772, 0.3613, 43.0600])), (("7.5YR", 7.0, 6.0), np.array([0.4107, 0.3820, 43.0600])), (("7.5YR", 7.0, 8.0), np.array([0.4415, 0.3996, 43.0600])), (("7.5YR", 7.0, 10.0), np.array([0.4704, 0.4151, 43.0600])), (("7.5YR", 7.0, 12.0), np.array([0.4970, 0.4282, 43.0600])), (("7.5YR", 7.0, 14.0), np.array([0.5174, 0.4381, 43.0600])), (("7.5YR", 7.0, 16.0), np.array([0.5319, 0.4449, 43.0600])), (("7.5YR", 7.0, 18.0), np.array([0.5417, 0.4492, 43.0600])), (("7.5YR", 7.0, 20.0), np.array([0.5480, 0.4530, 43.0600])), (("7.5YR", 7.0, 22.0), np.array([0.5560, 0.4560, 43.0600])), (("10YR", 7.0, 2.0), np.array([0.3443, 0.3454, 43.0600])), (("10YR", 7.0, 4.0), np.array([0.3778, 0.3719, 43.0600])), (("10YR", 7.0, 6.0), np.array([0.4102, 0.3960, 43.0600])), (("10YR", 7.0, 8.0), np.array([0.4399, 0.4164, 43.0600])), (("10YR", 7.0, 10.0), np.array([0.4667, 0.4335, 43.0600])), (("10YR", 7.0, 12.0), np.array([0.4900, 0.4480, 43.0600])), (("10YR", 7.0, 14.0), np.array([0.5074, 0.4581, 43.0600])), (("10YR", 7.0, 16.0), np.array([0.5188, 0.4650, 43.0600])), (("10YR", 7.0, 18.0), np.array([0.5276, 0.4700, 43.0600])), (("10YR", 7.0, 20.0), np.array([0.5320, 0.4740, 43.0600])), (("2.5Y", 7.0, 2.0), np.array([0.3436, 0.3507, 43.0600])), (("2.5Y", 7.0, 4.0), np.array([0.3761, 0.3800, 43.0600])), (("2.5Y", 7.0, 6.0), np.array([0.4073, 0.4073, 43.0600])), (("2.5Y", 7.0, 8.0), np.array([0.4353, 0.4312, 43.0600])), (("2.5Y", 7.0, 10.0), np.array([0.4606, 0.4516, 43.0600])), (("2.5Y", 7.0, 12.0), np.array([0.4806, 0.4666, 43.0600])), (("2.5Y", 7.0, 14.0), np.array([0.4950, 0.4773, 43.0600])), (("2.5Y", 7.0, 16.0), np.array([0.5049, 0.4843, 43.0600])), (("2.5Y", 7.0, 18.0), np.array([0.5110, 0.4880, 43.0600])), (("2.5Y", 7.0, 20.0), np.array([0.5160, 0.4920, 43.0600])), (("5Y", 7.0, 2.0), np.array([0.3419, 0.3540, 43.0600])), (("5Y", 7.0, 4.0), np.array([0.3718, 0.3885, 43.0600])), (("5Y", 7.0, 6.0), np.array([0.4009, 0.4198, 43.0600])), (("5Y", 7.0, 8.0), np.array([0.4271, 0.4462, 43.0600])), (("5Y", 7.0, 10.0), np.array([0.4509, 0.4696, 43.0600])), (("5Y", 7.0, 12.0), np.array([0.4677, 0.4857, 43.0600])), (("5Y", 7.0, 14.0), np.array([0.4791, 0.4965, 43.0600])), (("5Y", 7.0, 16.0), np.array([0.4875, 0.5047, 43.0600])), (("5Y", 7.0, 18.0), np.array([0.4930, 0.5090, 43.0600])), (("5Y", 7.0, 20.0), np.array([0.4980, 0.5130, 43.0600])), (("7.5Y", 7.0, 2.0), np.array([0.3396, 0.3558, 43.0600])), (("7.5Y", 7.0, 4.0), np.array([0.3677, 0.3925, 43.0600])), (("7.5Y", 7.0, 6.0), np.array([0.3943, 0.4264, 43.0600])), (("7.5Y", 7.0, 8.0), np.array([0.4184, 0.4568, 43.0600])), (("7.5Y", 7.0, 10.0), np.array([0.4400, 0.4830, 43.0600])), (("7.5Y", 7.0, 12.0), np.array([0.4547, 0.5005, 43.0600])), (("7.5Y", 7.0, 14.0), np.array([0.4652, 0.5128, 43.0600])), (("7.5Y", 7.0, 16.0), np.array([0.4728, 0.5215, 43.0600])), (("7.5Y", 7.0, 18.0), np.array([0.4770, 0.5270, 43.0600])), (("10Y", 8.0, 2.0), np.array([0.3359, 0.3552, 59.1000])), (("10Y", 8.0, 4.0), np.array([0.3581, 0.3883, 59.1000])), (("10Y", 8.0, 6.0), np.array([0.3803, 0.4216, 59.1000])), (("10Y", 8.0, 8.0), np.array([0.4008, 0.4520, 59.1000])), (("10Y", 8.0, 10.0), np.array([0.4190, 0.4791, 59.1000])), (("10Y", 8.0, 12.0), np.array([0.4341, 0.5020, 59.1000])), (("10Y", 8.0, 14.0), np.array([0.4450, 0.5181, 59.1000])), (("10Y", 8.0, 16.0), np.array([0.4525, 0.5295, 59.1000])), (("10Y", 8.0, 18.0), np.array([0.4570, 0.5366, 59.1000])), (("10Y", 8.0, 20.0), np.array([0.4610, 0.5420, 59.1000])), (("2.5GY", 8.0, 2.0), np.array([0.3327, 0.3555, 59.1000])), (("2.5GY", 8.0, 4.0), np.array([0.3504, 0.3887, 59.1000])), (("2.5GY", 8.0, 6.0), np.array([0.3690, 0.4230, 59.1000])), (("2.5GY", 8.0, 8.0), np.array([0.3858, 0.4550, 59.1000])), (("2.5GY", 8.0, 10.0), np.array([0.4021, 0.4869, 59.1000])), (("2.5GY", 8.0, 12.0), np.array([0.4154, 0.5133, 59.1000])), (("2.5GY", 8.0, 14.0), np.array([0.4261, 0.5344, 59.1000])), (("2.5GY", 8.0, 16.0), np.array([0.4327, 0.5475, 59.1000])), (("2.5GY", 8.0, 18.0), np.array([0.4371, 0.5557, 59.1000])), (("2.5GY", 8.0, 20.0), np.array([0.4400, 0.5620, 59.1000])), (("2.5GY", 8.0, 22.0), np.array([0.4430, 0.5680, 59.1000])), (("5GY", 8.0, 2.0), np.array([0.3284, 0.3542, 59.1000])), (("5GY", 8.0, 4.0), np.array([0.3433, 0.3872, 59.1000])), (("5GY", 8.0, 6.0), np.array([0.3573, 0.4214, 59.1000])), (("5GY", 8.0, 8.0), np.array([0.3696, 0.4542, 59.1000])), (("5GY", 8.0, 10.0), np.array([0.3816, 0.4879, 59.1000])), (("5GY", 8.0, 12.0), np.array([0.3924, 0.5199, 59.1000])), (("5GY", 8.0, 14.0), np.array([0.4011, 0.5468, 59.1000])), (("5GY", 8.0, 16.0), np.array([0.4061, 0.5641, 59.1000])), (("5GY", 8.0, 18.0), np.array([0.4104, 0.5785, 59.1000])), (("5GY", 8.0, 20.0), np.array([0.4127, 0.5855, 59.1000])), (("5GY", 8.0, 22.0), np.array([0.4150, 0.5950, 59.1000])), (("7.5GY", 8.0, 2.0), np.array([0.3194, 0.3502, 59.1000])), (("7.5GY", 8.0, 4.0), np.array([0.3266, 0.3809, 59.1000])), (("7.5GY", 8.0, 6.0), np.array([0.3339, 0.4129, 59.1000])), (("7.5GY", 8.0, 8.0), np.array([0.3408, 0.4452, 59.1000])), (("7.5GY", 8.0, 10.0), np.array([0.3463, 0.4791, 59.1000])), (("7.5GY", 8.0, 12.0), np.array([0.3511, 0.5144, 59.1000])), (("7.5GY", 8.0, 14.0), np.array([0.3546, 0.5490, 59.1000])), (("7.5GY", 8.0, 16.0), np.array([0.3569, 0.5798, 59.1000])), (("7.5GY", 8.0, 18.0), np.array([0.3585, 0.6063, 59.1000])), (("7.5GY", 8.0, 20.0), np.array([0.3592, 0.6235, 59.1000])), (("7.5GY", 8.0, 22.0), np.array([0.3600, 0.6450, 59.1000])), (("7.5GY", 8.0, 24.0), np.array([0.3600, 0.6600, 59.1000])), (("7.5GY", 8.0, 26.0), np.array([0.3610, 0.6790, 59.1000])), (("7.5GY", 8.0, 28.0), np.array([0.3610, 0.6960, 59.1000])), (("10GY", 8.0, 2.0), np.array([0.3121, 0.3459, 59.1000])), (("10GY", 8.0, 4.0), np.array([0.3140, 0.3727, 59.1000])), (("10GY", 8.0, 6.0), np.array([0.3150, 0.4014, 59.1000])), (("10GY", 8.0, 8.0), np.array([0.3149, 0.4284, 59.1000])), (("10GY", 8.0, 10.0), np.array([0.3140, 0.4601, 59.1000])), (("10GY", 8.0, 12.0), np.array([0.3124, 0.4926, 59.1000])), (("10GY", 8.0, 14.0), np.array([0.3091, 0.5247, 59.1000])), (("10GY", 8.0, 16.0), np.array([0.3043, 0.5578, 59.1000])), (("10GY", 8.0, 18.0), np.array([0.2987, 0.5919, 59.1000])), (("10GY", 8.0, 20.0), np.array([0.2918, 0.6255, 59.1000])), (("10GY", 8.0, 22.0), np.array([0.2846, 0.6564, 59.1000])), (("10GY", 8.0, 24.0), np.array([0.2781, 0.6840, 59.1000])), (("10GY", 8.0, 26.0), np.array([0.2710, 0.7020, 59.1000])), (("10GY", 8.0, 28.0), np.array([0.2620, 0.7260, 59.1000])), (("10GY", 8.0, 30.0), np.array([0.2520, 0.7520, 59.1000])), (("10GY", 8.0, 32.0), np.array([0.2400, 0.7840, 59.1000])), (("2.5G", 8.0, 2.0), np.array([0.3053, 0.3404, 59.1000])), (("2.5G", 8.0, 4.0), np.array([0.3009, 0.3614, 59.1000])), (("2.5G", 8.0, 6.0), np.array([0.2952, 0.3851, 59.1000])), (("2.5G", 8.0, 8.0), np.array([0.2896, 0.4065, 59.1000])), (("2.5G", 8.0, 10.0), np.array([0.2829, 0.4301, 59.1000])), (("2.5G", 8.0, 12.0), np.array([0.2743, 0.4554, 59.1000])), (("2.5G", 8.0, 14.0), np.array([0.2661, 0.4780, 59.1000])), (("2.5G", 8.0, 16.0), np.array([0.2563, 0.5045, 59.1000])), (("2.5G", 8.0, 18.0), np.array([0.2451, 0.5309, 59.1000])), (("2.5G", 8.0, 20.0), np.array([0.2339, 0.5561, 59.1000])), (("2.5G", 8.0, 22.0), np.array([0.2221, 0.5799, 59.1000])), (("2.5G", 8.0, 24.0), np.array([0.2091, 0.6033, 59.1000])), (("2.5G", 8.0, 26.0), np.array([0.1960, 0.6220, 59.1000])), (("2.5G", 8.0, 28.0), np.array([0.1800, 0.6470, 59.1000])), (("2.5G", 8.0, 30.0), np.array([0.1630, 0.6700, 59.1000])), (("2.5G", 8.0, 32.0), np.array([0.1440, 0.6920, 59.1000])), (("5G", 8.0, 2.0), np.array([0.3009, 0.3359, 59.1000])), (("5G", 8.0, 4.0), np.array([0.2924, 0.3523, 59.1000])), (("5G", 8.0, 6.0), np.array([0.2822, 0.3702, 59.1000])), (("5G", 8.0, 8.0), np.array([0.2723, 0.3865, 59.1000])), (("5G", 8.0, 10.0), np.array([0.2613, 0.4026, 59.1000])), (("5G", 8.0, 12.0), np.array([0.2489, 0.4191, 59.1000])), (("5G", 8.0, 14.0), np.array([0.2368, 0.4348, 59.1000])), (("5G", 8.0, 16.0), np.array([0.2240, 0.4500, 59.1000])), (("5G", 8.0, 18.0), np.array([0.2103, 0.4652, 59.1000])), (("5G", 8.0, 20.0), np.array([0.1956, 0.4806, 59.1000])), (("5G", 8.0, 22.0), np.array([0.1821, 0.4940, 59.1000])), (("5G", 8.0, 24.0), np.array([0.1680, 0.5070, 59.1000])), (("5G", 8.0, 26.0), np.array([0.1510, 0.5210, 59.1000])), (("5G", 8.0, 28.0), np.array([0.1340, 0.5370, 59.1000])), (("5G", 8.0, 30.0), np.array([0.1150, 0.5530, 59.1000])), (("5G", 8.0, 32.0), np.array([0.0960, 0.5640, 59.1000])), (("7.5G", 8.0, 2.0), np.array([0.2981, 0.3326, 59.1000])), (("7.5G", 8.0, 4.0), np.array([0.2874, 0.3464, 59.1000])), (("7.5G", 8.0, 6.0), np.array([0.2754, 0.3608, 59.1000])), (("7.5G", 8.0, 8.0), np.array([0.2639, 0.3733, 59.1000])), (("7.5G", 8.0, 10.0), np.array([0.2515, 0.3867, 59.1000])), (("7.5G", 8.0, 12.0), np.array([0.2380, 0.4002, 59.1000])), (("7.5G", 8.0, 14.0), np.array([0.2254, 0.4125, 59.1000])), (("7.5G", 8.0, 16.0), np.array([0.2120, 0.4252, 59.1000])), (("7.5G", 8.0, 18.0), np.array([0.1980, 0.4372, 59.1000])), (("7.5G", 8.0, 20.0), np.array([0.1845, 0.4492, 59.1000])), (("7.5G", 8.0, 22.0), np.array([0.1700, 0.4590, 59.1000])), (("7.5G", 8.0, 24.0), np.array([0.1550, 0.4710, 59.1000])), (("7.5G", 8.0, 26.0), np.array([0.1390, 0.4830, 59.1000])), (("7.5G", 8.0, 28.0), np.array([0.1230, 0.4940, 59.1000])), (("7.5G", 8.0, 30.0), np.array([0.1050, 0.5070, 59.1000])), (("10G", 8.0, 2.0), np.array([0.2957, 0.3293, 59.1000])), (("10G", 8.0, 4.0), np.array([0.2828, 0.3403, 59.1000])), (("10G", 8.0, 6.0), np.array([0.2693, 0.3512, 59.1000])), (("10G", 8.0, 8.0), np.array([0.2564, 0.3611, 59.1000])), (("10G", 8.0, 10.0), np.array([0.2430, 0.3710, 59.1000])), (("10G", 8.0, 12.0), np.array([0.2282, 0.3811, 59.1000])), (("10G", 8.0, 14.0), np.array([0.2148, 0.3903, 59.1000])), (("10G", 8.0, 16.0), np.array([0.2012, 0.3992, 59.1000])), (("10G", 8.0, 18.0), np.array([0.1866, 0.4086, 59.1000])), (("10G", 8.0, 20.0), np.array([0.1734, 0.4164, 59.1000])), (("10G", 8.0, 22.0), np.array([0.1590, 0.4240, 59.1000])), (("10G", 8.0, 24.0), np.array([0.1420, 0.4330, 59.1000])), (("10G", 8.0, 26.0), np.array([0.1270, 0.4410, 59.1000])), (("10G", 8.0, 28.0), np.array([0.1120, 0.4480, 59.1000])), (("2.5BG", 8.0, 2.0), np.array([0.2940, 0.3268, 59.1000])), (("2.5BG", 8.0, 4.0), np.array([0.2791, 0.3351, 59.1000])), (("2.5BG", 8.0, 6.0), np.array([0.2647, 0.3429, 59.1000])), (("2.5BG", 8.0, 8.0), np.array([0.2500, 0.3500, 59.1000])), (("2.5BG", 8.0, 10.0), np.array([0.2352, 0.3566, 59.1000])), (("2.5BG", 8.0, 12.0), np.array([0.2196, 0.3630, 59.1000])), (("2.5BG", 8.0, 14.0), np.array([0.2057, 0.3681, 59.1000])), (("2.5BG", 8.0, 16.0), np.array([0.1915, 0.3732, 59.1000])), (("2.5BG", 8.0, 18.0), np.array([0.1759, 0.3782, 59.1000])), (("2.5BG", 8.0, 20.0), np.array([0.1620, 0.3830, 59.1000])), (("2.5BG", 8.0, 22.0), np.array([0.1480, 0.3870, 59.1000])), (("2.5BG", 8.0, 24.0), np.array([0.1320, 0.3920, 59.1000])), (("2.5BG", 8.0, 26.0), np.array([0.1160, 0.3960, 59.1000])), (("5BG", 8.0, 2.0), np.array([0.2919, 0.3228, 59.1000])), (("5BG", 8.0, 4.0), np.array([0.2752, 0.3278, 59.1000])), (("5BG", 8.0, 6.0), np.array([0.2588, 0.3318, 59.1000])), (("5BG", 8.0, 8.0), np.array([0.2419, 0.3352, 59.1000])), (("5BG", 8.0, 10.0), np.array([0.2264, 0.3383, 59.1000])), (("5BG", 8.0, 12.0), np.array([0.2101, 0.3412, 59.1000])), (("5BG", 8.0, 14.0), np.array([0.1958, 0.3432, 59.1000])), (("5BG", 8.0, 16.0), np.array([0.1814, 0.3450, 59.1000])), (("5BG", 8.0, 18.0), np.array([0.1650, 0.3460, 59.1000])), (("5BG", 8.0, 20.0), np.array([0.1510, 0.3480, 59.1000])), (("5BG", 8.0, 22.0), np.array([0.1380, 0.3490, 59.1000])), (("5BG", 8.0, 24.0), np.array([0.1220, 0.3510, 59.1000])), (("5BG", 8.0, 26.0), np.array([0.1050, 0.3520, 59.1000])), (("7.5BG", 8.0, 2.0), np.array([0.2900, 0.3183, 59.1000])), (("7.5BG", 8.0, 4.0), np.array([0.2718, 0.3200, 59.1000])), (("7.5BG", 8.0, 6.0), np.array([0.2525, 0.3198, 59.1000])), (("7.5BG", 8.0, 8.0), np.array([0.2352, 0.3198, 59.1000])), (("7.5BG", 8.0, 10.0), np.array([0.2184, 0.3196, 59.1000])), (("7.5BG", 8.0, 12.0), np.array([0.2010, 0.3188, 59.1000])), (("7.5BG", 8.0, 14.0), np.array([0.1868, 0.3179, 59.1000])), (("7.5BG", 8.0, 16.0), np.array([0.1721, 0.3168, 59.1000])), (("7.5BG", 8.0, 18.0), np.array([0.1550, 0.3140, 59.1000])), (("7.5BG", 8.0, 20.0), np.array([0.1420, 0.3110, 59.1000])), (("7.5BG", 8.0, 22.0), np.array([0.1270, 0.3090, 59.1000])), (("7.5BG", 8.0, 24.0), np.array([0.1110, 0.3070, 59.1000])), (("10BG", 8.0, 2.0), np.array([0.2894, 0.3152, 59.1000])), (("10BG", 8.0, 4.0), np.array([0.2686, 0.3130, 59.1000])), (("10BG", 8.0, 6.0), np.array([0.2489, 0.3099, 59.1000])), (("10BG", 8.0, 8.0), np.array([0.2302, 0.3063, 59.1000])), (("10BG", 8.0, 10.0), np.array([0.2120, 0.3025, 59.1000])), (("10BG", 8.0, 12.0), np.array([0.1937, 0.2978, 59.1000])), (("10BG", 8.0, 14.0), np.array([0.1788, 0.2936, 59.1000])), (("10BG", 8.0, 16.0), np.array([0.1610, 0.2880, 59.1000])), (("10BG", 8.0, 18.0), np.array([0.1450, 0.2820, 59.1000])), (("10BG", 8.0, 20.0), np.array([0.1330, 0.2780, 59.1000])), (("10BG", 8.0, 22.0), np.array([0.1180, 0.2730, 59.1000])), (("2.5B", 8.0, 2.0), np.array([0.2897, 0.3124, 59.1000])), (("2.5B", 8.0, 4.0), np.array([0.2668, 0.3067, 59.1000])), (("2.5B", 8.0, 6.0), np.array([0.2462, 0.3000, 59.1000])), (("2.5B", 8.0, 8.0), np.array([0.2264, 0.2923, 59.1000])), (("2.5B", 8.0, 10.0), np.array([0.2066, 0.2839, 59.1000])), (("2.5B", 8.0, 12.0), np.array([0.1877, 0.2752, 59.1000])), (("2.5B", 8.0, 14.0), np.array([0.1720, 0.2660, 59.1000])), (("2.5B", 8.0, 16.0), np.array([0.1520, 0.2560, 59.1000])), (("2.5B", 8.0, 18.0), np.array([0.1370, 0.2450, 59.1000])), (("2.5B", 8.0, 20.0), np.array([0.1230, 0.2350, 59.1000])), (("5B", 8.0, 2.0), np.array([0.2908, 0.3096, 59.1000])), (("5B", 8.0, 4.0), np.array([0.2671, 0.2998, 59.1000])), (("5B", 8.0, 6.0), np.array([0.2457, 0.2888, 59.1000])), (("5B", 8.0, 8.0), np.array([0.2237, 0.2761, 59.1000])), (("5B", 8.0, 10.0), np.array([0.2040, 0.2630, 59.1000])), (("5B", 8.0, 12.0), np.array([0.1820, 0.2470, 59.1000])), (("5B", 8.0, 14.0), np.array([0.1660, 0.2360, 59.1000])), (("5B", 8.0, 16.0), np.array([0.1480, 0.2210, 59.1000])), (("5B", 8.0, 18.0), np.array([0.1320, 0.2070, 59.1000])), (("7.5B", 8.0, 2.0), np.array([0.2922, 0.3077, 59.1000])), (("7.5B", 8.0, 4.0), np.array([0.2688, 0.2956, 59.1000])), (("7.5B", 8.0, 6.0), np.array([0.2472, 0.2821, 59.1000])), (("7.5B", 8.0, 8.0), np.array([0.2252, 0.2668, 59.1000])), (("7.5B", 8.0, 10.0), np.array([0.2050, 0.2500, 59.1000])), (("7.5B", 8.0, 12.0), np.array([0.1840, 0.2330, 59.1000])), (("7.5B", 8.0, 14.0), np.array([0.1680, 0.2190, 59.1000])), (("7.5B", 8.0, 16.0), np.array([0.1510, 0.2040, 59.1000])), (("10B", 8.0, 2.0), np.array([0.2935, 0.3062, 59.1000])), (("10B", 8.0, 4.0), np.array([0.2718, 0.2911, 59.1000])), (("10B", 8.0, 6.0), np.array([0.2512, 0.2760, 59.1000])), (("10B", 8.0, 8.0), np.array([0.2294, 0.2587, 59.1000])), (("10B", 8.0, 10.0), np.array([0.2100, 0.2420, 59.1000])), (("10B", 8.0, 12.0), np.array([0.1900, 0.2240, 59.1000])), (("10B", 8.0, 14.0), np.array([0.1740, 0.2060, 59.1000])), (("2.5PB", 8.0, 2.0), np.array([0.2957, 0.3047, 59.1000])), (("2.5PB", 8.0, 4.0), np.array([0.2758, 0.2879, 59.1000])), (("2.5PB", 8.0, 6.0), np.array([0.2562, 0.2709, 59.1000])), (("2.5PB", 8.0, 8.0), np.array([0.2370, 0.2530, 59.1000])), (("2.5PB", 8.0, 10.0), np.array([0.2180, 0.2350, 59.1000])), (("2.5PB", 8.0, 12.0), np.array([0.2020, 0.2170, 59.1000])), (("2.5PB", 8.0, 14.0), np.array([0.1850, 0.1990, 59.1000])), (("5PB", 8.0, 2.0), np.array([0.2974, 0.3039, 59.1000])), (("5PB", 8.0, 4.0), np.array([0.2798, 0.2861, 59.1000])), (("5PB", 8.0, 6.0), np.array([0.2614, 0.2670, 59.1000])), (("5PB", 8.0, 8.0), np.array([0.2440, 0.2490, 59.1000])), (("5PB", 8.0, 10.0), np.array([0.2270, 0.2290, 59.1000])), (("5PB", 8.0, 12.0), np.array([0.2140, 0.2140, 59.1000])), (("5PB", 8.0, 14.0), np.array([0.2000, 0.1940, 59.1000])), (("7.5PB", 8.0, 2.0), np.array([0.3003, 0.3034, 59.1000])), (("7.5PB", 8.0, 4.0), np.array([0.2856, 0.2846, 59.1000])), (("7.5PB", 8.0, 6.0), np.array([0.2702, 0.2648, 59.1000])), (("7.5PB", 8.0, 8.0), np.array([0.2550, 0.2440, 59.1000])), (("7.5PB", 8.0, 10.0), np.array([0.2410, 0.2240, 59.1000])), (("7.5PB", 8.0, 12.0), np.array([0.2320, 0.2100, 59.1000])), (("7.5PB", 8.0, 14.0), np.array([0.2210, 0.1930, 59.1000])), (("10PB", 8.0, 2.0), np.array([0.3027, 0.3035, 59.1000])), (("10PB", 8.0, 4.0), np.array([0.2911, 0.2848, 59.1000])), (("10PB", 8.0, 6.0), np.array([0.2792, 0.2649, 59.1000])), (("10PB", 8.0, 8.0), np.array([0.2677, 0.2443, 59.1000])), (("10PB", 8.0, 10.0), np.array([0.2570, 0.2250, 59.1000])), (("10PB", 8.0, 12.0), np.array([0.2480, 0.2110, 59.1000])), (("10PB", 8.0, 14.0), np.array([0.2400, 0.1960, 59.1000])), (("10PB", 8.0, 16.0), np.array([0.2330, 0.1850, 59.1000])), (("2.5P", 8.0, 2.0), np.array([0.3048, 0.3040, 59.1000])), (("2.5P", 8.0, 4.0), np.array([0.2962, 0.2850, 59.1000])), (("2.5P", 8.0, 6.0), np.array([0.2881, 0.2671, 59.1000])), (("2.5P", 8.0, 8.0), np.array([0.2800, 0.2488, 59.1000])), (("2.5P", 8.0, 10.0), np.array([0.2740, 0.2310, 59.1000])), (("2.5P", 8.0, 12.0), np.array([0.2680, 0.2180, 59.1000])), (("2.5P", 8.0, 14.0), np.array([0.2630, 0.2040, 59.1000])), (("2.5P", 8.0, 16.0), np.array([0.2590, 0.1940, 59.1000])), (("2.5P", 8.0, 18.0), np.array([0.2550, 0.1830, 59.1000])), (("5P", 8.0, 2.0), np.array([0.3065, 0.3047, 59.1000])), (("5P", 8.0, 4.0), np.array([0.3012, 0.2868, 59.1000])), (("5P", 8.0, 6.0), np.array([0.2963, 0.2704, 59.1000])), (("5P", 8.0, 8.0), np.array([0.2914, 0.2534, 59.1000])), (("5P", 8.0, 10.0), np.array([0.2870, 0.2380, 59.1000])), (("5P", 8.0, 12.0), np.array([0.2830, 0.2240, 59.1000])), (("5P", 8.0, 14.0), np.array([0.2800, 0.2110, 59.1000])), (("5P", 8.0, 16.0), np.array([0.2780, 0.2010, 59.1000])), (("5P", 8.0, 18.0), np.array([0.2760, 0.1910, 59.1000])), (("5P", 8.0, 20.0), np.array([0.2730, 0.1790, 59.1000])), (("5P", 8.0, 22.0), np.array([0.2700, 0.1680, 59.1000])), (("7.5P", 8.0, 2.0), np.array([0.3107, 0.3070, 59.1000])), (("7.5P", 8.0, 4.0), np.array([0.3114, 0.2915, 59.1000])), (("7.5P", 8.0, 6.0), np.array([0.3114, 0.2785, 59.1000])), (("7.5P", 8.0, 8.0), np.array([0.3116, 0.2626, 59.1000])), (("7.5P", 8.0, 10.0), np.array([0.3116, 0.2497, 59.1000])), (("7.5P", 8.0, 12.0), np.array([0.3117, 0.2370, 59.1000])), (("7.5P", 8.0, 14.0), np.array([0.3110, 0.2240, 59.1000])), (("7.5P", 8.0, 16.0), np.array([0.3110, 0.2140, 59.1000])), (("7.5P", 8.0, 18.0), np.array([0.3110, 0.2040, 59.1000])), (("7.5P", 8.0, 20.0), np.array([0.3110, 0.1940, 59.1000])), (("7.5P", 8.0, 22.0), np.array([0.3110, 0.1840, 59.1000])), (("7.5P", 8.0, 24.0), np.array([0.3110, 0.1730, 59.1000])), (("7.5P", 8.0, 26.0), np.array([0.3110, 0.1620, 59.1000])), (("10P", 8.0, 2.0), np.array([0.3131, 0.3084, 59.1000])), (("10P", 8.0, 4.0), np.array([0.3175, 0.2955, 59.1000])), (("10P", 8.0, 6.0), np.array([0.3213, 0.2829, 59.1000])), (("10P", 8.0, 8.0), np.array([0.3250, 0.2700, 59.1000])), (("10P", 8.0, 10.0), np.array([0.3282, 0.2582, 59.1000])), (("10P", 8.0, 12.0), np.array([0.3312, 0.2470, 59.1000])), (("10P", 8.0, 14.0), np.array([0.3342, 0.2349, 59.1000])), (("10P", 8.0, 16.0), np.array([0.3370, 0.2250, 59.1000])), (("10P", 8.0, 18.0), np.array([0.3390, 0.2170, 59.1000])), (("10P", 8.0, 20.0), np.array([0.3410, 0.2070, 59.1000])), (("10P", 8.0, 22.0), np.array([0.3440, 0.1960, 59.1000])), (("10P", 8.0, 24.0), np.array([0.3460, 0.1860, 59.1000])), (("10P", 8.0, 26.0), np.array([0.3480, 0.1760, 59.1000])), (("2.5RP", 8.0, 2.0), np.array([0.3154, 0.3100, 59.1000])), (("2.5RP", 8.0, 4.0), np.array([0.3239, 0.3000, 59.1000])), (("2.5RP", 8.0, 6.0), np.array([0.3327, 0.2898, 59.1000])), (("2.5RP", 8.0, 8.0), np.array([0.3406, 0.2793, 59.1000])), (("2.5RP", 8.0, 10.0), np.array([0.3479, 0.2699, 59.1000])), (("2.5RP", 8.0, 12.0), np.array([0.3552, 0.2594, 59.1000])), (("2.5RP", 8.0, 14.0), np.array([0.3621, 0.2496, 59.1000])), (("2.5RP", 8.0, 16.0), np.array([0.3690, 0.2400, 59.1000])), (("2.5RP", 8.0, 18.0), np.array([0.3730, 0.2330, 59.1000])), (("2.5RP", 8.0, 20.0), np.array([0.3790, 0.2240, 59.1000])), (("2.5RP", 8.0, 22.0), np.array([0.3850, 0.2150, 59.1000])), (("2.5RP", 8.0, 24.0), np.array([0.3890, 0.2060, 59.1000])), (("2.5RP", 8.0, 26.0), np.array([0.3940, 0.1970, 59.1000])), (("5RP", 8.0, 2.0), np.array([0.3180, 0.3120, 59.1000])), (("5RP", 8.0, 4.0), np.array([0.3308, 0.3052, 59.1000])), (("5RP", 8.0, 6.0), np.array([0.3440, 0.2978, 59.1000])), (("5RP", 8.0, 8.0), np.array([0.3570, 0.2900, 59.1000])), (("5RP", 8.0, 10.0), np.array([0.3685, 0.2828, 59.1000])), (("5RP", 8.0, 12.0), np.array([0.3818, 0.2742, 59.1000])), (("5RP", 8.0, 14.0), np.array([0.3930, 0.2670, 59.1000])), (("5RP", 8.0, 16.0), np.array([0.4020, 0.2600, 59.1000])), (("5RP", 8.0, 18.0), np.array([0.4110, 0.2530, 59.1000])), (("5RP", 8.0, 20.0), np.array([0.4200, 0.2450, 59.1000])), (("5RP", 8.0, 22.0), np.array([0.4290, 0.2370, 59.1000])), (("5RP", 8.0, 24.0), np.array([0.4370, 0.2300, 59.1000])), (("7.5RP", 8.0, 2.0), np.array([0.3200, 0.3136, 59.1000])), (("7.5RP", 8.0, 4.0), np.array([0.3360, 0.3092, 59.1000])), (("7.5RP", 8.0, 6.0), np.array([0.3521, 0.3042, 59.1000])), (("7.5RP", 8.0, 8.0), np.array([0.3682, 0.2983, 59.1000])), (("7.5RP", 8.0, 10.0), np.array([0.3830, 0.2930, 59.1000])), (("7.5RP", 8.0, 12.0), np.array([0.4002, 0.2859, 59.1000])), (("7.5RP", 8.0, 14.0), np.array([0.4140, 0.2800, 59.1000])), (("7.5RP", 8.0, 16.0), np.array([0.4260, 0.2740, 59.1000])), (("7.5RP", 8.0, 18.0), np.array([0.4380, 0.2670, 59.1000])), (("7.5RP", 8.0, 20.0), np.array([0.4490, 0.2610, 59.1000])), (("7.5RP", 8.0, 22.0), np.array([0.4600, 0.2550, 59.1000])), (("10RP", 8.0, 2.0), np.array([0.3218, 0.3152, 59.1000])), (("10RP", 8.0, 4.0), np.array([0.3412, 0.3135, 59.1000])), (("10RP", 8.0, 6.0), np.array([0.3600, 0.3112, 59.1000])), (("10RP", 8.0, 8.0), np.array([0.3800, 0.3082, 59.1000])), (("10RP", 8.0, 10.0), np.array([0.3983, 0.3049, 59.1000])), (("10RP", 8.0, 12.0), np.array([0.4220, 0.3000, 59.1000])), (("10RP", 8.0, 14.0), np.array([0.4390, 0.2970, 59.1000])), (("10RP", 8.0, 16.0), np.array([0.4530, 0.2930, 59.1000])), (("10RP", 8.0, 18.0), np.array([0.4690, 0.2890, 59.1000])), (("10RP", 8.0, 20.0), np.array([0.4840, 0.2840, 59.1000])), (("2.5R", 8.0, 2.0), np.array([0.3236, 0.3169, 59.1000])), (("2.5R", 8.0, 4.0), np.array([0.3460, 0.3177, 59.1000])), (("2.5R", 8.0, 6.0), np.array([0.3671, 0.3175, 59.1000])), (("2.5R", 8.0, 8.0), np.array([0.3900, 0.3171, 59.1000])), (("2.5R", 8.0, 10.0), np.array([0.4125, 0.3160, 59.1000])), (("2.5R", 8.0, 12.0), np.array([0.4390, 0.3140, 59.1000])), (("2.5R", 8.0, 14.0), np.array([0.4600, 0.3110, 59.1000])), (("2.5R", 8.0, 16.0), np.array([0.4760, 0.3080, 59.1000])), (("2.5R", 8.0, 18.0), np.array([0.4930, 0.3060, 59.1000])), (("2.5R", 8.0, 20.0), np.array([0.5100, 0.3030, 59.1000])), (("5R", 8.0, 2.0), np.array([0.3254, 0.3186, 59.1000])), (("5R", 8.0, 4.0), np.array([0.3510, 0.3224, 59.1000])), (("5R", 8.0, 6.0), np.array([0.3743, 0.3248, 59.1000])), (("5R", 8.0, 8.0), np.array([0.4001, 0.3263, 59.1000])), (("5R", 8.0, 10.0), np.array([0.4249, 0.3270, 59.1000])), (("5R", 8.0, 12.0), np.array([0.4540, 0.3260, 59.1000])), (("5R", 8.0, 14.0), np.array([0.4760, 0.3250, 59.1000])), (("5R", 8.0, 16.0), np.array([0.4940, 0.3240, 59.1000])), (("5R", 8.0, 18.0), np.array([0.5130, 0.3220, 59.1000])), (("7.5R", 8.0, 2.0), np.array([0.3277, 0.3211, 59.1000])), (("7.5R", 8.0, 4.0), np.array([0.3564, 0.3279, 59.1000])), (("7.5R", 8.0, 6.0), np.array([0.3830, 0.3335, 59.1000])), (("7.5R", 8.0, 8.0), np.array([0.4118, 0.3385, 59.1000])), (("7.5R", 8.0, 10.0), np.array([0.4388, 0.3419, 59.1000])), (("7.5R", 8.0, 12.0), np.array([0.4700, 0.3450, 59.1000])), (("7.5R", 8.0, 14.0), np.array([0.4920, 0.3440, 59.1000])), (("7.5R", 8.0, 16.0), np.array([0.5140, 0.3440, 59.1000])), (("7.5R", 8.0, 18.0), np.array([0.5360, 0.3430, 59.1000])), (("7.5R", 8.0, 20.0), np.array([0.5530, 0.3430, 59.1000])), (("10R", 8.0, 2.0), np.array([0.3301, 0.3237, 59.1000])), (("10R", 8.0, 4.0), np.array([0.3621, 0.3349, 59.1000])), (("10R", 8.0, 6.0), np.array([0.3910, 0.3442, 59.1000])), (("10R", 8.0, 8.0), np.array([0.4212, 0.3526, 59.1000])), (("10R", 8.0, 10.0), np.array([0.4490, 0.3589, 59.1000])), (("10R", 8.0, 12.0), np.array([0.4810, 0.3650, 59.1000])), (("10R", 8.0, 14.0), np.array([0.5070, 0.3690, 59.1000])), (("10R", 8.0, 16.0), np.array([0.5290, 0.3710, 59.1000])), (("10R", 8.0, 18.0), np.array([0.5510, 0.3740, 59.1000])), (("10R", 8.0, 20.0), np.array([0.5690, 0.3740, 59.1000])), (("10R", 8.0, 22.0), np.array([0.5880, 0.3750, 59.1000])), (("10R", 8.0, 24.0), np.array([0.6070, 0.3750, 59.1000])), (("10R", 8.0, 26.0), np.array([0.6250, 0.3750, 59.1000])), (("2.5YR", 8.0, 2.0), np.array([0.3334, 0.3276, 59.1000])), (("2.5YR", 8.0, 4.0), np.array([0.3667, 0.3429, 59.1000])), (("2.5YR", 8.0, 6.0), np.array([0.3960, 0.3547, 59.1000])), (("2.5YR", 8.0, 8.0), np.array([0.4275, 0.3662, 59.1000])), (("2.5YR", 8.0, 10.0), np.array([0.4552, 0.3761, 59.1000])), (("2.5YR", 8.0, 12.0), np.array([0.4852, 0.3847, 59.1000])), (("2.5YR", 8.0, 14.0), np.array([0.5130, 0.3910, 59.1000])), (("2.5YR", 8.0, 16.0), np.array([0.5330, 0.3960, 59.1000])), (("2.5YR", 8.0, 18.0), np.array([0.5510, 0.3990, 59.1000])), (("2.5YR", 8.0, 20.0), np.array([0.5660, 0.4020, 59.1000])), (("2.5YR", 8.0, 22.0), np.array([0.5800, 0.4030, 59.1000])), (("2.5YR", 8.0, 24.0), np.array([0.5920, 0.4040, 59.1000])), (("2.5YR", 8.0, 26.0), np.array([0.6020, 0.4050, 59.1000])), (("5YR", 8.0, 2.0), np.array([0.3373, 0.3330, 59.1000])), (("5YR", 8.0, 4.0), np.array([0.3690, 0.3510, 59.1000])), (("5YR", 8.0, 6.0), np.array([0.3988, 0.3663, 59.1000])), (("5YR", 8.0, 8.0), np.array([0.4310, 0.3820, 59.1000])), (("5YR", 8.0, 10.0), np.array([0.4576, 0.3938, 59.1000])), (("5YR", 8.0, 12.0), np.array([0.4849, 0.4050, 59.1000])), (("5YR", 8.0, 14.0), np.array([0.5088, 0.4145, 59.1000])), (("5YR", 8.0, 16.0), np.array([0.5300, 0.4210, 59.1000])), (("5YR", 8.0, 18.0), np.array([0.5420, 0.4250, 59.1000])), (("5YR", 8.0, 20.0), np.array([0.5530, 0.4270, 59.1000])), (("5YR", 8.0, 22.0), np.array([0.5610, 0.4310, 59.1000])), (("5YR", 8.0, 24.0), np.array([0.5710, 0.4330, 59.1000])), (("5YR", 8.0, 26.0), np.array([0.5780, 0.4350, 59.1000])), (("7.5YR", 8.0, 2.0), np.array([0.3395, 0.3379, 59.1000])), (("7.5YR", 8.0, 4.0), np.array([0.3699, 0.3586, 59.1000])), (("7.5YR", 8.0, 6.0), np.array([0.4000, 0.3770, 59.1000])), (("7.5YR", 8.0, 8.0), np.array([0.4306, 0.3952, 59.1000])), (("7.5YR", 8.0, 10.0), np.array([0.4568, 0.4100, 59.1000])), (("7.5YR", 8.0, 12.0), np.array([0.4816, 0.4232, 59.1000])), (("7.5YR", 8.0, 14.0), np.array([0.5025, 0.4338, 59.1000])), (("7.5YR", 8.0, 16.0), np.array([0.5195, 0.4424, 59.1000])), (("7.5YR", 8.0, 18.0), np.array([0.5316, 0.4480, 59.1000])), (("7.5YR", 8.0, 20.0), np.array([0.5391, 0.4518, 59.1000])), (("7.5YR", 8.0, 22.0), np.array([0.5460, 0.4540, 59.1000])), (("7.5YR", 8.0, 24.0), np.array([0.5530, 0.4580, 59.1000])), (("10YR", 8.0, 2.0), np.array([0.3407, 0.3434, 59.1000])), (("10YR", 8.0, 4.0), np.array([0.3701, 0.3674, 59.1000])), (("10YR", 8.0, 6.0), np.array([0.3994, 0.3896, 59.1000])), (("10YR", 8.0, 8.0), np.array([0.4280, 0.4102, 59.1000])), (("10YR", 8.0, 10.0), np.array([0.4527, 0.4268, 59.1000])), (("10YR", 8.0, 12.0), np.array([0.4753, 0.4414, 59.1000])), (("10YR", 8.0, 14.0), np.array([0.4940, 0.4530, 59.1000])), (("10YR", 8.0, 16.0), np.array([0.5079, 0.4613, 59.1000])), (("10YR", 8.0, 18.0), np.array([0.5179, 0.4670, 59.1000])), (("10YR", 8.0, 20.0), np.array([0.5245, 0.4709, 59.1000])), (("10YR", 8.0, 22.0), np.array([0.5300, 0.4740, 59.1000])), (("2.5Y", 8.0, 2.0), np.array([0.3406, 0.3484, 59.1000])), (("2.5Y", 8.0, 4.0), np.array([0.3684, 0.3751, 59.1000])), (("2.5Y", 8.0, 6.0), np.array([0.3969, 0.4009, 59.1000])), (("2.5Y", 8.0, 8.0), np.array([0.4231, 0.4231, 59.1000])), (("2.5Y", 8.0, 10.0), np.array([0.4469, 0.4423, 59.1000])), (("2.5Y", 8.0, 12.0), np.array([0.4678, 0.4589, 59.1000])), (("2.5Y", 8.0, 14.0), np.array([0.4842, 0.4712, 59.1000])), (("2.5Y", 8.0, 16.0), np.array([0.4957, 0.4800, 59.1000])), (("2.5Y", 8.0, 18.0), np.array([0.5033, 0.4855, 59.1000])), (("2.5Y", 8.0, 20.0), np.array([0.5091, 0.4900, 59.1000])), (("2.5Y", 8.0, 22.0), np.array([0.5140, 0.4940, 59.1000])), (("5Y", 8.0, 2.0), np.array([0.3394, 0.3518, 59.1000])), (("5Y", 8.0, 4.0), np.array([0.3650, 0.3826, 59.1000])), (("5Y", 8.0, 6.0), np.array([0.3913, 0.4117, 59.1000])), (("5Y", 8.0, 8.0), np.array([0.4158, 0.4378, 59.1000])), (("5Y", 8.0, 10.0), np.array([0.4376, 0.4601, 59.1000])), (("5Y", 8.0, 12.0), np.array([0.4562, 0.4788, 59.1000])), (("5Y", 8.0, 14.0), np.array([0.4699, 0.4920, 59.1000])), (("5Y", 8.0, 16.0), np.array([0.4791, 0.5012, 59.1000])), (("5Y", 8.0, 18.0), np.array([0.4847, 0.5069, 59.1000])), (("5Y", 8.0, 20.0), np.array([0.4900, 0.5110, 59.1000])), (("5Y", 8.0, 22.0), np.array([0.4930, 0.5150, 59.1000])), (("7.5Y", 8.0, 2.0), np.array([0.3379, 0.3540, 59.1000])), (("7.5Y", 8.0, 4.0), np.array([0.3622, 0.3861, 59.1000])), (("7.5Y", 8.0, 6.0), np.array([0.3862, 0.4175, 59.1000])), (("7.5Y", 8.0, 8.0), np.array([0.4088, 0.4466, 59.1000])), (("7.5Y", 8.0, 10.0), np.array([0.4283, 0.4712, 59.1000])), (("7.5Y", 8.0, 12.0), np.array([0.4455, 0.4917, 59.1000])), (("7.5Y", 8.0, 14.0), np.array([0.4574, 0.5062, 59.1000])), (("7.5Y", 8.0, 16.0), np.array([0.4658, 0.5158, 59.1000])), (("7.5Y", 8.0, 18.0), np.array([0.4709, 0.5220, 59.1000])), (("7.5Y", 8.0, 20.0), np.array([0.4750, 0.5260, 59.1000])), (("10Y", 9.0, 2.0), np.array([0.3349, 0.3537, 78.6600])), (("10Y", 9.0, 4.0), np.array([0.3558, 0.3852, 78.6600])), (("10Y", 9.0, 6.0), np.array([0.3761, 0.4155, 78.6600])), (("10Y", 9.0, 8.0), np.array([0.3957, 0.4450, 78.6600])), (("10Y", 9.0, 10.0), np.array([0.4120, 0.4694, 78.6600])), (("10Y", 9.0, 12.0), np.array([0.4271, 0.4920, 78.6600])), (("10Y", 9.0, 14.0), np.array([0.4393, 0.5101, 78.6600])), (("10Y", 9.0, 16.0), np.array([0.4477, 0.5225, 78.6600])), (("10Y", 9.0, 18.0), np.array([0.4540, 0.5320, 78.6600])), (("10Y", 9.0, 20.0), np.array([0.4570, 0.5370, 78.6600])), (("10Y", 9.0, 22.0), np.array([0.4620, 0.5440, 78.6600])), (("2.5GY", 9.0, 2.0), np.array([0.3321, 0.3539, 78.6600])), (("2.5GY", 9.0, 4.0), np.array([0.3499, 0.3866, 78.6600])), (("2.5GY", 9.0, 6.0), np.array([0.3670, 0.4178, 78.6600])), (("2.5GY", 9.0, 8.0), np.array([0.3834, 0.4490, 78.6600])), (("2.5GY", 9.0, 10.0), np.array([0.3973, 0.4761, 78.6600])), (("2.5GY", 9.0, 12.0), np.array([0.4108, 0.5028, 78.6600])), (("2.5GY", 9.0, 14.0), np.array([0.4212, 0.5237, 78.6600])), (("2.5GY", 9.0, 16.0), np.array([0.4288, 0.5383, 78.6600])), (("2.5GY", 9.0, 18.0), np.array([0.4354, 0.5508, 78.6600])), (("2.5GY", 9.0, 20.0), np.array([0.4380, 0.5560, 78.6600])), (("2.5GY", 9.0, 22.0), np.array([0.4420, 0.5640, 78.6600])), (("5GY", 9.0, 2.0), np.array([0.3284, 0.3534, 78.6600])), (("5GY", 9.0, 4.0), np.array([0.3437, 0.3861, 78.6600])), (("5GY", 9.0, 6.0), np.array([0.3572, 0.4179, 78.6600])), (("5GY", 9.0, 8.0), np.array([0.3698, 0.4497, 78.6600])), (("5GY", 9.0, 10.0), np.array([0.3810, 0.4791, 78.6600])), (("5GY", 9.0, 12.0), np.array([0.3911, 0.5082, 78.6600])), (("5GY", 9.0, 14.0), np.array([0.3993, 0.5329, 78.6600])), (("5GY", 9.0, 16.0), np.array([0.4058, 0.5541, 78.6600])), (("5GY", 9.0, 18.0), np.array([0.4108, 0.5699, 78.6600])), (("5GY", 9.0, 20.0), np.array([0.4140, 0.5800, 78.6600])), (("5GY", 9.0, 22.0), np.array([0.4170, 0.5900, 78.6600])), (("7.5GY", 9.0, 2.0), np.array([0.3198, 0.3500, 78.6600])), (("7.5GY", 9.0, 4.0), np.array([0.3274, 0.3793, 78.6600])), (("7.5GY", 9.0, 6.0), np.array([0.3351, 0.4111, 78.6600])), (("7.5GY", 9.0, 8.0), np.array([0.3414, 0.4415, 78.6600])), (("7.5GY", 9.0, 10.0), np.array([0.3471, 0.4735, 78.6600])), (("7.5GY", 9.0, 12.0), np.array([0.3518, 0.5042, 78.6600])), (("7.5GY", 9.0, 14.0), np.array([0.3551, 0.5339, 78.6600])), (("7.5GY", 9.0, 16.0), np.array([0.3581, 0.5654, 78.6600])), (("7.5GY", 9.0, 18.0), np.array([0.3602, 0.5920, 78.6600])), (("7.5GY", 9.0, 20.0), np.array([0.3610, 0.6140, 78.6600])), (("7.5GY", 9.0, 22.0), np.array([0.3620, 0.6380, 78.6600])), (("7.5GY", 9.0, 24.0), np.array([0.3600, 0.6570, 78.6600])), (("7.5GY", 9.0, 26.0), np.array([0.3600, 0.6820, 78.6600])), (("7.5GY", 9.0, 28.0), np.array([0.3600, 0.7070, 78.6600])), (("10GY", 9.0, 2.0), np.array([0.3124, 0.3454, 78.6600])), (("10GY", 9.0, 4.0), np.array([0.3144, 0.3711, 78.6600])), (("10GY", 9.0, 6.0), np.array([0.3153, 0.4008, 78.6600])), (("10GY", 9.0, 8.0), np.array([0.3157, 0.4259, 78.6600])), (("10GY", 9.0, 10.0), np.array([0.3155, 0.4558, 78.6600])), (("10GY", 9.0, 12.0), np.array([0.3139, 0.4829, 78.6600])), (("10GY", 9.0, 14.0), np.array([0.3115, 0.5129, 78.6600])), (("10GY", 9.0, 16.0), np.array([0.3079, 0.5440, 78.6600])), (("10GY", 9.0, 18.0), np.array([0.3032, 0.5748, 78.6600])), (("10GY", 9.0, 20.0), np.array([0.2980, 0.6020, 78.6600])), (("10GY", 9.0, 22.0), np.array([0.2920, 0.6270, 78.6600])), (("10GY", 9.0, 24.0), np.array([0.2840, 0.6530, 78.6600])), (("10GY", 9.0, 26.0), np.array([0.2770, 0.6810, 78.6600])), (("10GY", 9.0, 28.0), np.array([0.2680, 0.7070, 78.6600])), (("2.5G", 9.0, 2.0), np.array([0.3058, 0.3400, 78.6600])), (("2.5G", 9.0, 4.0), np.array([0.3018, 0.3606, 78.6600])), (("2.5G", 9.0, 6.0), np.array([0.2966, 0.3846, 78.6600])), (("2.5G", 9.0, 8.0), np.array([0.2912, 0.4054, 78.6600])), (("2.5G", 9.0, 10.0), np.array([0.2851, 0.4275, 78.6600])), (("2.5G", 9.0, 12.0), np.array([0.2786, 0.4491, 78.6600])), (("2.5G", 9.0, 14.0), np.array([0.2711, 0.4726, 78.6600])), (("2.5G", 9.0, 16.0), np.array([0.2630, 0.4966, 78.6600])), (("2.5G", 9.0, 18.0), np.array([0.2530, 0.5250, 78.6600])), (("2.5G", 9.0, 20.0), np.array([0.2420, 0.5520, 78.6600])), (("2.5G", 9.0, 22.0), np.array([0.2300, 0.5760, 78.6600])), (("2.5G", 9.0, 24.0), np.array([0.2190, 0.5990, 78.6600])), (("2.5G", 9.0, 26.0), np.array([0.2060, 0.6190, 78.6600])), (("2.5G", 9.0, 28.0), np.array([0.1920, 0.6430, 78.6600])), (("5G", 9.0, 2.0), np.array([0.3017, 0.3357, 78.6600])), (("5G", 9.0, 4.0), np.array([0.2933, 0.3519, 78.6600])), (("5G", 9.0, 6.0), np.array([0.2832, 0.3697, 78.6600])), (("5G", 9.0, 8.0), np.array([0.2735, 0.3854, 78.6600])), (("5G", 9.0, 10.0), np.array([0.2639, 0.4001, 78.6600])), (("5G", 9.0, 12.0), np.array([0.2528, 0.4160, 78.6600])), (("5G", 9.0, 14.0), np.array([0.2420, 0.4300, 78.6600])), (("5G", 9.0, 16.0), np.array([0.2290, 0.4460, 78.6600])), (("5G", 9.0, 18.0), np.array([0.2140, 0.4610, 78.6600])), (("5G", 9.0, 20.0), np.array([0.2000, 0.4740, 78.6600])), (("5G", 9.0, 22.0), np.array([0.1850, 0.4870, 78.6600])), (("5G", 9.0, 24.0), np.array([0.1700, 0.4990, 78.6600])), (("5G", 9.0, 26.0), np.array([0.1570, 0.5090, 78.6600])), (("5G", 9.0, 28.0), np.array([0.1430, 0.5190, 78.6600])), (("7.5G", 9.0, 2.0), np.array([0.2987, 0.3323, 78.6600])), (("7.5G", 9.0, 4.0), np.array([0.2882, 0.3461, 78.6600])), (("7.5G", 9.0, 6.0), np.array([0.2763, 0.3607, 78.6600])), (("7.5G", 9.0, 8.0), np.array([0.2652, 0.3738, 78.6600])), (("7.5G", 9.0, 10.0), np.array([0.2545, 0.3855, 78.6600])), (("7.5G", 9.0, 12.0), np.array([0.2419, 0.3985, 78.6600])), (("7.5G", 9.0, 14.0), np.array([0.2290, 0.4100, 78.6600])), (("7.5G", 9.0, 16.0), np.array([0.2160, 0.4230, 78.6600])), (("7.5G", 9.0, 18.0), np.array([0.2010, 0.4360, 78.6600])), (("7.5G", 9.0, 20.0), np.array([0.1870, 0.4460, 78.6600])), (("7.5G", 9.0, 22.0), np.array([0.1740, 0.4570, 78.6600])), (("7.5G", 9.0, 24.0), np.array([0.1600, 0.4670, 78.6600])), (("10G", 9.0, 2.0), np.array([0.2965, 0.3293, 78.6600])), (("10G", 9.0, 4.0), np.array([0.2840, 0.3402, 78.6600])), (("10G", 9.0, 6.0), np.array([0.2703, 0.3513, 78.6600])), (("10G", 9.0, 8.0), np.array([0.2574, 0.3618, 78.6600])), (("10G", 9.0, 10.0), np.array([0.2457, 0.3702, 78.6600])), (("10G", 9.0, 12.0), np.array([0.2325, 0.3796, 78.6600])), (("10G", 9.0, 14.0), np.array([0.2170, 0.3880, 78.6600])), (("10G", 9.0, 16.0), np.array([0.2030, 0.3960, 78.6600])), (("10G", 9.0, 18.0), np.array([0.1880, 0.4050, 78.6600])), (("10G", 9.0, 20.0), np.array([0.1750, 0.4110, 78.6600])), (("10G", 9.0, 22.0), np.array([0.1610, 0.4190, 78.6600])), (("10G", 9.0, 24.0), np.array([0.1470, 0.4250, 78.6600])), (("2.5BG", 9.0, 2.0), np.array([0.2947, 0.3267, 78.6600])), (("2.5BG", 9.0, 4.0), np.array([0.2805, 0.3349, 78.6600])), (("2.5BG", 9.0, 6.0), np.array([0.2652, 0.3433, 78.6600])), (("2.5BG", 9.0, 8.0), np.array([0.2509, 0.3507, 78.6600])), (("2.5BG", 9.0, 10.0), np.array([0.2382, 0.3568, 78.6600])), (("2.5BG", 9.0, 12.0), np.array([0.2220, 0.3640, 78.6600])), (("2.5BG", 9.0, 14.0), np.array([0.2080, 0.3700, 78.6600])), (("2.5BG", 9.0, 16.0), np.array([0.1940, 0.3760, 78.6600])), (("2.5BG", 9.0, 18.0), np.array([0.1780, 0.3820, 78.6600])), (("2.5BG", 9.0, 20.0), np.array([0.1660, 0.3860, 78.6600])), (("2.5BG", 9.0, 22.0), np.array([0.1520, 0.3910, 78.6600])), (("5BG", 9.0, 2.0), np.array([0.2930, 0.3232, 78.6600])), (("5BG", 9.0, 4.0), np.array([0.2768, 0.3287, 78.6600])), (("5BG", 9.0, 6.0), np.array([0.2599, 0.3338, 78.6600])), (("5BG", 9.0, 8.0), np.array([0.2437, 0.3378, 78.6600])), (("5BG", 9.0, 10.0), np.array([0.2301, 0.3405, 78.6600])), (("5BG", 9.0, 12.0), np.array([0.2120, 0.3440, 78.6600])), (("5BG", 9.0, 14.0), np.array([0.1960, 0.3460, 78.6600])), (("5BG", 9.0, 16.0), np.array([0.1800, 0.3480, 78.6600])), (("5BG", 9.0, 18.0), np.array([0.1640, 0.3490, 78.6600])), (("5BG", 9.0, 20.0), np.array([0.1500, 0.3500, 78.6600])), (("7.5BG", 9.0, 2.0), np.array([0.2911, 0.3188, 78.6600])), (("7.5BG", 9.0, 4.0), np.array([0.2728, 0.3208, 78.6600])), (("7.5BG", 9.0, 6.0), np.array([0.2543, 0.3220, 78.6600])), (("7.5BG", 9.0, 8.0), np.array([0.2361, 0.3225, 78.6600])), (("7.5BG", 9.0, 10.0), np.array([0.2215, 0.3226, 78.6600])), (("7.5BG", 9.0, 12.0), np.array([0.2030, 0.3230, 78.6600])), (("7.5BG", 9.0, 14.0), np.array([0.1870, 0.3230, 78.6600])), (("7.5BG", 9.0, 16.0), np.array([0.1700, 0.3230, 78.6600])), (("7.5BG", 9.0, 18.0), np.array([0.1560, 0.3220, 78.6600])), (("10BG", 9.0, 2.0), np.array([0.2907, 0.3159, 78.6600])), (("10BG", 9.0, 4.0), np.array([0.2700, 0.3140, 78.6600])), (("10BG", 9.0, 6.0), np.array([0.2501, 0.3118, 78.6600])), (("10BG", 9.0, 8.0), np.array([0.2320, 0.3100, 78.6600])), (("10BG", 9.0, 10.0), np.array([0.2140, 0.3060, 78.6600])), (("10BG", 9.0, 12.0), np.array([0.1960, 0.3040, 78.6600])), (("10BG", 9.0, 14.0), np.array([0.1800, 0.3010, 78.6600])), (("10BG", 9.0, 16.0), np.array([0.1620, 0.2980, 78.6600])), (("10BG", 9.0, 18.0), np.array([0.1470, 0.2940, 78.6600])), (("2.5B", 9.0, 2.0), np.array([0.2909, 0.3125, 78.6600])), (("2.5B", 9.0, 4.0), np.array([0.2680, 0.3073, 78.6600])), (("2.5B", 9.0, 6.0), np.array([0.2470, 0.3020, 78.6600])), (("2.5B", 9.0, 8.0), np.array([0.2280, 0.2960, 78.6600])), (("2.5B", 9.0, 10.0), np.array([0.2110, 0.2900, 78.6600])), (("2.5B", 9.0, 12.0), np.array([0.1930, 0.2840, 78.6600])), (("2.5B", 9.0, 14.0), np.array([0.1760, 0.2780, 78.6600])), (("2.5B", 9.0, 16.0), np.array([0.1580, 0.2710, 78.6600])), (("5B", 9.0, 2.0), np.array([0.2919, 0.3102, 78.6600])), (("5B", 9.0, 4.0), np.array([0.2675, 0.3005, 78.6600])), (("5B", 9.0, 6.0), np.array([0.2460, 0.2900, 78.6600])), (("5B", 9.0, 8.0), np.array([0.2280, 0.2810, 78.6600])), (("5B", 9.0, 10.0), np.array([0.2100, 0.2720, 78.6600])), (("5B", 9.0, 12.0), np.array([0.1910, 0.2600, 78.6600])), (("5B", 9.0, 14.0), np.array([0.1750, 0.2510, 78.6600])), (("5B", 9.0, 16.0), np.array([0.1570, 0.2410, 78.6600])), (("7.5B", 9.0, 2.0), np.array([0.2937, 0.3087, 78.6600])), (("7.5B", 9.0, 4.0), np.array([0.2688, 0.2961, 78.6600])), (("7.5B", 9.0, 6.0), np.array([0.2470, 0.2850, 78.6600])), (("7.5B", 9.0, 8.0), np.array([0.2280, 0.2730, 78.6600])), (("7.5B", 9.0, 10.0), np.array([0.2110, 0.2620, 78.6600])), (("7.5B", 9.0, 12.0), np.array([0.1940, 0.2520, 78.6600])), (("10B", 9.0, 2.0), np.array([0.2949, 0.3076, 78.6600])), (("10B", 9.0, 4.0), np.array([0.2712, 0.2924, 78.6600])), (("10B", 9.0, 6.0), np.array([0.2500, 0.2780, 78.6600])), (("10B", 9.0, 8.0), np.array([0.2330, 0.2650, 78.6600])), (("10B", 9.0, 10.0), np.array([0.2160, 0.2500, 78.6600])), (("2.5PB", 9.0, 2.0), np.array([0.2975, 0.3063, 78.6600])), (("2.5PB", 9.0, 4.0), np.array([0.2760, 0.2890, 78.6600])), (("2.5PB", 9.0, 6.0), np.array([0.2560, 0.2720, 78.6600])), (("2.5PB", 9.0, 8.0), np.array([0.2390, 0.2570, 78.6600])), (("2.5PB", 9.0, 10.0), np.array([0.2240, 0.2430, 78.6600])), (("5PB", 9.0, 2.0), np.array([0.2991, 0.3057, 78.6600])), (("5PB", 9.0, 4.0), np.array([0.2810, 0.2870, 78.6600])), (("5PB", 9.0, 6.0), np.array([0.2620, 0.2680, 78.6600])), (("5PB", 9.0, 8.0), np.array([0.2470, 0.2520, 78.6600])), (("5PB", 9.0, 10.0), np.array([0.2320, 0.2350, 78.6600])), (("7.5PB", 9.0, 2.0), np.array([0.3015, 0.3052, 78.6600])), (("7.5PB", 9.0, 4.0), np.array([0.2860, 0.2850, 78.6600])), (("7.5PB", 9.0, 6.0), np.array([0.2710, 0.2660, 78.6600])), (("7.5PB", 9.0, 8.0), np.array([0.2570, 0.2450, 78.6600])), (("7.5PB", 9.0, 10.0), np.array([0.2470, 0.2270, 78.6600])), (("10PB", 9.0, 2.0), np.array([0.3038, 0.3054, 78.6600])), (("10PB", 9.0, 4.0), np.array([0.2910, 0.2850, 78.6600])), (("10PB", 9.0, 6.0), np.array([0.2780, 0.2660, 78.6600])), (("10PB", 9.0, 8.0), np.array([0.2670, 0.2450, 78.6600])), (("10PB", 9.0, 10.0), np.array([0.2560, 0.2260, 78.6600])), (("2.5P", 9.0, 2.0), np.array([0.3050, 0.3051, 78.6600])), (("2.5P", 9.0, 4.0), np.array([0.2963, 0.2865, 78.6600])), (("2.5P", 9.0, 6.0), np.array([0.2880, 0.2680, 78.6600])), (("2.5P", 9.0, 8.0), np.array([0.2800, 0.2490, 78.6600])), (("2.5P", 9.0, 10.0), np.array([0.2730, 0.2300, 78.6600])), (("5P", 9.0, 2.0), np.array([0.3067, 0.3060, 78.6600])), (("5P", 9.0, 4.0), np.array([0.3003, 0.2870, 78.6600])), (("5P", 9.0, 6.0), np.array([0.2960, 0.2710, 78.6600])), (("5P", 9.0, 8.0), np.array([0.2920, 0.2530, 78.6600])), (("5P", 9.0, 10.0), np.array([0.2860, 0.2350, 78.6600])), (("5P", 9.0, 12.0), np.array([0.2840, 0.2210, 78.6600])), (("5P", 9.0, 14.0), np.array([0.2810, 0.2080, 78.6600])), (("7.5P", 9.0, 2.0), np.array([0.3107, 0.3081, 78.6600])), (("7.5P", 9.0, 4.0), np.array([0.3117, 0.2928, 78.6600])), (("7.5P", 9.0, 6.0), np.array([0.3120, 0.2788, 78.6600])), (("7.5P", 9.0, 8.0), np.array([0.3110, 0.2620, 78.6600])), (("7.5P", 9.0, 10.0), np.array([0.3100, 0.2470, 78.6600])), (("7.5P", 9.0, 12.0), np.array([0.3080, 0.2330, 78.6600])), (("7.5P", 9.0, 14.0), np.array([0.3060, 0.2200, 78.6600])), (("7.5P", 9.0, 16.0), np.array([0.3050, 0.2080, 78.6600])), (("10P", 9.0, 2.0), np.array([0.3128, 0.3094, 78.6600])), (("10P", 9.0, 4.0), np.array([0.3176, 0.2966, 78.6600])), (("10P", 9.0, 6.0), np.array([0.3218, 0.2845, 78.6600])), (("10P", 9.0, 8.0), np.array([0.3260, 0.2700, 78.6600])), (("10P", 9.0, 10.0), np.array([0.3300, 0.2570, 78.6600])), (("10P", 9.0, 12.0), np.array([0.3340, 0.2460, 78.6600])), (("10P", 9.0, 14.0), np.array([0.3360, 0.2350, 78.6600])), (("10P", 9.0, 16.0), np.array([0.3390, 0.2240, 78.6600])), (("2.5RP", 9.0, 2.0), np.array([0.3149, 0.3108, 78.6600])), (("2.5RP", 9.0, 4.0), np.array([0.3234, 0.3010, 78.6600])), (("2.5RP", 9.0, 6.0), np.array([0.3322, 0.2910, 78.6600])), (("2.5RP", 9.0, 8.0), np.array([0.3400, 0.2800, 78.6600])), (("2.5RP", 9.0, 10.0), np.array([0.3490, 0.2710, 78.6600])), (("2.5RP", 9.0, 12.0), np.array([0.3560, 0.2610, 78.6600])), (("2.5RP", 9.0, 14.0), np.array([0.3640, 0.2510, 78.6600])), (("2.5RP", 9.0, 16.0), np.array([0.3710, 0.2430, 78.6600])), (("5RP", 9.0, 2.0), np.array([0.3172, 0.3126, 78.6600])), (("5RP", 9.0, 4.0), np.array([0.3301, 0.3060, 78.6600])), (("5RP", 9.0, 6.0), np.array([0.3431, 0.2988, 78.6600])), (("5RP", 9.0, 8.0), np.array([0.3550, 0.2920, 78.6600])), (("5RP", 9.0, 10.0), np.array([0.3680, 0.2840, 78.6600])), (("5RP", 9.0, 12.0), np.array([0.3800, 0.2760, 78.6600])), (("5RP", 9.0, 14.0), np.array([0.3890, 0.2690, 78.6600])), (("5RP", 9.0, 16.0), np.array([0.4000, 0.2630, 78.6600])), (("7.5RP", 9.0, 2.0), np.array([0.3190, 0.3141, 78.6600])), (("7.5RP", 9.0, 4.0), np.array([0.3350, 0.3099, 78.6600])), (("7.5RP", 9.0, 6.0), np.array([0.3512, 0.3052, 78.6600])), (("7.5RP", 9.0, 8.0), np.array([0.3640, 0.3000, 78.6600])), (("7.5RP", 9.0, 10.0), np.array([0.3820, 0.2950, 78.6600])), (("7.5RP", 9.0, 12.0), np.array([0.3970, 0.2890, 78.6600])), (("7.5RP", 9.0, 14.0), np.array([0.4100, 0.2840, 78.6600])), (("10RP", 9.0, 2.0), np.array([0.3205, 0.3155, 78.6600])), (("10RP", 9.0, 4.0), np.array([0.3400, 0.3140, 78.6600])), (("10RP", 9.0, 6.0), np.array([0.3590, 0.3118, 78.6600])), (("10RP", 9.0, 8.0), np.array([0.3760, 0.3100, 78.6600])), (("10RP", 9.0, 10.0), np.array([0.3940, 0.3060, 78.6600])), (("10RP", 9.0, 12.0), np.array([0.4140, 0.3020, 78.6600])), (("10RP", 9.0, 14.0), np.array([0.4310, 0.2980, 78.6600])), (("2.5R", 9.0, 2.0), np.array([0.3220, 0.3168, 78.6600])), (("2.5R", 9.0, 4.0), np.array([0.3445, 0.3179, 78.6600])), (("2.5R", 9.0, 6.0), np.array([0.3665, 0.3183, 78.6600])), (("2.5R", 9.0, 8.0), np.array([0.3840, 0.3180, 78.6600])), (("2.5R", 9.0, 10.0), np.array([0.4060, 0.3160, 78.6600])), (("2.5R", 9.0, 12.0), np.array([0.4290, 0.3140, 78.6600])), (("2.5R", 9.0, 14.0), np.array([0.4480, 0.3110, 78.6600])), (("5R", 9.0, 2.0), np.array([0.3240, 0.3188, 78.6600])), (("5R", 9.0, 4.0), np.array([0.3495, 0.3226, 78.6600])), (("5R", 9.0, 6.0), np.array([0.3734, 0.3256, 78.6600])), (("5R", 9.0, 8.0), np.array([0.3950, 0.3260, 78.6600])), (("5R", 9.0, 10.0), np.array([0.4180, 0.3260, 78.6600])), (("5R", 9.0, 12.0), np.array([0.4440, 0.3250, 78.6600])), (("7.5R", 9.0, 2.0), np.array([0.3263, 0.3210, 78.6600])), (("7.5R", 9.0, 4.0), np.array([0.3551, 0.3283, 78.6600])), (("7.5R", 9.0, 6.0), np.array([0.3812, 0.3348, 78.6600])), (("7.5R", 9.0, 8.0), np.array([0.4070, 0.3380, 78.6600])), (("7.5R", 9.0, 10.0), np.array([0.4310, 0.3400, 78.6600])), (("7.5R", 9.0, 12.0), np.array([0.4570, 0.3400, 78.6600])), (("7.5R", 9.0, 14.0), np.array([0.4800, 0.3400, 78.6600])), (("10R", 9.0, 2.0), np.array([0.3284, 0.3233, 78.6600])), (("10R", 9.0, 4.0), np.array([0.3600, 0.3348, 78.6600])), (("10R", 9.0, 6.0), np.array([0.3880, 0.3439, 78.6600])), (("10R", 9.0, 8.0), np.array([0.4160, 0.3500, 78.6600])), (("10R", 9.0, 10.0), np.array([0.4410, 0.3560, 78.6600])), (("10R", 9.0, 12.0), np.array([0.4650, 0.3610, 78.6600])), (("10R", 9.0, 14.0), np.array([0.4900, 0.3640, 78.6600])), (("10R", 9.0, 16.0), np.array([0.5100, 0.3680, 78.6600])), (("2.5YR", 9.0, 2.0), np.array([0.3320, 0.3273, 78.6600])), (("2.5YR", 9.0, 4.0), np.array([0.3641, 0.3422, 78.6600])), (("2.5YR", 9.0, 6.0), np.array([0.3927, 0.3550, 78.6600])), (("2.5YR", 9.0, 8.0), np.array([0.4220, 0.3650, 78.6600])), (("2.5YR", 9.0, 10.0), np.array([0.4460, 0.3730, 78.6600])), (("2.5YR", 9.0, 12.0), np.array([0.4690, 0.3800, 78.6600])), (("2.5YR", 9.0, 14.0), np.array([0.4920, 0.3870, 78.6600])), (("2.5YR", 9.0, 16.0), np.array([0.5130, 0.3920, 78.6600])), (("2.5YR", 9.0, 18.0), np.array([0.5320, 0.3960, 78.6600])), (("5YR", 9.0, 2.0), np.array([0.3353, 0.3325, 78.6600])), (("5YR", 9.0, 4.0), np.array([0.3668, 0.3509, 78.6600])), (("5YR", 9.0, 6.0), np.array([0.3948, 0.3659, 78.6600])), (("5YR", 9.0, 8.0), np.array([0.4220, 0.3790, 78.6600])), (("5YR", 9.0, 10.0), np.array([0.4480, 0.3900, 78.6600])), (("5YR", 9.0, 12.0), np.array([0.4700, 0.4000, 78.6600])), (("5YR", 9.0, 14.0), np.array([0.4910, 0.4080, 78.6600])), (("5YR", 9.0, 16.0), np.array([0.5100, 0.4160, 78.6600])), (("5YR", 9.0, 18.0), np.array([0.5250, 0.4210, 78.6600])), (("5YR", 9.0, 20.0), np.array([0.5410, 0.4260, 78.6600])), (("5YR", 9.0, 22.0), np.array([0.5500, 0.4300, 78.6600])), (("5YR", 9.0, 24.0), np.array([0.5590, 0.4330, 78.6600])), (("5YR", 9.0, 26.0), np.array([0.5670, 0.4350, 78.6600])), (("7.5YR", 9.0, 2.0), np.array([0.3380, 0.3377, 78.6600])), (("7.5YR", 9.0, 4.0), np.array([0.3679, 0.3585, 78.6600])), (("7.5YR", 9.0, 6.0), np.array([0.3950, 0.3763, 78.6600])), (("7.5YR", 9.0, 8.0), np.array([0.4220, 0.3930, 78.6600])), (("7.5YR", 9.0, 10.0), np.array([0.4470, 0.4070, 78.6600])), (("7.5YR", 9.0, 12.0), np.array([0.4680, 0.4180, 78.6600])), (("7.5YR", 9.0, 14.0), np.array([0.4860, 0.4280, 78.6600])), (("7.5YR", 9.0, 16.0), np.array([0.5030, 0.4360, 78.6600])), (("7.5YR", 9.0, 18.0), np.array([0.5170, 0.4440, 78.6600])), (("7.5YR", 9.0, 20.0), np.array([0.5290, 0.4500, 78.6600])), (("7.5YR", 9.0, 22.0), np.array([0.5370, 0.4540, 78.6600])), (("7.5YR", 9.0, 24.0), np.array([0.5450, 0.4590, 78.6600])), (("7.5YR", 9.0, 26.0), np.array([0.5530, 0.4630, 78.6600])), (("10YR", 9.0, 2.0), np.array([0.3392, 0.3430, 78.6600])), (("10YR", 9.0, 4.0), np.array([0.3677, 0.3668, 78.6600])), (("10YR", 9.0, 6.0), np.array([0.3941, 0.3877, 78.6600])), (("10YR", 9.0, 8.0), np.array([0.4199, 0.4069, 78.6600])), (("10YR", 9.0, 10.0), np.array([0.4440, 0.4240, 78.6600])), (("10YR", 9.0, 12.0), np.array([0.4630, 0.4360, 78.6600])), (("10YR", 9.0, 14.0), np.array([0.4800, 0.4470, 78.6600])), (("10YR", 9.0, 16.0), np.array([0.4950, 0.4550, 78.6600])), (("10YR", 9.0, 18.0), np.array([0.5060, 0.4620, 78.6600])), (("10YR", 9.0, 20.0), np.array([0.5160, 0.4680, 78.6600])), (("10YR", 9.0, 22.0), np.array([0.5240, 0.4730, 78.6600])), (("10YR", 9.0, 24.0), np.array([0.5320, 0.4780, 78.6600])), (("2.5Y", 9.0, 2.0), np.array([0.3390, 0.3472, 78.6600])), (("2.5Y", 9.0, 4.0), np.array([0.3655, 0.3738, 78.6600])), (("2.5Y", 9.0, 6.0), np.array([0.3910, 0.3972, 78.6600])), (("2.5Y", 9.0, 8.0), np.array([0.4154, 0.4186, 78.6600])), (("2.5Y", 9.0, 10.0), np.array([0.4370, 0.4369, 78.6600])), (("2.5Y", 9.0, 12.0), np.array([0.4569, 0.4527, 78.6600])), (("2.5Y", 9.0, 14.0), np.array([0.4730, 0.4650, 78.6600])), (("2.5Y", 9.0, 16.0), np.array([0.4860, 0.4760, 78.6600])), (("2.5Y", 9.0, 18.0), np.array([0.4940, 0.4830, 78.6600])), (("2.5Y", 9.0, 20.0), np.array([0.5010, 0.4880, 78.6600])), (("2.5Y", 9.0, 22.0), np.array([0.5090, 0.4940, 78.6600])), (("2.5Y", 9.0, 24.0), np.array([0.5150, 0.4990, 78.6600])), (("5Y", 9.0, 2.0), np.array([0.3378, 0.3504, 78.6600])), (("5Y", 9.0, 4.0), np.array([0.3621, 0.3799, 78.6600])), (("5Y", 9.0, 6.0), np.array([0.3858, 0.4071, 78.6600])), (("5Y", 9.0, 8.0), np.array([0.4080, 0.4319, 78.6600])), (("5Y", 9.0, 10.0), np.array([0.4275, 0.4529, 78.6600])), (("5Y", 9.0, 12.0), np.array([0.4455, 0.4719, 78.6600])), (("5Y", 9.0, 14.0), np.array([0.4602, 0.4869, 78.6600])), (("5Y", 9.0, 16.0), np.array([0.4711, 0.4977, 78.6600])), (("5Y", 9.0, 18.0), np.array([0.4782, 0.5049, 78.6600])), (("5Y", 9.0, 20.0), np.array([0.4830, 0.5092, 78.6600])), (("5Y", 9.0, 22.0), np.array([0.4890, 0.5150, 78.6600])), (("5Y", 9.0, 24.0), np.array([0.4950, 0.5220, 78.6600])), (("7.5Y", 9.0, 2.0), np.array([0.3365, 0.3527, 78.6600])), (("7.5Y", 9.0, 4.0), np.array([0.3591, 0.3832, 78.6600])), (("7.5Y", 9.0, 6.0), np.array([0.3811, 0.4123, 78.6600])), (("7.5Y", 9.0, 8.0), np.array([0.4019, 0.4392, 78.6600])), (("7.5Y", 9.0, 10.0), np.array([0.4201, 0.4622, 78.6600])), (("7.5Y", 9.0, 12.0), np.array([0.4369, 0.4829, 78.6600])), (("7.5Y", 9.0, 14.0), np.array([0.4503, 0.4993, 78.6600])), (("7.5Y", 9.0, 16.0), np.array([0.4595, 0.5104, 78.6600])), (("7.5Y", 9.0, 18.0), np.array([0.4663, 0.5188, 78.6600])), (("7.5Y", 9.0, 20.0), np.array([0.4710, 0.5230, 78.6600])), (("7.5Y", 9.0, 22.0), np.array([0.4760, 0.5280, 78.6600])), (("10Y", 10.0, 2.0), np.array([0.3340, 0.3520, 102.5700])), (("10Y", 10.0, 4.0), np.array([0.3550, 0.3820, 102.5700])), (("10Y", 10.0, 6.0), np.array([0.3710, 0.4090, 102.5700])), (("10Y", 10.0, 8.0), np.array([0.3900, 0.4370, 102.5700])), (("10Y", 10.0, 10.0), np.array([0.4050, 0.4600, 102.5700])), (("10Y", 10.0, 12.0), np.array([0.4200, 0.4810, 102.5700])), (("10Y", 10.0, 14.0), np.array([0.4330, 0.5020, 102.5700])), (("10Y", 10.0, 16.0), np.array([0.4420, 0.5150, 102.5700])), (("10Y", 10.0, 18.0), np.array([0.4500, 0.5270, 102.5700])), (("10Y", 10.0, 20.0), np.array([0.4550, 0.5340, 102.5700])), (("10Y", 10.0, 22.0), np.array([0.4600, 0.5410, 102.5700])), (("2.5GY", 10.0, 2.0), np.array([0.3320, 0.3540, 102.5700])), (("2.5GY", 10.0, 4.0), np.array([0.3480, 0.3840, 102.5700])), (("2.5GY", 10.0, 6.0), np.array([0.3650, 0.4130, 102.5700])), (("2.5GY", 10.0, 8.0), np.array([0.3800, 0.4420, 102.5700])), (("2.5GY", 10.0, 10.0), np.array([0.3930, 0.4660, 102.5700])), (("2.5GY", 10.0, 12.0), np.array([0.4060, 0.4920, 102.5700])), (("2.5GY", 10.0, 14.0), np.array([0.4160, 0.5140, 102.5700])), (("2.5GY", 10.0, 16.0), np.array([0.4240, 0.5290, 102.5700])), (("2.5GY", 10.0, 18.0), np.array([0.4320, 0.5460, 102.5700])), (("2.5GY", 10.0, 20.0), np.array([0.4360, 0.5520, 102.5700])), (("2.5GY", 10.0, 22.0), np.array([0.4400, 0.5600, 102.5700])), (("5GY", 10.0, 2.0), np.array([0.3280, 0.3540, 102.5700])), (("5GY", 10.0, 4.0), np.array([0.3430, 0.3840, 102.5700])), (("5GY", 10.0, 6.0), np.array([0.3560, 0.4140, 102.5700])), (("5GY", 10.0, 8.0), np.array([0.3700, 0.4460, 102.5700])), (("5GY", 10.0, 10.0), np.array([0.3800, 0.4700, 102.5700])), (("5GY", 10.0, 12.0), np.array([0.3910, 0.4970, 102.5700])), (("5GY", 10.0, 14.0), np.array([0.3980, 0.5180, 102.5700])), (("5GY", 10.0, 16.0), np.array([0.4050, 0.5380, 102.5700])), (("5GY", 10.0, 18.0), np.array([0.4100, 0.5600, 102.5700])), (("5GY", 10.0, 20.0), np.array([0.4130, 0.5720, 102.5700])), (("5GY", 10.0, 22.0), np.array([0.4160, 0.5800, 102.5700])), (("7.5GY", 10.0, 2.0), np.array([0.3200, 0.3510, 102.5700])), (("7.5GY", 10.0, 4.0), np.array([0.3270, 0.3780, 102.5700])), (("7.5GY", 10.0, 6.0), np.array([0.3340, 0.4100, 102.5700])), (("7.5GY", 10.0, 8.0), np.array([0.3420, 0.4390, 102.5700])), (("7.5GY", 10.0, 10.0), np.array([0.3470, 0.4700, 102.5700])), (("7.5GY", 10.0, 12.0), np.array([0.3510, 0.4930, 102.5700])), (("7.5GY", 10.0, 14.0), np.array([0.3540, 0.5180, 102.5700])), (("7.5GY", 10.0, 16.0), np.array([0.3570, 0.5450, 102.5700])), (("7.5GY", 10.0, 18.0), np.array([0.3600, 0.5710, 102.5700])), (("7.5GY", 10.0, 20.0), np.array([0.3610, 0.5920, 102.5700])), (("7.5GY", 10.0, 22.0), np.array([0.3600, 0.6080, 102.5700])), (("10GY", 10.0, 2.0), np.array([0.3120, 0.3460, 102.5700])), (("10GY", 10.0, 4.0), np.array([0.3140, 0.3700, 102.5700])), (("10GY", 10.0, 6.0), np.array([0.3140, 0.4000, 102.5700])), (("10GY", 10.0, 8.0), np.array([0.3140, 0.4230, 102.5700])), (("10GY", 10.0, 10.0), np.array([0.3140, 0.4540, 102.5700])), (("10GY", 10.0, 12.0), np.array([0.3140, 0.4740, 102.5700])), (("10GY", 10.0, 14.0), np.array([0.3130, 0.5000, 102.5700])), (("10GY", 10.0, 16.0), np.array([0.3100, 0.5270, 102.5700])), (("10GY", 10.0, 18.0), np.array([0.3070, 0.5560, 102.5700])), (("10GY", 10.0, 20.0), np.array([0.3030, 0.5800, 102.5700])), (("10GY", 10.0, 22.0), np.array([0.2990, 0.6000, 102.5700])), (("2.5G", 10.0, 2.0), np.array([0.3060, 0.3420, 102.5700])), (("2.5G", 10.0, 4.0), np.array([0.3030, 0.3610, 102.5700])), (("2.5G", 10.0, 6.0), np.array([0.2980, 0.3850, 102.5700])), (("2.5G", 10.0, 8.0), np.array([0.2930, 0.4040, 102.5700])), (("2.5G", 10.0, 10.0), np.array([0.2860, 0.4270, 102.5700])), (("2.5G", 10.0, 12.0), np.array([0.2820, 0.4440, 102.5700])), (("2.5G", 10.0, 14.0), np.array([0.2760, 0.4670, 102.5700])), (("2.5G", 10.0, 16.0), np.array([0.2700, 0.4900, 102.5700])), (("2.5G", 10.0, 18.0), np.array([0.2620, 0.5170, 102.5700])), (("2.5G", 10.0, 20.0), np.array([0.2540, 0.5430, 102.5700])), (("2.5G", 10.0, 22.0), np.array([0.2480, 0.5630, 102.5700])), (("5G", 10.0, 2.0), np.array([0.3010, 0.3370, 102.5700])), (("5G", 10.0, 4.0), np.array([0.2930, 0.3530, 102.5700])), (("5G", 10.0, 6.0), np.array([0.2830, 0.3690, 102.5700])), (("5G", 10.0, 8.0), np.array([0.2740, 0.3840, 102.5700])), (("5G", 10.0, 10.0), np.array([0.2650, 0.3980, 102.5700])), (("5G", 10.0, 12.0), np.array([0.2560, 0.4120, 102.5700])), (("5G", 10.0, 14.0), np.array([0.2450, 0.4260, 102.5700])), (("5G", 10.0, 16.0), np.array([0.2350, 0.4400, 102.5700])), (("5G", 10.0, 18.0), np.array([0.2220, 0.4570, 102.5700])), (("7.5G", 10.0, 2.0), np.array([0.2980, 0.3330, 102.5700])), (("7.5G", 10.0, 4.0), np.array([0.2880, 0.3460, 102.5700])), (("7.5G", 10.0, 6.0), np.array([0.2770, 0.3600, 102.5700])), (("7.5G", 10.0, 8.0), np.array([0.2660, 0.3740, 102.5700])), (("7.5G", 10.0, 10.0), np.array([0.2560, 0.3850, 102.5700])), (("7.5G", 10.0, 12.0), np.array([0.2460, 0.3970, 102.5700])), (("7.5G", 10.0, 14.0), np.array([0.2350, 0.4090, 102.5700])), (("7.5G", 10.0, 16.0), np.array([0.2240, 0.4200, 102.5700])), (("10G", 10.0, 2.0), np.array([0.2960, 0.3310, 102.5700])), (("10G", 10.0, 4.0), np.array([0.2840, 0.3410, 102.5700])), (("10G", 10.0, 6.0), np.array([0.2710, 0.3510, 102.5700])), (("10G", 10.0, 8.0), np.array([0.2580, 0.3610, 102.5700])), (("10G", 10.0, 10.0), np.array([0.2480, 0.3690, 102.5700])), (("10G", 10.0, 12.0), np.array([0.2350, 0.3780, 102.5700])), (("10G", 10.0, 14.0), np.array([0.2230, 0.3870, 102.5700])), (("2.5BG", 10.0, 2.0), np.array([0.2940, 0.3270, 102.5700])), (("2.5BG", 10.0, 4.0), np.array([0.2800, 0.3350, 102.5700])), (("2.5BG", 10.0, 6.0), np.array([0.2650, 0.3430, 102.5700])), (("2.5BG", 10.0, 8.0), np.array([0.2510, 0.3500, 102.5700])), (("2.5BG", 10.0, 10.0), np.array([0.2410, 0.3570, 102.5700])), (("2.5BG", 10.0, 12.0), np.array([0.2270, 0.3620, 102.5700])), (("2.5BG", 10.0, 14.0), np.array([0.2130, 0.3680, 102.5700])), (("5BG", 10.0, 2.0), np.array([0.2930, 0.3230, 102.5700])), (("5BG", 10.0, 4.0), np.array([0.2770, 0.3300, 102.5700])), (("5BG", 10.0, 6.0), np.array([0.2620, 0.3350, 102.5700])), (("5BG", 10.0, 8.0), np.array([0.2460, 0.3400, 102.5700])), (("5BG", 10.0, 10.0), np.array([0.2330, 0.3420, 102.5700])), (("5BG", 10.0, 12.0), np.array([0.2200, 0.3450, 102.5700])), (("5BG", 10.0, 14.0), np.array([0.2030, 0.3480, 102.5700])), (("7.5BG", 10.0, 2.0), np.array([0.2930, 0.3180, 102.5700])), (("7.5BG", 10.0, 4.0), np.array([0.2730, 0.3200, 102.5700])), (("7.5BG", 10.0, 6.0), np.array([0.2560, 0.3210, 102.5700])), (("7.5BG", 10.0, 8.0), np.array([0.2380, 0.3220, 102.5700])), (("7.5BG", 10.0, 10.0), np.array([0.2240, 0.3220, 102.5700])), (("7.5BG", 10.0, 12.0), np.array([0.2090, 0.3220, 102.5700])), (("10BG", 10.0, 2.0), np.array([0.2930, 0.3150, 102.5700])), (("10BG", 10.0, 4.0), np.array([0.2700, 0.3130, 102.5700])), (("10BG", 10.0, 6.0), np.array([0.2510, 0.3110, 102.5700])), (("10BG", 10.0, 8.0), np.array([0.2340, 0.3100, 102.5700])), (("10BG", 10.0, 10.0), np.array([0.2190, 0.3080, 102.5700])), (("10BG", 10.0, 12.0), np.array([0.2030, 0.3050, 102.5700])), (("2.5B", 10.0, 2.0), np.array([0.2930, 0.3130, 102.5700])), (("2.5B", 10.0, 4.0), np.array([0.2700, 0.3080, 102.5700])), (("2.5B", 10.0, 6.0), np.array([0.2490, 0.3040, 102.5700])), (("2.5B", 10.0, 8.0), np.array([0.2320, 0.2990, 102.5700])), (("2.5B", 10.0, 10.0), np.array([0.2150, 0.2930, 102.5700])), (("5B", 10.0, 2.0), np.array([0.2940, 0.3120, 102.5700])), (("5B", 10.0, 4.0), np.array([0.2680, 0.3020, 102.5700])), (("5B", 10.0, 6.0), np.array([0.2480, 0.2960, 102.5700])), (("5B", 10.0, 8.0), np.array([0.2300, 0.2880, 102.5700])), (("7.5B", 10.0, 2.0), np.array([0.2950, 0.3100, 102.5700])), (("7.5B", 10.0, 4.0), np.array([0.2690, 0.2980, 102.5700])), (("7.5B", 10.0, 6.0), np.array([0.2490, 0.2870, 102.5700])), (("10B", 10.0, 2.0), np.array([0.2960, 0.3090, 102.5700])), (("10B", 10.0, 4.0), np.array([0.2720, 0.2940, 102.5700])), (("10B", 10.0, 6.0), np.array([0.2510, 0.2800, 102.5700])), (("2.5PB", 10.0, 2.0), np.array([0.2980, 0.3070, 102.5700])), (("2.5PB", 10.0, 4.0), np.array([0.2780, 0.2900, 102.5700])), (("2.5PB", 10.0, 6.0), np.array([0.2600, 0.2740, 102.5700])), (("5PB", 10.0, 2.0), np.array([0.2990, 0.3070, 102.5700])), (("5PB", 10.0, 4.0), np.array([0.2820, 0.2880, 102.5700])), (("5PB", 10.0, 6.0), np.array([0.2650, 0.2700, 102.5700])), (("7.5PB", 10.0, 2.0), np.array([0.3020, 0.3070, 102.5700])), (("7.5PB", 10.0, 4.0), np.array([0.2860, 0.2860, 102.5700])), (("7.5PB", 10.0, 6.0), np.array([0.2730, 0.2680, 102.5700])), (("10PB", 10.0, 2.0), np.array([0.3030, 0.3070, 102.5700])), (("10PB", 10.0, 4.0), np.array([0.2910, 0.2860, 102.5700])), (("10PB", 10.0, 6.0), np.array([0.2800, 0.2680, 102.5700])), (("2.5P", 10.0, 2.0), np.array([0.3050, 0.3070, 102.5700])), (("2.5P", 10.0, 4.0), np.array([0.2960, 0.2880, 102.5700])), (("2.5P", 10.0, 6.0), np.array([0.2890, 0.2700, 102.5700])), (("5P", 10.0, 2.0), np.array([0.3070, 0.3070, 102.5700])), (("5P", 10.0, 4.0), np.array([0.3020, 0.2890, 102.5700])), (("5P", 10.0, 6.0), np.array([0.2980, 0.2740, 102.5700])), (("5P", 10.0, 8.0), np.array([0.2940, 0.2580, 102.5700])), (("7.5P", 10.0, 2.0), np.array([0.3100, 0.3080, 102.5700])), (("7.5P", 10.0, 4.0), np.array([0.3110, 0.2940, 102.5700])), (("7.5P", 10.0, 6.0), np.array([0.3110, 0.2800, 102.5700])), (("7.5P", 10.0, 8.0), np.array([0.3110, 0.2660, 102.5700])), (("10P", 10.0, 2.0), np.array([0.3130, 0.3090, 102.5700])), (("10P", 10.0, 4.0), np.array([0.3170, 0.2970, 102.5700])), (("10P", 10.0, 6.0), np.array([0.3210, 0.2840, 102.5700])), (("10P", 10.0, 8.0), np.array([0.3260, 0.2730, 102.5700])), (("10P", 10.0, 10.0), np.array([0.3280, 0.2640, 102.5700])), (("2.5RP", 10.0, 2.0), np.array([0.3150, 0.3110, 102.5700])), (("2.5RP", 10.0, 4.0), np.array([0.3230, 0.3010, 102.5700])), (("2.5RP", 10.0, 6.0), np.array([0.3320, 0.2910, 102.5700])), (("2.5RP", 10.0, 8.0), np.array([0.3390, 0.2820, 102.5700])), (("2.5RP", 10.0, 10.0), np.array([0.3440, 0.2750, 102.5700])), (("5RP", 10.0, 2.0), np.array([0.3180, 0.3130, 102.5700])), (("5RP", 10.0, 4.0), np.array([0.3320, 0.3070, 102.5700])), (("5RP", 10.0, 6.0), np.array([0.3450, 0.3000, 102.5700])), (("5RP", 10.0, 8.0), np.array([0.3550, 0.2930, 102.5700])), (("5RP", 10.0, 10.0), np.array([0.3630, 0.2880, 102.5700])), (("7.5RP", 10.0, 2.0), np.array([0.3200, 0.3140, 102.5700])), (("7.5RP", 10.0, 4.0), np.array([0.3350, 0.3100, 102.5700])), (("7.5RP", 10.0, 6.0), np.array([0.3510, 0.3050, 102.5700])), (("7.5RP", 10.0, 8.0), np.array([0.3650, 0.3010, 102.5700])), (("10RP", 10.0, 2.0), np.array([0.3220, 0.3160, 102.5700])), (("10RP", 10.0, 4.0), np.array([0.3420, 0.3150, 102.5700])), (("10RP", 10.0, 6.0), np.array([0.3610, 0.3140, 102.5700])), (("10RP", 10.0, 8.0), np.array([0.3780, 0.3110, 102.5700])), (("2.5R", 10.0, 2.0), np.array([0.3240, 0.3180, 102.5700])), (("2.5R", 10.0, 4.0), np.array([0.3450, 0.3180, 102.5700])), (("2.5R", 10.0, 6.0), np.array([0.3660, 0.3180, 102.5700])), (("2.5R", 10.0, 8.0), np.array([0.3850, 0.3180, 102.5700])), (("5R", 10.0, 2.0), np.array([0.3260, 0.3200, 102.5700])), (("5R", 10.0, 4.0), np.array([0.3480, 0.3220, 102.5700])), (("5R", 10.0, 6.0), np.array([0.3720, 0.3250, 102.5700])), (("5R", 10.0, 8.0), np.array([0.3920, 0.3260, 102.5700])), (("7.5R", 10.0, 2.0), np.array([0.3290, 0.3220, 102.5700])), (("7.5R", 10.0, 4.0), np.array([0.3540, 0.3290, 102.5700])), (("7.5R", 10.0, 6.0), np.array([0.3800, 0.3340, 102.5700])), (("7.5R", 10.0, 8.0), np.array([0.4020, 0.3370, 102.5700])), (("10R", 10.0, 2.0), np.array([0.3320, 0.3260, 102.5700])), (("10R", 10.0, 4.0), np.array([0.3590, 0.3360, 102.5700])), (("10R", 10.0, 6.0), np.array([0.3860, 0.3440, 102.5700])), (("10R", 10.0, 8.0), np.array([0.4110, 0.3490, 102.5700])), (("2.5YR", 10.0, 2.0), np.array([0.3340, 0.3290, 102.5700])), (("2.5YR", 10.0, 4.0), np.array([0.3620, 0.3420, 102.5700])), (("2.5YR", 10.0, 6.0), np.array([0.3890, 0.3540, 102.5700])), (("2.5YR", 10.0, 8.0), np.array([0.4150, 0.3630, 102.5700])), (("5YR", 10.0, 2.0), np.array([0.3360, 0.3330, 102.5700])), (("5YR", 10.0, 4.0), np.array([0.3640, 0.3500, 102.5700])), (("5YR", 10.0, 6.0), np.array([0.3910, 0.3650, 102.5700])), (("5YR", 10.0, 8.0), np.array([0.4160, 0.3780, 102.5700])), (("5YR", 10.0, 10.0), np.array([0.4400, 0.3880, 102.5700])), (("7.5YR", 10.0, 2.0), np.array([0.3370, 0.3380, 102.5700])), (("7.5YR", 10.0, 4.0), np.array([0.3660, 0.3570, 102.5700])), (("7.5YR", 10.0, 6.0), np.array([0.3910, 0.3750, 102.5700])), (("7.5YR", 10.0, 8.0), np.array([0.4150, 0.3910, 102.5700])), (("7.5YR", 10.0, 10.0), np.array([0.4390, 0.4050, 102.5700])), (("7.5YR", 10.0, 12.0), np.array([0.4550, 0.4160, 102.5700])), (("10YR", 10.0, 2.0), np.array([0.3380, 0.3430, 102.5700])), (("10YR", 10.0, 4.0), np.array([0.3660, 0.3670, 102.5700])), (("10YR", 10.0, 6.0), np.array([0.3890, 0.3850, 102.5700])), (("10YR", 10.0, 8.0), np.array([0.4120, 0.4020, 102.5700])), (("10YR", 10.0, 10.0), np.array([0.4350, 0.4200, 102.5700])), (("10YR", 10.0, 12.0), np.array([0.4520, 0.4310, 102.5700])), (("10YR", 10.0, 14.0), np.array([0.4670, 0.4420, 102.5700])), (("10YR", 10.0, 16.0), np.array([0.4830, 0.4530, 102.5700])), (("2.5Y", 10.0, 2.0), np.array([0.3370, 0.3470, 102.5700])), (("2.5Y", 10.0, 4.0), np.array([0.3630, 0.3730, 102.5700])), (("2.5Y", 10.0, 6.0), np.array([0.3850, 0.3950, 102.5700])), (("2.5Y", 10.0, 8.0), np.array([0.4070, 0.4130, 102.5700])), (("2.5Y", 10.0, 10.0), np.array([0.4280, 0.4310, 102.5700])), (("2.5Y", 10.0, 12.0), np.array([0.4460, 0.4460, 102.5700])), (("2.5Y", 10.0, 14.0), np.array([0.4630, 0.4600, 102.5700])), (("2.5Y", 10.0, 16.0), np.array([0.4760, 0.4700, 102.5700])), (("2.5Y", 10.0, 18.0), np.array([0.4870, 0.4770, 102.5700])), (("2.5Y", 10.0, 20.0), np.array([0.4960, 0.4860, 102.5700])), (("2.5Y", 10.0, 22.0), np.array([0.5030, 0.4900, 102.5700])), (("5Y", 10.0, 2.0), np.array([0.3360, 0.3480, 102.5700])), (("5Y", 10.0, 4.0), np.array([0.3600, 0.3770, 102.5700])), (("5Y", 10.0, 6.0), np.array([0.3810, 0.4020, 102.5700])), (("5Y", 10.0, 8.0), np.array([0.4000, 0.4250, 102.5700])), (("5Y", 10.0, 10.0), np.array([0.4180, 0.4460, 102.5700])), (("5Y", 10.0, 12.0), np.array([0.4350, 0.4650, 102.5700])), (("5Y", 10.0, 14.0), np.array([0.4500, 0.4810, 102.5700])), (("5Y", 10.0, 16.0), np.array([0.4620, 0.4940, 102.5700])), (("5Y", 10.0, 18.0), np.array([0.4720, 0.5020, 102.5700])), (("5Y", 10.0, 20.0), np.array([0.4780, 0.5080, 102.5700])), (("5Y", 10.0, 22.0), np.array([0.4840, 0.5140, 102.5700])), (("7.5Y", 10.0, 2.0), np.array([0.3350, 0.3510, 102.5700])), (("7.5Y", 10.0, 4.0), np.array([0.3570, 0.3800, 102.5700])), (("7.5Y", 10.0, 6.0), np.array([0.3760, 0.4070, 102.5700])), (("7.5Y", 10.0, 8.0), np.array([0.3950, 0.4320, 102.5700])), (("7.5Y", 10.0, 10.0), np.array([0.4120, 0.4540, 102.5700])), (("7.5Y", 10.0, 12.0), np.array([0.4270, 0.4730, 102.5700])), (("7.5Y", 10.0, 14.0), np.array([0.4420, 0.4920, 102.5700])), (("7.5Y", 10.0, 16.0), np.array([0.4530, 0.5050, 102.5700])), (("7.5Y", 10.0, 18.0), np.array([0.4620, 0.5150, 102.5700])), (("7.5Y", 10.0, 20.0), np.array([0.4670, 0.5210, 102.5700])), (("7.5Y", 10.0, 22.0), np.array([0.4720, 0.5280, 102.5700])), ) """ *All* published *Munsell* colours, including the extrapolated colors as a *tuple* as follows:: ( (('hue', 'value', 'chroma'), np.array(['x', 'y', 'Y'])), ..., (('hue', 'value', 'chroma'), np.array(['x', 'y', 'Y'])), ) References ---------- :cite:`MunsellColorSciencec` """
bsd-3-clause
8096936e45ec29203a900467d03f3a84
61.648766
78
0.4859
1.934405
false
false
false
false
colour-science/colour
colour/io/luts/sony_spi3d.py
1
6235
""" Sony .spi3d LUT Format Input / Output Utilities =============================================== Defines the *Sony* *.spi3d* *LUT* format related input / output utilities objects: - :func:`colour.io.read_LUT_SonySPI3D` - :func:`colour.io.write_LUT_SonySPI3D` """ from __future__ import annotations import numpy as np from colour.io.luts import LUT3D, LUTSequence from colour.io.luts.common import path_to_title from colour.hints import Boolean, Integer, List, Tuple, Union from colour.utilities import ( as_float_array, as_int_array, as_int_scalar, attest, usage_warning, ) __author__ = "Colour Developers" __copyright__ = "Copyright 2013 Colour Developers" __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" __maintainer__ = "Colour Developers" __email__ = "colour-developers@colour-science.org" __status__ = "Production" __all__ = [ "read_LUT_SonySPI3D", "write_LUT_SonySPI3D", ] def read_LUT_SonySPI3D(path: str) -> LUT3D: """ Read given *Sony* *.spi3d* *LUT* file. Parameters ---------- path *LUT* path. Returns ------- :class:`colour.LUT3D` :class:`LUT3D` class instance. Examples -------- Reading an ordered and an unordered 3D *Sony* *.spi3d* *LUT*: >>> import os >>> path = os.path.join( ... os.path.dirname(__file__), ... "tests", ... "resources", ... "sony_spi3d", ... "Colour_Correct.spi3d", ... ) >>> print(read_LUT_SonySPI3D(path)) LUT3D - Colour Correct ---------------------- <BLANKLINE> Dimensions : 3 Domain : [[ 0. 0. 0.] [ 1. 1. 1.]] Size : (4, 4, 4, 3) Comment 01 : Adapted from a LUT generated by Foundry::LUT. >>> path = os.path.join( ... os.path.dirname(__file__), ... "tests", ... "resources", ... "sony_spi3d", ... "Colour_Correct_Unordered.spi3d", ... ) >>> print(read_LUT_SonySPI3D(path)) LUT3D - Colour Correct Unordered -------------------------------- <BLANKLINE> Dimensions : 3 Domain : [[ 0. 0. 0.] [ 1. 1. 1.]] Size : (4, 4, 4, 3) Comment 01 : Adapted from a LUT generated by Foundry::LUT. """ title = path_to_title(path) domain_min, domain_max = np.array([0, 0, 0]), np.array([1, 1, 1]) size: Integer = 2 data_table = [] data_indexes = [] comments = [] with open(path) as spi3d_file: lines = filter(None, (line.strip() for line in spi3d_file.readlines())) for line in lines: if line.startswith("#"): comments.append(line[1:].strip()) continue tokens = line.split() if len(tokens) == 3: attest( len(set(tokens)) == 1, 'Non-uniform "LUT" shape is unsupported!', ) size = as_int_scalar(tokens[0]) if len(tokens) == 6: data_table.append(as_float_array(tokens[3:])) data_indexes.append(as_int_array(tokens[:3])) indexes = as_int_array(data_indexes) sorting_indexes = np.lexsort((indexes[:, 2], indexes[:, 1], indexes[:, 0])) attest( np.array_equal( indexes[sorting_indexes], as_int_array( np.around(LUT3D.linear_table(size) * (size - 1)) ).reshape((-1, 3)), ), 'Indexes do not match expected "LUT3D" indexes!', ) table = as_float_array(data_table)[sorting_indexes].reshape( [size, size, size, 3] ) return LUT3D( table, title, np.vstack([domain_min, domain_max]), comments=comments ) def write_LUT_SonySPI3D( LUT: Union[LUT3D, LUTSequence], path: str, decimals: Integer = 7 ) -> Boolean: """ Write given *LUT* to given *Sony* *.spi3d* *LUT* file. Parameters ---------- LUT :class:`LUT3D` or :class:`LUTSequence` class instance to write at given path. path *LUT* path. decimals Formatting decimals. Returns ------- :class:`bool` Definition success. Warnings -------- - If a :class:`LUTSequence` class instance is passed as ``LUT``, the first *LUT* in the *LUT* sequence will be used. Examples -------- Writing a 3D *Sony* *.spi3d* *LUT*: >>> LUT = LUT3D( ... LUT3D.linear_table(16) ** (1 / 2.2), ... "My LUT", ... np.array([[0, 0, 0], [1, 1, 1]]), ... comments=["A first comment.", "A second comment."], ... ) >>> write_LUT_SonySPI3D(LUT, "My_LUT.cube") # doctest: +SKIP """ if isinstance(LUT, LUTSequence): usage_warning( f'"LUT" is a "LUTSequence" instance was passed, using first ' f'sequence "LUT":\n{LUT}' ) LUTxD = LUT[0] else: LUTxD = LUT attest(not LUTxD.is_domain_explicit(), '"LUT" domain must be implicit!') attest(isinstance(LUTxD, LUT3D), '"LUT" must be either a 3D "LUT"!') attest( np.array_equal( LUTxD.domain, np.array( [ [0, 0, 0], [1, 1, 1], ] ), ), '"LUT" domain must be [[0, 0, 0], [1, 1, 1]]!', ) def _format_array(array: Union[List, Tuple]) -> str: """Format given array as a *Sony* *.spi3d* data row.""" return "{1:d} {2:d} {3:d} {4:0.{0}f} {5:0.{0}f} {6:0.{0}f}".format( decimals, *array ) with open(path, "w") as spi3d_file: spi3d_file.write("SPILUT 1.0\n") spi3d_file.write("3 3\n") spi3d_file.write("{0} {0} {0}\n".format(LUTxD.size)) indexes = as_int_array( np.around(LUTxD.linear_table(LUTxD.size) * (LUTxD.size - 1)) ).reshape([-1, 3]) table = LUTxD.table.reshape([-1, 3]) for i, row in enumerate(indexes): spi3d_file.write(f"{_format_array(list(row) + list(table[i]))}\n") if LUTxD.comments: for comment in LUTxD.comments: spi3d_file.write(f"# {comment}\n") return True
bsd-3-clause
d56a75eba617e478f87e97a44b63feba
25.875
79
0.51243
3.210608
false
false
false
false
colour-science/colour
colour/notation/datasets/munsell/real.py
1
174499
""" Munsell Renotation System Dataset - Real Munsell Colours ======================================================== Defines the *Munsell Renotation System* *Real* datasets. Those are *real*, within MacAdam limits *Munsell* colours only. They are the colours listed in the original 1943 renotation article *(Newhall, Nickerson, & Judd, 1943)*. Notes ----- - The Munsell Renotation data commonly available within the *all.dat*, *experimental.dat* and *real.dat* files features *CIE xyY* colourspace values that are scaled by a :math:`1 / 0.975 \\simeq 1.02568` factor. If you are performing conversions using *Munsell* *Colorlab* specification, e.g. *2.5R 9/2*, according to *ASTM D1535-08e1* method, you should not scale the output :math:`Y` Luminance. However, if you use directly the *CIE xyY* colourspace values from the Munsell Renotation data data, you should scale the :math:`Y` Luminance before conversions by a :math:`0.975` factor. *ASTM D1535-08e1* states that:: The coefficients of this equation are obtained from the 1943 equation by multiplying each coefficient by 0.975, the reflectance factor of magnesium oxide with respect to the perfect reflecting diffuser, and rounding to ve digits of precision. - Chromaticities assume *CIE Illuminant C*, approximately 6700K, as neutral origin for both the hue and chroma loci. References ---------- - :cite:`MunsellColorSciencec` : Munsell Color Science. (n.d.). Munsell Colours Data. Retrieved August 20, 2014, from http://www.cis.rit.edu/research/mcsl2/online/munsell.php """ from __future__ import annotations import numpy as np from colour.hints import Tuple __author__ = "Colour Developers" __copyright__ = "Copyright 2013 Colour Developers" __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" __maintainer__ = "Colour Developers" __email__ = "colour-developers@colour-science.org" __status__ = "Production" __all__ = [ "MUNSELL_COLOURS_REAL", ] MUNSELL_COLOURS_REAL: Tuple = ( (("10RP", 1.0, 2.0), np.array([0.3629, 0.2710, 1.2100])), (("10RP", 1.0, 4.0), np.array([0.3920, 0.2423, 1.2100])), (("10RP", 1.0, 6.0), np.array([0.4151, 0.2169, 1.2100])), (("10RP", 1.0, 8.0), np.array([0.4357, 0.1921, 1.2100])), (("10RP", 1.0, 10.0), np.array([0.4521, 0.1710, 1.2100])), (("10RP", 1.0, 12.0), np.array([0.4668, 0.1514, 1.2100])), (("2.5R", 1.0, 2.0), np.array([0.3768, 0.2816, 1.2100])), (("2.5R", 1.0, 4.0), np.array([0.4166, 0.2569, 1.2100])), (("2.5R", 1.0, 6.0), np.array([0.4515, 0.2329, 1.2100])), (("2.5R", 1.0, 8.0), np.array([0.4812, 0.2103, 1.2100])), (("2.5R", 1.0, 10.0), np.array([0.5058, 0.1900, 1.2100])), (("5R", 1.0, 2.0), np.array([0.3908, 0.2929, 1.2100])), (("5R", 1.0, 4.0), np.array([0.4420, 0.2728, 1.2100])), (("5R", 1.0, 6.0), np.array([0.4885, 0.2515, 1.2100])), (("5R", 1.0, 8.0), np.array([0.5282, 0.2297, 1.2100])), (("5R", 1.0, 10.0), np.array([0.5604, 0.2100, 1.2100])), (("7.5R", 1.0, 2.0), np.array([0.4020, 0.3034, 1.2100])), (("7.5R", 1.0, 4.0), np.array([0.4660, 0.2888, 1.2100])), (("7.5R", 1.0, 6.0), np.array([0.5235, 0.2698, 1.2100])), (("7.5R", 1.0, 8.0), np.array([0.5722, 0.2487, 1.2100])), (("7.5R", 1.0, 10.0), np.array([0.6111, 0.2290, 1.2100])), (("10R", 1.0, 2.0), np.array([0.4128, 0.3154, 1.2100])), (("10R", 1.0, 4.0), np.array([0.4933, 0.3068, 1.2100])), (("10R", 1.0, 6.0), np.array([0.5584, 0.2921, 1.2100])), (("10R", 1.0, 8.0), np.array([0.6178, 0.2713, 1.2100])), (("10R", 1.0, 10.0), np.array([0.6661, 0.2499, 1.2100])), (("2.5YR", 1.0, 2.0), np.array([0.4258, 0.3344, 1.2100])), (("2.5YR", 1.0, 4.0), np.array([0.5311, 0.3371, 1.2100])), (("2.5YR", 1.0, 6.0), np.array([0.6048, 0.3270, 1.2100])), (("2.5YR", 1.0, 8.0), np.array([0.6721, 0.3058, 1.2100])), (("5YR", 1.0, 2.0), np.array([0.4377, 0.3580, 1.2100])), (("5YR", 1.0, 4.0), np.array([0.5660, 0.3795, 1.2100])), (("7.5YR", 1.0, 2.0), np.array([0.4430, 0.3775, 1.2100])), (("10YR", 1.0, 2.0), np.array([0.4446, 0.3982, 1.2100])), (("2.5Y", 1.0, 2.0), np.array([0.4362, 0.4177, 1.2100])), (("5Y", 1.0, 2.0), np.array([0.4230, 0.4265, 1.2100])), (("7.5Y", 1.0, 2.0), np.array([0.4042, 0.4287, 1.2100])), (("10Y", 1.0, 2.0), np.array([0.3802, 0.4212, 1.2100])), (("2.5GY", 1.0, 2.0), np.array([0.3540, 0.4088, 1.2100])), (("5GY", 1.0, 2.0), np.array([0.3359, 0.3982, 1.2100])), (("5GY", 1.0, 4.0), np.array([0.3765, 0.5942, 1.2100])), (("7.5GY", 1.0, 2.0), np.array([0.3154, 0.3840, 1.2100])), (("7.5GY", 1.0, 4.0), np.array([0.3133, 0.5380, 1.2100])), (("10GY", 1.0, 2.0), np.array([0.3006, 0.3720, 1.2100])), (("10GY", 1.0, 4.0), np.array([0.2722, 0.4903, 1.2100])), (("10GY", 1.0, 6.0), np.array([0.2232, 0.6392, 1.2100])), (("2.5G", 1.0, 2.0), np.array([0.2910, 0.3634, 1.2100])), (("2.5G", 1.0, 4.0), np.array([0.2454, 0.4489, 1.2100])), (("2.5G", 1.0, 6.0), np.array([0.1711, 0.5619, 1.2100])), (("2.5G", 1.0, 8.0), np.array([0.0620, 0.6896, 1.2100])), (("5G", 1.0, 2.0), np.array([0.2833, 0.3564, 1.2100])), (("5G", 1.0, 4.0), np.array([0.2290, 0.4218, 1.2100])), (("5G", 1.0, 6.0), np.array([0.1468, 0.4996, 1.2100])), (("5G", 1.0, 8.0), np.array([0.0559, 0.5710, 1.2100])), (("7.5G", 1.0, 2.0), np.array([0.2758, 0.3484, 1.2100])), (("7.5G", 1.0, 4.0), np.array([0.2159, 0.3967, 1.2100])), (("7.5G", 1.0, 6.0), np.array([0.1344, 0.4505, 1.2100])), (("7.5G", 1.0, 8.0), np.array([0.0530, 0.4943, 1.2100])), (("10G", 1.0, 2.0), np.array([0.2689, 0.3407, 1.2100])), (("10G", 1.0, 4.0), np.array([0.2040, 0.3724, 1.2100])), (("10G", 1.0, 6.0), np.array([0.1249, 0.4019, 1.2100])), (("10G", 1.0, 8.0), np.array([0.0511, 0.4158, 1.2100])), (("2.5BG", 1.0, 2.0), np.array([0.2600, 0.3289, 1.2100])), (("2.5BG", 1.0, 4.0), np.array([0.1883, 0.3406, 1.2100])), (("2.5BG", 1.0, 6.0), np.array([0.1169, 0.3452, 1.2100])), (("2.5BG", 1.0, 8.0), np.array([0.0476, 0.3458, 1.2100])), (("5BG", 1.0, 2.0), np.array([0.2500, 0.3141, 1.2100])), (("5BG", 1.0, 4.0), np.array([0.1753, 0.3021, 1.2100])), (("5BG", 1.0, 6.0), np.array([0.1093, 0.2860, 1.2100])), (("7.5BG", 1.0, 2.0), np.array([0.2430, 0.3023, 1.2100])), (("7.5BG", 1.0, 4.0), np.array([0.1702, 0.2768, 1.2100])), (("7.5BG", 1.0, 6.0), np.array([0.1059, 0.2485, 1.2100])), (("10BG", 1.0, 2.0), np.array([0.2362, 0.2882, 1.2100])), (("10BG", 1.0, 4.0), np.array([0.1658, 0.2496, 1.2100])), (("10BG", 1.0, 6.0), np.array([0.1074, 0.2129, 1.2100])), (("2.5B", 1.0, 2.0), np.array([0.2322, 0.2781, 1.2100])), (("2.5B", 1.0, 4.0), np.array([0.1649, 0.2324, 1.2100])), (("2.5B", 1.0, 6.0), np.array([0.1118, 0.1908, 1.2100])), (("5B", 1.0, 2.0), np.array([0.2291, 0.2677, 1.2100])), (("5B", 1.0, 4.0), np.array([0.1667, 0.2168, 1.2100])), (("5B", 1.0, 6.0), np.array([0.1212, 0.1745, 1.2100])), (("7.5B", 1.0, 2.0), np.array([0.2291, 0.2579, 1.2100])), (("7.5B", 1.0, 4.0), np.array([0.1716, 0.2048, 1.2100])), (("7.5B", 1.0, 6.0), np.array([0.1303, 0.1639, 1.2100])), (("7.5B", 1.0, 8.0), np.array([0.0968, 0.1280, 1.2100])), (("10B", 1.0, 2.0), np.array([0.2309, 0.2491, 1.2100])), (("10B", 1.0, 4.0), np.array([0.1783, 0.1974, 1.2100])), (("10B", 1.0, 6.0), np.array([0.1392, 0.1563, 1.2100])), (("10B", 1.0, 8.0), np.array([0.1077, 0.1218, 1.2100])), (("2.5PB", 1.0, 2.0), np.array([0.2360, 0.2420, 1.2100])), (("2.5PB", 1.0, 4.0), np.array([0.1895, 0.1911, 1.2100])), (("2.5PB", 1.0, 6.0), np.array([0.1539, 0.1491, 1.2100])), (("2.5PB", 1.0, 8.0), np.array([0.1273, 0.1157, 1.2100])), (("5PB", 1.0, 2.0), np.array([0.2427, 0.2368, 1.2100])), (("5PB", 1.0, 4.0), np.array([0.2012, 0.1867, 1.2100])), (("5PB", 1.0, 6.0), np.array([0.1678, 0.1447, 1.2100])), (("5PB", 1.0, 8.0), np.array([0.1447, 0.1124, 1.2100])), (("5PB", 1.0, 10.0), np.array([0.1285, 0.0870, 1.2100])), (("7.5PB", 1.0, 2.0), np.array([0.2547, 0.2310, 1.2100])), (("7.5PB", 1.0, 4.0), np.array([0.2232, 0.1821, 1.2100])), (("7.5PB", 1.0, 6.0), np.array([0.2000, 0.1422, 1.2100])), (("7.5PB", 1.0, 8.0), np.array([0.1872, 0.1141, 1.2100])), (("7.5PB", 1.0, 10.0), np.array([0.1804, 0.0950, 1.2100])), (("7.5PB", 1.0, 12.0), np.array([0.1763, 0.0804, 1.2100])), (("7.5PB", 1.0, 14.0), np.array([0.1738, 0.0688, 1.2100])), (("7.5PB", 1.0, 16.0), np.array([0.1720, 0.0583, 1.2100])), (("7.5PB", 1.0, 18.0), np.array([0.1709, 0.0518, 1.2100])), (("7.5PB", 1.0, 20.0), np.array([0.1701, 0.0454, 1.2100])), (("7.5PB", 1.0, 22.0), np.array([0.1696, 0.0402, 1.2100])), (("7.5PB", 1.0, 24.0), np.array([0.1691, 0.0352, 1.2100])), (("7.5PB", 1.0, 26.0), np.array([0.1689, 0.0309, 1.2100])), (("7.5PB", 1.0, 28.0), np.array([0.1686, 0.0270, 1.2100])), (("7.5PB", 1.0, 30.0), np.array([0.1684, 0.0234, 1.2100])), (("7.5PB", 1.0, 32.0), np.array([0.1682, 0.0202, 1.2100])), (("7.5PB", 1.0, 34.0), np.array([0.1682, 0.0180, 1.2100])), (("7.5PB", 1.0, 36.0), np.array([0.1681, 0.0160, 1.2100])), (("7.5PB", 1.0, 38.0), np.array([0.1680, 0.0140, 1.2100])), (("10PB", 1.0, 2.0), np.array([0.2677, 0.2280, 1.2100])), (("10PB", 1.0, 4.0), np.array([0.2459, 0.1828, 1.2100])), (("10PB", 1.0, 6.0), np.array([0.2290, 0.1470, 1.2100])), (("10PB", 1.0, 8.0), np.array([0.2190, 0.1228, 1.2100])), (("10PB", 1.0, 10.0), np.array([0.2120, 0.1029, 1.2100])), (("10PB", 1.0, 12.0), np.array([0.2070, 0.0869, 1.2100])), (("10PB", 1.0, 14.0), np.array([0.2038, 0.0745, 1.2100])), (("10PB", 1.0, 16.0), np.array([0.2008, 0.0638, 1.2100])), (("10PB", 1.0, 18.0), np.array([0.1991, 0.0564, 1.2100])), (("10PB", 1.0, 20.0), np.array([0.1976, 0.0493, 1.2100])), (("10PB", 1.0, 22.0), np.array([0.1965, 0.0436, 1.2100])), (("10PB", 1.0, 24.0), np.array([0.1952, 0.0380, 1.2100])), (("10PB", 1.0, 26.0), np.array([0.1942, 0.0326, 1.2100])), (("10PB", 1.0, 28.0), np.array([0.1936, 0.0281, 1.2100])), (("10PB", 1.0, 30.0), np.array([0.1928, 0.0240, 1.2100])), (("2.5P", 1.0, 2.0), np.array([0.2808, 0.2296, 1.2100])), (("2.5P", 1.0, 4.0), np.array([0.2668, 0.1874, 1.2100])), (("2.5P", 1.0, 6.0), np.array([0.2570, 0.1559, 1.2100])), (("2.5P", 1.0, 8.0), np.array([0.2496, 0.1303, 1.2100])), (("2.5P", 1.0, 10.0), np.array([0.2441, 0.1112, 1.2100])), (("2.5P", 1.0, 12.0), np.array([0.2394, 0.0940, 1.2100])), (("2.5P", 1.0, 14.0), np.array([0.2361, 0.0810, 1.2100])), (("2.5P", 1.0, 16.0), np.array([0.2331, 0.0696, 1.2100])), (("2.5P", 1.0, 18.0), np.array([0.2312, 0.0618, 1.2100])), (("2.5P", 1.0, 20.0), np.array([0.2295, 0.0542, 1.2100])), (("2.5P", 1.0, 22.0), np.array([0.2279, 0.0473, 1.2100])), (("2.5P", 1.0, 24.0), np.array([0.2266, 0.0418, 1.2100])), (("2.5P", 1.0, 26.0), np.array([0.2251, 0.0355, 1.2100])), (("5P", 1.0, 2.0), np.array([0.2936, 0.2330, 1.2100])), (("5P", 1.0, 4.0), np.array([0.2854, 0.1927, 1.2100])), (("5P", 1.0, 6.0), np.array([0.2794, 0.1628, 1.2100])), (("5P", 1.0, 8.0), np.array([0.2742, 0.1375, 1.2100])), (("5P", 1.0, 10.0), np.array([0.2701, 0.1178, 1.2100])), (("5P", 1.0, 12.0), np.array([0.2670, 0.1006, 1.2100])), (("5P", 1.0, 14.0), np.array([0.2645, 0.0863, 1.2100])), (("5P", 1.0, 16.0), np.array([0.2625, 0.0746, 1.2100])), (("5P", 1.0, 18.0), np.array([0.2612, 0.0667, 1.2100])), (("5P", 1.0, 20.0), np.array([0.2601, 0.0586, 1.2100])), (("5P", 1.0, 22.0), np.array([0.2590, 0.0509, 1.2100])), (("7.5P", 1.0, 2.0), np.array([0.3030, 0.2361, 1.2100])), (("7.5P", 1.0, 4.0), np.array([0.2991, 0.1974, 1.2100])), (("7.5P", 1.0, 6.0), np.array([0.2960, 0.1682, 1.2100])), (("7.5P", 1.0, 8.0), np.array([0.2932, 0.1429, 1.2100])), (("7.5P", 1.0, 10.0), np.array([0.2905, 0.1229, 1.2100])), (("7.5P", 1.0, 12.0), np.array([0.2884, 0.1059, 1.2100])), (("7.5P", 1.0, 14.0), np.array([0.2868, 0.0903, 1.2100])), (("7.5P", 1.0, 16.0), np.array([0.2852, 0.0790, 1.2100])), (("7.5P", 1.0, 18.0), np.array([0.2841, 0.0706, 1.2100])), (("7.5P", 1.0, 20.0), np.array([0.2831, 0.0625, 1.2100])), (("10P", 1.0, 2.0), np.array([0.3132, 0.2404, 1.2100])), (("10P", 1.0, 4.0), np.array([0.3132, 0.2032, 1.2100])), (("10P", 1.0, 6.0), np.array([0.3126, 0.1737, 1.2100])), (("10P", 1.0, 8.0), np.array([0.3114, 0.1481, 1.2100])), (("10P", 1.0, 10.0), np.array([0.3102, 0.1282, 1.2100])), (("10P", 1.0, 12.0), np.array([0.3094, 0.1110, 1.2100])), (("10P", 1.0, 14.0), np.array([0.3084, 0.0952, 1.2100])), (("10P", 1.0, 16.0), np.array([0.3078, 0.0839, 1.2100])), (("10P", 1.0, 18.0), np.array([0.3069, 0.0748, 1.2100])), (("2.5RP", 1.0, 2.0), np.array([0.3240, 0.2459, 1.2100])), (("2.5RP", 1.0, 4.0), np.array([0.3290, 0.2095, 1.2100])), (("2.5RP", 1.0, 6.0), np.array([0.3321, 0.1811, 1.2100])), (("2.5RP", 1.0, 8.0), np.array([0.3342, 0.1551, 1.2100])), (("2.5RP", 1.0, 10.0), np.array([0.3354, 0.1351, 1.2100])), (("2.5RP", 1.0, 12.0), np.array([0.3361, 0.1181, 1.2100])), (("2.5RP", 1.0, 14.0), np.array([0.3368, 0.1020, 1.2100])), (("2.5RP", 1.0, 16.0), np.array([0.3368, 0.0902, 1.2100])), (("5RP", 1.0, 2.0), np.array([0.3378, 0.2542, 1.2100])), (("5RP", 1.0, 4.0), np.array([0.3503, 0.2196, 1.2100])), (("5RP", 1.0, 6.0), np.array([0.3588, 0.1920, 1.2100])), (("5RP", 1.0, 8.0), np.array([0.3660, 0.1662, 1.2100])), (("5RP", 1.0, 10.0), np.array([0.3727, 0.1458, 1.2100])), (("5RP", 1.0, 12.0), np.array([0.3772, 0.1283, 1.2100])), (("5RP", 1.0, 14.0), np.array([0.3811, 0.1138, 1.2100])), (("7.5RP", 1.0, 2.0), np.array([0.3498, 0.2617, 1.2100])), (("7.5RP", 1.0, 4.0), np.array([0.3705, 0.2300, 1.2100])), (("7.5RP", 1.0, 6.0), np.array([0.3865, 0.2036, 1.2100])), (("7.5RP", 1.0, 8.0), np.array([0.4005, 0.1793, 1.2100])), (("7.5RP", 1.0, 10.0), np.array([0.4132, 0.1580, 1.2100])), (("7.5RP", 1.0, 12.0), np.array([0.4240, 0.1400, 1.2100])), (("10RP", 2.0, 2.0), np.array([0.3532, 0.2957, 3.1260])), (("10RP", 2.0, 4.0), np.array([0.3850, 0.2778, 3.1260])), (("10RP", 2.0, 6.0), np.array([0.4139, 0.2608, 3.1260])), (("10RP", 2.0, 8.0), np.array([0.4428, 0.2419, 3.1260])), (("10RP", 2.0, 10.0), np.array([0.4678, 0.2237, 3.1260])), (("10RP", 2.0, 12.0), np.array([0.4911, 0.2060, 3.1260])), (("10RP", 2.0, 14.0), np.array([0.5129, 0.1888, 3.1260])), (("2.5R", 2.0, 2.0), np.array([0.3614, 0.3033, 3.1260])), (("2.5R", 2.0, 4.0), np.array([0.4021, 0.2900, 3.1260])), (("2.5R", 2.0, 6.0), np.array([0.4390, 0.2760, 3.1260])), (("2.5R", 2.0, 8.0), np.array([0.4776, 0.2593, 3.1260])), (("2.5R", 2.0, 10.0), np.array([0.5122, 0.2428, 3.1260])), (("2.5R", 2.0, 12.0), np.array([0.5438, 0.2254, 3.1260])), (("2.5R", 2.0, 14.0), np.array([0.5734, 0.2083, 3.1260])), (("5R", 2.0, 2.0), np.array([0.3692, 0.3111, 3.1260])), (("5R", 2.0, 4.0), np.array([0.4184, 0.3032, 3.1260])), (("5R", 2.0, 6.0), np.array([0.4642, 0.2934, 3.1260])), (("5R", 2.0, 8.0), np.array([0.5143, 0.2800, 3.1260])), (("5R", 2.0, 10.0), np.array([0.5557, 0.2633, 3.1260])), (("5R", 2.0, 12.0), np.array([0.5930, 0.2465, 3.1260])), (("5R", 2.0, 14.0), np.array([0.6302, 0.2287, 3.1260])), (("7.5R", 2.0, 2.0), np.array([0.3751, 0.3181, 3.1260])), (("7.5R", 2.0, 4.0), np.array([0.4335, 0.3169, 3.1260])), (("7.5R", 2.0, 6.0), np.array([0.4875, 0.3123, 3.1260])), (("7.5R", 2.0, 8.0), np.array([0.5433, 0.3027, 3.1260])), (("7.5R", 2.0, 10.0), np.array([0.5952, 0.2874, 3.1260])), (("7.5R", 2.0, 12.0), np.array([0.6392, 0.2704, 3.1260])), (("7.5R", 2.0, 14.0), np.array([0.6791, 0.2520, 3.1260])), (("10R", 2.0, 2.0), np.array([0.3811, 0.3274, 3.1260])), (("10R", 2.0, 4.0), np.array([0.4481, 0.3330, 3.1260])), (("10R", 2.0, 6.0), np.array([0.5095, 0.3331, 3.1260])), (("10R", 2.0, 8.0), np.array([0.5713, 0.3259, 3.1260])), (("10R", 2.0, 10.0), np.array([0.6247, 0.3120, 3.1260])), (("10R", 2.0, 12.0), np.array([0.6732, 0.2937, 3.1260])), (("10R", 2.0, 14.0), np.array([0.7165, 0.2734, 3.1260])), (("2.5YR", 2.0, 2.0), np.array([0.3852, 0.3365, 3.1260])), (("2.5YR", 2.0, 4.0), np.array([0.4598, 0.3508, 3.1260])), (("2.5YR", 2.0, 6.0), np.array([0.5280, 0.3581, 3.1260])), (("2.5YR", 2.0, 8.0), np.array([0.5995, 0.3590, 3.1260])), (("5YR", 2.0, 2.0), np.array([0.3880, 0.3476, 3.1260])), (("5YR", 2.0, 4.0), np.array([0.4674, 0.3738, 3.1260])), (("5YR", 2.0, 6.0), np.array([0.5426, 0.3925, 3.1260])), (("7.5YR", 2.0, 2.0), np.array([0.3889, 0.3590, 3.1260])), (("7.5YR", 2.0, 4.0), np.array([0.4690, 0.3964, 3.1260])), (("7.5YR", 2.0, 6.0), np.array([0.5475, 0.4271, 3.1260])), (("10YR", 2.0, 2.0), np.array([0.3872, 0.3688, 3.1260])), (("10YR", 2.0, 4.0), np.array([0.4676, 0.4168, 3.1260])), (("2.5Y", 2.0, 2.0), np.array([0.3825, 0.3785, 3.1260])), (("2.5Y", 2.0, 4.0), np.array([0.4627, 0.4392, 3.1260])), (("5Y", 2.0, 2.0), np.array([0.3757, 0.3839, 3.1260])), (("5Y", 2.0, 4.0), np.array([0.4543, 0.4573, 3.1260])), (("7.5Y", 2.0, 2.0), np.array([0.3660, 0.3858, 3.1260])), (("7.5Y", 2.0, 4.0), np.array([0.4401, 0.4723, 3.1260])), (("10Y", 2.0, 2.0), np.array([0.3556, 0.3848, 3.1260])), (("10Y", 2.0, 4.0), np.array([0.4188, 0.4789, 3.1260])), (("2.5GY", 2.0, 2.0), np.array([0.3421, 0.3803, 3.1260])), (("2.5GY", 2.0, 4.0), np.array([0.3881, 0.4752, 3.1260])), (("5GY", 2.0, 2.0), np.array([0.3309, 0.3743, 3.1260])), (("5GY", 2.0, 4.0), np.array([0.3582, 0.4650, 3.1260])), (("5GY", 2.0, 6.0), np.array([0.3839, 0.5748, 3.1260])), (("7.5GY", 2.0, 2.0), np.array([0.3165, 0.3650, 3.1260])), (("7.5GY", 2.0, 4.0), np.array([0.3248, 0.4457, 3.1260])), (("7.5GY", 2.0, 6.0), np.array([0.3260, 0.5379, 3.1260])), (("7.5GY", 2.0, 8.0), np.array([0.3160, 0.6509, 3.1260])), (("10GY", 2.0, 2.0), np.array([0.3069, 0.3580, 3.1260])), (("10GY", 2.0, 4.0), np.array([0.2986, 0.4240, 3.1260])), (("10GY", 2.0, 6.0), np.array([0.2852, 0.4972, 3.1260])), (("10GY", 2.0, 8.0), np.array([0.2628, 0.5837, 3.1260])), (("10GY", 2.0, 10.0), np.array([0.2307, 0.6814, 3.1260])), (("10GY", 2.0, 12.0), np.array([0.1907, 0.7798, 3.1260])), (("2.5G", 2.0, 2.0), np.array([0.2978, 0.3507, 3.1260])), (("2.5G", 2.0, 4.0), np.array([0.2763, 0.3998, 3.1260])), (("2.5G", 2.0, 6.0), np.array([0.2493, 0.4522, 3.1260])), (("2.5G", 2.0, 8.0), np.array([0.2192, 0.5042, 3.1260])), (("2.5G", 2.0, 10.0), np.array([0.1773, 0.5698, 3.1260])), (("2.5G", 2.0, 12.0), np.array([0.1307, 0.6308, 3.1260])), (("2.5G", 2.0, 14.0), np.array([0.0820, 0.6860, 3.1260])), (("2.5G", 2.0, 16.0), np.array([0.0329, 0.7358, 3.1260])), (("5G", 2.0, 2.0), np.array([0.2918, 0.3450, 3.1260])), (("5G", 2.0, 4.0), np.array([0.2640, 0.3845, 3.1260])), (("5G", 2.0, 6.0), np.array([0.2318, 0.4231, 3.1260])), (("5G", 2.0, 8.0), np.array([0.1979, 0.4583, 3.1260])), (("5G", 2.0, 10.0), np.array([0.1560, 0.4981, 3.1260])), (("5G", 2.0, 12.0), np.array([0.1120, 0.5358, 3.1260])), (("5G", 2.0, 14.0), np.array([0.0688, 0.5691, 3.1260])), (("5G", 2.0, 16.0), np.array([0.0277, 0.5986, 3.1260])), (("7.5G", 2.0, 2.0), np.array([0.2869, 0.3400, 3.1260])), (("7.5G", 2.0, 4.0), np.array([0.2540, 0.3705, 3.1260])), (("7.5G", 2.0, 6.0), np.array([0.2200, 0.3983, 3.1260])), (("7.5G", 2.0, 8.0), np.array([0.1842, 0.4244, 3.1260])), (("7.5G", 2.0, 10.0), np.array([0.1442, 0.4505, 3.1260])), (("7.5G", 2.0, 12.0), np.array([0.1022, 0.4759, 3.1260])), (("7.5G", 2.0, 14.0), np.array([0.0629, 0.4973, 3.1260])), (("7.5G", 2.0, 16.0), np.array([0.0276, 0.5153, 3.1260])), (("10G", 2.0, 2.0), np.array([0.2820, 0.3341, 3.1260])), (("10G", 2.0, 4.0), np.array([0.2442, 0.3559, 3.1260])), (("10G", 2.0, 6.0), np.array([0.2092, 0.3739, 3.1260])), (("10G", 2.0, 8.0), np.array([0.1705, 0.3911, 3.1260])), (("10G", 2.0, 10.0), np.array([0.1321, 0.4059, 3.1260])), (("10G", 2.0, 12.0), np.array([0.0934, 0.4183, 3.1260])), (("10G", 2.0, 14.0), np.array([0.0599, 0.4270, 3.1260])), (("10G", 2.0, 16.0), np.array([0.0285, 0.4327, 3.1260])), (("2.5BG", 2.0, 2.0), np.array([0.2765, 0.3271, 3.1260])), (("2.5BG", 2.0, 4.0), np.array([0.2343, 0.3378, 3.1260])), (("2.5BG", 2.0, 6.0), np.array([0.1971, 0.3452, 3.1260])), (("2.5BG", 2.0, 8.0), np.array([0.1557, 0.3517, 3.1260])), (("2.5BG", 2.0, 10.0), np.array([0.1190, 0.3551, 3.1260])), (("2.5BG", 2.0, 12.0), np.array([0.0851, 0.3576, 3.1260])), (("2.5BG", 2.0, 14.0), np.array([0.0555, 0.3588, 3.1260])), (("5BG", 2.0, 2.0), np.array([0.2697, 0.3175, 3.1260])), (("5BG", 2.0, 4.0), np.array([0.2234, 0.3150, 3.1260])), (("5BG", 2.0, 6.0), np.array([0.1843, 0.3110, 3.1260])), (("5BG", 2.0, 8.0), np.array([0.1405, 0.3037, 3.1260])), (("5BG", 2.0, 10.0), np.array([0.1050, 0.2956, 3.1260])), (("5BG", 2.0, 12.0), np.array([0.0769, 0.2880, 3.1260])), (("7.5BG", 2.0, 2.0), np.array([0.2651, 0.3098, 3.1260])), (("7.5BG", 2.0, 4.0), np.array([0.2162, 0.2981, 3.1260])), (("7.5BG", 2.0, 6.0), np.array([0.1747, 0.2853, 3.1260])), (("7.5BG", 2.0, 8.0), np.array([0.1325, 0.2710, 3.1260])), (("7.5BG", 2.0, 10.0), np.array([0.0991, 0.2582, 3.1260])), (("7.5BG", 2.0, 12.0), np.array([0.0724, 0.2478, 3.1260])), (("10BG", 2.0, 2.0), np.array([0.2606, 0.3010, 3.1260])), (("10BG", 2.0, 4.0), np.array([0.2096, 0.2790, 3.1260])), (("10BG", 2.0, 6.0), np.array([0.1669, 0.2570, 3.1260])), (("10BG", 2.0, 8.0), np.array([0.1258, 0.2331, 3.1260])), (("10BG", 2.0, 10.0), np.array([0.0929, 0.2133, 3.1260])), (("2.5B", 2.0, 2.0), np.array([0.2578, 0.2940, 3.1260])), (("2.5B", 2.0, 4.0), np.array([0.2060, 0.2649, 3.1260])), (("2.5B", 2.0, 6.0), np.array([0.1621, 0.2358, 3.1260])), (("2.5B", 2.0, 8.0), np.array([0.1230, 0.2076, 3.1260])), (("2.5B", 2.0, 10.0), np.array([0.0911, 0.1828, 3.1260])), (("5B", 2.0, 2.0), np.array([0.2559, 0.2874, 3.1260])), (("5B", 2.0, 4.0), np.array([0.2048, 0.2518, 3.1260])), (("5B", 2.0, 6.0), np.array([0.1617, 0.2162, 3.1260])), (("5B", 2.0, 8.0), np.array([0.1245, 0.1827, 3.1260])), (("5B", 2.0, 10.0), np.array([0.0965, 0.1558, 3.1260])), (("7.5B", 2.0, 2.0), np.array([0.2545, 0.2799, 3.1260])), (("7.5B", 2.0, 4.0), np.array([0.2063, 0.2400, 3.1260])), (("7.5B", 2.0, 6.0), np.array([0.1658, 0.2026, 3.1260])), (("7.5B", 2.0, 8.0), np.array([0.1313, 0.1692, 3.1260])), (("7.5B", 2.0, 10.0), np.array([0.1051, 0.1422, 3.1260])), (("10B", 2.0, 2.0), np.array([0.2558, 0.2725, 3.1260])), (("10B", 2.0, 4.0), np.array([0.2102, 0.2313, 3.1260])), (("10B", 2.0, 6.0), np.array([0.1716, 0.1937, 3.1260])), (("10B", 2.0, 8.0), np.array([0.1396, 0.1603, 3.1260])), (("10B", 2.0, 10.0), np.array([0.1157, 0.1346, 3.1260])), (("2.5PB", 2.0, 2.0), np.array([0.2592, 0.2675, 3.1260])), (("2.5PB", 2.0, 4.0), np.array([0.2175, 0.2245, 3.1260])), (("2.5PB", 2.0, 6.0), np.array([0.1825, 0.1857, 3.1260])), (("2.5PB", 2.0, 8.0), np.array([0.1540, 0.1530, 3.1260])), (("2.5PB", 2.0, 10.0), np.array([0.1332, 0.1278, 3.1260])), (("2.5PB", 2.0, 12.0), np.array([0.1166, 0.1076, 3.1260])), (("5PB", 2.0, 2.0), np.array([0.2638, 0.2624, 3.1260])), (("5PB", 2.0, 4.0), np.array([0.2263, 0.2192, 3.1260])), (("5PB", 2.0, 6.0), np.array([0.1942, 0.1811, 3.1260])), (("5PB", 2.0, 8.0), np.array([0.1685, 0.1491, 3.1260])), (("5PB", 2.0, 10.0), np.array([0.1500, 0.1240, 3.1260])), (("5PB", 2.0, 12.0), np.array([0.1363, 0.1048, 3.1260])), (("5PB", 2.0, 14.0), np.array([0.1253, 0.0873, 3.1260])), (("7.5PB", 2.0, 2.0), np.array([0.2712, 0.2582, 3.1260])), (("7.5PB", 2.0, 4.0), np.array([0.2420, 0.2148, 3.1260])), (("7.5PB", 2.0, 6.0), np.array([0.2189, 0.1790, 3.1260])), (("7.5PB", 2.0, 8.0), np.array([0.2005, 0.1495, 3.1260])), (("7.5PB", 2.0, 10.0), np.array([0.1882, 0.1258, 3.1260])), (("7.5PB", 2.0, 12.0), np.array([0.1813, 0.1094, 3.1260])), (("7.5PB", 2.0, 14.0), np.array([0.1762, 0.0955, 3.1260])), (("7.5PB", 2.0, 16.0), np.array([0.1728, 0.0839, 3.1260])), (("7.5PB", 2.0, 18.0), np.array([0.1701, 0.0742, 3.1260])), (("7.5PB", 2.0, 20.0), np.array([0.1685, 0.0666, 3.1260])), (("7.5PB", 2.0, 22.0), np.array([0.1670, 0.0594, 3.1260])), (("7.5PB", 2.0, 24.0), np.array([0.1660, 0.0538, 3.1260])), (("7.5PB", 2.0, 26.0), np.array([0.1653, 0.0492, 3.1260])), (("7.5PB", 2.0, 28.0), np.array([0.1647, 0.0451, 3.1260])), (("7.5PB", 2.0, 30.0), np.array([0.1640, 0.0409, 3.1260])), (("7.5PB", 2.0, 32.0), np.array([0.1635, 0.0373, 3.1260])), (("7.5PB", 2.0, 34.0), np.array([0.1630, 0.0340, 3.1260])), (("7.5PB", 2.0, 36.0), np.array([0.1628, 0.0310, 3.1260])), (("7.5PB", 2.0, 38.0), np.array([0.1623, 0.0280, 3.1260])), (("10PB", 2.0, 2.0), np.array([0.2803, 0.2567, 3.1260])), (("10PB", 2.0, 4.0), np.array([0.2600, 0.2162, 3.1260])), (("10PB", 2.0, 6.0), np.array([0.2440, 0.1840, 3.1260])), (("10PB", 2.0, 8.0), np.array([0.2294, 0.1551, 3.1260])), (("10PB", 2.0, 10.0), np.array([0.2200, 0.1330, 3.1260])), (("10PB", 2.0, 12.0), np.array([0.2139, 0.1170, 3.1260])), (("10PB", 2.0, 14.0), np.array([0.2087, 0.1026, 3.1260])), (("10PB", 2.0, 16.0), np.array([0.2052, 0.0910, 3.1260])), (("10PB", 2.0, 18.0), np.array([0.2021, 0.0808, 3.1260])), (("10PB", 2.0, 20.0), np.array([0.1998, 0.0718, 3.1260])), (("10PB", 2.0, 22.0), np.array([0.1978, 0.0643, 3.1260])), (("10PB", 2.0, 24.0), np.array([0.1962, 0.0578, 3.1260])), (("10PB", 2.0, 26.0), np.array([0.1949, 0.0520, 3.1260])), (("10PB", 2.0, 28.0), np.array([0.1937, 0.0471, 3.1260])), (("10PB", 2.0, 30.0), np.array([0.1925, 0.0420, 3.1260])), (("10PB", 2.0, 32.0), np.array([0.1918, 0.0379, 3.1260])), (("10PB", 2.0, 34.0), np.array([0.1911, 0.0344, 3.1260])), (("2.5P", 2.0, 2.0), np.array([0.2892, 0.2583, 3.1260])), (("2.5P", 2.0, 4.0), np.array([0.2758, 0.2208, 3.1260])), (("2.5P", 2.0, 6.0), np.array([0.2661, 0.1921, 3.1260])), (("2.5P", 2.0, 8.0), np.array([0.2570, 0.1635, 3.1260])), (("2.5P", 2.0, 10.0), np.array([0.2501, 0.1422, 3.1260])), (("2.5P", 2.0, 12.0), np.array([0.2449, 0.1245, 3.1260])), (("2.5P", 2.0, 14.0), np.array([0.2406, 0.1100, 3.1260])), (("2.5P", 2.0, 16.0), np.array([0.2372, 0.0980, 3.1260])), (("2.5P", 2.0, 18.0), np.array([0.2345, 0.0873, 3.1260])), (("2.5P", 2.0, 20.0), np.array([0.2320, 0.0779, 3.1260])), (("2.5P", 2.0, 22.0), np.array([0.2298, 0.0696, 3.1260])), (("2.5P", 2.0, 24.0), np.array([0.2277, 0.0621, 3.1260])), (("2.5P", 2.0, 26.0), np.array([0.2260, 0.0555, 3.1260])), (("2.5P", 2.0, 28.0), np.array([0.2245, 0.0491, 3.1260])), (("2.5P", 2.0, 30.0), np.array([0.2231, 0.0432, 3.1260])), (("5P", 2.0, 2.0), np.array([0.2984, 0.2612, 3.1260])), (("5P", 2.0, 4.0), np.array([0.2908, 0.2261, 3.1260])), (("5P", 2.0, 6.0), np.array([0.2850, 0.1992, 3.1260])), (("5P", 2.0, 8.0), np.array([0.2791, 0.1707, 3.1260])), (("5P", 2.0, 10.0), np.array([0.2748, 0.1500, 3.1260])), (("5P", 2.0, 12.0), np.array([0.2709, 0.1320, 3.1260])), (("5P", 2.0, 14.0), np.array([0.2676, 0.1163, 3.1260])), (("5P", 2.0, 16.0), np.array([0.2652, 0.1045, 3.1260])), (("5P", 2.0, 18.0), np.array([0.2632, 0.0935, 3.1260])), (("5P", 2.0, 20.0), np.array([0.2612, 0.0838, 3.1260])), (("5P", 2.0, 22.0), np.array([0.2597, 0.0750, 3.1260])), (("5P", 2.0, 24.0), np.array([0.2582, 0.0669, 3.1260])), (("5P", 2.0, 26.0), np.array([0.2569, 0.0594, 3.1260])), (("5P", 2.0, 28.0), np.array([0.2559, 0.0525, 3.1260])), (("7.5P", 2.0, 2.0), np.array([0.3071, 0.2647, 3.1260])), (("7.5P", 2.0, 4.0), np.array([0.3048, 0.2321, 3.1260])), (("7.5P", 2.0, 6.0), np.array([0.3025, 0.2058, 3.1260])), (("7.5P", 2.0, 8.0), np.array([0.3000, 0.1781, 3.1260])), (("7.5P", 2.0, 10.0), np.array([0.2979, 0.1569, 3.1260])), (("7.5P", 2.0, 12.0), np.array([0.2956, 0.1392, 3.1260])), (("7.5P", 2.0, 14.0), np.array([0.2938, 0.1235, 3.1260])), (("7.5P", 2.0, 16.0), np.array([0.2922, 0.1106, 3.1260])), (("7.5P", 2.0, 18.0), np.array([0.2912, 0.0995, 3.1260])), (("7.5P", 2.0, 20.0), np.array([0.2902, 0.0901, 3.1260])), (("7.5P", 2.0, 22.0), np.array([0.2890, 0.0799, 3.1260])), (("7.5P", 2.0, 24.0), np.array([0.2882, 0.0719, 3.1260])), (("10P", 2.0, 2.0), np.array([0.3161, 0.2691, 3.1260])), (("10P", 2.0, 4.0), np.array([0.3189, 0.2390, 3.1260])), (("10P", 2.0, 6.0), np.array([0.3207, 0.2132, 3.1260])), (("10P", 2.0, 8.0), np.array([0.3219, 0.1862, 3.1260])), (("10P", 2.0, 10.0), np.array([0.3230, 0.1659, 3.1260])), (("10P", 2.0, 12.0), np.array([0.3233, 0.1477, 3.1260])), (("10P", 2.0, 14.0), np.array([0.3235, 0.1317, 3.1260])), (("10P", 2.0, 16.0), np.array([0.3235, 0.1181, 3.1260])), (("10P", 2.0, 18.0), np.array([0.3233, 0.1063, 3.1260])), (("10P", 2.0, 20.0), np.array([0.3231, 0.0962, 3.1260])), (("10P", 2.0, 22.0), np.array([0.3230, 0.0861, 3.1260])), (("2.5RP", 2.0, 2.0), np.array([0.3279, 0.2754, 3.1260])), (("2.5RP", 2.0, 4.0), np.array([0.3382, 0.2496, 3.1260])), (("2.5RP", 2.0, 6.0), np.array([0.3470, 0.2259, 3.1260])), (("2.5RP", 2.0, 8.0), np.array([0.3555, 0.2003, 3.1260])), (("2.5RP", 2.0, 10.0), np.array([0.3617, 0.1800, 3.1260])), (("2.5RP", 2.0, 12.0), np.array([0.3668, 0.1618, 3.1260])), (("2.5RP", 2.0, 14.0), np.array([0.3711, 0.1449, 3.1260])), (("2.5RP", 2.0, 16.0), np.array([0.3748, 0.1310, 3.1260])), (("2.5RP", 2.0, 18.0), np.array([0.3778, 0.1188, 3.1260])), (("2.5RP", 2.0, 20.0), np.array([0.3802, 0.1080, 3.1260])), (("5RP", 2.0, 2.0), np.array([0.3383, 0.2829, 3.1260])), (("5RP", 2.0, 4.0), np.array([0.3558, 0.2597, 3.1260])), (("5RP", 2.0, 6.0), np.array([0.3708, 0.2380, 3.1260])), (("5RP", 2.0, 8.0), np.array([0.3858, 0.2140, 3.1260])), (("5RP", 2.0, 10.0), np.array([0.3971, 0.1939, 3.1260])), (("5RP", 2.0, 12.0), np.array([0.4080, 0.1764, 3.1260])), (("5RP", 2.0, 14.0), np.array([0.4180, 0.1598, 3.1260])), (("5RP", 2.0, 16.0), np.array([0.4269, 0.1454, 3.1260])), (("5RP", 2.0, 18.0), np.array([0.4338, 0.1340, 3.1260])), (("7.5RP", 2.0, 2.0), np.array([0.3459, 0.2892, 3.1260])), (("7.5RP", 2.0, 4.0), np.array([0.3702, 0.2683, 3.1260])), (("7.5RP", 2.0, 6.0), np.array([0.3918, 0.2490, 3.1260])), (("7.5RP", 2.0, 8.0), np.array([0.4137, 0.2276, 3.1260])), (("7.5RP", 2.0, 10.0), np.array([0.4321, 0.2082, 3.1260])), (("7.5RP", 2.0, 12.0), np.array([0.4481, 0.1903, 3.1260])), (("7.5RP", 2.0, 14.0), np.array([0.4624, 0.1737, 3.1260])), (("7.5RP", 2.0, 16.0), np.array([0.4744, 0.1595, 3.1260])), (("10RP", 3.0, 2.0), np.array([0.3526, 0.3068, 6.5550])), (("10RP", 3.0, 4.0), np.array([0.3889, 0.2969, 6.5550])), (("10RP", 3.0, 6.0), np.array([0.4218, 0.2864, 6.5550])), (("10RP", 3.0, 8.0), np.array([0.4552, 0.2741, 6.5550])), (("10RP", 3.0, 10.0), np.array([0.4851, 0.2618, 6.5550])), (("10RP", 3.0, 12.0), np.array([0.5139, 0.2489, 6.5550])), (("10RP", 3.0, 14.0), np.array([0.5380, 0.2369, 6.5550])), (("10RP", 3.0, 16.0), np.array([0.5628, 0.2241, 6.5550])), (("2.5R", 3.0, 2.0), np.array([0.3591, 0.3130, 6.5550])), (("2.5R", 3.0, 4.0), np.array([0.4021, 0.3076, 6.5550])), (("2.5R", 3.0, 6.0), np.array([0.4409, 0.3009, 6.5550])), (("2.5R", 3.0, 8.0), np.array([0.4821, 0.2918, 6.5550])), (("2.5R", 3.0, 10.0), np.array([0.5191, 0.2811, 6.5550])), (("2.5R", 3.0, 12.0), np.array([0.5536, 0.2691, 6.5550])), (("2.5R", 3.0, 14.0), np.array([0.5828, 0.2579, 6.5550])), (("2.5R", 3.0, 16.0), np.array([0.6116, 0.2456, 6.5550])), (("5R", 3.0, 2.0), np.array([0.3645, 0.3190, 6.5550])), (("5R", 3.0, 4.0), np.array([0.4148, 0.3190, 6.5550])), (("5R", 3.0, 6.0), np.array([0.4592, 0.3168, 6.5550])), (("5R", 3.0, 8.0), np.array([0.5064, 0.3114, 6.5550])), (("5R", 3.0, 10.0), np.array([0.5500, 0.3024, 6.5550])), (("5R", 3.0, 12.0), np.array([0.5884, 0.2904, 6.5550])), (("5R", 3.0, 14.0), np.array([0.6204, 0.2789, 6.5550])), (("5R", 3.0, 16.0), np.array([0.6520, 0.2660, 6.5550])), (("7.5R", 3.0, 2.0), np.array([0.3690, 0.3248, 6.5550])), (("7.5R", 3.0, 4.0), np.array([0.4240, 0.3302, 6.5550])), (("7.5R", 3.0, 6.0), np.array([0.4738, 0.3316, 6.5550])), (("7.5R", 3.0, 8.0), np.array([0.5251, 0.3297, 6.5550])), (("7.5R", 3.0, 10.0), np.array([0.5730, 0.3240, 6.5550])), (("7.5R", 3.0, 12.0), np.array([0.6158, 0.3129, 6.5550])), (("7.5R", 3.0, 14.0), np.array([0.6492, 0.3012, 6.5550])), (("7.5R", 3.0, 16.0), np.array([0.6817, 0.2872, 6.5550])), (("10R", 3.0, 2.0), np.array([0.3728, 0.3314, 6.5550])), (("10R", 3.0, 4.0), np.array([0.4308, 0.3412, 6.5550])), (("10R", 3.0, 6.0), np.array([0.4854, 0.3467, 6.5550])), (("10R", 3.0, 8.0), np.array([0.5393, 0.3477, 6.5550])), (("10R", 3.0, 10.0), np.array([0.5871, 0.3440, 6.5550])), (("10R", 3.0, 12.0), np.array([0.6322, 0.3361, 6.5550])), (("10R", 3.0, 14.0), np.array([0.6703, 0.3249, 6.5550])), (("2.5YR", 3.0, 2.0), np.array([0.3757, 0.3391, 6.5550])), (("2.5YR", 3.0, 4.0), np.array([0.4360, 0.3563, 6.5550])), (("2.5YR", 3.0, 6.0), np.array([0.4954, 0.3692, 6.5550])), (("2.5YR", 3.0, 8.0), np.array([0.5475, 0.3771, 6.5550])), (("2.5YR", 3.0, 10.0), np.array([0.5941, 0.3818, 6.5550])), (("5YR", 3.0, 2.0), np.array([0.3771, 0.3476, 6.5550])), (("5YR", 3.0, 4.0), np.array([0.4376, 0.3715, 6.5550])), (("5YR", 3.0, 6.0), np.array([0.4966, 0.3908, 6.5550])), (("5YR", 3.0, 8.0), np.array([0.5456, 0.4040, 6.5550])), (("7.5YR", 3.0, 2.0), np.array([0.3771, 0.3549, 6.5550])), (("7.5YR", 3.0, 4.0), np.array([0.4378, 0.3865, 6.5550])), (("7.5YR", 3.0, 6.0), np.array([0.4930, 0.4116, 6.5550])), (("7.5YR", 3.0, 8.0), np.array([0.5390, 0.4306, 6.5550])), (("10YR", 3.0, 2.0), np.array([0.3747, 0.3630, 6.5550])), (("10YR", 3.0, 4.0), np.array([0.4341, 0.4018, 6.5550])), (("10YR", 3.0, 6.0), np.array([0.4872, 0.4326, 6.5550])), (("10YR", 3.0, 8.0), np.array([0.5305, 0.4559, 6.5550])), (("2.5Y", 3.0, 2.0), np.array([0.3703, 0.3700, 6.5550])), (("2.5Y", 3.0, 4.0), np.array([0.4277, 0.4166, 6.5550])), (("2.5Y", 3.0, 6.0), np.array([0.4784, 0.4531, 6.5550])), (("5Y", 3.0, 2.0), np.array([0.3646, 0.3748, 6.5550])), (("5Y", 3.0, 4.0), np.array([0.4191, 0.4283, 6.5550])), (("5Y", 3.0, 6.0), np.array([0.4670, 0.4711, 6.5550])), (("7.5Y", 3.0, 2.0), np.array([0.3589, 0.3778, 6.5550])), (("7.5Y", 3.0, 4.0), np.array([0.4086, 0.4379, 6.5550])), (("7.5Y", 3.0, 6.0), np.array([0.4526, 0.4889, 6.5550])), (("10Y", 3.0, 2.0), np.array([0.3513, 0.3789, 6.5550])), (("10Y", 3.0, 4.0), np.array([0.3961, 0.4452, 6.5550])), (("10Y", 3.0, 6.0), np.array([0.4345, 0.5026, 6.5550])), (("2.5GY", 3.0, 2.0), np.array([0.3412, 0.3768, 6.5550])), (("2.5GY", 3.0, 4.0), np.array([0.3772, 0.4484, 6.5550])), (("2.5GY", 3.0, 6.0), np.array([0.4069, 0.5110, 6.5550])), (("5GY", 3.0, 2.0), np.array([0.3319, 0.3729, 6.5550])), (("5GY", 3.0, 4.0), np.array([0.3554, 0.4429, 6.5550])), (("5GY", 3.0, 6.0), np.array([0.3750, 0.5109, 6.5550])), (("5GY", 3.0, 8.0), np.array([0.3924, 0.5832, 6.5550])), (("7.5GY", 3.0, 2.0), np.array([0.3180, 0.3644, 6.5550])), (("7.5GY", 3.0, 4.0), np.array([0.3270, 0.4288, 6.5550])), (("7.5GY", 3.0, 6.0), np.array([0.3333, 0.4967, 6.5550])), (("7.5GY", 3.0, 8.0), np.array([0.3341, 0.5700, 6.5550])), (("7.5GY", 3.0, 10.0), np.array([0.3266, 0.6448, 6.5550])), (("10GY", 3.0, 2.0), np.array([0.3088, 0.3578, 6.5550])), (("10GY", 3.0, 4.0), np.array([0.3053, 0.4123, 6.5550])), (("10GY", 3.0, 6.0), np.array([0.2992, 0.4717, 6.5550])), (("10GY", 3.0, 8.0), np.array([0.2887, 0.5361, 6.5550])), (("10GY", 3.0, 10.0), np.array([0.2724, 0.6026, 6.5550])), (("10GY", 3.0, 12.0), np.array([0.2531, 0.6700, 6.5550])), (("10GY", 3.0, 14.0), np.array([0.2283, 0.7423, 6.5550])), (("2.5G", 3.0, 2.0), np.array([0.2999, 0.3500, 6.5550])), (("2.5G", 3.0, 4.0), np.array([0.2836, 0.3915, 6.5550])), (("2.5G", 3.0, 6.0), np.array([0.2642, 0.4342, 6.5550])), (("2.5G", 3.0, 8.0), np.array([0.2435, 0.4752, 6.5550])), (("2.5G", 3.0, 10.0), np.array([0.2170, 0.5211, 6.5550])), (("2.5G", 3.0, 12.0), np.array([0.1902, 0.5642, 6.5550])), (("2.5G", 3.0, 14.0), np.array([0.1626, 0.6052, 6.5550])), (("2.5G", 3.0, 16.0), np.array([0.1341, 0.6420, 6.5550])), (("2.5G", 3.0, 18.0), np.array([0.1049, 0.6766, 6.5550])), (("2.5G", 3.0, 20.0), np.array([0.0720, 0.7127, 6.5550])), (("2.5G", 3.0, 22.0), np.array([0.0390, 0.7468, 6.5550])), (("5G", 3.0, 2.0), np.array([0.2935, 0.3439, 6.5550])), (("5G", 3.0, 4.0), np.array([0.2711, 0.3780, 6.5550])), (("5G", 3.0, 6.0), np.array([0.2471, 0.4100, 6.5550])), (("5G", 3.0, 8.0), np.array([0.2228, 0.4380, 6.5550])), (("5G", 3.0, 10.0), np.array([0.1935, 0.4682, 6.5550])), (("5G", 3.0, 12.0), np.array([0.1660, 0.4948, 6.5550])), (("5G", 3.0, 14.0), np.array([0.1382, 0.5197, 6.5550])), (("5G", 3.0, 16.0), np.array([0.1120, 0.5414, 6.5550])), (("5G", 3.0, 18.0), np.array([0.0882, 0.5605, 6.5550])), (("5G", 3.0, 20.0), np.array([0.0620, 0.5802, 6.5550])), (("5G", 3.0, 22.0), np.array([0.0340, 0.6011, 6.5550])), (("7.5G", 3.0, 2.0), np.array([0.2890, 0.3391, 6.5550])), (("7.5G", 3.0, 4.0), np.array([0.2618, 0.3667, 6.5550])), (("7.5G", 3.0, 6.0), np.array([0.2346, 0.3901, 6.5550])), (("7.5G", 3.0, 8.0), np.array([0.2088, 0.4101, 6.5550])), (("7.5G", 3.0, 10.0), np.array([0.1800, 0.4310, 6.5550])), (("7.5G", 3.0, 12.0), np.array([0.1516, 0.4505, 6.5550])), (("7.5G", 3.0, 14.0), np.array([0.1262, 0.4667, 6.5550])), (("7.5G", 3.0, 16.0), np.array([0.1023, 0.4818, 6.5550])), (("7.5G", 3.0, 18.0), np.array([0.0798, 0.4954, 6.5550])), (("7.5G", 3.0, 20.0), np.array([0.0568, 0.5082, 6.5550])), (("7.5G", 3.0, 22.0), np.array([0.0332, 0.5206, 6.5550])), (("10G", 3.0, 2.0), np.array([0.2844, 0.3337, 6.5550])), (("10G", 3.0, 4.0), np.array([0.2525, 0.3537, 6.5550])), (("10G", 3.0, 6.0), np.array([0.2240, 0.3699, 6.5550])), (("10G", 3.0, 8.0), np.array([0.1970, 0.3841, 6.5550])), (("10G", 3.0, 10.0), np.array([0.1688, 0.3974, 6.5550])), (("10G", 3.0, 12.0), np.array([0.1411, 0.4095, 6.5550])), (("10G", 3.0, 14.0), np.array([0.1161, 0.4192, 6.5550])), (("10G", 3.0, 16.0), np.array([0.0925, 0.4275, 6.5550])), (("10G", 3.0, 18.0), np.array([0.0718, 0.4340, 6.5550])), (("10G", 3.0, 20.0), np.array([0.0528, 0.4393, 6.5550])), (("10G", 3.0, 22.0), np.array([0.0333, 0.4444, 6.5550])), (("2.5BG", 3.0, 2.0), np.array([0.2799, 0.3271, 6.5550])), (("2.5BG", 3.0, 4.0), np.array([0.2437, 0.3386, 6.5550])), (("2.5BG", 3.0, 6.0), np.array([0.2132, 0.3468, 6.5550])), (("2.5BG", 3.0, 8.0), np.array([0.1845, 0.3531, 6.5550])), (("2.5BG", 3.0, 10.0), np.array([0.1552, 0.3580, 6.5550])), (("2.5BG", 3.0, 12.0), np.array([0.1288, 0.3620, 6.5550])), (("2.5BG", 3.0, 14.0), np.array([0.1051, 0.3648, 6.5550])), (("2.5BG", 3.0, 16.0), np.array([0.0843, 0.3667, 6.5550])), (("2.5BG", 3.0, 18.0), np.array([0.0648, 0.3682, 6.5550])), (("2.5BG", 3.0, 20.0), np.array([0.0482, 0.3695, 6.5550])), (("5BG", 3.0, 2.0), np.array([0.2742, 0.3192, 6.5550])), (("5BG", 3.0, 4.0), np.array([0.2343, 0.3200, 6.5550])), (("5BG", 3.0, 6.0), np.array([0.2020, 0.3188, 6.5550])), (("5BG", 3.0, 8.0), np.array([0.1703, 0.3159, 6.5550])), (("5BG", 3.0, 10.0), np.array([0.1410, 0.3118, 6.5550])), (("5BG", 3.0, 12.0), np.array([0.1158, 0.3071, 6.5550])), (("5BG", 3.0, 14.0), np.array([0.0940, 0.3027, 6.5550])), (("5BG", 3.0, 16.0), np.array([0.0735, 0.2979, 6.5550])), (("5BG", 3.0, 18.0), np.array([0.0580, 0.2940, 6.5550])), (("7.5BG", 3.0, 2.0), np.array([0.2699, 0.3120, 6.5550])), (("7.5BG", 3.0, 4.0), np.array([0.2272, 0.3041, 6.5550])), (("7.5BG", 3.0, 6.0), np.array([0.1928, 0.2958, 6.5550])), (("7.5BG", 3.0, 8.0), np.array([0.1620, 0.2872, 6.5550])), (("7.5BG", 3.0, 10.0), np.array([0.1326, 0.2784, 6.5550])), (("7.5BG", 3.0, 12.0), np.array([0.1086, 0.2706, 6.5550])), (("7.5BG", 3.0, 14.0), np.array([0.0874, 0.2627, 6.5550])), (("7.5BG", 3.0, 16.0), np.array([0.0691, 0.2559, 6.5550])), (("10BG", 3.0, 2.0), np.array([0.2660, 0.3050, 6.5550])), (("10BG", 3.0, 4.0), np.array([0.2221, 0.2886, 6.5550])), (("10BG", 3.0, 6.0), np.array([0.1861, 0.2722, 6.5550])), (("10BG", 3.0, 8.0), np.array([0.1551, 0.2571, 6.5550])), (("10BG", 3.0, 10.0), np.array([0.1250, 0.2411, 6.5550])), (("10BG", 3.0, 12.0), np.array([0.1018, 0.2281, 6.5550])), (("10BG", 3.0, 14.0), np.array([0.0798, 0.2151, 6.5550])), (("2.5B", 3.0, 2.0), np.array([0.2636, 0.2983, 6.5550])), (("2.5B", 3.0, 4.0), np.array([0.2183, 0.2748, 6.5550])), (("2.5B", 3.0, 6.0), np.array([0.1826, 0.2536, 6.5550])), (("2.5B", 3.0, 8.0), np.array([0.1511, 0.2331, 6.5550])), (("2.5B", 3.0, 10.0), np.array([0.1220, 0.2132, 6.5550])), (("2.5B", 3.0, 12.0), np.array([0.0989, 0.1963, 6.5550])), (("5B", 3.0, 2.0), np.array([0.2617, 0.2921, 6.5550])), (("5B", 3.0, 4.0), np.array([0.2176, 0.2632, 6.5550])), (("5B", 3.0, 6.0), np.array([0.1835, 0.2375, 6.5550])), (("5B", 3.0, 8.0), np.array([0.1527, 0.2119, 6.5550])), (("5B", 3.0, 10.0), np.array([0.1259, 0.1879, 6.5550])), (("5B", 3.0, 12.0), np.array([0.1042, 0.1681, 6.5550])), (("7.5B", 3.0, 2.0), np.array([0.2616, 0.2857, 6.5550])), (("7.5B", 3.0, 4.0), np.array([0.2200, 0.2536, 6.5550])), (("7.5B", 3.0, 6.0), np.array([0.1875, 0.2258, 6.5550])), (("7.5B", 3.0, 8.0), np.array([0.1583, 0.1987, 6.5550])), (("7.5B", 3.0, 10.0), np.array([0.1343, 0.1756, 6.5550])), (("7.5B", 3.0, 12.0), np.array([0.1131, 0.1542, 6.5550])), (("10B", 3.0, 2.0), np.array([0.2631, 0.2801, 6.5550])), (("10B", 3.0, 4.0), np.array([0.2246, 0.2467, 6.5550])), (("10B", 3.0, 6.0), np.array([0.1933, 0.2173, 6.5550])), (("10B", 3.0, 8.0), np.array([0.1658, 0.1905, 6.5550])), (("10B", 3.0, 10.0), np.array([0.1432, 0.1675, 6.5550])), (("10B", 3.0, 12.0), np.array([0.1228, 0.1460, 6.5550])), (("10B", 3.0, 14.0), np.array([0.1065, 0.1285, 6.5550])), (("2.5PB", 3.0, 2.0), np.array([0.2663, 0.2756, 6.5550])), (("2.5PB", 3.0, 4.0), np.array([0.2312, 0.2405, 6.5550])), (("2.5PB", 3.0, 6.0), np.array([0.2022, 0.2101, 6.5550])), (("2.5PB", 3.0, 8.0), np.array([0.1780, 0.1833, 6.5550])), (("2.5PB", 3.0, 10.0), np.array([0.1576, 0.1600, 6.5550])), (("2.5PB", 3.0, 12.0), np.array([0.1398, 0.1395, 6.5550])), (("2.5PB", 3.0, 14.0), np.array([0.1251, 0.1218, 6.5550])), (("5PB", 3.0, 2.0), np.array([0.2708, 0.2719, 6.5550])), (("5PB", 3.0, 4.0), np.array([0.2393, 0.2361, 6.5550])), (("5PB", 3.0, 6.0), np.array([0.2122, 0.2052, 6.5550])), (("5PB", 3.0, 8.0), np.array([0.1908, 0.1799, 6.5550])), (("5PB", 3.0, 10.0), np.array([0.1718, 0.1562, 6.5550])), (("5PB", 3.0, 12.0), np.array([0.1557, 0.1356, 6.5550])), (("5PB", 3.0, 14.0), np.array([0.1431, 0.1184, 6.5550])), (("5PB", 3.0, 16.0), np.array([0.1318, 0.1024, 6.5550])), (("5PB", 3.0, 18.0), np.array([0.1228, 0.0895, 6.5550])), (("7.5PB", 3.0, 2.0), np.array([0.2777, 0.2687, 6.5550])), (("7.5PB", 3.0, 4.0), np.array([0.2520, 0.2319, 6.5550])), (("7.5PB", 3.0, 6.0), np.array([0.2311, 0.2010, 6.5550])), (("7.5PB", 3.0, 8.0), np.array([0.2149, 0.1761, 6.5550])), (("7.5PB", 3.0, 10.0), np.array([0.2005, 0.1536, 6.5550])), (("7.5PB", 3.0, 12.0), np.array([0.1903, 0.1353, 6.5550])), (("7.5PB", 3.0, 14.0), np.array([0.1824, 0.1188, 6.5550])), (("7.5PB", 3.0, 16.0), np.array([0.1765, 0.1048, 6.5550])), (("7.5PB", 3.0, 18.0), np.array([0.1730, 0.0948, 6.5550])), (("7.5PB", 3.0, 20.0), np.array([0.1702, 0.0867, 6.5550])), (("7.5PB", 3.0, 22.0), np.array([0.1677, 0.0782, 6.5550])), (("7.5PB", 3.0, 24.0), np.array([0.1658, 0.0711, 6.5550])), (("7.5PB", 3.0, 26.0), np.array([0.1642, 0.0655, 6.5550])), (("7.5PB", 3.0, 28.0), np.array([0.1632, 0.0609, 6.5550])), (("7.5PB", 3.0, 30.0), np.array([0.1621, 0.0556, 6.5550])), (("7.5PB", 3.0, 32.0), np.array([0.1612, 0.0511, 6.5550])), (("7.5PB", 3.0, 34.0), np.array([0.1608, 0.0480, 6.5550])), (("10PB", 3.0, 2.0), np.array([0.2847, 0.2670, 6.5550])), (("10PB", 3.0, 4.0), np.array([0.2660, 0.2319, 6.5550])), (("10PB", 3.0, 6.0), np.array([0.2511, 0.2031, 6.5550])), (("10PB", 3.0, 8.0), np.array([0.2387, 0.1786, 6.5550])), (("10PB", 3.0, 10.0), np.array([0.2278, 0.1565, 6.5550])), (("10PB", 3.0, 12.0), np.array([0.2206, 0.1407, 6.5550])), (("10PB", 3.0, 14.0), np.array([0.2142, 0.1250, 6.5550])), (("10PB", 3.0, 16.0), np.array([0.2092, 0.1118, 6.5550])), (("10PB", 3.0, 18.0), np.array([0.2060, 0.1020, 6.5550])), (("10PB", 3.0, 20.0), np.array([0.2030, 0.0930, 6.5550])), (("10PB", 3.0, 22.0), np.array([0.2004, 0.0847, 6.5550])), (("10PB", 3.0, 24.0), np.array([0.1982, 0.0772, 6.5550])), (("10PB", 3.0, 26.0), np.array([0.1963, 0.0708, 6.5550])), (("10PB", 3.0, 28.0), np.array([0.1950, 0.0650, 6.5550])), (("10PB", 3.0, 30.0), np.array([0.1938, 0.0599, 6.5550])), (("10PB", 3.0, 32.0), np.array([0.1926, 0.0542, 6.5550])), (("10PB", 3.0, 34.0), np.array([0.1918, 0.0503, 6.5550])), (("2.5P", 3.0, 2.0), np.array([0.2922, 0.2680, 6.5550])), (("2.5P", 3.0, 4.0), np.array([0.2792, 0.2342, 6.5550])), (("2.5P", 3.0, 6.0), np.array([0.2691, 0.2072, 6.5550])), (("2.5P", 3.0, 8.0), np.array([0.2615, 0.1845, 6.5550])), (("2.5P", 3.0, 10.0), np.array([0.2548, 0.1638, 6.5550])), (("2.5P", 3.0, 12.0), np.array([0.2498, 0.1480, 6.5550])), (("2.5P", 3.0, 14.0), np.array([0.2449, 0.1325, 6.5550])), (("2.5P", 3.0, 16.0), np.array([0.2410, 0.1198, 6.5550])), (("2.5P", 3.0, 18.0), np.array([0.2380, 0.1094, 6.5550])), (("2.5P", 3.0, 20.0), np.array([0.2354, 0.1003, 6.5550])), (("2.5P", 3.0, 22.0), np.array([0.2329, 0.0911, 6.5550])), (("2.5P", 3.0, 24.0), np.array([0.2305, 0.0832, 6.5550])), (("2.5P", 3.0, 26.0), np.array([0.2286, 0.0765, 6.5550])), (("2.5P", 3.0, 28.0), np.array([0.2268, 0.0698, 6.5550])), (("2.5P", 3.0, 30.0), np.array([0.2252, 0.0638, 6.5550])), (("2.5P", 3.0, 32.0), np.array([0.2242, 0.0587, 6.5550])), (("2.5P", 3.0, 34.0), np.array([0.2230, 0.0543, 6.5550])), (("5P", 3.0, 2.0), np.array([0.2997, 0.2700, 6.5550])), (("5P", 3.0, 4.0), np.array([0.2928, 0.2386, 6.5550])), (("5P", 3.0, 6.0), np.array([0.2870, 0.2135, 6.5550])), (("5P", 3.0, 8.0), np.array([0.2819, 0.1910, 6.5550])), (("5P", 3.0, 10.0), np.array([0.2772, 0.1707, 6.5550])), (("5P", 3.0, 12.0), np.array([0.2739, 0.1539, 6.5550])), (("5P", 3.0, 14.0), np.array([0.2707, 0.1397, 6.5550])), (("5P", 3.0, 16.0), np.array([0.2680, 0.1272, 6.5550])), (("5P", 3.0, 18.0), np.array([0.2657, 0.1163, 6.5550])), (("5P", 3.0, 20.0), np.array([0.2639, 0.1074, 6.5550])), (("5P", 3.0, 22.0), np.array([0.2620, 0.0978, 6.5550])), (("5P", 3.0, 24.0), np.array([0.2602, 0.0891, 6.5550])), (("5P", 3.0, 26.0), np.array([0.2590, 0.0822, 6.5550])), (("5P", 3.0, 28.0), np.array([0.2579, 0.0750, 6.5550])), (("5P", 3.0, 30.0), np.array([0.2568, 0.0690, 6.5550])), (("5P", 3.0, 32.0), np.array([0.2557, 0.0630, 6.5550])), (("7.5P", 3.0, 2.0), np.array([0.3088, 0.2740, 6.5550])), (("7.5P", 3.0, 4.0), np.array([0.3072, 0.2448, 6.5550])), (("7.5P", 3.0, 6.0), np.array([0.3057, 0.2208, 6.5550])), (("7.5P", 3.0, 8.0), np.array([0.3037, 0.1981, 6.5550])), (("7.5P", 3.0, 10.0), np.array([0.3020, 0.1794, 6.5550])), (("7.5P", 3.0, 12.0), np.array([0.3003, 0.1618, 6.5550])), (("7.5P", 3.0, 14.0), np.array([0.2992, 0.1475, 6.5550])), (("7.5P", 3.0, 16.0), np.array([0.2981, 0.1356, 6.5550])), (("7.5P", 3.0, 18.0), np.array([0.2969, 0.1239, 6.5550])), (("7.5P", 3.0, 20.0), np.array([0.2961, 0.1151, 6.5550])), (("7.5P", 3.0, 22.0), np.array([0.2953, 0.1057, 6.5550])), (("7.5P", 3.0, 24.0), np.array([0.2944, 0.0967, 6.5550])), (("7.5P", 3.0, 26.0), np.array([0.2938, 0.0892, 6.5550])), (("7.5P", 3.0, 28.0), np.array([0.2930, 0.0812, 6.5550])), (("7.5P", 3.0, 30.0), np.array([0.2922, 0.0750, 6.5550])), (("10P", 3.0, 2.0), np.array([0.3170, 0.2790, 6.5550])), (("10P", 3.0, 4.0), np.array([0.3214, 0.2517, 6.5550])), (("10P", 3.0, 6.0), np.array([0.3243, 0.2293, 6.5550])), (("10P", 3.0, 8.0), np.array([0.3269, 0.2075, 6.5550])), (("10P", 3.0, 10.0), np.array([0.3286, 0.1889, 6.5550])), (("10P", 3.0, 12.0), np.array([0.3301, 0.1715, 6.5550])), (("10P", 3.0, 14.0), np.array([0.3309, 0.1572, 6.5550])), (("10P", 3.0, 16.0), np.array([0.3320, 0.1456, 6.5550])), (("10P", 3.0, 18.0), np.array([0.3329, 0.1332, 6.5550])), (("10P", 3.0, 20.0), np.array([0.3332, 0.1240, 6.5550])), (("10P", 3.0, 22.0), np.array([0.3340, 0.1146, 6.5550])), (("10P", 3.0, 24.0), np.array([0.3341, 0.1055, 6.5550])), (("10P", 3.0, 26.0), np.array([0.3343, 0.0978, 6.5550])), (("2.5RP", 3.0, 2.0), np.array([0.3272, 0.2861, 6.5550])), (("2.5RP", 3.0, 4.0), np.array([0.3400, 0.2624, 6.5550])), (("2.5RP", 3.0, 6.0), np.array([0.3501, 0.2425, 6.5550])), (("2.5RP", 3.0, 8.0), np.array([0.3598, 0.2233, 6.5550])), (("2.5RP", 3.0, 10.0), np.array([0.3681, 0.2054, 6.5550])), (("2.5RP", 3.0, 12.0), np.array([0.3754, 0.1898, 6.5550])), (("2.5RP", 3.0, 14.0), np.array([0.3818, 0.1758, 6.5550])), (("2.5RP", 3.0, 16.0), np.array([0.3876, 0.1629, 6.5550])), (("2.5RP", 3.0, 18.0), np.array([0.3929, 0.1506, 6.5550])), (("2.5RP", 3.0, 20.0), np.array([0.3969, 0.1413, 6.5550])), (("2.5RP", 3.0, 22.0), np.array([0.4018, 0.1304, 6.5550])), (("5RP", 3.0, 2.0), np.array([0.3370, 0.2940, 6.5550])), (("5RP", 3.0, 4.0), np.array([0.3586, 0.2742, 6.5550])), (("5RP", 3.0, 6.0), np.array([0.3765, 0.2569, 6.5550])), (("5RP", 3.0, 8.0), np.array([0.3930, 0.2395, 6.5550])), (("5RP", 3.0, 10.0), np.array([0.4073, 0.2235, 6.5550])), (("5RP", 3.0, 12.0), np.array([0.4199, 0.2089, 6.5550])), (("5RP", 3.0, 14.0), np.array([0.4313, 0.1944, 6.5550])), (("5RP", 3.0, 16.0), np.array([0.4418, 0.1809, 6.5550])), (("5RP", 3.0, 18.0), np.array([0.4503, 0.1695, 6.5550])), (("5RP", 3.0, 20.0), np.array([0.4577, 0.1593, 6.5550])), (("7.5RP", 3.0, 2.0), np.array([0.3450, 0.3001, 6.5550])), (("7.5RP", 3.0, 4.0), np.array([0.3739, 0.2851, 6.5550])), (("7.5RP", 3.0, 6.0), np.array([0.3990, 0.2708, 6.5550])), (("7.5RP", 3.0, 8.0), np.array([0.4234, 0.2556, 6.5550])), (("7.5RP", 3.0, 10.0), np.array([0.4445, 0.2419, 6.5550])), (("7.5RP", 3.0, 12.0), np.array([0.4654, 0.2273, 6.5550])), (("7.5RP", 3.0, 14.0), np.array([0.4831, 0.2140, 6.5550])), (("7.5RP", 3.0, 16.0), np.array([0.4991, 0.2011, 6.5550])), (("7.5RP", 3.0, 18.0), np.array([0.5130, 0.1893, 6.5550])), (("10RP", 4.0, 2.0), np.array([0.3417, 0.3106, 12.0000])), (("10RP", 4.0, 4.0), np.array([0.3715, 0.3042, 12.0000])), (("10RP", 4.0, 6.0), np.array([0.3999, 0.2972, 12.0000])), (("10RP", 4.0, 8.0), np.array([0.4282, 0.2890, 12.0000])), (("10RP", 4.0, 10.0), np.array([0.4528, 0.2811, 12.0000])), (("10RP", 4.0, 12.0), np.array([0.4789, 0.2717, 12.0000])), (("10RP", 4.0, 14.0), np.array([0.5020, 0.2623, 12.0000])), (("10RP", 4.0, 16.0), np.array([0.5234, 0.2530, 12.0000])), (("10RP", 4.0, 18.0), np.array([0.5466, 0.2424, 12.0000])), (("10RP", 4.0, 20.0), np.array([0.5674, 0.2319, 12.0000])), (("2.5R", 4.0, 2.0), np.array([0.3461, 0.3150, 12.0000])), (("2.5R", 4.0, 4.0), np.array([0.3806, 0.3125, 12.0000])), (("2.5R", 4.0, 6.0), np.array([0.4141, 0.3085, 12.0000])), (("2.5R", 4.0, 8.0), np.array([0.4472, 0.3031, 12.0000])), (("2.5R", 4.0, 10.0), np.array([0.4774, 0.2969, 12.0000])), (("2.5R", 4.0, 12.0), np.array([0.5072, 0.2897, 12.0000])), (("2.5R", 4.0, 14.0), np.array([0.5369, 0.2810, 12.0000])), (("2.5R", 4.0, 16.0), np.array([0.5620, 0.2724, 12.0000])), (("2.5R", 4.0, 18.0), np.array([0.5898, 0.2622, 12.0000])), (("5R", 4.0, 2.0), np.array([0.3508, 0.3200, 12.0000])), (("5R", 4.0, 4.0), np.array([0.3916, 0.3223, 12.0000])), (("5R", 4.0, 6.0), np.array([0.4299, 0.3226, 12.0000])), (("5R", 4.0, 8.0), np.array([0.4690, 0.3209, 12.0000])), (("5R", 4.0, 10.0), np.array([0.5043, 0.3176, 12.0000])), (("5R", 4.0, 12.0), np.array([0.5385, 0.3129, 12.0000])), (("5R", 4.0, 14.0), np.array([0.5734, 0.3057, 12.0000])), (("5R", 4.0, 16.0), np.array([0.6039, 0.2978, 12.0000])), (("5R", 4.0, 18.0), np.array([0.6329, 0.2881, 12.0000])), (("7.5R", 4.0, 2.0), np.array([0.3538, 0.3236, 12.0000])), (("7.5R", 4.0, 4.0), np.array([0.3990, 0.3300, 12.0000])), (("7.5R", 4.0, 6.0), np.array([0.4415, 0.3340, 12.0000])), (("7.5R", 4.0, 8.0), np.array([0.4850, 0.3359, 12.0000])), (("7.5R", 4.0, 10.0), np.array([0.5235, 0.3351, 12.0000])), (("7.5R", 4.0, 12.0), np.array([0.5603, 0.3321, 12.0000])), (("7.5R", 4.0, 14.0), np.array([0.5959, 0.3269, 12.0000])), (("7.5R", 4.0, 16.0), np.array([0.6260, 0.3192, 12.0000])), (("7.5R", 4.0, 18.0), np.array([0.6538, 0.3100, 12.0000])), (("7.5R", 4.0, 20.0), np.array([0.6806, 0.2988, 12.0000])), (("10R", 4.0, 2.0), np.array([0.3582, 0.3294, 12.0000])), (("10R", 4.0, 4.0), np.array([0.4078, 0.3412, 12.0000])), (("10R", 4.0, 6.0), np.array([0.4535, 0.3500, 12.0000])), (("10R", 4.0, 8.0), np.array([0.4995, 0.3557, 12.0000])), (("10R", 4.0, 10.0), np.array([0.5418, 0.3580, 12.0000])), (("10R", 4.0, 12.0), np.array([0.5801, 0.3588, 12.0000])), (("10R", 4.0, 14.0), np.array([0.6154, 0.3568, 12.0000])), (("10R", 4.0, 16.0), np.array([0.6409, 0.3533, 12.0000])), (("2.5YR", 4.0, 2.0), np.array([0.3624, 0.3367, 12.0000])), (("2.5YR", 4.0, 4.0), np.array([0.4141, 0.3539, 12.0000])), (("2.5YR", 4.0, 6.0), np.array([0.4612, 0.3674, 12.0000])), (("2.5YR", 4.0, 8.0), np.array([0.5071, 0.3777, 12.0000])), (("2.5YR", 4.0, 10.0), np.array([0.5475, 0.3856, 12.0000])), (("2.5YR", 4.0, 12.0), np.array([0.5809, 0.3910, 12.0000])), (("5YR", 4.0, 2.0), np.array([0.3651, 0.3442, 12.0000])), (("5YR", 4.0, 4.0), np.array([0.4187, 0.3679, 12.0000])), (("5YR", 4.0, 6.0), np.array([0.4651, 0.3859, 12.0000])), (("5YR", 4.0, 8.0), np.array([0.5070, 0.3994, 12.0000])), (("5YR", 4.0, 10.0), np.array([0.5432, 0.4097, 12.0000])), (("5YR", 4.0, 12.0), np.array([0.5729, 0.4169, 12.0000])), (("7.5YR", 4.0, 2.0), np.array([0.3662, 0.3504, 12.0000])), (("7.5YR", 4.0, 4.0), np.array([0.4208, 0.3809, 12.0000])), (("7.5YR", 4.0, 6.0), np.array([0.4655, 0.4029, 12.0000])), (("7.5YR", 4.0, 8.0), np.array([0.5038, 0.4204, 12.0000])), (("7.5YR", 4.0, 10.0), np.array([0.5356, 0.4342, 12.0000])), (("10YR", 4.0, 2.0), np.array([0.3660, 0.3590, 12.0000])), (("10YR", 4.0, 4.0), np.array([0.4189, 0.3948, 12.0000])), (("10YR", 4.0, 6.0), np.array([0.4618, 0.4213, 12.0000])), (("10YR", 4.0, 8.0), np.array([0.4965, 0.4414, 12.0000])), (("10YR", 4.0, 10.0), np.array([0.5250, 0.4573, 12.0000])), (("2.5Y", 4.0, 2.0), np.array([0.3633, 0.3654, 12.0000])), (("2.5Y", 4.0, 4.0), np.array([0.4138, 0.4076, 12.0000])), (("2.5Y", 4.0, 6.0), np.array([0.4542, 0.4391, 12.0000])), (("2.5Y", 4.0, 8.0), np.array([0.4865, 0.4625, 12.0000])), (("2.5Y", 4.0, 10.0), np.array([0.5120, 0.4800, 12.0000])), (("5Y", 4.0, 2.0), np.array([0.3590, 0.3701, 12.0000])), (("5Y", 4.0, 4.0), np.array([0.4069, 0.4188, 12.0000])), (("5Y", 4.0, 6.0), np.array([0.4451, 0.4550, 12.0000])), (("5Y", 4.0, 8.0), np.array([0.4745, 0.4810, 12.0000])), (("7.5Y", 4.0, 2.0), np.array([0.3542, 0.3727, 12.0000])), (("7.5Y", 4.0, 4.0), np.array([0.3982, 0.4272, 12.0000])), (("7.5Y", 4.0, 6.0), np.array([0.4331, 0.4688, 12.0000])), (("7.5Y", 4.0, 8.0), np.array([0.4595, 0.4990, 12.0000])), (("10Y", 4.0, 2.0), np.array([0.3436, 0.3732, 12.0000])), (("10Y", 4.0, 4.0), np.array([0.3871, 0.4321, 12.0000])), (("10Y", 4.0, 6.0), np.array([0.4190, 0.4795, 12.0000])), (("10Y", 4.0, 8.0), np.array([0.4430, 0.5153, 12.0000])), (("2.5GY", 4.0, 2.0), np.array([0.3382, 0.3706, 12.0000])), (("2.5GY", 4.0, 4.0), np.array([0.3708, 0.4329, 12.0000])), (("2.5GY", 4.0, 6.0), np.array([0.3968, 0.4857, 12.0000])), (("2.5GY", 4.0, 8.0), np.array([0.4174, 0.5300, 12.0000])), (("5GY", 4.0, 2.0), np.array([0.3312, 0.3678, 12.0000])), (("5GY", 4.0, 4.0), np.array([0.3538, 0.4284, 12.0000])), (("5GY", 4.0, 6.0), np.array([0.3718, 0.4852, 12.0000])), (("5GY", 4.0, 8.0), np.array([0.3868, 0.5384, 12.0000])), (("5GY", 4.0, 10.0), np.array([0.3983, 0.5850, 12.0000])), (("7.5GY", 4.0, 2.0), np.array([0.3185, 0.3604, 12.0000])), (("7.5GY", 4.0, 4.0), np.array([0.3281, 0.4157, 12.0000])), (("7.5GY", 4.0, 6.0), np.array([0.3355, 0.4739, 12.0000])), (("7.5GY", 4.0, 8.0), np.array([0.3400, 0.5348, 12.0000])), (("7.5GY", 4.0, 10.0), np.array([0.3395, 0.5913, 12.0000])), (("7.5GY", 4.0, 12.0), np.array([0.3348, 0.6468, 12.0000])), (("10GY", 4.0, 2.0), np.array([0.3109, 0.3550, 12.0000])), (("10GY", 4.0, 4.0), np.array([0.3100, 0.4018, 12.0000])), (("10GY", 4.0, 6.0), np.array([0.3069, 0.4550, 12.0000])), (("10GY", 4.0, 8.0), np.array([0.3008, 0.5095, 12.0000])), (("10GY", 4.0, 10.0), np.array([0.2908, 0.5672, 12.0000])), (("10GY", 4.0, 12.0), np.array([0.2758, 0.6282, 12.0000])), (("10GY", 4.0, 14.0), np.array([0.2590, 0.6858, 12.0000])), (("10GY", 4.0, 16.0), np.array([0.2422, 0.7360, 12.0000])), (("2.5G", 4.0, 2.0), np.array([0.3012, 0.3470, 12.0000])), (("2.5G", 4.0, 4.0), np.array([0.2891, 0.3821, 12.0000])), (("2.5G", 4.0, 6.0), np.array([0.2735, 0.4215, 12.0000])), (("2.5G", 4.0, 8.0), np.array([0.2561, 0.4597, 12.0000])), (("2.5G", 4.0, 10.0), np.array([0.2355, 0.5006, 12.0000])), (("2.5G", 4.0, 12.0), np.array([0.2128, 0.5425, 12.0000])), (("2.5G", 4.0, 14.0), np.array([0.1909, 0.5779, 12.0000])), (("2.5G", 4.0, 16.0), np.array([0.1682, 0.6111, 12.0000])), (("2.5G", 4.0, 18.0), np.array([0.1446, 0.6431, 12.0000])), (("2.5G", 4.0, 20.0), np.array([0.1230, 0.6706, 12.0000])), (("2.5G", 4.0, 22.0), np.array([0.1009, 0.6975, 12.0000])), (("2.5G", 4.0, 24.0), np.array([0.0760, 0.7250, 12.0000])), (("2.5G", 4.0, 26.0), np.array([0.0528, 0.7502, 12.0000])), (("5G", 4.0, 2.0), np.array([0.2959, 0.3417, 12.0000])), (("5G", 4.0, 4.0), np.array([0.2781, 0.3704, 12.0000])), (("5G", 4.0, 6.0), np.array([0.2581, 0.3992, 12.0000])), (("5G", 4.0, 8.0), np.array([0.2359, 0.4266, 12.0000])), (("5G", 4.0, 10.0), np.array([0.2115, 0.4532, 12.0000])), (("5G", 4.0, 12.0), np.array([0.1843, 0.4807, 12.0000])), (("5G", 4.0, 14.0), np.array([0.1627, 0.5015, 12.0000])), (("5G", 4.0, 16.0), np.array([0.1402, 0.5214, 12.0000])), (("5G", 4.0, 18.0), np.array([0.1188, 0.5400, 12.0000])), (("5G", 4.0, 20.0), np.array([0.1018, 0.5543, 12.0000])), (("5G", 4.0, 22.0), np.array([0.0841, 0.5684, 12.0000])), (("5G", 4.0, 24.0), np.array([0.0614, 0.5857, 12.0000])), (("5G", 4.0, 26.0), np.array([0.0407, 0.6010, 12.0000])), (("7.5G", 4.0, 2.0), np.array([0.2919, 0.3371, 12.0000])), (("7.5G", 4.0, 4.0), np.array([0.2702, 0.3602, 12.0000])), (("7.5G", 4.0, 6.0), np.array([0.2467, 0.3822, 12.0000])), (("7.5G", 4.0, 8.0), np.array([0.2232, 0.4022, 12.0000])), (("7.5G", 4.0, 10.0), np.array([0.1989, 0.4219, 12.0000])), (("7.5G", 4.0, 12.0), np.array([0.1706, 0.4419, 12.0000])), (("7.5G", 4.0, 14.0), np.array([0.1500, 0.4562, 12.0000])), (("7.5G", 4.0, 16.0), np.array([0.1293, 0.4703, 12.0000])), (("7.5G", 4.0, 18.0), np.array([0.1086, 0.4842, 12.0000])), (("7.5G", 4.0, 20.0), np.array([0.0928, 0.4942, 12.0000])), (("7.5G", 4.0, 22.0), np.array([0.0770, 0.5040, 12.0000])), (("7.5G", 4.0, 24.0), np.array([0.0581, 0.5151, 12.0000])), (("7.5G", 4.0, 26.0), np.array([0.0392, 0.5258, 12.0000])), (("10G", 4.0, 2.0), np.array([0.2880, 0.3327, 12.0000])), (("10G", 4.0, 4.0), np.array([0.2628, 0.3498, 12.0000])), (("10G", 4.0, 6.0), np.array([0.2374, 0.3655, 12.0000])), (("10G", 4.0, 8.0), np.array([0.2124, 0.3799, 12.0000])), (("10G", 4.0, 10.0), np.array([0.1876, 0.3933, 12.0000])), (("10G", 4.0, 12.0), np.array([0.1602, 0.4070, 12.0000])), (("10G", 4.0, 14.0), np.array([0.1398, 0.4168, 12.0000])), (("10G", 4.0, 16.0), np.array([0.1212, 0.4245, 12.0000])), (("10G", 4.0, 18.0), np.array([0.1006, 0.4330, 12.0000])), (("10G", 4.0, 20.0), np.array([0.0850, 0.4388, 12.0000])), (("10G", 4.0, 22.0), np.array([0.0702, 0.4440, 12.0000])), (("10G", 4.0, 24.0), np.array([0.0553, 0.4492, 12.0000])), (("10G", 4.0, 26.0), np.array([0.0400, 0.4545, 12.0000])), (("2.5BG", 4.0, 2.0), np.array([0.2840, 0.3270, 12.0000])), (("2.5BG", 4.0, 4.0), np.array([0.2552, 0.3375, 12.0000])), (("2.5BG", 4.0, 6.0), np.array([0.2278, 0.3463, 12.0000])), (("2.5BG", 4.0, 8.0), np.array([0.2006, 0.3540, 12.0000])), (("2.5BG", 4.0, 10.0), np.array([0.1738, 0.3600, 12.0000])), (("2.5BG", 4.0, 12.0), np.array([0.1492, 0.3649, 12.0000])), (("2.5BG", 4.0, 14.0), np.array([0.1283, 0.3688, 12.0000])), (("2.5BG", 4.0, 16.0), np.array([0.1102, 0.3720, 12.0000])), (("2.5BG", 4.0, 18.0), np.array([0.0915, 0.3754, 12.0000])), (("2.5BG", 4.0, 20.0), np.array([0.0768, 0.3773, 12.0000])), (("2.5BG", 4.0, 22.0), np.array([0.0636, 0.3788, 12.0000])), (("2.5BG", 4.0, 24.0), np.array([0.0510, 0.3800, 12.0000])), (("5BG", 4.0, 2.0), np.array([0.2799, 0.3208, 12.0000])), (("5BG", 4.0, 4.0), np.array([0.2480, 0.3232, 12.0000])), (("5BG", 4.0, 6.0), np.array([0.2182, 0.3240, 12.0000])), (("5BG", 4.0, 8.0), np.array([0.1890, 0.3234, 12.0000])), (("5BG", 4.0, 10.0), np.array([0.1618, 0.3219, 12.0000])), (("5BG", 4.0, 12.0), np.array([0.1379, 0.3198, 12.0000])), (("5BG", 4.0, 14.0), np.array([0.1170, 0.3170, 12.0000])), (("5BG", 4.0, 16.0), np.array([0.0992, 0.3141, 12.0000])), (("5BG", 4.0, 18.0), np.array([0.0828, 0.3108, 12.0000])), (("5BG", 4.0, 20.0), np.array([0.0675, 0.3075, 12.0000])), (("7.5BG", 4.0, 2.0), np.array([0.2764, 0.3148, 12.0000])), (("7.5BG", 4.0, 4.0), np.array([0.2429, 0.3108, 12.0000])), (("7.5BG", 4.0, 6.0), np.array([0.2113, 0.3052, 12.0000])), (("7.5BG", 4.0, 8.0), np.array([0.1815, 0.2985, 12.0000])), (("7.5BG", 4.0, 10.0), np.array([0.1540, 0.2910, 12.0000])), (("7.5BG", 4.0, 12.0), np.array([0.1298, 0.2840, 12.0000])), (("7.5BG", 4.0, 14.0), np.array([0.1092, 0.2774, 12.0000])), (("7.5BG", 4.0, 16.0), np.array([0.0922, 0.2718, 12.0000])), (("7.5BG", 4.0, 18.0), np.array([0.0768, 0.2667, 12.0000])), (("10BG", 4.0, 2.0), np.array([0.2740, 0.3091, 12.0000])), (("10BG", 4.0, 4.0), np.array([0.2384, 0.2984, 12.0000])), (("10BG", 4.0, 6.0), np.array([0.2065, 0.2863, 12.0000])), (("10BG", 4.0, 8.0), np.array([0.1760, 0.2730, 12.0000])), (("10BG", 4.0, 10.0), np.array([0.1480, 0.2600, 12.0000])), (("10BG", 4.0, 12.0), np.array([0.1248, 0.2484, 12.0000])), (("10BG", 4.0, 14.0), np.array([0.1033, 0.2376, 12.0000])), (("10BG", 4.0, 16.0), np.array([0.0888, 0.2298, 12.0000])), (("2.5B", 4.0, 2.0), np.array([0.2727, 0.3038, 12.0000])), (("2.5B", 4.0, 4.0), np.array([0.2360, 0.2872, 12.0000])), (("2.5B", 4.0, 6.0), np.array([0.2048, 0.2708, 12.0000])), (("2.5B", 4.0, 8.0), np.array([0.1737, 0.2524, 12.0000])), (("2.5B", 4.0, 10.0), np.array([0.1463, 0.2354, 12.0000])), (("2.5B", 4.0, 12.0), np.array([0.1247, 0.2209, 12.0000])), (("2.5B", 4.0, 14.0), np.array([0.1027, 0.2057, 12.0000])), (("2.5B", 4.0, 16.0), np.array([0.0900, 0.1973, 12.0000])), (("5B", 4.0, 2.0), np.array([0.2723, 0.2992, 12.0000])), (("5B", 4.0, 4.0), np.array([0.2363, 0.2782, 12.0000])), (("5B", 4.0, 6.0), np.array([0.2060, 0.2572, 12.0000])), (("5B", 4.0, 8.0), np.array([0.1759, 0.2345, 12.0000])), (("5B", 4.0, 10.0), np.array([0.1512, 0.2148, 12.0000])), (("5B", 4.0, 12.0), np.array([0.1299, 0.1963, 12.0000])), (("5B", 4.0, 14.0), np.array([0.1098, 0.1785, 12.0000])), (("7.5B", 4.0, 2.0), np.array([0.2733, 0.2947, 12.0000])), (("7.5B", 4.0, 4.0), np.array([0.2388, 0.2704, 12.0000])), (("7.5B", 4.0, 6.0), np.array([0.2102, 0.2470, 12.0000])), (("7.5B", 4.0, 8.0), np.array([0.1821, 0.2232, 12.0000])), (("7.5B", 4.0, 10.0), np.array([0.1601, 0.2028, 12.0000])), (("7.5B", 4.0, 12.0), np.array([0.1393, 0.1837, 12.0000])), (("7.5B", 4.0, 14.0), np.array([0.1204, 0.1655, 12.0000])), (("10B", 4.0, 2.0), np.array([0.2753, 0.2910, 12.0000])), (("10B", 4.0, 4.0), np.array([0.2429, 0.2648, 12.0000])), (("10B", 4.0, 6.0), np.array([0.2157, 0.2407, 12.0000])), (("10B", 4.0, 8.0), np.array([0.1893, 0.2160, 12.0000])), (("10B", 4.0, 10.0), np.array([0.1681, 0.1954, 12.0000])), (("10B", 4.0, 12.0), np.array([0.1487, 0.1760, 12.0000])), (("10B", 4.0, 14.0), np.array([0.1310, 0.1580, 12.0000])), (("10B", 4.0, 16.0), np.array([0.1155, 0.1416, 12.0000])), (("2.5PB", 4.0, 2.0), np.array([0.2782, 0.2876, 12.0000])), (("2.5PB", 4.0, 4.0), np.array([0.2487, 0.2597, 12.0000])), (("2.5PB", 4.0, 6.0), np.array([0.2235, 0.2343, 12.0000])), (("2.5PB", 4.0, 8.0), np.array([0.1995, 0.2094, 12.0000])), (("2.5PB", 4.0, 10.0), np.array([0.1805, 0.1888, 12.0000])), (("2.5PB", 4.0, 12.0), np.array([0.1634, 0.1698, 12.0000])), (("2.5PB", 4.0, 14.0), np.array([0.1473, 0.1513, 12.0000])), (("2.5PB", 4.0, 16.0), np.array([0.1336, 0.1349, 12.0000])), (("2.5PB", 4.0, 18.0), np.array([0.1218, 0.1208, 12.0000])), (("5PB", 4.0, 2.0), np.array([0.2816, 0.2842, 12.0000])), (("5PB", 4.0, 4.0), np.array([0.2562, 0.2560, 12.0000])), (("5PB", 4.0, 6.0), np.array([0.2325, 0.2300, 12.0000])), (("5PB", 4.0, 8.0), np.array([0.2103, 0.2050, 12.0000])), (("5PB", 4.0, 10.0), np.array([0.1925, 0.1843, 12.0000])), (("5PB", 4.0, 12.0), np.array([0.1773, 0.1659, 12.0000])), (("5PB", 4.0, 14.0), np.array([0.1627, 0.1479, 12.0000])), (("5PB", 4.0, 16.0), np.array([0.1504, 0.1317, 12.0000])), (("5PB", 4.0, 18.0), np.array([0.1392, 0.1167, 12.0000])), (("5PB", 4.0, 20.0), np.array([0.1288, 0.1027, 12.0000])), (("7.5PB", 4.0, 2.0), np.array([0.2861, 0.2819, 12.0000])), (("7.5PB", 4.0, 4.0), np.array([0.2657, 0.2528, 12.0000])), (("7.5PB", 4.0, 6.0), np.array([0.2471, 0.2266, 12.0000])), (("7.5PB", 4.0, 8.0), np.array([0.2304, 0.2023, 12.0000])), (("7.5PB", 4.0, 10.0), np.array([0.2158, 0.1811, 12.0000])), (("7.5PB", 4.0, 12.0), np.array([0.2037, 0.1629, 12.0000])), (("7.5PB", 4.0, 14.0), np.array([0.1941, 0.1468, 12.0000])), (("7.5PB", 4.0, 16.0), np.array([0.1861, 0.1316, 12.0000])), (("7.5PB", 4.0, 18.0), np.array([0.1798, 0.1185, 12.0000])), (("7.5PB", 4.0, 20.0), np.array([0.1742, 0.1058, 12.0000])), (("7.5PB", 4.0, 22.0), np.array([0.1713, 0.0980, 12.0000])), (("7.5PB", 4.0, 24.0), np.array([0.1684, 0.0899, 12.0000])), (("7.5PB", 4.0, 26.0), np.array([0.1659, 0.0825, 12.0000])), (("10PB", 4.0, 2.0), np.array([0.2911, 0.2804, 12.0000])), (("10PB", 4.0, 4.0), np.array([0.2759, 0.2522, 12.0000])), (("10PB", 4.0, 6.0), np.array([0.2618, 0.2263, 12.0000])), (("10PB", 4.0, 8.0), np.array([0.2497, 0.2038, 12.0000])), (("10PB", 4.0, 10.0), np.array([0.2388, 0.1837, 12.0000])), (("10PB", 4.0, 12.0), np.array([0.2298, 0.1659, 12.0000])), (("10PB", 4.0, 14.0), np.array([0.2220, 0.1503, 12.0000])), (("10PB", 4.0, 16.0), np.array([0.2170, 0.1373, 12.0000])), (("10PB", 4.0, 18.0), np.array([0.2120, 0.1256, 12.0000])), (("10PB", 4.0, 20.0), np.array([0.2075, 0.1140, 12.0000])), (("10PB", 4.0, 22.0), np.array([0.2048, 0.1064, 12.0000])), (("10PB", 4.0, 24.0), np.array([0.2020, 0.0985, 12.0000])), (("10PB", 4.0, 26.0), np.array([0.1994, 0.0904, 12.0000])), (("10PB", 4.0, 28.0), np.array([0.1971, 0.0840, 12.0000])), (("10PB", 4.0, 30.0), np.array([0.1952, 0.0778, 12.0000])), (("2.5P", 4.0, 2.0), np.array([0.2962, 0.2807, 12.0000])), (("2.5P", 4.0, 4.0), np.array([0.2855, 0.2531, 12.0000])), (("2.5P", 4.0, 6.0), np.array([0.2763, 0.2300, 12.0000])), (("2.5P", 4.0, 8.0), np.array([0.2685, 0.2089, 12.0000])), (("2.5P", 4.0, 10.0), np.array([0.2619, 0.1903, 12.0000])), (("2.5P", 4.0, 12.0), np.array([0.2559, 0.1730, 12.0000])), (("2.5P", 4.0, 14.0), np.array([0.2509, 0.1585, 12.0000])), (("2.5P", 4.0, 16.0), np.array([0.2467, 0.1452, 12.0000])), (("2.5P", 4.0, 18.0), np.array([0.2430, 0.1332, 12.0000])), (("2.5P", 4.0, 20.0), np.array([0.2394, 0.1221, 12.0000])), (("2.5P", 4.0, 22.0), np.array([0.2371, 0.1143, 12.0000])), (("2.5P", 4.0, 24.0), np.array([0.2348, 0.1062, 12.0000])), (("2.5P", 4.0, 26.0), np.array([0.2322, 0.0978, 12.0000])), (("2.5P", 4.0, 28.0), np.array([0.2302, 0.0909, 12.0000])), (("2.5P", 4.0, 30.0), np.array([0.2285, 0.0847, 12.0000])), (("2.5P", 4.0, 32.0), np.array([0.2265, 0.0774, 12.0000])), (("5P", 4.0, 2.0), np.array([0.3022, 0.2825, 12.0000])), (("5P", 4.0, 4.0), np.array([0.2958, 0.2565, 12.0000])), (("5P", 4.0, 6.0), np.array([0.2903, 0.2347, 12.0000])), (("5P", 4.0, 8.0), np.array([0.2855, 0.2150, 12.0000])), (("5P", 4.0, 10.0), np.array([0.2814, 0.1967, 12.0000])), (("5P", 4.0, 12.0), np.array([0.2778, 0.1808, 12.0000])), (("5P", 4.0, 14.0), np.array([0.2747, 0.1660, 12.0000])), (("5P", 4.0, 16.0), np.array([0.2718, 0.1520, 12.0000])), (("5P", 4.0, 18.0), np.array([0.2693, 0.1408, 12.0000])), (("5P", 4.0, 20.0), np.array([0.2670, 0.1300, 12.0000])), (("5P", 4.0, 22.0), np.array([0.2652, 0.1218, 12.0000])), (("5P", 4.0, 24.0), np.array([0.2635, 0.1132, 12.0000])), (("5P", 4.0, 26.0), np.array([0.2618, 0.1052, 12.0000])), (("5P", 4.0, 28.0), np.array([0.2600, 0.0971, 12.0000])), (("5P", 4.0, 30.0), np.array([0.2588, 0.0907, 12.0000])), (("5P", 4.0, 32.0), np.array([0.2574, 0.0833, 12.0000])), (("7.5P", 4.0, 2.0), np.array([0.3093, 0.2859, 12.0000])), (("7.5P", 4.0, 4.0), np.array([0.3084, 0.2622, 12.0000])), (("7.5P", 4.0, 6.0), np.array([0.3076, 0.2416, 12.0000])), (("7.5P", 4.0, 8.0), np.array([0.3066, 0.2228, 12.0000])), (("7.5P", 4.0, 10.0), np.array([0.3056, 0.2060, 12.0000])), (("7.5P", 4.0, 12.0), np.array([0.3045, 0.1905, 12.0000])), (("7.5P", 4.0, 14.0), np.array([0.3035, 0.1755, 12.0000])), (("7.5P", 4.0, 16.0), np.array([0.3028, 0.1621, 12.0000])), (("7.5P", 4.0, 18.0), np.array([0.3016, 0.1500, 12.0000])), (("7.5P", 4.0, 20.0), np.array([0.3010, 0.1396, 12.0000])), (("7.5P", 4.0, 22.0), np.array([0.3001, 0.1306, 12.0000])), (("7.5P", 4.0, 24.0), np.array([0.2993, 0.1225, 12.0000])), (("7.5P", 4.0, 26.0), np.array([0.2986, 0.1135, 12.0000])), (("7.5P", 4.0, 28.0), np.array([0.2979, 0.1062, 12.0000])), (("7.5P", 4.0, 30.0), np.array([0.2969, 0.0979, 12.0000])), (("7.5P", 4.0, 32.0), np.array([0.2962, 0.0906, 12.0000])), (("10P", 4.0, 2.0), np.array([0.3162, 0.2902, 12.0000])), (("10P", 4.0, 4.0), np.array([0.3210, 0.2686, 12.0000])), (("10P", 4.0, 6.0), np.array([0.3248, 0.2493, 12.0000])), (("10P", 4.0, 8.0), np.array([0.3280, 0.2318, 12.0000])), (("10P", 4.0, 10.0), np.array([0.3306, 0.2162, 12.0000])), (("10P", 4.0, 12.0), np.array([0.3331, 0.2014, 12.0000])), (("10P", 4.0, 14.0), np.array([0.3351, 0.1875, 12.0000])), (("10P", 4.0, 16.0), np.array([0.3370, 0.1756, 12.0000])), (("10P", 4.0, 18.0), np.array([0.3386, 0.1626, 12.0000])), (("10P", 4.0, 20.0), np.array([0.3400, 0.1500, 12.0000])), (("10P", 4.0, 22.0), np.array([0.3411, 0.1424, 12.0000])), (("10P", 4.0, 24.0), np.array([0.3421, 0.1337, 12.0000])), (("10P", 4.0, 26.0), np.array([0.3428, 0.1248, 12.0000])), (("10P", 4.0, 28.0), np.array([0.3432, 0.1172, 12.0000])), (("10P", 4.0, 30.0), np.array([0.3440, 0.1080, 12.0000])), (("2.5RP", 4.0, 2.0), np.array([0.3231, 0.2951, 12.0000])), (("2.5RP", 4.0, 4.0), np.array([0.3340, 0.2770, 12.0000])), (("2.5RP", 4.0, 6.0), np.array([0.3442, 0.2595, 12.0000])), (("2.5RP", 4.0, 8.0), np.array([0.3533, 0.2438, 12.0000])), (("2.5RP", 4.0, 10.0), np.array([0.3608, 0.2301, 12.0000])), (("2.5RP", 4.0, 12.0), np.array([0.3683, 0.2162, 12.0000])), (("2.5RP", 4.0, 14.0), np.array([0.3748, 0.2039, 12.0000])), (("2.5RP", 4.0, 16.0), np.array([0.3807, 0.1923, 12.0000])), (("2.5RP", 4.0, 18.0), np.array([0.3865, 0.1802, 12.0000])), (("2.5RP", 4.0, 20.0), np.array([0.3926, 0.1679, 12.0000])), (("2.5RP", 4.0, 22.0), np.array([0.3967, 0.1593, 12.0000])), (("2.5RP", 4.0, 24.0), np.array([0.4011, 0.1504, 12.0000])), (("2.5RP", 4.0, 26.0), np.array([0.4048, 0.1428, 12.0000])), (("5RP", 4.0, 2.0), np.array([0.3310, 0.3010, 12.0000])), (("5RP", 4.0, 4.0), np.array([0.3491, 0.2872, 12.0000])), (("5RP", 4.0, 6.0), np.array([0.3671, 0.2733, 12.0000])), (("5RP", 4.0, 8.0), np.array([0.3833, 0.2600, 12.0000])), (("5RP", 4.0, 10.0), np.array([0.3960, 0.2489, 12.0000])), (("5RP", 4.0, 12.0), np.array([0.4104, 0.2361, 12.0000])), (("5RP", 4.0, 14.0), np.array([0.4225, 0.2249, 12.0000])), (("5RP", 4.0, 16.0), np.array([0.4339, 0.2139, 12.0000])), (("5RP", 4.0, 18.0), np.array([0.4455, 0.2023, 12.0000])), (("5RP", 4.0, 20.0), np.array([0.4571, 0.1906, 12.0000])), (("5RP", 4.0, 22.0), np.array([0.4656, 0.1821, 12.0000])), (("7.5RP", 4.0, 2.0), np.array([0.3371, 0.3061, 12.0000])), (("7.5RP", 4.0, 4.0), np.array([0.3612, 0.2963, 12.0000])), (("7.5RP", 4.0, 6.0), np.array([0.3850, 0.2859, 12.0000])), (("7.5RP", 4.0, 8.0), np.array([0.4072, 0.2750, 12.0000])), (("7.5RP", 4.0, 10.0), np.array([0.4259, 0.2651, 12.0000])), (("7.5RP", 4.0, 12.0), np.array([0.4450, 0.2541, 12.0000])), (("7.5RP", 4.0, 14.0), np.array([0.4629, 0.2437, 12.0000])), (("7.5RP", 4.0, 16.0), np.array([0.4799, 0.2329, 12.0000])), (("7.5RP", 4.0, 18.0), np.array([0.4965, 0.2217, 12.0000])), (("7.5RP", 4.0, 20.0), np.array([0.5130, 0.2101, 12.0000])), (("10RP", 5.0, 2.0), np.array([0.3332, 0.3131, 19.7700])), (("10RP", 5.0, 4.0), np.array([0.3594, 0.3090, 19.7700])), (("10RP", 5.0, 6.0), np.array([0.3851, 0.3039, 19.7700])), (("10RP", 5.0, 8.0), np.array([0.4105, 0.2980, 19.7700])), (("10RP", 5.0, 10.0), np.array([0.4332, 0.2918, 19.7700])), (("10RP", 5.0, 12.0), np.array([0.4579, 0.2841, 19.7700])), (("10RP", 5.0, 14.0), np.array([0.4767, 0.2776, 19.7700])), (("10RP", 5.0, 16.0), np.array([0.4986, 0.2695, 19.7700])), (("10RP", 5.0, 18.0), np.array([0.5185, 0.2620, 19.7700])), (("10RP", 5.0, 20.0), np.array([0.5396, 0.2535, 19.7700])), (("2.5R", 5.0, 2.0), np.array([0.3360, 0.3158, 19.7700])), (("2.5R", 5.0, 4.0), np.array([0.3660, 0.3148, 19.7700])), (("2.5R", 5.0, 6.0), np.array([0.3960, 0.3130, 19.7700])), (("2.5R", 5.0, 8.0), np.array([0.4252, 0.3101, 19.7700])), (("2.5R", 5.0, 10.0), np.array([0.4533, 0.3058, 19.7700])), (("2.5R", 5.0, 12.0), np.array([0.4820, 0.3002, 19.7700])), (("2.5R", 5.0, 14.0), np.array([0.5047, 0.2950, 19.7700])), (("2.5R", 5.0, 16.0), np.array([0.5300, 0.2880, 19.7700])), (("2.5R", 5.0, 18.0), np.array([0.5540, 0.2804, 19.7700])), (("2.5R", 5.0, 20.0), np.array([0.5784, 0.2719, 19.7700])), (("5R", 5.0, 2.0), np.array([0.3392, 0.3192, 19.7700])), (("5R", 5.0, 4.0), np.array([0.3740, 0.3220, 19.7700])), (("5R", 5.0, 6.0), np.array([0.4078, 0.3238, 19.7700])), (("5R", 5.0, 8.0), np.array([0.4413, 0.3240, 19.7700])), (("5R", 5.0, 10.0), np.array([0.4747, 0.3227, 19.7700])), (("5R", 5.0, 12.0), np.array([0.5071, 0.3194, 19.7700])), (("5R", 5.0, 14.0), np.array([0.5341, 0.3158, 19.7700])), (("5R", 5.0, 16.0), np.array([0.5637, 0.3102, 19.7700])), (("5R", 5.0, 18.0), np.array([0.5918, 0.3038, 19.7700])), (("5R", 5.0, 20.0), np.array([0.6142, 0.2970, 19.7700])), (("7.5R", 5.0, 2.0), np.array([0.3425, 0.3229, 19.7700])), (("7.5R", 5.0, 4.0), np.array([0.3806, 0.3294, 19.7700])), (("7.5R", 5.0, 6.0), np.array([0.4180, 0.3348, 19.7700])), (("7.5R", 5.0, 8.0), np.array([0.4563, 0.3387, 19.7700])), (("7.5R", 5.0, 10.0), np.array([0.4927, 0.3399, 19.7700])), (("7.5R", 5.0, 12.0), np.array([0.5280, 0.3389, 19.7700])), (("7.5R", 5.0, 14.0), np.array([0.5590, 0.3370, 19.7700])), (("7.5R", 5.0, 16.0), np.array([0.5901, 0.3331, 19.7700])), (("7.5R", 5.0, 18.0), np.array([0.6161, 0.3277, 19.7700])), (("7.5R", 5.0, 20.0), np.array([0.6388, 0.3216, 19.7700])), (("10R", 5.0, 2.0), np.array([0.3465, 0.3278, 19.7700])), (("10R", 5.0, 4.0), np.array([0.3879, 0.3398, 19.7700])), (("10R", 5.0, 6.0), np.array([0.4299, 0.3499, 19.7700])), (("10R", 5.0, 8.0), np.array([0.4713, 0.3575, 19.7700])), (("10R", 5.0, 10.0), np.array([0.5113, 0.3630, 19.7700])), (("10R", 5.0, 12.0), np.array([0.5481, 0.3660, 19.7700])), (("10R", 5.0, 14.0), np.array([0.5771, 0.3664, 19.7700])), (("10R", 5.0, 16.0), np.array([0.6037, 0.3657, 19.7700])), (("10R", 5.0, 18.0), np.array([0.6297, 0.3642, 19.7700])), (("2.5YR", 5.0, 2.0), np.array([0.3506, 0.3337, 19.7700])), (("2.5YR", 5.0, 4.0), np.array([0.3925, 0.3494, 19.7700])), (("2.5YR", 5.0, 6.0), np.array([0.4365, 0.3640, 19.7700])), (("2.5YR", 5.0, 8.0), np.array([0.4795, 0.3758, 19.7700])), (("2.5YR", 5.0, 10.0), np.array([0.5175, 0.3844, 19.7700])), (("2.5YR", 5.0, 12.0), np.array([0.5482, 0.3909, 19.7700])), (("2.5YR", 5.0, 14.0), np.array([0.5731, 0.3953, 19.7700])), (("2.5YR", 5.0, 16.0), np.array([0.5933, 0.3989, 19.7700])), (("5YR", 5.0, 2.0), np.array([0.3530, 0.3395, 19.7700])), (("5YR", 5.0, 4.0), np.array([0.3968, 0.3614, 19.7700])), (("5YR", 5.0, 6.0), np.array([0.4420, 0.3808, 19.7700])), (("5YR", 5.0, 8.0), np.array([0.4830, 0.3960, 19.7700])), (("5YR", 5.0, 10.0), np.array([0.5161, 0.4064, 19.7700])), (("5YR", 5.0, 12.0), np.array([0.5422, 0.4141, 19.7700])), (("5YR", 5.0, 14.0), np.array([0.5642, 0.4201, 19.7700])), (("7.5YR", 5.0, 2.0), np.array([0.3540, 0.3445, 19.7700])), (("7.5YR", 5.0, 4.0), np.array([0.3991, 0.3714, 19.7700])), (("7.5YR", 5.0, 6.0), np.array([0.4440, 0.3954, 19.7700])), (("7.5YR", 5.0, 8.0), np.array([0.4820, 0.4141, 19.7700])), (("7.5YR", 5.0, 10.0), np.array([0.5108, 0.4276, 19.7700])), (("7.5YR", 5.0, 12.0), np.array([0.5335, 0.4378, 19.7700])), (("7.5YR", 5.0, 14.0), np.array([0.5506, 0.4450, 19.7700])), (("10YR", 5.0, 2.0), np.array([0.3546, 0.3514, 19.7700])), (("10YR", 5.0, 4.0), np.array([0.3995, 0.3840, 19.7700])), (("10YR", 5.0, 6.0), np.array([0.4428, 0.4128, 19.7700])), (("10YR", 5.0, 8.0), np.array([0.4770, 0.4338, 19.7700])), (("10YR", 5.0, 10.0), np.array([0.5025, 0.4489, 19.7700])), (("10YR", 5.0, 12.0), np.array([0.5211, 0.4600, 19.7700])), (("2.5Y", 5.0, 2.0), np.array([0.3534, 0.3570, 19.7700])), (("2.5Y", 5.0, 4.0), np.array([0.3968, 0.3954, 19.7700])), (("2.5Y", 5.0, 6.0), np.array([0.4380, 0.4292, 19.7700])), (("2.5Y", 5.0, 8.0), np.array([0.4685, 0.4524, 19.7700])), (("2.5Y", 5.0, 10.0), np.array([0.4905, 0.4683, 19.7700])), (("2.5Y", 5.0, 12.0), np.array([0.5082, 0.4812, 19.7700])), (("5Y", 5.0, 2.0), np.array([0.3500, 0.3620, 19.7700])), (("5Y", 5.0, 4.0), np.array([0.3915, 0.4057, 19.7700])), (("5Y", 5.0, 6.0), np.array([0.4302, 0.4435, 19.7700])), (("5Y", 5.0, 8.0), np.array([0.4579, 0.4692, 19.7700])), (("5Y", 5.0, 10.0), np.array([0.4777, 0.4876, 19.7700])), (("5Y", 5.0, 12.0), np.array([0.4932, 0.5019, 19.7700])), (("7.5Y", 5.0, 2.0), np.array([0.3470, 0.3640, 19.7700])), (("7.5Y", 5.0, 4.0), np.array([0.3850, 0.4120, 19.7700])), (("7.5Y", 5.0, 6.0), np.array([0.4199, 0.4551, 19.7700])), (("7.5Y", 5.0, 8.0), np.array([0.4450, 0.4850, 19.7700])), (("7.5Y", 5.0, 10.0), np.array([0.4632, 0.5057, 19.7700])), (("7.5Y", 5.0, 12.0), np.array([0.4767, 0.5208, 19.7700])), (("10Y", 5.0, 2.0), np.array([0.3422, 0.3648, 19.7700])), (("10Y", 5.0, 4.0), np.array([0.3762, 0.4158, 19.7700])), (("10Y", 5.0, 6.0), np.array([0.4072, 0.4621, 19.7700])), (("10Y", 5.0, 8.0), np.array([0.4307, 0.4967, 19.7700])), (("10Y", 5.0, 10.0), np.array([0.4468, 0.5209, 19.7700])), (("10Y", 5.0, 12.0), np.array([0.4590, 0.5390, 19.7700])), (("2.5GY", 5.0, 2.0), np.array([0.3352, 0.3636, 19.7700])), (("2.5GY", 5.0, 4.0), np.array([0.3621, 0.4143, 19.7700])), (("2.5GY", 5.0, 6.0), np.array([0.3879, 0.4646, 19.7700])), (("2.5GY", 5.0, 8.0), np.array([0.4088, 0.5068, 19.7700])), (("2.5GY", 5.0, 10.0), np.array([0.4224, 0.5369, 19.7700])), (("2.5GY", 5.0, 12.0), np.array([0.4333, 0.5602, 19.7700])), (("5GY", 5.0, 2.0), np.array([0.3289, 0.3612, 19.7700])), (("5GY", 5.0, 4.0), np.array([0.3482, 0.4097, 19.7700])), (("5GY", 5.0, 6.0), np.array([0.3663, 0.4614, 19.7700])), (("5GY", 5.0, 8.0), np.array([0.3815, 0.5093, 19.7700])), (("5GY", 5.0, 10.0), np.array([0.3928, 0.5485, 19.7700])), (("5GY", 5.0, 12.0), np.array([0.4011, 0.5802, 19.7700])), (("7.5GY", 5.0, 2.0), np.array([0.3188, 0.3560, 19.7700])), (("7.5GY", 5.0, 4.0), np.array([0.3274, 0.3994, 19.7700])), (("7.5GY", 5.0, 6.0), np.array([0.3354, 0.4483, 19.7700])), (("7.5GY", 5.0, 8.0), np.array([0.3412, 0.4976, 19.7700])), (("7.5GY", 5.0, 10.0), np.array([0.3451, 0.5490, 19.7700])), (("7.5GY", 5.0, 12.0), np.array([0.3450, 0.5949, 19.7700])), (("7.5GY", 5.0, 14.0), np.array([0.3429, 0.6335, 19.7700])), (("10GY", 5.0, 2.0), np.array([0.3110, 0.3508, 19.7700])), (("10GY", 5.0, 4.0), np.array([0.3111, 0.3881, 19.7700])), (("10GY", 5.0, 6.0), np.array([0.3108, 0.4301, 19.7700])), (("10GY", 5.0, 8.0), np.array([0.3080, 0.4759, 19.7700])), (("10GY", 5.0, 10.0), np.array([0.3028, 0.5237, 19.7700])), (("10GY", 5.0, 12.0), np.array([0.2940, 0.5751, 19.7700])), (("10GY", 5.0, 14.0), np.array([0.2838, 0.6208, 19.7700])), (("10GY", 5.0, 16.0), np.array([0.2702, 0.6700, 19.7700])), (("10GY", 5.0, 18.0), np.array([0.2549, 0.7179, 19.7700])), (("2.5G", 5.0, 2.0), np.array([0.3030, 0.3445, 19.7700])), (("2.5G", 5.0, 4.0), np.array([0.2943, 0.3735, 19.7700])), (("2.5G", 5.0, 6.0), np.array([0.2841, 0.4045, 19.7700])), (("2.5G", 5.0, 8.0), np.array([0.2710, 0.4380, 19.7700])), (("2.5G", 5.0, 10.0), np.array([0.2565, 0.4705, 19.7700])), (("2.5G", 5.0, 12.0), np.array([0.2385, 0.5071, 19.7700])), (("2.5G", 5.0, 14.0), np.array([0.2211, 0.5411, 19.7700])), (("2.5G", 5.0, 16.0), np.array([0.2005, 0.5759, 19.7700])), (("2.5G", 5.0, 18.0), np.array([0.1782, 0.6095, 19.7700])), (("2.5G", 5.0, 20.0), np.array([0.1579, 0.6392, 19.7700])), (("2.5G", 5.0, 22.0), np.array([0.1377, 0.6674, 19.7700])), (("2.5G", 5.0, 24.0), np.array([0.1188, 0.6918, 19.7700])), (("2.5G", 5.0, 26.0), np.array([0.0992, 0.7155, 19.7700])), (("2.5G", 5.0, 28.0), np.array([0.0794, 0.7385, 19.7700])), (("5G", 5.0, 2.0), np.array([0.2978, 0.3392, 19.7700])), (("5G", 5.0, 4.0), np.array([0.2841, 0.3628, 19.7700])), (("5G", 5.0, 6.0), np.array([0.2690, 0.3860, 19.7700])), (("5G", 5.0, 8.0), np.array([0.2511, 0.4107, 19.7700])), (("5G", 5.0, 10.0), np.array([0.2329, 0.4331, 19.7700])), (("5G", 5.0, 12.0), np.array([0.2104, 0.4578, 19.7700])), (("5G", 5.0, 14.0), np.array([0.1912, 0.4773, 19.7700])), (("5G", 5.0, 16.0), np.array([0.1695, 0.4981, 19.7700])), (("5G", 5.0, 18.0), np.array([0.1489, 0.5171, 19.7700])), (("5G", 5.0, 20.0), np.array([0.1318, 0.5321, 19.7700])), (("5G", 5.0, 22.0), np.array([0.1144, 0.5463, 19.7700])), (("5G", 5.0, 24.0), np.array([0.0953, 0.5628, 19.7700])), (("5G", 5.0, 26.0), np.array([0.0784, 0.5761, 19.7700])), (("5G", 5.0, 28.0), np.array([0.0609, 0.5898, 19.7700])), (("7.5G", 5.0, 2.0), np.array([0.2945, 0.3355, 19.7700])), (("7.5G", 5.0, 4.0), np.array([0.2775, 0.3545, 19.7700])), (("7.5G", 5.0, 6.0), np.array([0.2598, 0.3724, 19.7700])), (("7.5G", 5.0, 8.0), np.array([0.2395, 0.3915, 19.7700])), (("7.5G", 5.0, 10.0), np.array([0.2200, 0.4082, 19.7700])), (("7.5G", 5.0, 12.0), np.array([0.1964, 0.4271, 19.7700])), (("7.5G", 5.0, 14.0), np.array([0.1776, 0.4415, 19.7700])), (("7.5G", 5.0, 16.0), np.array([0.1571, 0.4561, 19.7700])), (("7.5G", 5.0, 18.0), np.array([0.1372, 0.4705, 19.7700])), (("7.5G", 5.0, 20.0), np.array([0.1212, 0.4817, 19.7700])), (("7.5G", 5.0, 22.0), np.array([0.1050, 0.4927, 19.7700])), (("7.5G", 5.0, 24.0), np.array([0.0878, 0.5039, 19.7700])), (("7.5G", 5.0, 26.0), np.array([0.0730, 0.5131, 19.7700])), (("7.5G", 5.0, 28.0), np.array([0.0585, 0.5224, 19.7700])), (("10G", 5.0, 2.0), np.array([0.2910, 0.3310, 19.7700])), (("10G", 5.0, 4.0), np.array([0.2711, 0.3455, 19.7700])), (("10G", 5.0, 6.0), np.array([0.2519, 0.3587, 19.7700])), (("10G", 5.0, 8.0), np.array([0.2297, 0.3730, 19.7700])), (("10G", 5.0, 10.0), np.array([0.2095, 0.3853, 19.7700])), (("10G", 5.0, 12.0), np.array([0.1852, 0.3992, 19.7700])), (("10G", 5.0, 14.0), np.array([0.1671, 0.4089, 19.7700])), (("10G", 5.0, 16.0), np.array([0.1469, 0.4192, 19.7700])), (("10G", 5.0, 18.0), np.array([0.1275, 0.4288, 19.7700])), (("10G", 5.0, 20.0), np.array([0.1120, 0.4360, 19.7700])), (("10G", 5.0, 22.0), np.array([0.0958, 0.4428, 19.7700])), (("10G", 5.0, 24.0), np.array([0.0811, 0.4491, 19.7700])), (("10G", 5.0, 26.0), np.array([0.0690, 0.4542, 19.7700])), (("10G", 5.0, 28.0), np.array([0.0572, 0.4590, 19.7700])), (("2.5BG", 5.0, 2.0), np.array([0.2880, 0.3270, 19.7700])), (("2.5BG", 5.0, 4.0), np.array([0.2659, 0.3369, 19.7700])), (("2.5BG", 5.0, 6.0), np.array([0.2448, 0.3452, 19.7700])), (("2.5BG", 5.0, 8.0), np.array([0.2205, 0.3537, 19.7700])), (("2.5BG", 5.0, 10.0), np.array([0.1980, 0.3606, 19.7700])), (("2.5BG", 5.0, 12.0), np.array([0.1735, 0.3668, 19.7700])), (("2.5BG", 5.0, 14.0), np.array([0.1559, 0.3708, 19.7700])), (("2.5BG", 5.0, 16.0), np.array([0.1348, 0.3750, 19.7700])), (("2.5BG", 5.0, 18.0), np.array([0.1165, 0.3785, 19.7700])), (("2.5BG", 5.0, 20.0), np.array([0.1005, 0.3814, 19.7700])), (("2.5BG", 5.0, 22.0), np.array([0.0861, 0.3832, 19.7700])), (("2.5BG", 5.0, 24.0), np.array([0.0738, 0.3851, 19.7700])), (("5BG", 5.0, 2.0), np.array([0.2841, 0.3210, 19.7700])), (("5BG", 5.0, 4.0), np.array([0.2591, 0.3246, 19.7700])), (("5BG", 5.0, 6.0), np.array([0.2360, 0.3270, 19.7700])), (("5BG", 5.0, 8.0), np.array([0.2100, 0.3280, 19.7700])), (("5BG", 5.0, 10.0), np.array([0.1850, 0.3280, 19.7700])), (("5BG", 5.0, 12.0), np.array([0.1614, 0.3280, 19.7700])), (("5BG", 5.0, 14.0), np.array([0.1448, 0.3275, 19.7700])), (("5BG", 5.0, 16.0), np.array([0.1243, 0.3261, 19.7700])), (("5BG", 5.0, 18.0), np.array([0.1046, 0.3244, 19.7700])), (("5BG", 5.0, 20.0), np.array([0.0904, 0.3231, 19.7700])), (("5BG", 5.0, 22.0), np.array([0.0781, 0.3211, 19.7700])), (("7.5BG", 5.0, 2.0), np.array([0.2812, 0.3161, 19.7700])), (("7.5BG", 5.0, 4.0), np.array([0.2550, 0.3150, 19.7700])), (("7.5BG", 5.0, 6.0), np.array([0.2292, 0.3125, 19.7700])), (("7.5BG", 5.0, 8.0), np.array([0.2030, 0.3082, 19.7700])), (("7.5BG", 5.0, 10.0), np.array([0.1776, 0.3032, 19.7700])), (("7.5BG", 5.0, 12.0), np.array([0.1537, 0.2976, 19.7700])), (("7.5BG", 5.0, 14.0), np.array([0.1364, 0.2932, 19.7700])), (("7.5BG", 5.0, 16.0), np.array([0.1167, 0.2880, 19.7700])), (("7.5BG", 5.0, 18.0), np.array([0.0982, 0.2828, 19.7700])), (("10BG", 5.0, 2.0), np.array([0.2796, 0.3111, 19.7700])), (("10BG", 5.0, 4.0), np.array([0.2512, 0.3040, 19.7700])), (("10BG", 5.0, 6.0), np.array([0.2234, 0.2952, 19.7700])), (("10BG", 5.0, 8.0), np.array([0.1970, 0.2860, 19.7700])), (("10BG", 5.0, 10.0), np.array([0.1716, 0.2760, 19.7700])), (("10BG", 5.0, 12.0), np.array([0.1485, 0.2662, 19.7700])), (("10BG", 5.0, 14.0), np.array([0.1308, 0.2582, 19.7700])), (("10BG", 5.0, 16.0), np.array([0.1108, 0.2489, 19.7700])), (("2.5B", 5.0, 2.0), np.array([0.2791, 0.3071, 19.7700])), (("2.5B", 5.0, 4.0), np.array([0.2492, 0.2954, 19.7700])), (("2.5B", 5.0, 6.0), np.array([0.2210, 0.2823, 19.7700])), (("2.5B", 5.0, 8.0), np.array([0.1947, 0.2687, 19.7700])), (("2.5B", 5.0, 10.0), np.array([0.1697, 0.2549, 19.7700])), (("2.5B", 5.0, 12.0), np.array([0.1461, 0.2406, 19.7700])), (("2.5B", 5.0, 14.0), np.array([0.1283, 0.2292, 19.7700])), (("2.5B", 5.0, 16.0), np.array([0.1090, 0.2166, 19.7700])), (("5B", 5.0, 2.0), np.array([0.2794, 0.3032, 19.7700])), (("5B", 5.0, 4.0), np.array([0.2493, 0.2879, 19.7700])), (("5B", 5.0, 6.0), np.array([0.2215, 0.2701, 19.7700])), (("5B", 5.0, 8.0), np.array([0.1958, 0.2519, 19.7700])), (("5B", 5.0, 10.0), np.array([0.1729, 0.2347, 19.7700])), (("5B", 5.0, 12.0), np.array([0.1505, 0.2172, 19.7700])), (("5B", 5.0, 14.0), np.array([0.1320, 0.2021, 19.7700])), (("5B", 5.0, 16.0), np.array([0.1132, 0.1863, 19.7700])), (("7.5B", 5.0, 2.0), np.array([0.2803, 0.3000, 19.7700])), (("7.5B", 5.0, 4.0), np.array([0.2511, 0.2808, 19.7700])), (("7.5B", 5.0, 6.0), np.array([0.2248, 0.2612, 19.7700])), (("7.5B", 5.0, 8.0), np.array([0.2007, 0.2417, 19.7700])), (("7.5B", 5.0, 10.0), np.array([0.1792, 0.2230, 19.7700])), (("7.5B", 5.0, 12.0), np.array([0.1584, 0.2042, 19.7700])), (("7.5B", 5.0, 14.0), np.array([0.1404, 0.1878, 19.7700])), (("7.5B", 5.0, 16.0), np.array([0.1230, 0.1711, 19.7700])), (("10B", 5.0, 2.0), np.array([0.2821, 0.2966, 19.7700])), (("10B", 5.0, 4.0), np.array([0.2547, 0.2757, 19.7700])), (("10B", 5.0, 6.0), np.array([0.2299, 0.2548, 19.7700])), (("10B", 5.0, 8.0), np.array([0.2067, 0.2344, 19.7700])), (("10B", 5.0, 10.0), np.array([0.1860, 0.2149, 19.7700])), (("10B", 5.0, 12.0), np.array([0.1666, 0.1964, 19.7700])), (("10B", 5.0, 14.0), np.array([0.1492, 0.1797, 19.7700])), (("10B", 5.0, 16.0), np.array([0.1326, 0.1632, 19.7700])), (("10B", 5.0, 18.0), np.array([0.1203, 0.1505, 19.7700])), (("2.5PB", 5.0, 2.0), np.array([0.2847, 0.2942, 19.7700])), (("2.5PB", 5.0, 4.0), np.array([0.2600, 0.2720, 19.7700])), (("2.5PB", 5.0, 6.0), np.array([0.2365, 0.2488, 19.7700])), (("2.5PB", 5.0, 8.0), np.array([0.2157, 0.2278, 19.7700])), (("2.5PB", 5.0, 10.0), np.array([0.1968, 0.2078, 19.7700])), (("2.5PB", 5.0, 12.0), np.array([0.1793, 0.1894, 19.7700])), (("2.5PB", 5.0, 14.0), np.array([0.1642, 0.1728, 19.7700])), (("2.5PB", 5.0, 16.0), np.array([0.1495, 0.1559, 19.7700])), (("2.5PB", 5.0, 18.0), np.array([0.1363, 0.1410, 19.7700])), (("5PB", 5.0, 2.0), np.array([0.2882, 0.2923, 19.7700])), (("5PB", 5.0, 4.0), np.array([0.2662, 0.2687, 19.7700])), (("5PB", 5.0, 6.0), np.array([0.2447, 0.2449, 19.7700])), (("5PB", 5.0, 8.0), np.array([0.2255, 0.2239, 19.7700])), (("5PB", 5.0, 10.0), np.array([0.2080, 0.2041, 19.7700])), (("5PB", 5.0, 12.0), np.array([0.1918, 0.1858, 19.7700])), (("5PB", 5.0, 14.0), np.array([0.1773, 0.1689, 19.7700])), (("5PB", 5.0, 16.0), np.array([0.1638, 0.1521, 19.7700])), (("5PB", 5.0, 18.0), np.array([0.1518, 0.1365, 19.7700])), (("7.5PB", 5.0, 2.0), np.array([0.2918, 0.2908, 19.7700])), (("7.5PB", 5.0, 4.0), np.array([0.2739, 0.2666, 19.7700])), (("7.5PB", 5.0, 6.0), np.array([0.2563, 0.2417, 19.7700])), (("7.5PB", 5.0, 8.0), np.array([0.2417, 0.2204, 19.7700])), (("7.5PB", 5.0, 10.0), np.array([0.2285, 0.2020, 19.7700])), (("7.5PB", 5.0, 12.0), np.array([0.2157, 0.1830, 19.7700])), (("7.5PB", 5.0, 14.0), np.array([0.2042, 0.1661, 19.7700])), (("7.5PB", 5.0, 16.0), np.array([0.1945, 0.1511, 19.7700])), (("7.5PB", 5.0, 18.0), np.array([0.1862, 0.1365, 19.7700])), (("7.5PB", 5.0, 20.0), np.array([0.1794, 0.1239, 19.7700])), (("10PB", 5.0, 2.0), np.array([0.2959, 0.2905, 19.7700])), (("10PB", 5.0, 4.0), np.array([0.2821, 0.2659, 19.7700])), (("10PB", 5.0, 6.0), np.array([0.2686, 0.2412, 19.7700])), (("10PB", 5.0, 8.0), np.array([0.2572, 0.2211, 19.7700])), (("10PB", 5.0, 10.0), np.array([0.2478, 0.2030, 19.7700])), (("10PB", 5.0, 12.0), np.array([0.2384, 0.1857, 19.7700])), (("10PB", 5.0, 14.0), np.array([0.2299, 0.1698, 19.7700])), (("10PB", 5.0, 16.0), np.array([0.2224, 0.1555, 19.7700])), (("10PB", 5.0, 18.0), np.array([0.2174, 0.1444, 19.7700])), (("10PB", 5.0, 20.0), np.array([0.2121, 0.1329, 19.7700])), (("10PB", 5.0, 22.0), np.array([0.2082, 0.1225, 19.7700])), (("2.5P", 5.0, 2.0), np.array([0.3000, 0.2912, 19.7700])), (("2.5P", 5.0, 4.0), np.array([0.2898, 0.2667, 19.7700])), (("2.5P", 5.0, 6.0), np.array([0.2806, 0.2444, 19.7700])), (("2.5P", 5.0, 8.0), np.array([0.2728, 0.2240, 19.7700])), (("2.5P", 5.0, 10.0), np.array([0.2665, 0.2075, 19.7700])), (("2.5P", 5.0, 12.0), np.array([0.2608, 0.1913, 19.7700])), (("2.5P", 5.0, 14.0), np.array([0.2560, 0.1774, 19.7700])), (("2.5P", 5.0, 16.0), np.array([0.2515, 0.1644, 19.7700])), (("2.5P", 5.0, 18.0), np.array([0.2476, 0.1532, 19.7700])), (("2.5P", 5.0, 20.0), np.array([0.2438, 0.1419, 19.7700])), (("2.5P", 5.0, 22.0), np.array([0.2402, 0.1315, 19.7700])), (("2.5P", 5.0, 24.0), np.array([0.2372, 0.1223, 19.7700])), (("2.5P", 5.0, 26.0), np.array([0.2348, 0.1140, 19.7700])), (("5P", 5.0, 2.0), np.array([0.3045, 0.2928, 19.7700])), (("5P", 5.0, 4.0), np.array([0.2986, 0.2699, 19.7700])), (("5P", 5.0, 6.0), np.array([0.2932, 0.2487, 19.7700])), (("5P", 5.0, 8.0), np.array([0.2885, 0.2296, 19.7700])), (("5P", 5.0, 10.0), np.array([0.2845, 0.2137, 19.7700])), (("5P", 5.0, 12.0), np.array([0.2806, 0.1977, 19.7700])), (("5P", 5.0, 14.0), np.array([0.2775, 0.1847, 19.7700])), (("5P", 5.0, 16.0), np.array([0.2744, 0.1718, 19.7700])), (("5P", 5.0, 18.0), np.array([0.2718, 0.1604, 19.7700])), (("5P", 5.0, 20.0), np.array([0.2694, 0.1499, 19.7700])), (("5P", 5.0, 22.0), np.array([0.2673, 0.1398, 19.7700])), (("5P", 5.0, 24.0), np.array([0.2652, 0.1304, 19.7700])), (("5P", 5.0, 26.0), np.array([0.2635, 0.1224, 19.7700])), (("5P", 5.0, 28.0), np.array([0.2618, 0.1135, 19.7700])), (("7.5P", 5.0, 2.0), np.array([0.3103, 0.2959, 19.7700])), (("7.5P", 5.0, 4.0), np.array([0.3100, 0.2750, 19.7700])), (("7.5P", 5.0, 6.0), np.array([0.3093, 0.2555, 19.7700])), (("7.5P", 5.0, 8.0), np.array([0.3087, 0.2375, 19.7700])), (("7.5P", 5.0, 10.0), np.array([0.3080, 0.2230, 19.7700])), (("7.5P", 5.0, 12.0), np.array([0.3071, 0.2080, 19.7700])), (("7.5P", 5.0, 14.0), np.array([0.3068, 0.1951, 19.7700])), (("7.5P", 5.0, 16.0), np.array([0.3060, 0.1830, 19.7700])), (("7.5P", 5.0, 18.0), np.array([0.3052, 0.1711, 19.7700])), (("7.5P", 5.0, 20.0), np.array([0.3042, 0.1606, 19.7700])), (("7.5P", 5.0, 22.0), np.array([0.3038, 0.1500, 19.7700])), (("7.5P", 5.0, 24.0), np.array([0.3030, 0.1423, 19.7700])), (("7.5P", 5.0, 26.0), np.array([0.3022, 0.1331, 19.7700])), (("7.5P", 5.0, 28.0), np.array([0.3018, 0.1253, 19.7700])), (("7.5P", 5.0, 30.0), np.array([0.3010, 0.1170, 19.7700])), (("10P", 5.0, 2.0), np.array([0.3148, 0.2986, 19.7700])), (("10P", 5.0, 4.0), np.array([0.3198, 0.2807, 19.7700])), (("10P", 5.0, 6.0), np.array([0.3243, 0.2630, 19.7700])), (("10P", 5.0, 8.0), np.array([0.3280, 0.2464, 19.7700])), (("10P", 5.0, 10.0), np.array([0.3308, 0.2328, 19.7700])), (("10P", 5.0, 12.0), np.array([0.3335, 0.2187, 19.7700])), (("10P", 5.0, 14.0), np.array([0.3360, 0.2066, 19.7700])), (("10P", 5.0, 16.0), np.array([0.3382, 0.1951, 19.7700])), (("10P", 5.0, 18.0), np.array([0.3401, 0.1840, 19.7700])), (("10P", 5.0, 20.0), np.array([0.3422, 0.1735, 19.7700])), (("10P", 5.0, 22.0), np.array([0.3437, 0.1644, 19.7700])), (("10P", 5.0, 24.0), np.array([0.3450, 0.1555, 19.7700])), (("10P", 5.0, 26.0), np.array([0.3468, 0.1460, 19.7700])), (("10P", 5.0, 28.0), np.array([0.3478, 0.1388, 19.7700])), (("10P", 5.0, 30.0), np.array([0.3490, 0.1308, 19.7700])), (("2.5RP", 5.0, 2.0), np.array([0.3199, 0.3019, 19.7700])), (("2.5RP", 5.0, 4.0), np.array([0.3298, 0.2869, 19.7700])), (("2.5RP", 5.0, 6.0), np.array([0.3396, 0.2718, 19.7700])), (("2.5RP", 5.0, 8.0), np.array([0.3490, 0.2570, 19.7700])), (("2.5RP", 5.0, 10.0), np.array([0.3560, 0.2452, 19.7700])), (("2.5RP", 5.0, 12.0), np.array([0.3635, 0.2325, 19.7700])), (("2.5RP", 5.0, 14.0), np.array([0.3703, 0.2211, 19.7700])), (("2.5RP", 5.0, 16.0), np.array([0.3763, 0.2108, 19.7700])), (("2.5RP", 5.0, 18.0), np.array([0.3821, 0.2007, 19.7700])), (("2.5RP", 5.0, 20.0), np.array([0.3873, 0.1909, 19.7700])), (("2.5RP", 5.0, 22.0), np.array([0.3924, 0.1814, 19.7700])), (("2.5RP", 5.0, 24.0), np.array([0.3965, 0.1738, 19.7700])), (("2.5RP", 5.0, 26.0), np.array([0.4011, 0.1652, 19.7700])), (("5RP", 5.0, 2.0), np.array([0.3256, 0.3065, 19.7700])), (("5RP", 5.0, 4.0), np.array([0.3421, 0.2954, 19.7700])), (("5RP", 5.0, 6.0), np.array([0.3585, 0.2842, 19.7700])), (("5RP", 5.0, 8.0), np.array([0.3748, 0.2729, 19.7700])), (("5RP", 5.0, 10.0), np.array([0.3880, 0.2630, 19.7700])), (("5RP", 5.0, 12.0), np.array([0.4022, 0.2523, 19.7700])), (("5RP", 5.0, 14.0), np.array([0.4142, 0.2428, 19.7700])), (("5RP", 5.0, 16.0), np.array([0.4261, 0.2331, 19.7700])), (("5RP", 5.0, 18.0), np.array([0.4372, 0.2242, 19.7700])), (("5RP", 5.0, 20.0), np.array([0.4484, 0.2150, 19.7700])), (("5RP", 5.0, 22.0), np.array([0.4581, 0.2068, 19.7700])), (("5RP", 5.0, 24.0), np.array([0.4683, 0.1978, 19.7700])), (("7.5RP", 5.0, 2.0), np.array([0.3296, 0.3098, 19.7700])), (("7.5RP", 5.0, 4.0), np.array([0.3515, 0.3024, 19.7700])), (("7.5RP", 5.0, 6.0), np.array([0.3726, 0.2941, 19.7700])), (("7.5RP", 5.0, 8.0), np.array([0.3932, 0.2852, 19.7700])), (("7.5RP", 5.0, 10.0), np.array([0.4108, 0.2773, 19.7700])), (("7.5RP", 5.0, 12.0), np.array([0.4303, 0.2675, 19.7700])), (("7.5RP", 5.0, 14.0), np.array([0.4454, 0.2596, 19.7700])), (("7.5RP", 5.0, 16.0), np.array([0.4617, 0.2506, 19.7700])), (("7.5RP", 5.0, 18.0), np.array([0.4761, 0.2421, 19.7700])), (("7.5RP", 5.0, 20.0), np.array([0.4915, 0.2330, 19.7700])), (("7.5RP", 5.0, 22.0), np.array([0.5045, 0.2248, 19.7700])), (("10RP", 6.0, 2.0), np.array([0.3292, 0.3141, 30.0500])), (("10RP", 6.0, 4.0), np.array([0.3508, 0.3112, 30.0500])), (("10RP", 6.0, 6.0), np.array([0.3740, 0.3074, 30.0500])), (("10RP", 6.0, 8.0), np.array([0.3930, 0.3038, 30.0500])), (("10RP", 6.0, 10.0), np.array([0.4150, 0.2989, 30.0500])), (("10RP", 6.0, 12.0), np.array([0.4360, 0.2936, 30.0500])), (("10RP", 6.0, 14.0), np.array([0.4552, 0.2881, 30.0500])), (("10RP", 6.0, 16.0), np.array([0.4781, 0.2812, 30.0500])), (("10RP", 6.0, 18.0), np.array([0.4961, 0.2751, 30.0500])), (("2.5R", 6.0, 2.0), np.array([0.3318, 0.3166, 30.0500])), (("2.5R", 6.0, 4.0), np.array([0.3566, 0.3163, 30.0500])), (("2.5R", 6.0, 6.0), np.array([0.3832, 0.3158, 30.0500])), (("2.5R", 6.0, 8.0), np.array([0.4065, 0.3144, 30.0500])), (("2.5R", 6.0, 10.0), np.array([0.4320, 0.3118, 30.0500])), (("2.5R", 6.0, 12.0), np.array([0.4568, 0.3082, 30.0500])), (("2.5R", 6.0, 14.0), np.array([0.4790, 0.3041, 30.0500])), (("2.5R", 6.0, 16.0), np.array([0.5041, 0.2983, 30.0500])), (("2.5R", 6.0, 18.0), np.array([0.5262, 0.2928, 30.0500])), (("5R", 6.0, 2.0), np.array([0.3343, 0.3190, 30.0500])), (("5R", 6.0, 4.0), np.array([0.3628, 0.3221, 30.0500])), (("5R", 6.0, 6.0), np.array([0.3921, 0.3244, 30.0500])), (("5R", 6.0, 8.0), np.array([0.4187, 0.3251, 30.0500])), (("5R", 6.0, 10.0), np.array([0.4480, 0.3250, 30.0500])), (("5R", 6.0, 12.0), np.array([0.4760, 0.3234, 30.0500])), (("5R", 6.0, 14.0), np.array([0.5020, 0.3212, 30.0500])), (("5R", 6.0, 16.0), np.array([0.5297, 0.3179, 30.0500])), (("5R", 6.0, 18.0), np.array([0.5552, 0.3138, 30.0500])), (("7.5R", 6.0, 2.0), np.array([0.3381, 0.3228, 30.0500])), (("7.5R", 6.0, 4.0), np.array([0.3692, 0.3291, 30.0500])), (("7.5R", 6.0, 6.0), np.array([0.4000, 0.3340, 30.0500])), (("7.5R", 6.0, 8.0), np.array([0.4318, 0.3383, 30.0500])), (("7.5R", 6.0, 10.0), np.array([0.4655, 0.3412, 30.0500])), (("7.5R", 6.0, 12.0), np.array([0.4961, 0.3428, 30.0500])), (("7.5R", 6.0, 14.0), np.array([0.5265, 0.3431, 30.0500])), (("7.5R", 6.0, 16.0), np.array([0.5560, 0.3420, 30.0500])), (("7.5R", 6.0, 18.0), np.array([0.5829, 0.3396, 30.0500])), (("10R", 6.0, 2.0), np.array([0.3417, 0.3268, 30.0500])), (("10R", 6.0, 4.0), np.array([0.3768, 0.3381, 30.0500])), (("10R", 6.0, 6.0), np.array([0.4103, 0.3473, 30.0500])), (("10R", 6.0, 8.0), np.array([0.4449, 0.3550, 30.0500])), (("10R", 6.0, 10.0), np.array([0.4812, 0.3619, 30.0500])), (("10R", 6.0, 12.0), np.array([0.5150, 0.3667, 30.0500])), (("10R", 6.0, 14.0), np.array([0.5468, 0.3697, 30.0500])), (("10R", 6.0, 16.0), np.array([0.5741, 0.3713, 30.0500])), (("10R", 6.0, 18.0), np.array([0.6009, 0.3720, 30.0500])), (("2.5YR", 6.0, 2.0), np.array([0.3453, 0.3321, 30.0500])), (("2.5YR", 6.0, 4.0), np.array([0.3806, 0.3467, 30.0500])), (("2.5YR", 6.0, 6.0), np.array([0.4180, 0.3600, 30.0500])), (("2.5YR", 6.0, 8.0), np.array([0.4533, 0.3708, 30.0500])), (("2.5YR", 6.0, 10.0), np.array([0.4891, 0.3806, 30.0500])), (("2.5YR", 6.0, 12.0), np.array([0.5215, 0.3887, 30.0500])), (("2.5YR", 6.0, 14.0), np.array([0.5488, 0.3947, 30.0500])), (("2.5YR", 6.0, 16.0), np.array([0.5698, 0.3990, 30.0500])), (("2.5YR", 6.0, 18.0), np.array([0.5879, 0.4021, 30.0500])), (("5YR", 6.0, 2.0), np.array([0.3474, 0.3373, 30.0500])), (("5YR", 6.0, 4.0), np.array([0.3840, 0.3564, 30.0500])), (("5YR", 6.0, 6.0), np.array([0.4229, 0.3750, 30.0500])), (("5YR", 6.0, 8.0), np.array([0.4592, 0.3900, 30.0500])), (("5YR", 6.0, 10.0), np.array([0.4921, 0.4022, 30.0500])), (("5YR", 6.0, 12.0), np.array([0.5199, 0.4119, 30.0500])), (("5YR", 6.0, 14.0), np.array([0.5423, 0.4188, 30.0500])), (("5YR", 6.0, 16.0), np.array([0.5597, 0.4239, 30.0500])), (("5YR", 6.0, 18.0), np.array([0.5715, 0.4270, 30.0500])), (("7.5YR", 6.0, 2.0), np.array([0.3487, 0.3421, 30.0500])), (("7.5YR", 6.0, 4.0), np.array([0.3860, 0.3652, 30.0500])), (("7.5YR", 6.0, 6.0), np.array([0.4242, 0.3876, 30.0500])), (("7.5YR", 6.0, 8.0), np.array([0.4596, 0.4064, 30.0500])), (("7.5YR", 6.0, 10.0), np.array([0.4904, 0.4220, 30.0500])), (("7.5YR", 6.0, 12.0), np.array([0.5145, 0.4331, 30.0500])), (("7.5YR", 6.0, 14.0), np.array([0.5320, 0.4412, 30.0500])), (("7.5YR", 6.0, 16.0), np.array([0.5468, 0.4478, 30.0500])), (("10YR", 6.0, 2.0), np.array([0.3491, 0.3483, 30.0500])), (("10YR", 6.0, 4.0), np.array([0.3861, 0.3767, 30.0500])), (("10YR", 6.0, 6.0), np.array([0.4240, 0.4030, 30.0500])), (("10YR", 6.0, 8.0), np.array([0.4570, 0.4249, 30.0500])), (("10YR", 6.0, 10.0), np.array([0.4843, 0.4416, 30.0500])), (("10YR", 6.0, 12.0), np.array([0.5050, 0.4536, 30.0500])), (("10YR", 6.0, 14.0), np.array([0.5200, 0.4623, 30.0500])), (("2.5Y", 6.0, 2.0), np.array([0.3480, 0.3540, 30.0500])), (("2.5Y", 6.0, 4.0), np.array([0.3840, 0.3867, 30.0500])), (("2.5Y", 6.0, 6.0), np.array([0.4203, 0.4176, 30.0500])), (("2.5Y", 6.0, 8.0), np.array([0.4517, 0.4421, 30.0500])), (("2.5Y", 6.0, 10.0), np.array([0.4760, 0.4607, 30.0500])), (("2.5Y", 6.0, 12.0), np.array([0.4928, 0.4730, 30.0500])), (("2.5Y", 6.0, 14.0), np.array([0.5061, 0.4829, 30.0500])), (("5Y", 6.0, 2.0), np.array([0.3457, 0.3580, 30.0500])), (("5Y", 6.0, 4.0), np.array([0.3794, 0.3955, 30.0500])), (("5Y", 6.0, 6.0), np.array([0.4140, 0.4305, 30.0500])), (("5Y", 6.0, 8.0), np.array([0.4426, 0.4588, 30.0500])), (("5Y", 6.0, 10.0), np.array([0.4639, 0.4790, 30.0500])), (("5Y", 6.0, 12.0), np.array([0.4780, 0.4920, 30.0500])), (("5Y", 6.0, 14.0), np.array([0.4905, 0.5038, 30.0500])), (("7.5Y", 6.0, 2.0), np.array([0.3431, 0.3601, 30.0500])), (("7.5Y", 6.0, 4.0), np.array([0.3745, 0.4004, 30.0500])), (("7.5Y", 6.0, 6.0), np.array([0.4060, 0.4400, 30.0500])), (("7.5Y", 6.0, 8.0), np.array([0.4321, 0.4719, 30.0500])), (("7.5Y", 6.0, 10.0), np.array([0.4512, 0.4943, 30.0500])), (("7.5Y", 6.0, 12.0), np.array([0.4638, 0.5087, 30.0500])), (("7.5Y", 6.0, 14.0), np.array([0.4754, 0.5220, 30.0500])), (("10Y", 6.0, 2.0), np.array([0.3398, 0.3611, 30.0500])), (("10Y", 6.0, 4.0), np.array([0.3679, 0.4033, 30.0500])), (("10Y", 6.0, 6.0), np.array([0.3960, 0.4452, 30.0500])), (("10Y", 6.0, 8.0), np.array([0.4201, 0.4812, 30.0500])), (("10Y", 6.0, 10.0), np.array([0.4372, 0.5068, 30.0500])), (("10Y", 6.0, 12.0), np.array([0.4488, 0.5237, 30.0500])), (("10Y", 6.0, 14.0), np.array([0.4593, 0.5392, 30.0500])), (("2.5GY", 6.0, 2.0), np.array([0.3342, 0.3607, 30.0500])), (("2.5GY", 6.0, 4.0), np.array([0.3572, 0.4038, 30.0500])), (("2.5GY", 6.0, 6.0), np.array([0.3799, 0.4470, 30.0500])), (("2.5GY", 6.0, 8.0), np.array([0.4006, 0.4885, 30.0500])), (("2.5GY", 6.0, 10.0), np.array([0.4159, 0.5190, 30.0500])), (("2.5GY", 6.0, 12.0), np.array([0.4269, 0.5414, 30.0500])), (("2.5GY", 6.0, 14.0), np.array([0.4354, 0.5594, 30.0500])), (("5GY", 6.0, 2.0), np.array([0.3288, 0.3592, 30.0500])), (("5GY", 6.0, 4.0), np.array([0.3461, 0.4008, 30.0500])), (("5GY", 6.0, 6.0), np.array([0.3622, 0.4438, 30.0500])), (("5GY", 6.0, 8.0), np.array([0.3772, 0.4880, 30.0500])), (("5GY", 6.0, 10.0), np.array([0.3891, 0.5264, 30.0500])), (("5GY", 6.0, 12.0), np.array([0.3980, 0.5564, 30.0500])), (("5GY", 6.0, 14.0), np.array([0.4042, 0.5788, 30.0500])), (("7.5GY", 6.0, 2.0), np.array([0.3193, 0.3550, 30.0500])), (("7.5GY", 6.0, 4.0), np.array([0.3275, 0.3922, 30.0500])), (("7.5GY", 6.0, 6.0), np.array([0.3351, 0.4321, 30.0500])), (("7.5GY", 6.0, 8.0), np.array([0.3418, 0.4768, 30.0500])), (("7.5GY", 6.0, 10.0), np.array([0.3463, 0.5196, 30.0500])), (("7.5GY", 6.0, 12.0), np.array([0.3488, 0.5596, 30.0500])), (("7.5GY", 6.0, 14.0), np.array([0.3498, 0.5985, 30.0500])), (("7.5GY", 6.0, 16.0), np.array([0.3498, 0.6282, 30.0500])), (("10GY", 6.0, 2.0), np.array([0.3112, 0.3496, 30.0500])), (("10GY", 6.0, 4.0), np.array([0.3124, 0.3822, 30.0500])), (("10GY", 6.0, 6.0), np.array([0.3128, 0.4175, 30.0500])), (("10GY", 6.0, 8.0), np.array([0.3116, 0.4563, 30.0500])), (("10GY", 6.0, 10.0), np.array([0.3086, 0.4949, 30.0500])), (("10GY", 6.0, 12.0), np.array([0.3037, 0.5358, 30.0500])), (("10GY", 6.0, 14.0), np.array([0.2962, 0.5802, 30.0500])), (("10GY", 6.0, 16.0), np.array([0.2872, 0.6199, 30.0500])), (("10GY", 6.0, 18.0), np.array([0.2763, 0.6616, 30.0500])), (("10GY", 6.0, 20.0), np.array([0.2648, 0.7004, 30.0500])), (("2.5G", 6.0, 2.0), np.array([0.3039, 0.3437, 30.0500])), (("2.5G", 6.0, 4.0), np.array([0.2967, 0.3695, 30.0500])), (("2.5G", 6.0, 6.0), np.array([0.2892, 0.3963, 30.0500])), (("2.5G", 6.0, 8.0), np.array([0.2799, 0.4239, 30.0500])), (("2.5G", 6.0, 10.0), np.array([0.2690, 0.4530, 30.0500])), (("2.5G", 6.0, 12.0), np.array([0.2574, 0.4814, 30.0500])), (("2.5G", 6.0, 14.0), np.array([0.2426, 0.5133, 30.0500])), (("2.5G", 6.0, 16.0), np.array([0.2278, 0.5430, 30.0500])), (("2.5G", 6.0, 18.0), np.array([0.2102, 0.5737, 30.0500])), (("2.5G", 6.0, 20.0), np.array([0.1922, 0.6035, 30.0500])), (("2.5G", 6.0, 22.0), np.array([0.1739, 0.6318, 30.0500])), (("2.5G", 6.0, 24.0), np.array([0.1536, 0.6605, 30.0500])), (("2.5G", 6.0, 26.0), np.array([0.1340, 0.6871, 30.0500])), (("2.5G", 6.0, 28.0), np.array([0.1145, 0.7122, 30.0500])), (("5G", 6.0, 2.0), np.array([0.2988, 0.3382, 30.0500])), (("5G", 6.0, 4.0), np.array([0.2868, 0.3595, 30.0500])), (("5G", 6.0, 6.0), np.array([0.2748, 0.3795, 30.0500])), (("5G", 6.0, 8.0), np.array([0.2612, 0.3990, 30.0500])), (("5G", 6.0, 10.0), np.array([0.2466, 0.4181, 30.0500])), (("5G", 6.0, 12.0), np.array([0.2293, 0.4390, 30.0500])), (("5G", 6.0, 14.0), np.array([0.2130, 0.4571, 30.0500])), (("5G", 6.0, 16.0), np.array([0.1960, 0.4751, 30.0500])), (("5G", 6.0, 18.0), np.array([0.1785, 0.4924, 30.0500])), (("5G", 6.0, 20.0), np.array([0.1609, 0.5091, 30.0500])), (("5G", 6.0, 22.0), np.array([0.1432, 0.5252, 30.0500])), (("5G", 6.0, 24.0), np.array([0.1252, 0.5408, 30.0500])), (("5G", 6.0, 26.0), np.array([0.1079, 0.5560, 30.0500])), (("5G", 6.0, 28.0), np.array([0.0908, 0.5695, 30.0500])), (("7.5G", 6.0, 2.0), np.array([0.2958, 0.3344, 30.0500])), (("7.5G", 6.0, 4.0), np.array([0.2807, 0.3522, 30.0500])), (("7.5G", 6.0, 6.0), np.array([0.2662, 0.3672, 30.0500])), (("7.5G", 6.0, 8.0), np.array([0.2510, 0.3829, 30.0500])), (("7.5G", 6.0, 10.0), np.array([0.2350, 0.3979, 30.0500])), (("7.5G", 6.0, 12.0), np.array([0.2171, 0.4138, 30.0500])), (("7.5G", 6.0, 14.0), np.array([0.2001, 0.4278, 30.0500])), (("7.5G", 6.0, 16.0), np.array([0.1832, 0.4414, 30.0500])), (("7.5G", 6.0, 18.0), np.array([0.1654, 0.4551, 30.0500])), (("7.5G", 6.0, 20.0), np.array([0.1485, 0.4677, 30.0500])), (("7.5G", 6.0, 22.0), np.array([0.1325, 0.4795, 30.0500])), (("7.5G", 6.0, 24.0), np.array([0.1159, 0.4910, 30.0500])), (("7.5G", 6.0, 26.0), np.array([0.1010, 0.5018, 30.0500])), (("7.5G", 6.0, 28.0), np.array([0.0858, 0.5127, 30.0500])), (("10G", 6.0, 2.0), np.array([0.2929, 0.3303, 30.0500])), (("10G", 6.0, 4.0), np.array([0.2749, 0.3443, 30.0500])), (("10G", 6.0, 6.0), np.array([0.2591, 0.3558, 30.0500])), (("10G", 6.0, 8.0), np.array([0.2420, 0.3679, 30.0500])), (("10G", 6.0, 10.0), np.array([0.2247, 0.3796, 30.0500])), (("10G", 6.0, 12.0), np.array([0.2060, 0.3914, 30.0500])), (("10G", 6.0, 14.0), np.array([0.1895, 0.4015, 30.0500])), (("10G", 6.0, 16.0), np.array([0.1722, 0.4113, 30.0500])), (("10G", 6.0, 18.0), np.array([0.1551, 0.4208, 30.0500])), (("10G", 6.0, 20.0), np.array([0.1382, 0.4299, 30.0500])), (("10G", 6.0, 22.0), np.array([0.1230, 0.4378, 30.0500])), (("10G", 6.0, 24.0), np.array([0.1070, 0.4458, 30.0500])), (("10G", 6.0, 26.0), np.array([0.0941, 0.4520, 30.0500])), (("2.5BG", 6.0, 2.0), np.array([0.2902, 0.3268, 30.0500])), (("2.5BG", 6.0, 4.0), np.array([0.2702, 0.3369, 30.0500])), (("2.5BG", 6.0, 6.0), np.array([0.2526, 0.3448, 30.0500])), (("2.5BG", 6.0, 8.0), np.array([0.2332, 0.3522, 30.0500])), (("2.5BG", 6.0, 10.0), np.array([0.2148, 0.3584, 30.0500])), (("2.5BG", 6.0, 12.0), np.array([0.1954, 0.3645, 30.0500])), (("2.5BG", 6.0, 14.0), np.array([0.1779, 0.3699, 30.0500])), (("2.5BG", 6.0, 16.0), np.array([0.1600, 0.3748, 30.0500])), (("2.5BG", 6.0, 18.0), np.array([0.1428, 0.3790, 30.0500])), (("2.5BG", 6.0, 20.0), np.array([0.1269, 0.3829, 30.0500])), (("2.5BG", 6.0, 22.0), np.array([0.1120, 0.3860, 30.0500])), (("5BG", 6.0, 2.0), np.array([0.2872, 0.3219, 30.0500])), (("5BG", 6.0, 4.0), np.array([0.2648, 0.3262, 30.0500])), (("5BG", 6.0, 6.0), np.array([0.2441, 0.3290, 30.0500])), (("5BG", 6.0, 8.0), np.array([0.2236, 0.3311, 30.0500])), (("5BG", 6.0, 10.0), np.array([0.2037, 0.3329, 30.0500])), (("5BG", 6.0, 12.0), np.array([0.1844, 0.3337, 30.0500])), (("5BG", 6.0, 14.0), np.array([0.1662, 0.3343, 30.0500])), (("5BG", 6.0, 16.0), np.array([0.1491, 0.3345, 30.0500])), (("5BG", 6.0, 18.0), np.array([0.1325, 0.3345, 30.0500])), (("5BG", 6.0, 20.0), np.array([0.1168, 0.3344, 30.0500])), (("7.5BG", 6.0, 2.0), np.array([0.2849, 0.3172, 30.0500])), (("7.5BG", 6.0, 4.0), np.array([0.2604, 0.3169, 30.0500])), (("7.5BG", 6.0, 6.0), np.array([0.2384, 0.3155, 30.0500])), (("7.5BG", 6.0, 8.0), np.array([0.2171, 0.3138, 30.0500])), (("7.5BG", 6.0, 10.0), np.array([0.1961, 0.3110, 30.0500])), (("7.5BG", 6.0, 12.0), np.array([0.1762, 0.3081, 30.0500])), (("7.5BG", 6.0, 14.0), np.array([0.1585, 0.3052, 30.0500])), (("7.5BG", 6.0, 16.0), np.array([0.1408, 0.3017, 30.0500])), (("7.5BG", 6.0, 18.0), np.array([0.1248, 0.2981, 30.0500])), (("10BG", 6.0, 2.0), np.array([0.2837, 0.3132, 30.0500])), (("10BG", 6.0, 4.0), np.array([0.2578, 0.3078, 30.0500])), (("10BG", 6.0, 6.0), np.array([0.2335, 0.3015, 30.0500])), (("10BG", 6.0, 8.0), np.array([0.2116, 0.2950, 30.0500])), (("10BG", 6.0, 10.0), np.array([0.1909, 0.2881, 30.0500])), (("10BG", 6.0, 12.0), np.array([0.1698, 0.2802, 30.0500])), (("10BG", 6.0, 14.0), np.array([0.1518, 0.2729, 30.0500])), (("10BG", 6.0, 16.0), np.array([0.1337, 0.2651, 30.0500])), (("10BG", 6.0, 18.0), np.array([0.1181, 0.2581, 30.0500])), (("2.5B", 6.0, 2.0), np.array([0.2835, 0.3097, 30.0500])), (("2.5B", 6.0, 4.0), np.array([0.2571, 0.3008, 30.0500])), (("2.5B", 6.0, 6.0), np.array([0.2312, 0.2899, 30.0500])), (("2.5B", 6.0, 8.0), np.array([0.2080, 0.2789, 30.0500])), (("2.5B", 6.0, 10.0), np.array([0.1879, 0.2682, 30.0500])), (("2.5B", 6.0, 12.0), np.array([0.1660, 0.2561, 30.0500])), (("2.5B", 6.0, 14.0), np.array([0.1480, 0.2459, 30.0500])), (("2.5B", 6.0, 16.0), np.array([0.1294, 0.2348, 30.0500])), (("5B", 6.0, 2.0), np.array([0.2842, 0.3063, 30.0500])), (("5B", 6.0, 4.0), np.array([0.2579, 0.2938, 30.0500])), (("5B", 6.0, 6.0), np.array([0.2320, 0.2789, 30.0500])), (("5B", 6.0, 8.0), np.array([0.2088, 0.2635, 30.0500])), (("5B", 6.0, 10.0), np.array([0.1883, 0.2487, 30.0500])), (("5B", 6.0, 12.0), np.array([0.1685, 0.2339, 30.0500])), (("5B", 6.0, 14.0), np.array([0.1496, 0.2193, 30.0500])), (("5B", 6.0, 16.0), np.array([0.1310, 0.2048, 30.0500])), (("7.5B", 6.0, 2.0), np.array([0.2854, 0.3037, 30.0500])), (("7.5B", 6.0, 4.0), np.array([0.2602, 0.2881, 30.0500])), (("7.5B", 6.0, 6.0), np.array([0.2352, 0.2708, 30.0500])), (("7.5B", 6.0, 8.0), np.array([0.2132, 0.2537, 30.0500])), (("7.5B", 6.0, 10.0), np.array([0.1934, 0.2374, 30.0500])), (("7.5B", 6.0, 12.0), np.array([0.1734, 0.2203, 30.0500])), (("7.5B", 6.0, 14.0), np.array([0.1556, 0.2043, 30.0500])), (("7.5B", 6.0, 16.0), np.array([0.1376, 0.1879, 30.0500])), (("10B", 6.0, 2.0), np.array([0.2871, 0.3012, 30.0500])), (("10B", 6.0, 4.0), np.array([0.2637, 0.2840, 30.0500])), (("10B", 6.0, 6.0), np.array([0.2399, 0.2650, 30.0500])), (("10B", 6.0, 8.0), np.array([0.2189, 0.2468, 30.0500])), (("10B", 6.0, 10.0), np.array([0.2000, 0.2298, 30.0500])), (("10B", 6.0, 12.0), np.array([0.1803, 0.2114, 30.0500])), (("10B", 6.0, 14.0), np.array([0.1629, 0.1947, 30.0500])), (("10B", 6.0, 16.0), np.array([0.1454, 0.1778, 30.0500])), (("2.5PB", 6.0, 2.0), np.array([0.2897, 0.2991, 30.0500])), (("2.5PB", 6.0, 4.0), np.array([0.2684, 0.2804, 30.0500])), (("2.5PB", 6.0, 6.0), np.array([0.2465, 0.2599, 30.0500])), (("2.5PB", 6.0, 8.0), np.array([0.2274, 0.2406, 30.0500])), (("2.5PB", 6.0, 10.0), np.array([0.2095, 0.2225, 30.0500])), (("2.5PB", 6.0, 12.0), np.array([0.1913, 0.2038, 30.0500])), (("2.5PB", 6.0, 14.0), np.array([0.1754, 0.1868, 30.0500])), (("5PB", 6.0, 2.0), np.array([0.2923, 0.2978, 30.0500])), (("5PB", 6.0, 4.0), np.array([0.2734, 0.2778, 30.0500])), (("5PB", 6.0, 6.0), np.array([0.2533, 0.2558, 30.0500])), (("5PB", 6.0, 8.0), np.array([0.2360, 0.2365, 30.0500])), (("5PB", 6.0, 10.0), np.array([0.2197, 0.2188, 30.0500])), (("5PB", 6.0, 12.0), np.array([0.2026, 0.1999, 30.0500])), (("5PB", 6.0, 14.0), np.array([0.1873, 0.1822, 30.0500])), (("7.5PB", 6.0, 2.0), np.array([0.2955, 0.2963, 30.0500])), (("7.5PB", 6.0, 4.0), np.array([0.2798, 0.2752, 30.0500])), (("7.5PB", 6.0, 6.0), np.array([0.2638, 0.2531, 30.0500])), (("7.5PB", 6.0, 8.0), np.array([0.2505, 0.2347, 30.0500])), (("7.5PB", 6.0, 10.0), np.array([0.2378, 0.2168, 30.0500])), (("7.5PB", 6.0, 12.0), np.array([0.2241, 0.1975, 30.0500])), (("7.5PB", 6.0, 14.0), np.array([0.2119, 0.1799, 30.0500])), (("10PB", 6.0, 2.0), np.array([0.2988, 0.2961, 30.0500])), (("10PB", 6.0, 4.0), np.array([0.2863, 0.2747, 30.0500])), (("10PB", 6.0, 6.0), np.array([0.2740, 0.2533, 30.0500])), (("10PB", 6.0, 8.0), np.array([0.2637, 0.2352, 30.0500])), (("10PB", 6.0, 10.0), np.array([0.2540, 0.2176, 30.0500])), (("10PB", 6.0, 12.0), np.array([0.2440, 0.1998, 30.0500])), (("10PB", 6.0, 14.0), np.array([0.2352, 0.1839, 30.0500])), (("10PB", 6.0, 16.0), np.array([0.2265, 0.1671, 30.0500])), (("2.5P", 6.0, 2.0), np.array([0.3016, 0.2960, 30.0500])), (("2.5P", 6.0, 4.0), np.array([0.2932, 0.2759, 30.0500])), (("2.5P", 6.0, 6.0), np.array([0.2842, 0.2550, 30.0500])), (("2.5P", 6.0, 8.0), np.array([0.2770, 0.2372, 30.0500])), (("2.5P", 6.0, 10.0), np.array([0.2703, 0.2204, 30.0500])), (("2.5P", 6.0, 12.0), np.array([0.2647, 0.2052, 30.0500])), (("2.5P", 6.0, 14.0), np.array([0.2593, 0.1909, 30.0500])), (("2.5P", 6.0, 16.0), np.array([0.2548, 0.1768, 30.0500])), (("2.5P", 6.0, 18.0), np.array([0.2504, 0.1658, 30.0500])), (("5P", 6.0, 2.0), np.array([0.3050, 0.2967, 30.0500])), (("5P", 6.0, 4.0), np.array([0.3001, 0.2778, 30.0500])), (("5P", 6.0, 6.0), np.array([0.2950, 0.2585, 30.0500])), (("5P", 6.0, 8.0), np.array([0.2905, 0.2421, 30.0500])), (("5P", 6.0, 10.0), np.array([0.2862, 0.2260, 30.0500])), (("5P", 6.0, 12.0), np.array([0.2829, 0.2121, 30.0500])), (("5P", 6.0, 14.0), np.array([0.2794, 0.1979, 30.0500])), (("5P", 6.0, 16.0), np.array([0.2761, 0.1852, 30.0500])), (("5P", 6.0, 18.0), np.array([0.2731, 0.1738, 30.0500])), (("5P", 6.0, 20.0), np.array([0.2702, 0.1621, 30.0500])), (("7.5P", 6.0, 2.0), np.array([0.3107, 0.2993, 30.0500])), (("7.5P", 6.0, 4.0), np.array([0.3107, 0.2831, 30.0500])), (("7.5P", 6.0, 6.0), np.array([0.3101, 0.2650, 30.0500])), (("7.5P", 6.0, 8.0), np.array([0.3099, 0.2502, 30.0500])), (("7.5P", 6.0, 10.0), np.array([0.3092, 0.2350, 30.0500])), (("7.5P", 6.0, 12.0), np.array([0.3090, 0.2222, 30.0500])), (("7.5P", 6.0, 14.0), np.array([0.3084, 0.2095, 30.0500])), (("7.5P", 6.0, 16.0), np.array([0.3080, 0.1976, 30.0500])), (("7.5P", 6.0, 18.0), np.array([0.3075, 0.1870, 30.0500])), (("7.5P", 6.0, 20.0), np.array([0.3069, 0.1745, 30.0500])), (("7.5P", 6.0, 22.0), np.array([0.3062, 0.1638, 30.0500])), (("7.5P", 6.0, 24.0), np.array([0.3058, 0.1547, 30.0500])), (("10P", 6.0, 2.0), np.array([0.3146, 0.3018, 30.0500])), (("10P", 6.0, 4.0), np.array([0.3181, 0.2871, 30.0500])), (("10P", 6.0, 6.0), np.array([0.3226, 0.2716, 30.0500])), (("10P", 6.0, 8.0), np.array([0.3259, 0.2584, 30.0500])), (("10P", 6.0, 10.0), np.array([0.3293, 0.2450, 30.0500])), (("10P", 6.0, 12.0), np.array([0.3321, 0.2329, 30.0500])), (("10P", 6.0, 14.0), np.array([0.3349, 0.2203, 30.0500])), (("10P", 6.0, 16.0), np.array([0.3370, 0.2095, 30.0500])), (("10P", 6.0, 18.0), np.array([0.3388, 0.1995, 30.0500])), (("10P", 6.0, 20.0), np.array([0.3409, 0.1882, 30.0500])), (("10P", 6.0, 22.0), np.array([0.3426, 0.1785, 30.0500])), (("10P", 6.0, 24.0), np.array([0.3441, 0.1698, 30.0500])), (("10P", 6.0, 26.0), np.array([0.3457, 0.1604, 30.0500])), (("2.5RP", 6.0, 2.0), np.array([0.3188, 0.3048, 30.0500])), (("2.5RP", 6.0, 4.0), np.array([0.3272, 0.2929, 30.0500])), (("2.5RP", 6.0, 6.0), np.array([0.3362, 0.2799, 30.0500])), (("2.5RP", 6.0, 8.0), np.array([0.3437, 0.2688, 30.0500])), (("2.5RP", 6.0, 10.0), np.array([0.3509, 0.2578, 30.0500])), (("2.5RP", 6.0, 12.0), np.array([0.3582, 0.2462, 30.0500])), (("2.5RP", 6.0, 14.0), np.array([0.3652, 0.2355, 30.0500])), (("2.5RP", 6.0, 16.0), np.array([0.3718, 0.2251, 30.0500])), (("2.5RP", 6.0, 18.0), np.array([0.3773, 0.2158, 30.0500])), (("2.5RP", 6.0, 20.0), np.array([0.3833, 0.2056, 30.0500])), (("2.5RP", 6.0, 22.0), np.array([0.3877, 0.1978, 30.0500])), (("2.5RP", 6.0, 24.0), np.array([0.3927, 0.1892, 30.0500])), (("5RP", 6.0, 2.0), np.array([0.3232, 0.3085, 30.0500])), (("5RP", 6.0, 4.0), np.array([0.3371, 0.3001, 30.0500])), (("5RP", 6.0, 6.0), np.array([0.3520, 0.2904, 30.0500])), (("5RP", 6.0, 8.0), np.array([0.3648, 0.2820, 30.0500])), (("5RP", 6.0, 10.0), np.array([0.3769, 0.2738, 30.0500])), (("5RP", 6.0, 12.0), np.array([0.3900, 0.2646, 30.0500])), (("5RP", 6.0, 14.0), np.array([0.4023, 0.2552, 30.0500])), (("5RP", 6.0, 16.0), np.array([0.4136, 0.2467, 30.0500])), (("5RP", 6.0, 18.0), np.array([0.4245, 0.2382, 30.0500])), (("5RP", 6.0, 20.0), np.array([0.4368, 0.2283, 30.0500])), (("5RP", 6.0, 22.0), np.array([0.4449, 0.2219, 30.0500])), (("7.5RP", 6.0, 2.0), np.array([0.3261, 0.3113, 30.0500])), (("7.5RP", 6.0, 4.0), np.array([0.3439, 0.3056, 30.0500])), (("7.5RP", 6.0, 6.0), np.array([0.3635, 0.2987, 30.0500])), (("7.5RP", 6.0, 8.0), np.array([0.3791, 0.2929, 30.0500])), (("7.5RP", 6.0, 10.0), np.array([0.3960, 0.2860, 30.0500])), (("7.5RP", 6.0, 12.0), np.array([0.4125, 0.2784, 30.0500])), (("7.5RP", 6.0, 14.0), np.array([0.4285, 0.2705, 30.0500])), (("7.5RP", 6.0, 16.0), np.array([0.4448, 0.2622, 30.0500])), (("7.5RP", 6.0, 18.0), np.array([0.4581, 0.2549, 30.0500])), (("7.5RP", 6.0, 20.0), np.array([0.4735, 0.2464, 30.0500])), (("10RP", 7.0, 2.0), np.array([0.3258, 0.3148, 43.0600])), (("10RP", 7.0, 4.0), np.array([0.3446, 0.3125, 43.0600])), (("10RP", 7.0, 6.0), np.array([0.3648, 0.3098, 43.0600])), (("10RP", 7.0, 8.0), np.array([0.3851, 0.3067, 43.0600])), (("10RP", 7.0, 10.0), np.array([0.4040, 0.3030, 43.0600])), (("10RP", 7.0, 12.0), np.array([0.4260, 0.2980, 43.0600])), (("10RP", 7.0, 14.0), np.array([0.4456, 0.2931, 43.0600])), (("10RP", 7.0, 16.0), np.array([0.4648, 0.2878, 43.0600])), (("2.5R", 7.0, 2.0), np.array([0.3284, 0.3170, 43.0600])), (("2.5R", 7.0, 4.0), np.array([0.3499, 0.3171, 43.0600])), (("2.5R", 7.0, 6.0), np.array([0.3728, 0.3170, 43.0600])), (("2.5R", 7.0, 8.0), np.array([0.3961, 0.3160, 43.0600])), (("2.5R", 7.0, 10.0), np.array([0.4183, 0.3144, 43.0600])), (("2.5R", 7.0, 12.0), np.array([0.4435, 0.3119, 43.0600])), (("2.5R", 7.0, 14.0), np.array([0.4660, 0.3082, 43.0600])), (("2.5R", 7.0, 16.0), np.array([0.4885, 0.3039, 43.0600])), (("5R", 7.0, 2.0), np.array([0.3306, 0.3190, 43.0600])), (("5R", 7.0, 4.0), np.array([0.3552, 0.3222, 43.0600])), (("5R", 7.0, 6.0), np.array([0.3805, 0.3244, 43.0600])), (("5R", 7.0, 8.0), np.array([0.4067, 0.3256, 43.0600])), (("5R", 7.0, 10.0), np.array([0.4320, 0.3260, 43.0600])), (("5R", 7.0, 12.0), np.array([0.4595, 0.3252, 43.0600])), (("5R", 7.0, 14.0), np.array([0.4848, 0.3238, 43.0600])), (("7.5R", 7.0, 2.0), np.array([0.3335, 0.3220, 43.0600])), (("7.5R", 7.0, 4.0), np.array([0.3611, 0.3282, 43.0600])), (("7.5R", 7.0, 6.0), np.array([0.3888, 0.3336, 43.0600])), (("7.5R", 7.0, 8.0), np.array([0.4196, 0.3382, 43.0600])), (("7.5R", 7.0, 10.0), np.array([0.4470, 0.3413, 43.0600])), (("7.5R", 7.0, 12.0), np.array([0.4777, 0.3435, 43.0600])), (("7.5R", 7.0, 14.0), np.array([0.5059, 0.3450, 43.0600])), (("7.5R", 7.0, 16.0), np.array([0.5341, 0.3452, 43.0600])), (("10R", 7.0, 2.0), np.array([0.3360, 0.3253, 43.0600])), (("10R", 7.0, 4.0), np.array([0.3671, 0.3360, 43.0600])), (("10R", 7.0, 6.0), np.array([0.3984, 0.3452, 43.0600])), (("10R", 7.0, 8.0), np.array([0.4308, 0.3533, 43.0600])), (("10R", 7.0, 10.0), np.array([0.4600, 0.3596, 43.0600])), (("10R", 7.0, 12.0), np.array([0.4930, 0.3659, 43.0600])), (("10R", 7.0, 14.0), np.array([0.5234, 0.3700, 43.0600])), (("10R", 7.0, 16.0), np.array([0.5519, 0.3729, 43.0600])), (("2.5YR", 7.0, 2.0), np.array([0.3392, 0.3298, 43.0600])), (("2.5YR", 7.0, 4.0), np.array([0.3715, 0.3439, 43.0600])), (("2.5YR", 7.0, 6.0), np.array([0.4053, 0.3570, 43.0600])), (("2.5YR", 7.0, 8.0), np.array([0.4371, 0.3679, 43.0600])), (("2.5YR", 7.0, 10.0), np.array([0.4671, 0.3768, 43.0600])), (("2.5YR", 7.0, 12.0), np.array([0.5001, 0.3861, 43.0600])), (("2.5YR", 7.0, 14.0), np.array([0.5297, 0.3938, 43.0600])), (("2.5YR", 7.0, 16.0), np.array([0.5522, 0.3989, 43.0600])), (("2.5YR", 7.0, 18.0), np.array([0.5695, 0.4024, 43.0600])), (("2.5YR", 7.0, 20.0), np.array([0.5824, 0.4046, 43.0600])), (("5YR", 7.0, 2.0), np.array([0.3421, 0.3349, 43.0600])), (("5YR", 7.0, 4.0), np.array([0.3750, 0.3530, 43.0600])), (("5YR", 7.0, 6.0), np.array([0.4091, 0.3701, 43.0600])), (("5YR", 7.0, 8.0), np.array([0.4402, 0.3842, 43.0600])), (("5YR", 7.0, 10.0), np.array([0.4711, 0.3972, 43.0600])), (("5YR", 7.0, 12.0), np.array([0.5007, 0.4081, 43.0600])), (("5YR", 7.0, 14.0), np.array([0.5252, 0.4168, 43.0600])), (("5YR", 7.0, 16.0), np.array([0.5437, 0.4228, 43.0600])), (("5YR", 7.0, 18.0), np.array([0.5564, 0.4267, 43.0600])), (("5YR", 7.0, 20.0), np.array([0.5657, 0.4298, 43.0600])), (("7.5YR", 7.0, 2.0), np.array([0.3437, 0.3397, 43.0600])), (("7.5YR", 7.0, 4.0), np.array([0.3772, 0.3613, 43.0600])), (("7.5YR", 7.0, 6.0), np.array([0.4107, 0.3820, 43.0600])), (("7.5YR", 7.0, 8.0), np.array([0.4415, 0.3996, 43.0600])), (("7.5YR", 7.0, 10.0), np.array([0.4704, 0.4151, 43.0600])), (("7.5YR", 7.0, 12.0), np.array([0.4970, 0.4282, 43.0600])), (("7.5YR", 7.0, 14.0), np.array([0.5174, 0.4381, 43.0600])), (("7.5YR", 7.0, 16.0), np.array([0.5319, 0.4449, 43.0600])), (("7.5YR", 7.0, 18.0), np.array([0.5417, 0.4492, 43.0600])), (("10YR", 7.0, 2.0), np.array([0.3443, 0.3454, 43.0600])), (("10YR", 7.0, 4.0), np.array([0.3778, 0.3719, 43.0600])), (("10YR", 7.0, 6.0), np.array([0.4102, 0.3960, 43.0600])), (("10YR", 7.0, 8.0), np.array([0.4399, 0.4164, 43.0600])), (("10YR", 7.0, 10.0), np.array([0.4667, 0.4335, 43.0600])), (("10YR", 7.0, 12.0), np.array([0.4900, 0.4480, 43.0600])), (("10YR", 7.0, 14.0), np.array([0.5074, 0.4581, 43.0600])), (("10YR", 7.0, 16.0), np.array([0.5188, 0.4650, 43.0600])), (("10YR", 7.0, 18.0), np.array([0.5276, 0.4700, 43.0600])), (("2.5Y", 7.0, 2.0), np.array([0.3436, 0.3507, 43.0600])), (("2.5Y", 7.0, 4.0), np.array([0.3761, 0.3800, 43.0600])), (("2.5Y", 7.0, 6.0), np.array([0.4073, 0.4073, 43.0600])), (("2.5Y", 7.0, 8.0), np.array([0.4353, 0.4312, 43.0600])), (("2.5Y", 7.0, 10.0), np.array([0.4606, 0.4516, 43.0600])), (("2.5Y", 7.0, 12.0), np.array([0.4806, 0.4666, 43.0600])), (("2.5Y", 7.0, 14.0), np.array([0.4950, 0.4773, 43.0600])), (("2.5Y", 7.0, 16.0), np.array([0.5049, 0.4843, 43.0600])), (("5Y", 7.0, 2.0), np.array([0.3419, 0.3540, 43.0600])), (("5Y", 7.0, 4.0), np.array([0.3718, 0.3885, 43.0600])), (("5Y", 7.0, 6.0), np.array([0.4009, 0.4198, 43.0600])), (("5Y", 7.0, 8.0), np.array([0.4271, 0.4462, 43.0600])), (("5Y", 7.0, 10.0), np.array([0.4509, 0.4696, 43.0600])), (("5Y", 7.0, 12.0), np.array([0.4677, 0.4857, 43.0600])), (("5Y", 7.0, 14.0), np.array([0.4791, 0.4965, 43.0600])), (("5Y", 7.0, 16.0), np.array([0.4875, 0.5047, 43.0600])), (("7.5Y", 7.0, 2.0), np.array([0.3396, 0.3558, 43.0600])), (("7.5Y", 7.0, 4.0), np.array([0.3677, 0.3925, 43.0600])), (("7.5Y", 7.0, 6.0), np.array([0.3943, 0.4264, 43.0600])), (("7.5Y", 7.0, 8.0), np.array([0.4184, 0.4568, 43.0600])), (("7.5Y", 7.0, 10.0), np.array([0.4400, 0.4830, 43.0600])), (("7.5Y", 7.0, 12.0), np.array([0.4547, 0.5005, 43.0600])), (("7.5Y", 7.0, 14.0), np.array([0.4652, 0.5128, 43.0600])), (("7.5Y", 7.0, 16.0), np.array([0.4728, 0.5215, 43.0600])), (("10Y", 7.0, 2.0), np.array([0.3369, 0.3569, 43.0600])), (("10Y", 7.0, 4.0), np.array([0.3624, 0.3951, 43.0600])), (("10Y", 7.0, 6.0), np.array([0.3864, 0.4305, 43.0600])), (("10Y", 7.0, 8.0), np.array([0.4090, 0.4641, 43.0600])), (("10Y", 7.0, 10.0), np.array([0.4289, 0.4937, 43.0600])), (("10Y", 7.0, 12.0), np.array([0.4420, 0.5131, 43.0600])), (("10Y", 7.0, 14.0), np.array([0.4516, 0.5277, 43.0600])), (("10Y", 7.0, 16.0), np.array([0.4582, 0.5375, 43.0600])), (("2.5GY", 7.0, 2.0), np.array([0.3328, 0.3569, 43.0600])), (("2.5GY", 7.0, 4.0), np.array([0.3534, 0.3953, 43.0600])), (("2.5GY", 7.0, 6.0), np.array([0.3728, 0.4316, 43.0600])), (("2.5GY", 7.0, 8.0), np.array([0.3919, 0.4684, 43.0600])), (("2.5GY", 7.0, 10.0), np.array([0.4091, 0.5030, 43.0600])), (("2.5GY", 7.0, 12.0), np.array([0.4213, 0.5270, 43.0600])), (("2.5GY", 7.0, 14.0), np.array([0.4309, 0.5459, 43.0600])), (("2.5GY", 7.0, 16.0), np.array([0.4366, 0.5578, 43.0600])), (("5GY", 7.0, 2.0), np.array([0.3284, 0.3559, 43.0600])), (("5GY", 7.0, 4.0), np.array([0.3437, 0.3929, 43.0600])), (("5GY", 7.0, 6.0), np.array([0.3581, 0.4291, 43.0600])), (("5GY", 7.0, 8.0), np.array([0.3722, 0.4669, 43.0600])), (("5GY", 7.0, 10.0), np.array([0.3852, 0.5051, 43.0600])), (("5GY", 7.0, 12.0), np.array([0.3949, 0.5367, 43.0600])), (("5GY", 7.0, 14.0), np.array([0.4027, 0.5615, 43.0600])), (("5GY", 7.0, 16.0), np.array([0.4076, 0.5783, 43.0600])), (("7.5GY", 7.0, 2.0), np.array([0.3190, 0.3516, 43.0600])), (("7.5GY", 7.0, 4.0), np.array([0.3267, 0.3848, 43.0600])), (("7.5GY", 7.0, 6.0), np.array([0.3341, 0.4191, 43.0600])), (("7.5GY", 7.0, 8.0), np.array([0.3406, 0.4558, 43.0600])), (("7.5GY", 7.0, 10.0), np.array([0.3461, 0.4950, 43.0600])), (("7.5GY", 7.0, 12.0), np.array([0.3502, 0.5328, 43.0600])), (("7.5GY", 7.0, 14.0), np.array([0.3532, 0.5700, 43.0600])), (("7.5GY", 7.0, 16.0), np.array([0.3549, 0.6000, 43.0600])), (("7.5GY", 7.0, 18.0), np.array([0.3555, 0.6242, 43.0600])), (("10GY", 7.0, 2.0), np.array([0.3117, 0.3469, 43.0600])), (("10GY", 7.0, 4.0), np.array([0.3133, 0.3764, 43.0600])), (("10GY", 7.0, 6.0), np.array([0.3142, 0.4058, 43.0600])), (("10GY", 7.0, 8.0), np.array([0.3140, 0.4387, 43.0600])), (("10GY", 7.0, 10.0), np.array([0.3123, 0.4732, 43.0600])), (("10GY", 7.0, 12.0), np.array([0.3092, 0.5095, 43.0600])), (("10GY", 7.0, 14.0), np.array([0.3047, 0.5458, 43.0600])), (("10GY", 7.0, 16.0), np.array([0.2981, 0.5835, 43.0600])), (("10GY", 7.0, 18.0), np.array([0.2905, 0.6186, 43.0600])), (("10GY", 7.0, 20.0), np.array([0.2816, 0.6563, 43.0600])), (("10GY", 7.0, 22.0), np.array([0.2728, 0.6893, 43.0600])), (("2.5G", 7.0, 2.0), np.array([0.3047, 0.3413, 43.0600])), (("2.5G", 7.0, 4.0), np.array([0.2992, 0.3644, 43.0600])), (("2.5G", 7.0, 6.0), np.array([0.2933, 0.3873, 43.0600])), (("2.5G", 7.0, 8.0), np.array([0.2861, 0.4129, 43.0600])), (("2.5G", 7.0, 10.0), np.array([0.2775, 0.4395, 43.0600])), (("2.5G", 7.0, 12.0), np.array([0.2672, 0.4667, 43.0600])), (("2.5G", 7.0, 14.0), np.array([0.2568, 0.4931, 43.0600])), (("2.5G", 7.0, 16.0), np.array([0.2448, 0.5203, 43.0600])), (("2.5G", 7.0, 18.0), np.array([0.2328, 0.5467, 43.0600])), (("2.5G", 7.0, 20.0), np.array([0.2181, 0.5744, 43.0600])), (("2.5G", 7.0, 22.0), np.array([0.2029, 0.6017, 43.0600])), (("2.5G", 7.0, 24.0), np.array([0.1875, 0.6265, 43.0600])), (("2.5G", 7.0, 26.0), np.array([0.1689, 0.6549, 43.0600])), (("5G", 7.0, 2.0), np.array([0.3001, 0.3366, 43.0600])), (("5G", 7.0, 4.0), np.array([0.2902, 0.3548, 43.0600])), (("5G", 7.0, 6.0), np.array([0.2801, 0.3721, 43.0600])), (("5G", 7.0, 8.0), np.array([0.2687, 0.3901, 43.0600])), (("5G", 7.0, 10.0), np.array([0.2554, 0.4087, 43.0600])), (("5G", 7.0, 12.0), np.array([0.2416, 0.4267, 43.0600])), (("5G", 7.0, 14.0), np.array([0.2262, 0.4450, 43.0600])), (("5G", 7.0, 16.0), np.array([0.2111, 0.4616, 43.0600])), (("5G", 7.0, 18.0), np.array([0.1967, 0.4771, 43.0600])), (("5G", 7.0, 20.0), np.array([0.1805, 0.4933, 43.0600])), (("5G", 7.0, 22.0), np.array([0.1659, 0.5074, 43.0600])), (("5G", 7.0, 24.0), np.array([0.1521, 0.5200, 43.0600])), (("5G", 7.0, 26.0), np.array([0.1397, 0.5312, 43.0600])), (("7.5G", 7.0, 2.0), np.array([0.2972, 0.3333, 43.0600])), (("7.5G", 7.0, 4.0), np.array([0.2850, 0.3482, 43.0600])), (("7.5G", 7.0, 6.0), np.array([0.2728, 0.3622, 43.0600])), (("7.5G", 7.0, 8.0), np.array([0.2595, 0.3764, 43.0600])), (("7.5G", 7.0, 10.0), np.array([0.2445, 0.3914, 43.0600])), (("7.5G", 7.0, 12.0), np.array([0.2295, 0.4058, 43.0600])), (("7.5G", 7.0, 14.0), np.array([0.2139, 0.4199, 43.0600])), (("7.5G", 7.0, 16.0), np.array([0.1982, 0.4330, 43.0600])), (("7.5G", 7.0, 18.0), np.array([0.1841, 0.4448, 43.0600])), (("7.5G", 7.0, 20.0), np.array([0.1688, 0.4570, 43.0600])), (("7.5G", 7.0, 22.0), np.array([0.1539, 0.4683, 43.0600])), (("7.5G", 7.0, 24.0), np.array([0.1415, 0.4778, 43.0600])), (("7.5G", 7.0, 26.0), np.array([0.1303, 0.4858, 43.0600])), (("10G", 7.0, 2.0), np.array([0.2945, 0.3297, 43.0600])), (("10G", 7.0, 4.0), np.array([0.2803, 0.3415, 43.0600])), (("10G", 7.0, 6.0), np.array([0.2662, 0.3526, 43.0600])), (("10G", 7.0, 8.0), np.array([0.2513, 0.3635, 43.0600])), (("10G", 7.0, 10.0), np.array([0.2352, 0.3748, 43.0600])), (("10G", 7.0, 12.0), np.array([0.2195, 0.3854, 43.0600])), (("10G", 7.0, 14.0), np.array([0.2033, 0.3956, 43.0600])), (("10G", 7.0, 16.0), np.array([0.1881, 0.4049, 43.0600])), (("10G", 7.0, 18.0), np.array([0.1734, 0.4135, 43.0600])), (("10G", 7.0, 20.0), np.array([0.1589, 0.4220, 43.0600])), (("10G", 7.0, 22.0), np.array([0.1434, 0.4306, 43.0600])), (("10G", 7.0, 24.0), np.array([0.1310, 0.4377, 43.0600])), (("2.5BG", 7.0, 2.0), np.array([0.2927, 0.3269, 43.0600])), (("2.5BG", 7.0, 4.0), np.array([0.2764, 0.3354, 43.0600])), (("2.5BG", 7.0, 6.0), np.array([0.2608, 0.3430, 43.0600])), (("2.5BG", 7.0, 8.0), np.array([0.2439, 0.3508, 43.0600])), (("2.5BG", 7.0, 10.0), np.array([0.2264, 0.3576, 43.0600])), (("2.5BG", 7.0, 12.0), np.array([0.2102, 0.3636, 43.0600])), (("2.5BG", 7.0, 14.0), np.array([0.1932, 0.3694, 43.0600])), (("2.5BG", 7.0, 16.0), np.array([0.1788, 0.3739, 43.0600])), (("2.5BG", 7.0, 18.0), np.array([0.1626, 0.3788, 43.0600])), (("2.5BG", 7.0, 20.0), np.array([0.1490, 0.3827, 43.0600])), (("2.5BG", 7.0, 22.0), np.array([0.1334, 0.3870, 43.0600])), (("5BG", 7.0, 2.0), np.array([0.2898, 0.3225, 43.0600])), (("5BG", 7.0, 4.0), np.array([0.2712, 0.3269, 43.0600])), (("5BG", 7.0, 6.0), np.array([0.2543, 0.3302, 43.0600])), (("5BG", 7.0, 8.0), np.array([0.2354, 0.3335, 43.0600])), (("5BG", 7.0, 10.0), np.array([0.2163, 0.3361, 43.0600])), (("5BG", 7.0, 12.0), np.array([0.1997, 0.3379, 43.0600])), (("5BG", 7.0, 14.0), np.array([0.1838, 0.3390, 43.0600])), (("5BG", 7.0, 16.0), np.array([0.1675, 0.3401, 43.0600])), (("5BG", 7.0, 18.0), np.array([0.1515, 0.3410, 43.0600])), (("5BG", 7.0, 20.0), np.array([0.1380, 0.3412, 43.0600])), (("7.5BG", 7.0, 2.0), np.array([0.2878, 0.3182, 43.0600])), (("7.5BG", 7.0, 4.0), np.array([0.2671, 0.3189, 43.0600])), (("7.5BG", 7.0, 6.0), np.array([0.2490, 0.3186, 43.0600])), (("7.5BG", 7.0, 8.0), np.array([0.2292, 0.3178, 43.0600])), (("7.5BG", 7.0, 10.0), np.array([0.2094, 0.3165, 43.0600])), (("7.5BG", 7.0, 12.0), np.array([0.1914, 0.3148, 43.0600])), (("7.5BG", 7.0, 14.0), np.array([0.1751, 0.3129, 43.0600])), (("7.5BG", 7.0, 16.0), np.array([0.1584, 0.3101, 43.0600])), (("7.5BG", 7.0, 18.0), np.array([0.1427, 0.3076, 43.0600])), (("10BG", 7.0, 2.0), np.array([0.2869, 0.3143, 43.0600])), (("10BG", 7.0, 4.0), np.array([0.2642, 0.3109, 43.0600])), (("10BG", 7.0, 6.0), np.array([0.2448, 0.3069, 43.0600])), (("10BG", 7.0, 8.0), np.array([0.2235, 0.3014, 43.0600])), (("10BG", 7.0, 10.0), np.array([0.2035, 0.2956, 43.0600])), (("10BG", 7.0, 12.0), np.array([0.1841, 0.2892, 43.0600])), (("10BG", 7.0, 14.0), np.array([0.1671, 0.2832, 43.0600])), (("10BG", 7.0, 16.0), np.array([0.1489, 0.2768, 43.0600])), (("2.5B", 7.0, 2.0), np.array([0.2867, 0.3110, 43.0600])), (("2.5B", 7.0, 4.0), np.array([0.2629, 0.3038, 43.0600])), (("2.5B", 7.0, 6.0), np.array([0.2418, 0.2960, 43.0600])), (("2.5B", 7.0, 8.0), np.array([0.2208, 0.2871, 43.0600])), (("2.5B", 7.0, 10.0), np.array([0.1994, 0.2775, 43.0600])), (("2.5B", 7.0, 12.0), np.array([0.1797, 0.2672, 43.0600])), (("2.5B", 7.0, 14.0), np.array([0.1624, 0.2581, 43.0600])), (("2.5B", 7.0, 16.0), np.array([0.1435, 0.2472, 43.0600])), (("5B", 7.0, 2.0), np.array([0.2875, 0.3078, 43.0600])), (("5B", 7.0, 4.0), np.array([0.2633, 0.2972, 43.0600])), (("5B", 7.0, 6.0), np.array([0.2410, 0.2854, 43.0600])), (("5B", 7.0, 8.0), np.array([0.2204, 0.2729, 43.0600])), (("5B", 7.0, 10.0), np.array([0.1986, 0.2579, 43.0600])), (("5B", 7.0, 12.0), np.array([0.1778, 0.2430, 43.0600])), (("5B", 7.0, 14.0), np.array([0.1615, 0.2307, 43.0600])), (("7.5B", 7.0, 2.0), np.array([0.2888, 0.3058, 43.0600])), (("7.5B", 7.0, 4.0), np.array([0.2651, 0.2927, 43.0600])), (("7.5B", 7.0, 6.0), np.array([0.2436, 0.2787, 43.0600])), (("7.5B", 7.0, 8.0), np.array([0.2225, 0.2631, 43.0600])), (("7.5B", 7.0, 10.0), np.array([0.2016, 0.2466, 43.0600])), (("7.5B", 7.0, 12.0), np.array([0.1818, 0.2303, 43.0600])), (("10B", 7.0, 2.0), np.array([0.2908, 0.3039, 43.0600])), (("10B", 7.0, 4.0), np.array([0.2685, 0.2886, 43.0600])), (("10B", 7.0, 6.0), np.array([0.2478, 0.2728, 43.0600])), (("10B", 7.0, 8.0), np.array([0.2277, 0.2559, 43.0600])), (("10B", 7.0, 10.0), np.array([0.2078, 0.2382, 43.0600])), (("10B", 7.0, 12.0), np.array([0.1883, 0.2203, 43.0600])), (("2.5PB", 7.0, 2.0), np.array([0.2932, 0.3025, 43.0600])), (("2.5PB", 7.0, 4.0), np.array([0.2729, 0.2848, 43.0600])), (("2.5PB", 7.0, 6.0), np.array([0.2538, 0.2677, 43.0600])), (("2.5PB", 7.0, 8.0), np.array([0.2352, 0.2498, 43.0600])), (("2.5PB", 7.0, 10.0), np.array([0.2162, 0.2309, 43.0600])), (("5PB", 7.0, 2.0), np.array([0.2952, 0.3011, 43.0600])), (("5PB", 7.0, 4.0), np.array([0.2773, 0.2828, 43.0600])), (("5PB", 7.0, 6.0), np.array([0.2596, 0.2643, 43.0600])), (("5PB", 7.0, 8.0), np.array([0.2427, 0.2458, 43.0600])), (("5PB", 7.0, 10.0), np.array([0.2254, 0.2267, 43.0600])), (("7.5PB", 7.0, 2.0), np.array([0.2982, 0.3003, 43.0600])), (("7.5PB", 7.0, 4.0), np.array([0.2833, 0.2809, 43.0600])), (("7.5PB", 7.0, 6.0), np.array([0.2687, 0.2612, 43.0600])), (("7.5PB", 7.0, 8.0), np.array([0.2546, 0.2418, 43.0600])), (("7.5PB", 7.0, 10.0), np.array([0.2410, 0.2224, 43.0600])), (("10PB", 7.0, 2.0), np.array([0.3005, 0.3000, 43.0600])), (("10PB", 7.0, 4.0), np.array([0.2886, 0.2801, 43.0600])), (("10PB", 7.0, 6.0), np.array([0.2776, 0.2612, 43.0600])), (("10PB", 7.0, 8.0), np.array([0.2670, 0.2425, 43.0600])), (("10PB", 7.0, 10.0), np.array([0.2563, 0.2240, 43.0600])), (("10PB", 7.0, 12.0), np.array([0.2465, 0.2058, 43.0600])), (("2.5P", 7.0, 2.0), np.array([0.3031, 0.3000, 43.0600])), (("2.5P", 7.0, 4.0), np.array([0.2950, 0.2810, 43.0600])), (("2.5P", 7.0, 6.0), np.array([0.2873, 0.2633, 43.0600])), (("2.5P", 7.0, 8.0), np.array([0.2799, 0.2459, 43.0600])), (("2.5P", 7.0, 10.0), np.array([0.2729, 0.2289, 43.0600])), (("2.5P", 7.0, 12.0), np.array([0.2664, 0.2127, 43.0600])), (("5P", 7.0, 2.0), np.array([0.3059, 0.3010, 43.0600])), (("5P", 7.0, 4.0), np.array([0.3009, 0.2831, 43.0600])), (("5P", 7.0, 6.0), np.array([0.2961, 0.2663, 43.0600])), (("5P", 7.0, 8.0), np.array([0.2918, 0.2504, 43.0600])), (("5P", 7.0, 10.0), np.array([0.2872, 0.2343, 43.0600])), (("5P", 7.0, 12.0), np.array([0.2833, 0.2197, 43.0600])), (("5P", 7.0, 14.0), np.array([0.2801, 0.2068, 43.0600])), (("7.5P", 7.0, 2.0), np.array([0.3109, 0.3037, 43.0600])), (("7.5P", 7.0, 4.0), np.array([0.3111, 0.2880, 43.0600])), (("7.5P", 7.0, 6.0), np.array([0.3111, 0.2730, 43.0600])), (("7.5P", 7.0, 8.0), np.array([0.3109, 0.2584, 43.0600])), (("7.5P", 7.0, 10.0), np.array([0.3108, 0.2442, 43.0600])), (("7.5P", 7.0, 12.0), np.array([0.3104, 0.2320, 43.0600])), (("7.5P", 7.0, 14.0), np.array([0.3101, 0.2192, 43.0600])), (("7.5P", 7.0, 16.0), np.array([0.3099, 0.2074, 43.0600])), (("7.5P", 7.0, 18.0), np.array([0.3093, 0.1962, 43.0600])), (("10P", 7.0, 2.0), np.array([0.3138, 0.3054, 43.0600])), (("10P", 7.0, 4.0), np.array([0.3181, 0.2920, 43.0600])), (("10P", 7.0, 6.0), np.array([0.3221, 0.2786, 43.0600])), (("10P", 7.0, 8.0), np.array([0.3256, 0.2654, 43.0600])), (("10P", 7.0, 10.0), np.array([0.3288, 0.2531, 43.0600])), (("10P", 7.0, 12.0), np.array([0.3314, 0.2423, 43.0600])), (("10P", 7.0, 14.0), np.array([0.3341, 0.2308, 43.0600])), (("10P", 7.0, 16.0), np.array([0.3368, 0.2192, 43.0600])), (("10P", 7.0, 18.0), np.array([0.3391, 0.2088, 43.0600])), (("10P", 7.0, 20.0), np.array([0.3410, 0.1988, 43.0600])), (("10P", 7.0, 22.0), np.array([0.3430, 0.1883, 43.0600])), (("2.5RP", 7.0, 2.0), np.array([0.3170, 0.3076, 43.0600])), (("2.5RP", 7.0, 4.0), np.array([0.3254, 0.2971, 43.0600])), (("2.5RP", 7.0, 6.0), np.array([0.3338, 0.2854, 43.0600])), (("2.5RP", 7.0, 8.0), np.array([0.3417, 0.2745, 43.0600])), (("2.5RP", 7.0, 10.0), np.array([0.3487, 0.2648, 43.0600])), (("2.5RP", 7.0, 12.0), np.array([0.3555, 0.2545, 43.0600])), (("2.5RP", 7.0, 14.0), np.array([0.3620, 0.2448, 43.0600])), (("2.5RP", 7.0, 16.0), np.array([0.3688, 0.2342, 43.0600])), (("2.5RP", 7.0, 18.0), np.array([0.3751, 0.2241, 43.0600])), (("2.5RP", 7.0, 20.0), np.array([0.3811, 0.2143, 43.0600])), (("5RP", 7.0, 2.0), np.array([0.3206, 0.3104, 43.0600])), (("5RP", 7.0, 4.0), np.array([0.3332, 0.3032, 43.0600])), (("5RP", 7.0, 6.0), np.array([0.3470, 0.2949, 43.0600])), (("5RP", 7.0, 8.0), np.array([0.3603, 0.2869, 43.0600])), (("5RP", 7.0, 10.0), np.array([0.3713, 0.2798, 43.0600])), (("5RP", 7.0, 12.0), np.array([0.3841, 0.2710, 43.0600])), (("5RP", 7.0, 14.0), np.array([0.3958, 0.2628, 43.0600])), (("5RP", 7.0, 16.0), np.array([0.4076, 0.2540, 43.0600])), (("5RP", 7.0, 18.0), np.array([0.4186, 0.2459, 43.0600])), (("7.5RP", 7.0, 2.0), np.array([0.3232, 0.3125, 43.0600])), (("7.5RP", 7.0, 4.0), np.array([0.3389, 0.3079, 43.0600])), (("7.5RP", 7.0, 6.0), np.array([0.3562, 0.3022, 43.0600])), (("7.5RP", 7.0, 8.0), np.array([0.3722, 0.2963, 43.0600])), (("7.5RP", 7.0, 10.0), np.array([0.3871, 0.2906, 43.0600])), (("7.5RP", 7.0, 12.0), np.array([0.4040, 0.2834, 43.0600])), (("7.5RP", 7.0, 14.0), np.array([0.4195, 0.2762, 43.0600])), (("7.5RP", 7.0, 16.0), np.array([0.4346, 0.2689, 43.0600])), (("10RP", 8.0, 2.0), np.array([0.3218, 0.3152, 59.1000])), (("10RP", 8.0, 4.0), np.array([0.3412, 0.3135, 59.1000])), (("10RP", 8.0, 6.0), np.array([0.3600, 0.3112, 59.1000])), (("10RP", 8.0, 8.0), np.array([0.3800, 0.3082, 59.1000])), (("10RP", 8.0, 10.0), np.array([0.3983, 0.3049, 59.1000])), (("2.5R", 8.0, 2.0), np.array([0.3236, 0.3169, 59.1000])), (("2.5R", 8.0, 4.0), np.array([0.3460, 0.3177, 59.1000])), (("2.5R", 8.0, 6.0), np.array([0.3671, 0.3175, 59.1000])), (("2.5R", 8.0, 8.0), np.array([0.3900, 0.3171, 59.1000])), (("2.5R", 8.0, 10.0), np.array([0.4125, 0.3160, 59.1000])), (("5R", 8.0, 2.0), np.array([0.3254, 0.3186, 59.1000])), (("5R", 8.0, 4.0), np.array([0.3510, 0.3224, 59.1000])), (("5R", 8.0, 6.0), np.array([0.3743, 0.3248, 59.1000])), (("5R", 8.0, 8.0), np.array([0.4001, 0.3263, 59.1000])), (("5R", 8.0, 10.0), np.array([0.4249, 0.3270, 59.1000])), (("7.5R", 8.0, 2.0), np.array([0.3277, 0.3211, 59.1000])), (("7.5R", 8.0, 4.0), np.array([0.3564, 0.3279, 59.1000])), (("7.5R", 8.0, 6.0), np.array([0.3830, 0.3335, 59.1000])), (("7.5R", 8.0, 8.0), np.array([0.4118, 0.3385, 59.1000])), (("7.5R", 8.0, 10.0), np.array([0.4388, 0.3419, 59.1000])), (("10R", 8.0, 2.0), np.array([0.3301, 0.3237, 59.1000])), (("10R", 8.0, 4.0), np.array([0.3621, 0.3349, 59.1000])), (("10R", 8.0, 6.0), np.array([0.3910, 0.3442, 59.1000])), (("10R", 8.0, 8.0), np.array([0.4212, 0.3526, 59.1000])), (("10R", 8.0, 10.0), np.array([0.4490, 0.3589, 59.1000])), (("2.5YR", 8.0, 2.0), np.array([0.3334, 0.3276, 59.1000])), (("2.5YR", 8.0, 4.0), np.array([0.3667, 0.3429, 59.1000])), (("2.5YR", 8.0, 6.0), np.array([0.3960, 0.3547, 59.1000])), (("2.5YR", 8.0, 8.0), np.array([0.4275, 0.3662, 59.1000])), (("2.5YR", 8.0, 10.0), np.array([0.4552, 0.3761, 59.1000])), (("2.5YR", 8.0, 12.0), np.array([0.4852, 0.3847, 59.1000])), (("5YR", 8.0, 2.0), np.array([0.3373, 0.3330, 59.1000])), (("5YR", 8.0, 4.0), np.array([0.3690, 0.3510, 59.1000])), (("5YR", 8.0, 6.0), np.array([0.3988, 0.3663, 59.1000])), (("5YR", 8.0, 8.0), np.array([0.4310, 0.3820, 59.1000])), (("5YR", 8.0, 10.0), np.array([0.4576, 0.3938, 59.1000])), (("5YR", 8.0, 12.0), np.array([0.4849, 0.4050, 59.1000])), (("5YR", 8.0, 14.0), np.array([0.5088, 0.4145, 59.1000])), (("7.5YR", 8.0, 2.0), np.array([0.3395, 0.3379, 59.1000])), (("7.5YR", 8.0, 4.0), np.array([0.3699, 0.3586, 59.1000])), (("7.5YR", 8.0, 6.0), np.array([0.4000, 0.3770, 59.1000])), (("7.5YR", 8.0, 8.0), np.array([0.4306, 0.3952, 59.1000])), (("7.5YR", 8.0, 10.0), np.array([0.4568, 0.4100, 59.1000])), (("7.5YR", 8.0, 12.0), np.array([0.4816, 0.4232, 59.1000])), (("7.5YR", 8.0, 14.0), np.array([0.5025, 0.4338, 59.1000])), (("7.5YR", 8.0, 16.0), np.array([0.5195, 0.4424, 59.1000])), (("7.5YR", 8.0, 18.0), np.array([0.5316, 0.4480, 59.1000])), (("7.5YR", 8.0, 20.0), np.array([0.5391, 0.4518, 59.1000])), (("10YR", 8.0, 2.0), np.array([0.3407, 0.3434, 59.1000])), (("10YR", 8.0, 4.0), np.array([0.3701, 0.3674, 59.1000])), (("10YR", 8.0, 6.0), np.array([0.3994, 0.3896, 59.1000])), (("10YR", 8.0, 8.0), np.array([0.4280, 0.4102, 59.1000])), (("10YR", 8.0, 10.0), np.array([0.4527, 0.4268, 59.1000])), (("10YR", 8.0, 12.0), np.array([0.4753, 0.4414, 59.1000])), (("10YR", 8.0, 14.0), np.array([0.4940, 0.4530, 59.1000])), (("10YR", 8.0, 16.0), np.array([0.5079, 0.4613, 59.1000])), (("10YR", 8.0, 18.0), np.array([0.5179, 0.4670, 59.1000])), (("10YR", 8.0, 20.0), np.array([0.5245, 0.4709, 59.1000])), (("2.5Y", 8.0, 2.0), np.array([0.3406, 0.3484, 59.1000])), (("2.5Y", 8.0, 4.0), np.array([0.3684, 0.3751, 59.1000])), (("2.5Y", 8.0, 6.0), np.array([0.3969, 0.4009, 59.1000])), (("2.5Y", 8.0, 8.0), np.array([0.4231, 0.4231, 59.1000])), (("2.5Y", 8.0, 10.0), np.array([0.4469, 0.4423, 59.1000])), (("2.5Y", 8.0, 12.0), np.array([0.4678, 0.4589, 59.1000])), (("2.5Y", 8.0, 14.0), np.array([0.4842, 0.4712, 59.1000])), (("2.5Y", 8.0, 16.0), np.array([0.4957, 0.4800, 59.1000])), (("2.5Y", 8.0, 18.0), np.array([0.5033, 0.4855, 59.1000])), (("2.5Y", 8.0, 20.0), np.array([0.5091, 0.4900, 59.1000])), (("5Y", 8.0, 2.0), np.array([0.3394, 0.3518, 59.1000])), (("5Y", 8.0, 4.0), np.array([0.3650, 0.3826, 59.1000])), (("5Y", 8.0, 6.0), np.array([0.3913, 0.4117, 59.1000])), (("5Y", 8.0, 8.0), np.array([0.4158, 0.4378, 59.1000])), (("5Y", 8.0, 10.0), np.array([0.4376, 0.4601, 59.1000])), (("5Y", 8.0, 12.0), np.array([0.4562, 0.4788, 59.1000])), (("5Y", 8.0, 14.0), np.array([0.4699, 0.4920, 59.1000])), (("5Y", 8.0, 16.0), np.array([0.4791, 0.5012, 59.1000])), (("5Y", 8.0, 18.0), np.array([0.4847, 0.5069, 59.1000])), (("7.5Y", 8.0, 2.0), np.array([0.3379, 0.3540, 59.1000])), (("7.5Y", 8.0, 4.0), np.array([0.3622, 0.3861, 59.1000])), (("7.5Y", 8.0, 6.0), np.array([0.3862, 0.4175, 59.1000])), (("7.5Y", 8.0, 8.0), np.array([0.4088, 0.4466, 59.1000])), (("7.5Y", 8.0, 10.0), np.array([0.4283, 0.4712, 59.1000])), (("7.5Y", 8.0, 12.0), np.array([0.4455, 0.4917, 59.1000])), (("7.5Y", 8.0, 14.0), np.array([0.4574, 0.5062, 59.1000])), (("7.5Y", 8.0, 16.0), np.array([0.4658, 0.5158, 59.1000])), (("7.5Y", 8.0, 18.0), np.array([0.4709, 0.5220, 59.1000])), (("10Y", 8.0, 2.0), np.array([0.3359, 0.3552, 59.1000])), (("10Y", 8.0, 4.0), np.array([0.3581, 0.3883, 59.1000])), (("10Y", 8.0, 6.0), np.array([0.3803, 0.4216, 59.1000])), (("10Y", 8.0, 8.0), np.array([0.4008, 0.4520, 59.1000])), (("10Y", 8.0, 10.0), np.array([0.4190, 0.4791, 59.1000])), (("10Y", 8.0, 12.0), np.array([0.4341, 0.5020, 59.1000])), (("10Y", 8.0, 14.0), np.array([0.4450, 0.5181, 59.1000])), (("10Y", 8.0, 16.0), np.array([0.4525, 0.5295, 59.1000])), (("10Y", 8.0, 18.0), np.array([0.4570, 0.5366, 59.1000])), (("2.5GY", 8.0, 2.0), np.array([0.3327, 0.3555, 59.1000])), (("2.5GY", 8.0, 4.0), np.array([0.3504, 0.3887, 59.1000])), (("2.5GY", 8.0, 6.0), np.array([0.3690, 0.4230, 59.1000])), (("2.5GY", 8.0, 8.0), np.array([0.3858, 0.4550, 59.1000])), (("2.5GY", 8.0, 10.0), np.array([0.4021, 0.4869, 59.1000])), (("2.5GY", 8.0, 12.0), np.array([0.4154, 0.5133, 59.1000])), (("2.5GY", 8.0, 14.0), np.array([0.4261, 0.5344, 59.1000])), (("2.5GY", 8.0, 16.0), np.array([0.4327, 0.5475, 59.1000])), (("2.5GY", 8.0, 18.0), np.array([0.4371, 0.5557, 59.1000])), (("5GY", 8.0, 2.0), np.array([0.3284, 0.3542, 59.1000])), (("5GY", 8.0, 4.0), np.array([0.3433, 0.3872, 59.1000])), (("5GY", 8.0, 6.0), np.array([0.3573, 0.4214, 59.1000])), (("5GY", 8.0, 8.0), np.array([0.3696, 0.4542, 59.1000])), (("5GY", 8.0, 10.0), np.array([0.3816, 0.4879, 59.1000])), (("5GY", 8.0, 12.0), np.array([0.3924, 0.5199, 59.1000])), (("5GY", 8.0, 14.0), np.array([0.4011, 0.5468, 59.1000])), (("5GY", 8.0, 16.0), np.array([0.4061, 0.5641, 59.1000])), (("5GY", 8.0, 18.0), np.array([0.4104, 0.5785, 59.1000])), (("5GY", 8.0, 20.0), np.array([0.4127, 0.5855, 59.1000])), (("7.5GY", 8.0, 2.0), np.array([0.3194, 0.3502, 59.1000])), (("7.5GY", 8.0, 4.0), np.array([0.3266, 0.3809, 59.1000])), (("7.5GY", 8.0, 6.0), np.array([0.3339, 0.4129, 59.1000])), (("7.5GY", 8.0, 8.0), np.array([0.3408, 0.4452, 59.1000])), (("7.5GY", 8.0, 10.0), np.array([0.3463, 0.4791, 59.1000])), (("7.5GY", 8.0, 12.0), np.array([0.3511, 0.5144, 59.1000])), (("7.5GY", 8.0, 14.0), np.array([0.3546, 0.5490, 59.1000])), (("7.5GY", 8.0, 16.0), np.array([0.3569, 0.5798, 59.1000])), (("7.5GY", 8.0, 18.0), np.array([0.3585, 0.6063, 59.1000])), (("7.5GY", 8.0, 20.0), np.array([0.3592, 0.6235, 59.1000])), (("10GY", 8.0, 2.0), np.array([0.3121, 0.3459, 59.1000])), (("10GY", 8.0, 4.0), np.array([0.3140, 0.3727, 59.1000])), (("10GY", 8.0, 6.0), np.array([0.3150, 0.4014, 59.1000])), (("10GY", 8.0, 8.0), np.array([0.3149, 0.4284, 59.1000])), (("10GY", 8.0, 10.0), np.array([0.3140, 0.4601, 59.1000])), (("10GY", 8.0, 12.0), np.array([0.3124, 0.4926, 59.1000])), (("10GY", 8.0, 14.0), np.array([0.3091, 0.5247, 59.1000])), (("10GY", 8.0, 16.0), np.array([0.3043, 0.5578, 59.1000])), (("10GY", 8.0, 18.0), np.array([0.2987, 0.5919, 59.1000])), (("10GY", 8.0, 20.0), np.array([0.2918, 0.6255, 59.1000])), (("10GY", 8.0, 22.0), np.array([0.2846, 0.6564, 59.1000])), (("10GY", 8.0, 24.0), np.array([0.2781, 0.6840, 59.1000])), (("2.5G", 8.0, 2.0), np.array([0.3053, 0.3404, 59.1000])), (("2.5G", 8.0, 4.0), np.array([0.3009, 0.3614, 59.1000])), (("2.5G", 8.0, 6.0), np.array([0.2952, 0.3851, 59.1000])), (("2.5G", 8.0, 8.0), np.array([0.2896, 0.4065, 59.1000])), (("2.5G", 8.0, 10.0), np.array([0.2829, 0.4301, 59.1000])), (("2.5G", 8.0, 12.0), np.array([0.2743, 0.4554, 59.1000])), (("2.5G", 8.0, 14.0), np.array([0.2661, 0.4780, 59.1000])), (("2.5G", 8.0, 16.0), np.array([0.2563, 0.5045, 59.1000])), (("2.5G", 8.0, 18.0), np.array([0.2451, 0.5309, 59.1000])), (("2.5G", 8.0, 20.0), np.array([0.2339, 0.5561, 59.1000])), (("2.5G", 8.0, 22.0), np.array([0.2221, 0.5799, 59.1000])), (("2.5G", 8.0, 24.0), np.array([0.2091, 0.6033, 59.1000])), (("5G", 8.0, 2.0), np.array([0.3009, 0.3359, 59.1000])), (("5G", 8.0, 4.0), np.array([0.2924, 0.3523, 59.1000])), (("5G", 8.0, 6.0), np.array([0.2822, 0.3702, 59.1000])), (("5G", 8.0, 8.0), np.array([0.2723, 0.3865, 59.1000])), (("5G", 8.0, 10.0), np.array([0.2613, 0.4026, 59.1000])), (("5G", 8.0, 12.0), np.array([0.2489, 0.4191, 59.1000])), (("5G", 8.0, 14.0), np.array([0.2368, 0.4348, 59.1000])), (("5G", 8.0, 16.0), np.array([0.2240, 0.4500, 59.1000])), (("5G", 8.0, 18.0), np.array([0.2103, 0.4652, 59.1000])), (("5G", 8.0, 20.0), np.array([0.1956, 0.4806, 59.1000])), (("5G", 8.0, 22.0), np.array([0.1821, 0.4940, 59.1000])), (("7.5G", 8.0, 2.0), np.array([0.2981, 0.3326, 59.1000])), (("7.5G", 8.0, 4.0), np.array([0.2874, 0.3464, 59.1000])), (("7.5G", 8.0, 6.0), np.array([0.2754, 0.3608, 59.1000])), (("7.5G", 8.0, 8.0), np.array([0.2639, 0.3733, 59.1000])), (("7.5G", 8.0, 10.0), np.array([0.2515, 0.3867, 59.1000])), (("7.5G", 8.0, 12.0), np.array([0.2380, 0.4002, 59.1000])), (("7.5G", 8.0, 14.0), np.array([0.2254, 0.4125, 59.1000])), (("7.5G", 8.0, 16.0), np.array([0.2120, 0.4252, 59.1000])), (("7.5G", 8.0, 18.0), np.array([0.1980, 0.4372, 59.1000])), (("7.5G", 8.0, 20.0), np.array([0.1845, 0.4492, 59.1000])), (("10G", 8.0, 2.0), np.array([0.2957, 0.3293, 59.1000])), (("10G", 8.0, 4.0), np.array([0.2828, 0.3403, 59.1000])), (("10G", 8.0, 6.0), np.array([0.2693, 0.3512, 59.1000])), (("10G", 8.0, 8.0), np.array([0.2564, 0.3611, 59.1000])), (("10G", 8.0, 10.0), np.array([0.2430, 0.3710, 59.1000])), (("10G", 8.0, 12.0), np.array([0.2282, 0.3811, 59.1000])), (("10G", 8.0, 14.0), np.array([0.2148, 0.3903, 59.1000])), (("10G", 8.0, 16.0), np.array([0.2012, 0.3992, 59.1000])), (("10G", 8.0, 18.0), np.array([0.1866, 0.4086, 59.1000])), (("10G", 8.0, 20.0), np.array([0.1734, 0.4164, 59.1000])), (("2.5BG", 8.0, 2.0), np.array([0.2940, 0.3268, 59.1000])), (("2.5BG", 8.0, 4.0), np.array([0.2791, 0.3351, 59.1000])), (("2.5BG", 8.0, 6.0), np.array([0.2647, 0.3429, 59.1000])), (("2.5BG", 8.0, 8.0), np.array([0.2500, 0.3500, 59.1000])), (("2.5BG", 8.0, 10.0), np.array([0.2352, 0.3566, 59.1000])), (("2.5BG", 8.0, 12.0), np.array([0.2196, 0.3630, 59.1000])), (("2.5BG", 8.0, 14.0), np.array([0.2057, 0.3681, 59.1000])), (("2.5BG", 8.0, 16.0), np.array([0.1915, 0.3732, 59.1000])), (("2.5BG", 8.0, 18.0), np.array([0.1759, 0.3782, 59.1000])), (("5BG", 8.0, 2.0), np.array([0.2919, 0.3228, 59.1000])), (("5BG", 8.0, 4.0), np.array([0.2752, 0.3278, 59.1000])), (("5BG", 8.0, 6.0), np.array([0.2588, 0.3318, 59.1000])), (("5BG", 8.0, 8.0), np.array([0.2419, 0.3352, 59.1000])), (("5BG", 8.0, 10.0), np.array([0.2264, 0.3383, 59.1000])), (("5BG", 8.0, 12.0), np.array([0.2101, 0.3412, 59.1000])), (("5BG", 8.0, 14.0), np.array([0.1958, 0.3432, 59.1000])), (("5BG", 8.0, 16.0), np.array([0.1814, 0.3450, 59.1000])), (("7.5BG", 8.0, 2.0), np.array([0.2900, 0.3183, 59.1000])), (("7.5BG", 8.0, 4.0), np.array([0.2718, 0.3200, 59.1000])), (("7.5BG", 8.0, 6.0), np.array([0.2525, 0.3198, 59.1000])), (("7.5BG", 8.0, 8.0), np.array([0.2352, 0.3198, 59.1000])), (("7.5BG", 8.0, 10.0), np.array([0.2184, 0.3196, 59.1000])), (("7.5BG", 8.0, 12.0), np.array([0.2010, 0.3188, 59.1000])), (("7.5BG", 8.0, 14.0), np.array([0.1868, 0.3179, 59.1000])), (("7.5BG", 8.0, 16.0), np.array([0.1721, 0.3168, 59.1000])), (("10BG", 8.0, 2.0), np.array([0.2894, 0.3152, 59.1000])), (("10BG", 8.0, 4.0), np.array([0.2686, 0.3130, 59.1000])), (("10BG", 8.0, 6.0), np.array([0.2489, 0.3099, 59.1000])), (("10BG", 8.0, 8.0), np.array([0.2302, 0.3063, 59.1000])), (("10BG", 8.0, 10.0), np.array([0.2120, 0.3025, 59.1000])), (("10BG", 8.0, 12.0), np.array([0.1937, 0.2978, 59.1000])), (("10BG", 8.0, 14.0), np.array([0.1788, 0.2936, 59.1000])), (("2.5B", 8.0, 2.0), np.array([0.2897, 0.3124, 59.1000])), (("2.5B", 8.0, 4.0), np.array([0.2668, 0.3067, 59.1000])), (("2.5B", 8.0, 6.0), np.array([0.2462, 0.3000, 59.1000])), (("2.5B", 8.0, 8.0), np.array([0.2264, 0.2923, 59.1000])), (("2.5B", 8.0, 10.0), np.array([0.2066, 0.2839, 59.1000])), (("2.5B", 8.0, 12.0), np.array([0.1877, 0.2752, 59.1000])), (("5B", 8.0, 2.0), np.array([0.2908, 0.3096, 59.1000])), (("5B", 8.0, 4.0), np.array([0.2671, 0.2998, 59.1000])), (("5B", 8.0, 6.0), np.array([0.2457, 0.2888, 59.1000])), (("5B", 8.0, 8.0), np.array([0.2237, 0.2761, 59.1000])), (("7.5B", 8.0, 2.0), np.array([0.2922, 0.3077, 59.1000])), (("7.5B", 8.0, 4.0), np.array([0.2688, 0.2956, 59.1000])), (("7.5B", 8.0, 6.0), np.array([0.2472, 0.2821, 59.1000])), (("7.5B", 8.0, 8.0), np.array([0.2252, 0.2668, 59.1000])), (("10B", 8.0, 2.0), np.array([0.2935, 0.3062, 59.1000])), (("10B", 8.0, 4.0), np.array([0.2718, 0.2911, 59.1000])), (("10B", 8.0, 6.0), np.array([0.2512, 0.2760, 59.1000])), (("10B", 8.0, 8.0), np.array([0.2294, 0.2587, 59.1000])), (("2.5PB", 8.0, 2.0), np.array([0.2957, 0.3047, 59.1000])), (("2.5PB", 8.0, 4.0), np.array([0.2758, 0.2879, 59.1000])), (("2.5PB", 8.0, 6.0), np.array([0.2562, 0.2709, 59.1000])), (("5PB", 8.0, 2.0), np.array([0.2974, 0.3039, 59.1000])), (("5PB", 8.0, 4.0), np.array([0.2798, 0.2861, 59.1000])), (("5PB", 8.0, 6.0), np.array([0.2614, 0.2670, 59.1000])), (("7.5PB", 8.0, 2.0), np.array([0.3003, 0.3034, 59.1000])), (("7.5PB", 8.0, 4.0), np.array([0.2856, 0.2846, 59.1000])), (("7.5PB", 8.0, 6.0), np.array([0.2702, 0.2648, 59.1000])), (("10PB", 8.0, 2.0), np.array([0.3027, 0.3035, 59.1000])), (("10PB", 8.0, 4.0), np.array([0.2911, 0.2848, 59.1000])), (("10PB", 8.0, 6.0), np.array([0.2792, 0.2649, 59.1000])), (("10PB", 8.0, 8.0), np.array([0.2677, 0.2443, 59.1000])), (("2.5P", 8.0, 2.0), np.array([0.3048, 0.3040, 59.1000])), (("2.5P", 8.0, 4.0), np.array([0.2962, 0.2850, 59.1000])), (("2.5P", 8.0, 6.0), np.array([0.2881, 0.2671, 59.1000])), (("2.5P", 8.0, 8.0), np.array([0.2800, 0.2488, 59.1000])), (("5P", 8.0, 2.0), np.array([0.3065, 0.3047, 59.1000])), (("5P", 8.0, 4.0), np.array([0.3012, 0.2868, 59.1000])), (("5P", 8.0, 6.0), np.array([0.2963, 0.2704, 59.1000])), (("5P", 8.0, 8.0), np.array([0.2914, 0.2534, 59.1000])), (("5P", 8.0, 10.0), np.array([0.2870, 0.2380, 59.1000])), (("7.5P", 8.0, 2.0), np.array([0.3107, 0.3070, 59.1000])), (("7.5P", 8.0, 4.0), np.array([0.3114, 0.2915, 59.1000])), (("7.5P", 8.0, 6.0), np.array([0.3114, 0.2785, 59.1000])), (("7.5P", 8.0, 8.0), np.array([0.3116, 0.2626, 59.1000])), (("7.5P", 8.0, 10.0), np.array([0.3116, 0.2497, 59.1000])), (("7.5P", 8.0, 12.0), np.array([0.3117, 0.2370, 59.1000])), (("10P", 8.0, 2.0), np.array([0.3131, 0.3084, 59.1000])), (("10P", 8.0, 4.0), np.array([0.3175, 0.2955, 59.1000])), (("10P", 8.0, 6.0), np.array([0.3213, 0.2829, 59.1000])), (("10P", 8.0, 8.0), np.array([0.3250, 0.2700, 59.1000])), (("10P", 8.0, 10.0), np.array([0.3282, 0.2582, 59.1000])), (("10P", 8.0, 12.0), np.array([0.3312, 0.2470, 59.1000])), (("10P", 8.0, 14.0), np.array([0.3342, 0.2349, 59.1000])), (("2.5RP", 8.0, 2.0), np.array([0.3154, 0.3100, 59.1000])), (("2.5RP", 8.0, 4.0), np.array([0.3239, 0.3000, 59.1000])), (("2.5RP", 8.0, 6.0), np.array([0.3327, 0.2898, 59.1000])), (("2.5RP", 8.0, 8.0), np.array([0.3406, 0.2793, 59.1000])), (("2.5RP", 8.0, 10.0), np.array([0.3479, 0.2699, 59.1000])), (("2.5RP", 8.0, 12.0), np.array([0.3552, 0.2594, 59.1000])), (("2.5RP", 8.0, 14.0), np.array([0.3621, 0.2496, 59.1000])), (("5RP", 8.0, 2.0), np.array([0.3180, 0.3120, 59.1000])), (("5RP", 8.0, 4.0), np.array([0.3308, 0.3052, 59.1000])), (("5RP", 8.0, 6.0), np.array([0.3440, 0.2978, 59.1000])), (("5RP", 8.0, 8.0), np.array([0.3570, 0.2900, 59.1000])), (("5RP", 8.0, 10.0), np.array([0.3685, 0.2828, 59.1000])), (("5RP", 8.0, 12.0), np.array([0.3818, 0.2742, 59.1000])), (("7.5RP", 8.0, 2.0), np.array([0.3200, 0.3136, 59.1000])), (("7.5RP", 8.0, 4.0), np.array([0.3360, 0.3092, 59.1000])), (("7.5RP", 8.0, 6.0), np.array([0.3521, 0.3042, 59.1000])), (("7.5RP", 8.0, 8.0), np.array([0.3682, 0.2983, 59.1000])), (("7.5RP", 8.0, 10.0), np.array([0.3830, 0.2930, 59.1000])), (("7.5RP", 8.0, 12.0), np.array([0.4002, 0.2859, 59.1000])), (("10RP", 9.0, 2.0), np.array([0.3205, 0.3155, 78.6600])), (("10RP", 9.0, 4.0), np.array([0.3400, 0.3140, 78.6600])), (("10RP", 9.0, 6.0), np.array([0.3590, 0.3118, 78.6600])), (("2.5R", 9.0, 2.0), np.array([0.3210, 0.3168, 78.6600])), (("2.5R", 9.0, 4.0), np.array([0.3445, 0.3179, 78.6600])), (("2.5R", 9.0, 6.0), np.array([0.3665, 0.3183, 78.6600])), (("5R", 9.0, 2.0), np.array([0.3240, 0.3188, 78.6600])), (("5R", 9.0, 4.0), np.array([0.3495, 0.3226, 78.6600])), (("5R", 9.0, 6.0), np.array([0.3734, 0.3256, 78.6600])), (("7.5R", 9.0, 2.0), np.array([0.3263, 0.3210, 78.6600])), (("7.5R", 9.0, 4.0), np.array([0.3551, 0.3283, 78.6600])), (("7.5R", 9.0, 6.0), np.array([0.3812, 0.3348, 78.6600])), (("10R", 9.0, 2.0), np.array([0.3284, 0.3233, 78.6600])), (("10R", 9.0, 4.0), np.array([0.3600, 0.3348, 78.6600])), (("10R", 9.0, 6.0), np.array([0.3880, 0.3439, 78.6600])), (("2.5YR", 9.0, 2.0), np.array([0.3320, 0.3273, 78.6600])), (("2.5YR", 9.0, 4.0), np.array([0.3641, 0.3422, 78.6600])), (("2.5YR", 9.0, 6.0), np.array([0.3927, 0.3550, 78.6600])), (("5YR", 9.0, 2.0), np.array([0.3353, 0.3325, 78.6600])), (("5YR", 9.0, 4.0), np.array([0.3668, 0.3509, 78.6600])), (("5YR", 9.0, 6.0), np.array([0.3948, 0.3659, 78.6600])), (("7.5YR", 9.0, 2.0), np.array([0.3380, 0.3377, 78.6600])), (("7.5YR", 9.0, 4.0), np.array([0.3679, 0.3585, 78.6600])), (("7.5YR", 9.0, 6.0), np.array([0.3950, 0.3763, 78.6600])), (("7.5YR", 9.0, 8.0), np.array([0.4220, 0.3930, 78.6600])), (("10YR", 9.0, 2.0), np.array([0.3392, 0.3430, 78.6600])), (("10YR", 9.0, 4.0), np.array([0.3677, 0.3668, 78.6600])), (("10YR", 9.0, 6.0), np.array([0.3941, 0.3877, 78.6600])), (("10YR", 9.0, 8.0), np.array([0.4199, 0.4069, 78.6600])), (("2.5Y", 9.0, 2.0), np.array([0.3390, 0.3472, 78.6600])), (("2.5Y", 9.0, 4.0), np.array([0.3655, 0.3738, 78.6600])), (("2.5Y", 9.0, 6.0), np.array([0.3910, 0.3972, 78.6600])), (("2.5Y", 9.0, 8.0), np.array([0.4154, 0.4186, 78.6600])), (("2.5Y", 9.0, 10.0), np.array([0.4370, 0.4369, 78.6600])), (("2.5Y", 9.0, 12.0), np.array([0.4569, 0.4527, 78.6600])), (("5Y", 9.0, 2.0), np.array([0.3378, 0.3504, 78.6600])), (("5Y", 9.0, 4.0), np.array([0.3621, 0.3799, 78.6600])), (("5Y", 9.0, 6.0), np.array([0.3858, 0.4071, 78.6600])), (("5Y", 9.0, 8.0), np.array([0.4080, 0.4319, 78.6600])), (("5Y", 9.0, 10.0), np.array([0.4275, 0.4529, 78.6600])), (("5Y", 9.0, 12.0), np.array([0.4455, 0.4719, 78.6600])), (("5Y", 9.0, 14.0), np.array([0.4602, 0.4869, 78.6600])), (("5Y", 9.0, 16.0), np.array([0.4711, 0.4977, 78.6600])), (("5Y", 9.0, 18.0), np.array([0.4782, 0.5049, 78.6600])), (("5Y", 9.0, 20.0), np.array([0.4830, 0.5092, 78.6600])), (("7.5Y", 9.0, 2.0), np.array([0.3365, 0.3527, 78.6600])), (("7.5Y", 9.0, 4.0), np.array([0.3591, 0.3832, 78.6600])), (("7.5Y", 9.0, 6.0), np.array([0.3811, 0.4123, 78.6600])), (("7.5Y", 9.0, 8.0), np.array([0.4019, 0.4392, 78.6600])), (("7.5Y", 9.0, 10.0), np.array([0.4201, 0.4622, 78.6600])), (("7.5Y", 9.0, 12.0), np.array([0.4369, 0.4829, 78.6600])), (("7.5Y", 9.0, 14.0), np.array([0.4503, 0.4993, 78.6600])), (("7.5Y", 9.0, 16.0), np.array([0.4595, 0.5104, 78.6600])), (("7.5Y", 9.0, 18.0), np.array([0.4663, 0.5188, 78.6600])), (("10Y", 9.0, 2.0), np.array([0.3349, 0.3537, 78.6600])), (("10Y", 9.0, 4.0), np.array([0.3558, 0.3852, 78.6600])), (("10Y", 9.0, 6.0), np.array([0.3761, 0.4155, 78.6600])), (("10Y", 9.0, 8.0), np.array([0.3957, 0.4450, 78.6600])), (("10Y", 9.0, 10.0), np.array([0.4120, 0.4694, 78.6600])), (("10Y", 9.0, 12.0), np.array([0.4271, 0.4920, 78.6600])), (("10Y", 9.0, 14.0), np.array([0.4393, 0.5101, 78.6600])), (("10Y", 9.0, 16.0), np.array([0.4477, 0.5225, 78.6600])), (("10Y", 9.0, 18.0), np.array([0.4540, 0.5320, 78.6600])), (("2.5GY", 9.0, 2.0), np.array([0.3321, 0.3539, 78.6600])), (("2.5GY", 9.0, 4.0), np.array([0.3499, 0.3866, 78.6600])), (("2.5GY", 9.0, 6.0), np.array([0.3670, 0.4178, 78.6600])), (("2.5GY", 9.0, 8.0), np.array([0.3834, 0.4490, 78.6600])), (("2.5GY", 9.0, 10.0), np.array([0.3973, 0.4761, 78.6600])), (("2.5GY", 9.0, 12.0), np.array([0.4108, 0.5028, 78.6600])), (("2.5GY", 9.0, 14.0), np.array([0.4212, 0.5237, 78.6600])), (("2.5GY", 9.0, 16.0), np.array([0.4288, 0.5383, 78.6600])), (("2.5GY", 9.0, 18.0), np.array([0.4354, 0.5508, 78.6600])), (("5GY", 9.0, 2.0), np.array([0.3284, 0.3534, 78.6600])), (("5GY", 9.0, 4.0), np.array([0.3437, 0.3861, 78.6600])), (("5GY", 9.0, 6.0), np.array([0.3572, 0.4179, 78.6600])), (("5GY", 9.0, 8.0), np.array([0.3698, 0.4497, 78.6600])), (("5GY", 9.0, 10.0), np.array([0.3810, 0.4791, 78.6600])), (("5GY", 9.0, 12.0), np.array([0.3911, 0.5082, 78.6600])), (("5GY", 9.0, 14.0), np.array([0.3993, 0.5329, 78.6600])), (("5GY", 9.0, 16.0), np.array([0.4058, 0.5541, 78.6600])), (("5GY", 9.0, 18.0), np.array([0.4108, 0.5699, 78.6600])), (("7.5GY", 9.0, 2.0), np.array([0.3198, 0.3500, 78.6600])), (("7.5GY", 9.0, 4.0), np.array([0.3274, 0.3793, 78.6600])), (("7.5GY", 9.0, 6.0), np.array([0.3351, 0.4111, 78.6600])), (("7.5GY", 9.0, 8.0), np.array([0.3414, 0.4415, 78.6600])), (("7.5GY", 9.0, 10.0), np.array([0.3471, 0.4735, 78.6600])), (("7.5GY", 9.0, 12.0), np.array([0.3518, 0.5042, 78.6600])), (("7.5GY", 9.0, 14.0), np.array([0.3551, 0.5339, 78.6600])), (("7.5GY", 9.0, 16.0), np.array([0.3581, 0.5654, 78.6600])), (("7.5GY", 9.0, 18.0), np.array([0.3602, 0.5920, 78.6600])), (("10GY", 9.0, 2.0), np.array([0.3124, 0.3454, 78.6600])), (("10GY", 9.0, 4.0), np.array([0.3144, 0.3711, 78.6600])), (("10GY", 9.0, 6.0), np.array([0.3153, 0.4008, 78.6600])), (("10GY", 9.0, 8.0), np.array([0.3157, 0.4259, 78.6600])), (("10GY", 9.0, 10.0), np.array([0.3155, 0.4558, 78.6600])), (("10GY", 9.0, 12.0), np.array([0.3139, 0.4829, 78.6600])), (("10GY", 9.0, 14.0), np.array([0.3115, 0.5129, 78.6600])), (("10GY", 9.0, 16.0), np.array([0.3079, 0.5440, 78.6600])), (("10GY", 9.0, 18.0), np.array([0.3032, 0.5748, 78.6600])), (("2.5G", 9.0, 2.0), np.array([0.3058, 0.3400, 78.6600])), (("2.5G", 9.0, 4.0), np.array([0.3018, 0.3606, 78.6600])), (("2.5G", 9.0, 6.0), np.array([0.2966, 0.3846, 78.6600])), (("2.5G", 9.0, 8.0), np.array([0.2912, 0.4054, 78.6600])), (("2.5G", 9.0, 10.0), np.array([0.2851, 0.4275, 78.6600])), (("2.5G", 9.0, 12.0), np.array([0.2786, 0.4491, 78.6600])), (("2.5G", 9.0, 14.0), np.array([0.2711, 0.4726, 78.6600])), (("2.5G", 9.0, 16.0), np.array([0.2630, 0.4966, 78.6600])), (("5G", 9.0, 2.0), np.array([0.3017, 0.3357, 78.6600])), (("5G", 9.0, 4.0), np.array([0.2933, 0.3519, 78.6600])), (("5G", 9.0, 6.0), np.array([0.2832, 0.3697, 78.6600])), (("5G", 9.0, 8.0), np.array([0.2735, 0.3854, 78.6600])), (("5G", 9.0, 10.0), np.array([0.2639, 0.4001, 78.6600])), (("5G", 9.0, 12.0), np.array([0.2528, 0.4160, 78.6600])), (("7.5G", 9.0, 2.0), np.array([0.2987, 0.3323, 78.6600])), (("7.5G", 9.0, 4.0), np.array([0.2882, 0.3461, 78.6600])), (("7.5G", 9.0, 6.0), np.array([0.2763, 0.3607, 78.6600])), (("7.5G", 9.0, 8.0), np.array([0.2652, 0.3738, 78.6600])), (("7.5G", 9.0, 10.0), np.array([0.2545, 0.3855, 78.6600])), (("7.5G", 9.0, 12.0), np.array([0.2419, 0.3985, 78.6600])), (("10G", 9.0, 2.0), np.array([0.2965, 0.3293, 78.6600])), (("10G", 9.0, 4.0), np.array([0.2840, 0.3402, 78.6600])), (("10G", 9.0, 6.0), np.array([0.2703, 0.3513, 78.6600])), (("10G", 9.0, 8.0), np.array([0.2574, 0.3618, 78.6600])), (("10G", 9.0, 10.0), np.array([0.2457, 0.3702, 78.6600])), (("10G", 9.0, 12.0), np.array([0.2325, 0.3796, 78.6600])), (("2.5BG", 9.0, 2.0), np.array([0.2947, 0.3267, 78.6600])), (("2.5BG", 9.0, 4.0), np.array([0.2805, 0.3349, 78.6600])), (("2.5BG", 9.0, 6.0), np.array([0.2652, 0.3433, 78.6600])), (("2.5BG", 9.0, 8.0), np.array([0.2509, 0.3507, 78.6600])), (("2.5BG", 9.0, 10.0), np.array([0.2382, 0.3568, 78.6600])), (("5BG", 9.0, 2.0), np.array([0.2930, 0.3232, 78.6600])), (("5BG", 9.0, 4.0), np.array([0.2768, 0.3287, 78.6600])), (("5BG", 9.0, 6.0), np.array([0.2599, 0.3338, 78.6600])), (("5BG", 9.0, 8.0), np.array([0.2437, 0.3378, 78.6600])), (("5BG", 9.0, 10.0), np.array([0.2301, 0.3405, 78.6600])), (("7.5BG", 9.0, 2.0), np.array([0.2911, 0.3188, 78.6600])), (("7.5BG", 9.0, 4.0), np.array([0.2728, 0.3208, 78.6600])), (("7.5BG", 9.0, 6.0), np.array([0.2543, 0.3220, 78.6600])), (("7.5BG", 9.0, 8.0), np.array([0.2361, 0.3225, 78.6600])), (("7.5BG", 9.0, 10.0), np.array([0.2215, 0.3226, 78.6600])), (("10BG", 9.0, 2.0), np.array([0.2907, 0.3159, 78.6600])), (("10BG", 9.0, 4.0), np.array([0.2700, 0.3140, 78.6600])), (("10BG", 9.0, 6.0), np.array([0.2501, 0.3118, 78.6600])), (("2.5B", 9.0, 2.0), np.array([0.2909, 0.3125, 78.6600])), (("2.5B", 9.0, 4.0), np.array([0.2680, 0.3073, 78.6600])), (("5B", 9.0, 2.0), np.array([0.2919, 0.3102, 78.6600])), (("5B", 9.0, 4.0), np.array([0.2675, 0.3005, 78.6600])), (("7.5B", 9.0, 2.0), np.array([0.2937, 0.3087, 78.6600])), (("7.5B", 9.0, 4.0), np.array([0.2688, 0.2961, 78.6600])), (("10B", 9.0, 2.0), np.array([0.2949, 0.3076, 78.6600])), (("10B", 9.0, 4.0), np.array([0.2712, 0.2924, 78.6600])), (("2.5PB", 9.0, 2.0), np.array([0.2975, 0.3063, 78.6600])), (("5PB", 9.0, 2.0), np.array([0.2991, 0.3057, 78.6600])), (("7.5PB", 9.0, 2.0), np.array([0.3015, 0.3052, 78.6600])), (("10PB", 9.0, 2.0), np.array([0.3038, 0.3054, 78.6600])), (("10PB", 9.0, 4.0), np.array([0.2910, 0.2850, 78.6600])), (("2.5P", 9.0, 2.0), np.array([0.3050, 0.3051, 78.6600])), (("2.5P", 9.0, 4.0), np.array([0.2963, 0.2865, 78.6600])), (("5P", 9.0, 2.0), np.array([0.3067, 0.3060, 78.6600])), (("5P", 9.0, 4.0), np.array([0.3003, 0.2870, 78.6600])), (("7.5P", 9.0, 2.0), np.array([0.3107, 0.3081, 78.6600])), (("7.5P", 9.0, 4.0), np.array([0.3117, 0.2928, 78.6600])), (("7.5P", 9.0, 6.0), np.array([0.3120, 0.2788, 78.6600])), (("10P", 9.0, 2.0), np.array([0.3128, 0.3094, 78.6600])), (("10P", 9.0, 4.0), np.array([0.3176, 0.2966, 78.6600])), (("10P", 9.0, 6.0), np.array([0.3218, 0.2845, 78.6600])), (("2.5RP", 9.0, 2.0), np.array([0.3149, 0.3108, 78.6600])), (("2.5RP", 9.0, 4.0), np.array([0.3234, 0.3010, 78.6600])), (("2.5RP", 9.0, 6.0), np.array([0.3322, 0.2910, 78.6600])), (("5RP", 9.0, 2.0), np.array([0.3172, 0.3126, 78.6600])), (("5RP", 9.0, 4.0), np.array([0.3301, 0.3060, 78.6600])), (("5RP", 9.0, 6.0), np.array([0.3431, 0.2988, 78.6600])), (("7.5RP", 9.0, 2.0), np.array([0.3190, 0.3141, 78.6600])), (("7.5RP", 9.0, 4.0), np.array([0.3350, 0.3099, 78.6600])), (("7.5RP", 9.0, 6.0), np.array([0.3512, 0.3052, 78.6600])), ) """ *Real*, within MacAdam limits, published *Munsell* colours as a *tuple* as follows:: ( (('hue', 'value', 'chroma'), np.array(['x', 'y', 'Y'])), ..., (('hue', 'value', 'chroma'), np.array(['x', 'y', 'Y'])), ) References ---------- :cite:`MunsellColorSciencec` """
bsd-3-clause
3eda898a1d9c2dbe3326f5c47db14ae4
61.209982
78
0.486221
1.935845
false
false
false
false
colour-science/colour
colour/models/rgb/datasets/gopro.py
1
3027
""" GoPro Colourspaces ================== Defines the *GoPro* colourspaces: - :attr:`colour.models.RGB_COLOURSPACE_PROTUNE_NATIVE`. Notes ----- - The *Protune Native* colourspace primaries were derived using the method outlined in :cite:`Mansencal2015d` followed with a chromatic adaptation step to *CIE Standard Illuminant D Series D65* using :func:`colour.chromatically_adapted_primaries` definition. References ---------- - :cite:`GoPro2016a` : GoPro, Duiker, H.-P., & Mansencal, T. (2016). gopro.py. Retrieved April 12, 2017, from https://github.com/hpd/OpenColorIO-Configs/blob/master/aces_1.0.3/python/\ aces_ocio/colorspaces/gopro.py - :cite:`Mansencal2015d` : Mansencal, T. (2015). RED Colourspaces Derivation. Retrieved May 20, 2015, from https://www.colour-science.org/posts/red-colourspaces-derivation """ from __future__ import annotations import numpy as np from colour.colorimetry import CCS_ILLUMINANTS from colour.hints import NDArray from colour.models.rgb import ( RGB_Colourspace, log_decoding_Protune, log_encoding_Protune, normalised_primary_matrix, ) __author__ = "Colour Developers" __copyright__ = "Copyright 2013 Colour Developers" __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" __maintainer__ = "Colour Developers" __email__ = "colour-developers@colour-science.org" __status__ = "Production" __all__ = [ "PRIMARIES_PROTUNE_NATIVE", "WHITEPOINT_NAME_PROTUNE_NATIVE", "CCS_WHITEPOINT_PROTUNE_NATIVE", "MATRIX_PROTUNE_NATIVE_TO_XYZ", "MATRIX_XYZ_TO_PROTUNE_NATIVE", "RGB_COLOURSPACE_PROTUNE_NATIVE", ] PRIMARIES_PROTUNE_NATIVE: NDArray = np.array( [ [0.698480461493841, 0.193026445370121], [0.329555378387345, 1.024596624134644], [0.108442631407675, -0.034678569754016], ] ) """*Protune Native* colourspace primaries.""" WHITEPOINT_NAME_PROTUNE_NATIVE: str = "D65" """*Protune Native* colourspace whitepoint name.""" CCS_WHITEPOINT_PROTUNE_NATIVE: NDArray = CCS_ILLUMINANTS[ "CIE 1931 2 Degree Standard Observer" ][WHITEPOINT_NAME_PROTUNE_NATIVE] """*Protune Native* colourspace whitepoint chromaticity coordinates.""" MATRIX_PROTUNE_NATIVE_TO_XYZ: NDArray = normalised_primary_matrix( PRIMARIES_PROTUNE_NATIVE, CCS_WHITEPOINT_PROTUNE_NATIVE ) """*Protune Native* colourspace to *CIE XYZ* tristimulus values matrix.""" MATRIX_XYZ_TO_PROTUNE_NATIVE: NDArray = np.linalg.inv( MATRIX_PROTUNE_NATIVE_TO_XYZ ) """*CIE XYZ* tristimulus values to *Protune Native* colourspace matrix.""" RGB_COLOURSPACE_PROTUNE_NATIVE: RGB_Colourspace = RGB_Colourspace( "Protune Native", PRIMARIES_PROTUNE_NATIVE, CCS_WHITEPOINT_PROTUNE_NATIVE, WHITEPOINT_NAME_PROTUNE_NATIVE, MATRIX_PROTUNE_NATIVE_TO_XYZ, MATRIX_XYZ_TO_PROTUNE_NATIVE, log_encoding_Protune, log_decoding_Protune, ) RGB_COLOURSPACE_PROTUNE_NATIVE.__doc__ = """ *Protune Native* colourspace. References ---------- :cite:`GoPro2016a`, :cite:`Mansencal2015d` """
bsd-3-clause
cc491cd4f4d4d7239a5355a477f702b1
29.575758
79
0.712917
2.828972
false
false
true
false
colour-science/colour
colour/notation/hexadecimal.py
1
3566
""" Hexadecimal Notation ==================== Defines the objects for hexadecimal notation: - :func:`colour.notation.RGB_to_HEX` - :func:`colour.notation.HEX_to_RGB` """ from __future__ import annotations import numpy as np from colour.algebra import normalise_maximum from colour.hints import ArrayLike, List, NDArray, StrOrArrayLike, StrOrNDArray from colour.models import eotf_inverse_sRGB, eotf_sRGB from colour.utilities import ( as_float_array, as_int_array, from_range_1, to_domain_1, usage_warning, ) __author__ = "Colour Developers" __copyright__ = "Copyright 2013 Colour Developers" __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" __maintainer__ = "Colour Developers" __email__ = "colour-developers@colour-science.org" __status__ = "Production" __all__ = [ "RGB_to_HEX", "HEX_to_RGB", ] def RGB_to_HEX(RGB: ArrayLike) -> StrOrNDArray: """ Convert from *RGB* colourspace to hexadecimal representation. Parameters ---------- RGB *RGB* colourspace array. Returns ------- :class:`str` or :class:`numpy.array` Hexadecimal representation. Notes ----- +------------+-----------------------+---------------+ | **Domain** | **Scale - Reference** | **Scale - 1** | +============+=======================+===============+ | ``RGB`` | [0, 1] | [0, 1] | +------------+-----------------------+---------------+ Examples -------- >>> RGB = np.array([0.66666667, 0.86666667, 1.00000000]) >>> RGB_to_HEX(RGB) '#aaddff' """ RGB = to_domain_1(RGB) if np.any(RGB < 0): usage_warning( '"RGB" array contains negative values, those will be clipped, ' "unpredictable results may occur!" ) RGB = as_float_array(np.clip(RGB, 0, np.inf)) if np.any(RGB > 1): usage_warning( '"RGB" array contains values over 1 and will be normalised, ' "unpredictable results may occur!" ) RGB = eotf_inverse_sRGB(normalise_maximum(eotf_sRGB(RGB))) to_HEX = np.vectorize("{:02x}".format) HEX = to_HEX(as_int_array(RGB * 255, dtype=np.uint8)).astype(object) HEX = np.asarray("#") + HEX[..., 0] + HEX[..., 1] + HEX[..., 2] return HEX def HEX_to_RGB(HEX: StrOrArrayLike) -> NDArray: """ Convert from hexadecimal representation to *RGB* colourspace. Parameters ---------- HEX Hexadecimal representation. Returns ------- :class:`numpy.array` *RGB* colourspace array. Notes ----- +-----------+-----------------------+---------------+ | **Range** | **Scale - Reference** | **Scale - 1** | +===========+=======================+===============+ | ``RGB`` | [0, 1] | [0, 1] | +-----------+-----------------------+---------------+ Examples -------- >>> HEX = "#aaddff" >>> HEX_to_RGB(HEX) # doctest: +ELLIPSIS array([ 0.6666666..., 0.8666666..., 1. ]) """ HEX = np.core.defchararray.lstrip(HEX, "#") # type: ignore[arg-type] def to_RGB(x: List) -> List: """Convert given hexadecimal representation to *RGB*.""" l_x = len(x) return [ int(x[i : i + l_x // 3], 16) # type: ignore[call-overload] for i in range(0, l_x, l_x // 3) ] to_RGB_v = np.vectorize(to_RGB, otypes=[np.ndarray]) RGB = as_float_array(to_RGB_v(HEX).tolist()) / 255 return from_range_1(RGB)
bsd-3-clause
d9c7e6c538f2e6fccc4f69cea41cbbb3
24.654676
79
0.501402
3.523715
false
false
false
false
colour-science/colour
colour/colorimetry/datasets/light_sources/chromaticity_coordinates.py
1
17945
""" Chromaticity Coordinates of the Light Sources ============================================= Defines the chromaticity coordinates of the light sources. The following light sources are available: - *RIT* *PointerData.xls* spreadsheet light sources: Natural, Philips TL-84, T8 Luxline Plus White, SA, SC, T8 Polylux 3000, T8 Polylux 4000, Thorn Kolor-rite - *NIST* *NIST CQS simulation 7.4.xls* spreadsheet traditional light sources: Cool White FL, Daylight FL, HPS, Incandescent, LPS, Mercury, Metal Halide, Neodimium Incandescent, Super HPS, Triphosphor FL - *NIST* *NIST CQS simulation 7.4.xls* spreadsheet LED light sources: 3-LED-1 (457/540/605), 3-LED-2 (473/545/616), 3-LED-2 Yellow, 3-LED-3 (465/546/614), 3-LED-4 (455/547/623), 4-LED No Yellow, 4-LED Yellow, 4-LED-1 (461/526/576/624), 4-LED-2 (447/512/573/627), Luxeon WW 2880, PHOS-1, PHOS-2, PHOS-3, PHOS-4, Phosphor LED YAG - *NIST* *NIST CQS simulation 7.4.xls* spreadsheet Philips light sources: 60 A/W (Soft White), C100S54 (HPS), C100S54C (HPS), F32T8/TL830 (Triphosphor), F32T8/TL835 (Triphosphor), F32T8/TL841 (Triphosphor), F32T8/TL850 (Triphosphor), F32T8/TL865 /PLUS (Triphosphor), F34/CW/RS/EW (Cool White FL), F34T12/LW/RS /EW, F34T12WW/RS /EW (Warm White FL), F40/C50 (Broadband FL), F40/C75 (Broadband FL), F40/CWX (Broadband FL), F40/DX (Broadband FL), F40/DXTP (Delux FL), F40/N (Natural FL), H38HT-100 (Mercury), H38JA-100/DX (Mercury DX), MHC100/U/MP /3K, MHC100/U/MP /4K, SDW-T 100W/LV (Super HPS) - Common light sources: Kinoton 75P References ---------- - :cite:`Houston2015a` : Borer, T. (2017). Private Discussion with Mansencal, T. and Shaw, N. - :cite:`Ohno2008a` : Ohno, Yoshiro, & Davis, W. (2008). NIST CQS simulation (Version 7.4) [Computer software]. https://drive.google.com/file/d/1PsuU6QjUJjCX6tQyCud6ul2Tbs8rYWW9/view?\ usp=sharing - :cite:`Pointer1980a` : Pointer, M. R. (1980). Pointer's Gamut Data. http://www.cis.rit.edu/research/mcsl2/online/PointerData.xls """ from __future__ import annotations import numpy as np from colour.utilities import CanonicalMapping __author__ = "Colour Developers" __copyright__ = "Copyright 2013 Colour Developers" __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" __maintainer__ = "Colour Developers" __email__ = "colour-developers@colour-science.org" __status__ = "Production" __all__ = [ "CCS_LIGHT_SOURCES_RIT_STANDARD_OBSERVER_2_DEGREE_CIE1931", "CCS_LIGHT_SOURCES_RIT_STANDARD_OBSERVER_10_DEGREE_CIE1964", "CCS_LIGHT_SOURCES_NIST_TRADITIONAL_STANDARD_OBSERVER_2_DEGREE_CIE1931", "CCS_LIGHT_SOURCES_NIST_TRADITIONAL_STANDARD_OBSERVER_10_DEGREE_CIE1964", "CCS_LIGHT_SOURCES_NIST_LED_STANDARD_OBSERVER_2_DEGREE_CIE1931", "CCS_LIGHT_SOURCES_NIST_LED_STANDARD_OBSERVER_10_DEGREE_CIE1964", "CCS_LIGHT_SOURCES_NIST_PHILIPS_STANDARD_OBSERVER_2_DEGREE_CIE1931", "CCS_LIGHT_SOURCES_NIST_PHILIPS_STANDARD_OBSERVER_10_DEGREE_CIE1964", "CCS_LIGHT_SOURCES_COMMON_STANDARD_OBSERVER_2_DEGREE_CIE1931", "CCS_LIGHT_SOURCES_COMMON_STANDARD_OBSERVER_10_DEGREE_CIE1964", "CCS_LIGHT_SOURCES", ] CCS_LIGHT_SOURCES_RIT_STANDARD_OBSERVER_2_DEGREE_CIE1931: ( CanonicalMapping ) = CanonicalMapping( { "Natural": np.array([0.381585730647787, 0.359224138274067]), "Philips TL-84": np.array([0.378413599970988, 0.379290254544090]), "SA": np.array([0.447573030734154, 0.407438137156467]), "SC": np.array([0.310056734303928, 0.316145704789204]), "T8 Luxline Plus White": np.array( [0.410492204086250, 0.388932529676840] ), "T8 Polylux 3000": np.array([0.431706082207185, 0.413877736072647]), "T8 Polylux 4000": np.array([0.379219473139794, 0.384469085577631]), "Thorn Kolor-rite": np.array([0.381919124282806, 0.374309261641251]), } ) """ Chromaticity coordinates of the light sources from the *RIT* *PointerData.xls* spreadsheet for the *CIE 1931 2 Degree Standard Observer*. Warnings -------- The chromaticity coordinates have been calculated from *PointerData.xls* spreadsheet which doesn't mention the data source thus the light source names cannot be accurately verified. References ---------- :cite:`Pointer1980a` """ CCS_LIGHT_SOURCES_RIT_STANDARD_OBSERVER_10_DEGREE_CIE1964: ( CanonicalMapping ) = CanonicalMapping( { "Natural": np.array([0.384870991183035, 0.353869223366545]), "Philips TL-84": np.array([0.383592002892950, 0.373922741815762]), "SA": np.array([0.451176803594070, 0.405936046781591]), "SC": np.array([0.310388637415649, 0.319050651220986]), "T8 Luxline Plus White": np.array( [0.416946978831203, 0.380991426462756] ), "T8 Polylux 3000": np.array([0.439038926288670, 0.404554330124715]), "T8 Polylux 4000": np.array([0.385115161872875, 0.377800928395769]), "Thorn Kolor-rite": np.array([0.385533929282467, 0.370840492090948]), } ) """ Chromaticity coordinates of the light sources from the *RIT* *PointerData.xls* spreadsheet for the *CIE 1964 10 Degree Standard Observer*. """ CCS_LIGHT_SOURCES_NIST_TRADITIONAL_STANDARD_OBSERVER_2_DEGREE_CIE1931: ( CanonicalMapping ) = CanonicalMapping( { "Cool White FL": np.array([0.369256318971281, 0.372549878176631]), "Daylight FL": np.array([0.312662993963651, 0.331985688793009]), "HPS": np.array([0.521677696062816, 0.417971177117239]), "Incandescent": np.array([0.450730217519680, 0.408046128945005]), "LPS": np.array([0.575151311365165, 0.424232234924905]), "Mercury": np.array([0.392018457637112, 0.383777071984453]), "Metal Halide": np.array([0.372544558972793, 0.385603925927588]), "Neodimium Incandescent": np.array( [0.447398697052100, 0.395008601248268] ), "Super HPS": np.array([0.470061659271846, 0.406116584248741]), "Triphosphor FL": np.array([0.413163268257275, 0.396422053758680]), } ) """ Chromaticity coordinates of the traditional light sources from the *NIST* *NIST CQS simulation 7.4.xls* spreadsheet for the *CIE 1931 2 Degree Standard Observer*. References ---------- :cite:`Ohno2008a` """ CCS_LIGHT_SOURCES_NIST_TRADITIONAL_STANDARD_OBSERVER_10_DEGREE_CIE1964: ( CanonicalMapping ) = CanonicalMapping( { "Cool White FL": np.array([0.376715047518455, 0.364576802118673]), "Daylight FL": np.array([0.317395878738965, 0.330780819136676]), "HPS": np.array([0.531764495177513, 0.408752715284645]), "Incandescent": np.array([0.454365604973572, 0.406573684216774]), "LPS": np.array([0.589960045887891, 0.410039954112109]), "Mercury": np.array([0.401266412873755, 0.364732538221183]), "Metal Halide": np.array([0.378786167751226, 0.377496928504661]), "Neodimium Incandescent": np.array( [0.447516717156694, 0.396734151368497] ), "Super HPS": np.array([0.473859567146135, 0.401381825309197]), "Triphosphor FL": np.array([0.418591963931736, 0.388947713332192]), } ) """ Chromaticity coordinates of the traditional light sources from the *NIST* *NIST CQS simulation 7.4.xls* spreadsheet for the *CIE 1964 10 Degree Standard Observer*. """ CCS_LIGHT_SOURCES_NIST_LED_STANDARD_OBSERVER_2_DEGREE_CIE1931: ( CanonicalMapping ) = CanonicalMapping( { "3-LED-1 (457/540/605)": np.array( [0.417057686949170, 0.396262457986602] ), "3-LED-2 (473/545/616)": np.array( [0.417060475566006, 0.396268120523418] ), "3-LED-2 Yellow": np.array([0.436563079184047, 0.443649619298676]), "3-LED-3 (465/546/614)": np.array( [0.380460502184482, 0.376772001481922] ), "3-LED-4 (455/547/623)": np.array( [0.417067943691045, 0.396276280071757] ), "4-LED No Yellow": np.array([0.417060589301332, 0.396268153712350]), "4-LED Yellow": np.array([0.417069637940463, 0.396276766014859]), "4-LED-1 (461/526/576/624)": np.array( [0.417067615440556, 0.396275056779587] ), "4-LED-2 (447/512/573/627)": np.array( [0.417071570560054, 0.396278745130373] ), "Luxeon WW 2880": np.array([0.459088527920913, 0.432916480607903]), "PHOS-1": np.array([0.436443167801164, 0.404616033549917]), "PHOS-2": np.array([0.452704462198571, 0.437584543052711]), "PHOS-3": np.array([0.436899870751359, 0.404037372134463]), "PHOS-4": np.array([0.436936023906427, 0.404113558278629]), "Phosphor LED YAG": np.array([0.307761817314310, 0.325268939239941]), } ) """ Chromaticity coordinates of the LED light sources from the *NIST* *NIST CQS simulation 7.4.xls* spreadsheet for the *CIE 1931 2 Degree Standard Observer*. """ CCS_LIGHT_SOURCES_NIST_LED_STANDARD_OBSERVER_10_DEGREE_CIE1964: ( CanonicalMapping ) = CanonicalMapping( { "3-LED-1 (457/540/605)": np.array( [0.425099988926548, 0.389451349911075] ), "3-LED-2 (473/545/616)": np.array( [0.422222118774217, 0.401298495594226] ), "3-LED-2 Yellow": np.array([0.446222216139125, 0.441646464276087]), "3-LED-3 (465/546/614)": np.array( [0.387470465801936, 0.376404716015666] ), "3-LED-4 (455/547/623)": np.array( [0.422865464107041, 0.388772240171637] ), "4-LED No Yellow": np.array([0.419807532952439, 0.399465294930377]), "4-LED Yellow": np.array([0.422720601750053, 0.390284663473479]), "4-LED-1 (461/526/576/624)": np.array( [0.423899783323037, 0.394170886226971] ), "4-LED-2 (447/512/573/627)": np.array( [0.421571042053867, 0.394089741928601] ), "Luxeon WW 2880": np.array([0.466639299623263, 0.430817417218051]), "PHOS-1": np.array([0.440120001281140, 0.403135783393416]), "PHOS-2": np.array([0.461487398870558, 0.436150294667024]), "PHOS-3": np.array([0.440892655302172, 0.408662264402299]), "PHOS-4": np.array([0.441760443951475, 0.407267478268879]), "Phosphor LED YAG": np.array([0.312807834772696, 0.334180937864035]), } ) """ Chromaticity coordinates of the LED light sources from the *NIST* *NIST CQS simulation 7.4.xls* spreadsheet for the *CIE 1964 10 Degree Standard Observer*. """ CCS_LIGHT_SOURCES_NIST_PHILIPS_STANDARD_OBSERVER_2_DEGREE_CIE1931: ( CanonicalMapping ) = CanonicalMapping( { "60 A/W (Soft White)": np.array( [0.450730217519680, 0.408046128945005] ), "C100S54 (HPS)": np.array([0.529231515407657, 0.411370164988427]), "C100S54C (HPS)": np.array([0.502380414374839, 0.415877299905475]), "F32T8/TL830 (Triphosphor)": np.array( [0.443250764475753, 0.409523700296928] ), "F32T8/TL835 (Triphosphor)": np.array( [0.407150274569933, 0.393172743482571] ), "F32T8/TL841 (Triphosphor)": np.array( [0.385376686681605, 0.390370762102806] ), "F32T8/TL850 (Triphosphor)": np.array( [0.343768910392287, 0.358447436104108] ), "F32T8/TL865 /PLUS (Triphosphor)": np.array( [0.316368879615201, 0.345320790143017] ), "F34/CW/RS/EW (Cool White FL)": np.array( [0.377250931364378, 0.393087658636060] ), "F34T12/LW/RS /EW": np.array([0.378863642993776, 0.394960629979820]), "F34T12WW/RS /EW (Warm White FL)": np.array( [0.438466967656789, 0.408635441565706] ), "F40/C50 (Broadband FL)": np.array( [0.345836574973021, 0.361724450389430] ), "F40/C75 (Broadband FL)": np.array( [0.299966663385220, 0.316582165804824] ), "F40/CWX (Broadband FL)": np.array( [0.375037045754214, 0.360543952129462] ), "F40/DX (Broadband FL)": np.array( [0.311922310746537, 0.342802103417329] ), "F40/DXTP (Delux FL)": np.array( [0.313066543826958, 0.342225714484412] ), "F40/N (Natural FL)": np.array([0.376878697365115, 0.354153458302878]), "H38HT-100 (Mercury)": np.array( [0.311200590193641, 0.382944245857018] ), "H38JA-100/DX (Mercury DX)": np.array( [0.389791630360359, 0.373394688931767] ), "MHC100/U/MP /3K": np.array([0.428581768670222, 0.388168915678330]), "MHC100/U/MP /4K": np.array([0.373145253482762, 0.371366990216717]), "SDW-T 100W/LV (Super HPS)": np.array( [0.472339157938672, 0.407106330880316] ), } ) """ Chromaticity coordinates of the Philips light sources from the *NIST* *NIST CQS simulation 7.4.xls* spreadsheet for the *CIE 1931 2 Degree Standard Observer*. """ CCS_LIGHT_SOURCES_NIST_PHILIPS_STANDARD_OBSERVER_10_DEGREE_CIE1964: ( CanonicalMapping ) = CanonicalMapping( { "60 A/W (Soft White)": np.array( [0.454365604973572, 0.406573684216774] ), "C100S54 (HPS)": np.array([0.538554605063010, 0.402575827972962]), "C100S54C (HPS)": np.array([0.509663059970892, 0.409064508209193]), "F32T8/TL830 (Triphosphor)": np.array( [0.448795219301811, 0.403574636091678] ), "F32T8/TL835 (Triphosphor)": np.array( [0.412082534290652, 0.388001071127592] ), "F32T8/TL841 (Triphosphor)": np.array( [0.390908619219527, 0.385290559992705] ), "F32T8/TL850 (Triphosphor)": np.array( [0.347882431257452, 0.355845742210551] ), "F32T8/TL865 /PLUS (Triphosphor)": np.array( [0.320698199593768, 0.343871441043854] ), "F34/CW/RS/EW (Cool White FL)": np.array( [0.386514853545337, 0.382843326097814] ), "F34T12/LW/RS /EW": np.array([0.389628909159399, 0.382074721889904]), "F34T12WW/RS /EW (Warm White FL)": np.array( [0.448395377616960, 0.395666643335296] ), "F40/C50 (Broadband FL)": np.array( [0.349880827196884, 0.360661316491439] ), "F40/C75 (Broadband FL)": np.array( [0.301988533872761, 0.318479025875818] ), "F40/CWX (Broadband FL)": np.array( [0.378502309910296, 0.356371890168937] ), "F40/DX (Broadband FL)": np.array( [0.316783037559153, 0.341749269085077] ), "F40/DXTP (Delux FL)": np.array( [0.318774745065791, 0.339798825605488] ), "F40/N (Natural FL)": np.array([0.378833157741751, 0.350724402658646]), "H38HT-100 (Mercury)": np.array( [0.326260627082484, 0.360001095895205] ), "H38JA-100/DX (Mercury DX)": np.array( [0.397058597517533, 0.356532431806974] ), "MHC100/U/MP /3K": np.array([0.431422986591898, 0.380642213887539]), "MHC100/U/MP /4K": np.array([0.375707105948115, 0.366156465779779]), "SDW-T 100W/LV (Super HPS)": np.array( [0.476461908192661, 0.402288012403575] ), } ) """ Chromaticity coordinates of the Philips light sources from the *NIST* *NIST CQS simulation 7.4.xls* spreadsheet for the *CIE 1964 10 Degree Standard Observer*. """ CCS_LIGHT_SOURCES_COMMON_STANDARD_OBSERVER_2_DEGREE_CIE1931: ( CanonicalMapping ) = CanonicalMapping( {"Kinoton 75P": np.array([0.315252413629716, 0.332870794805328])} ) """ Chromaticity coordinates of the common light sources for the *CIE 1931 2 Degree Standard Observer*. References ---------- :cite:`Houston2015a` """ CCS_LIGHT_SOURCES_COMMON_STANDARD_OBSERVER_10_DEGREE_CIE1964: ( CanonicalMapping ) = CanonicalMapping( {"Kinoton 75P": np.array([0.317086642148234, 0.336222428041514])} ) """ Chromaticity coordinates of the common light sources for the *CIE 1964 10 Degree Standard Observer*. """ CCS_LIGHT_SOURCES: CanonicalMapping = CanonicalMapping( { "CIE 1931 2 Degree Standard Observer": CanonicalMapping( CCS_LIGHT_SOURCES_RIT_STANDARD_OBSERVER_2_DEGREE_CIE1931 ), "CIE 1964 10 Degree Standard Observer": CanonicalMapping( CCS_LIGHT_SOURCES_RIT_STANDARD_OBSERVER_10_DEGREE_CIE1964 ), } ) CCS_LIGHT_SOURCES.__doc__ = """ Chromaticity coordinates of the light sources. Aliases: - 'cie_2_1931': 'CIE 1931 2 Degree Standard Observer' - 'cie_10_1964': 'CIE 1964 10 Degree Standard Observer' """ CCS_LIGHT_SOURCES["cie_2_1931"] = CCS_LIGHT_SOURCES[ "CIE 1931 2 Degree Standard Observer" ] CCS_LIGHT_SOURCES["cie_10_1964"] = CCS_LIGHT_SOURCES[ "CIE 1964 10 Degree Standard Observer" ] CCS_LIGHT_SOURCES["CIE 1931 2 Degree Standard Observer"].update( CCS_LIGHT_SOURCES_NIST_TRADITIONAL_STANDARD_OBSERVER_2_DEGREE_CIE1931 ) CCS_LIGHT_SOURCES["CIE 1964 10 Degree Standard Observer"].update( CCS_LIGHT_SOURCES_NIST_TRADITIONAL_STANDARD_OBSERVER_10_DEGREE_CIE1964 ) CCS_LIGHT_SOURCES["CIE 1931 2 Degree Standard Observer"].update( CCS_LIGHT_SOURCES_NIST_LED_STANDARD_OBSERVER_2_DEGREE_CIE1931 ) CCS_LIGHT_SOURCES["CIE 1964 10 Degree Standard Observer"].update( CCS_LIGHT_SOURCES_NIST_LED_STANDARD_OBSERVER_10_DEGREE_CIE1964 ) CCS_LIGHT_SOURCES["CIE 1931 2 Degree Standard Observer"].update( CCS_LIGHT_SOURCES_NIST_PHILIPS_STANDARD_OBSERVER_2_DEGREE_CIE1931 ) CCS_LIGHT_SOURCES["CIE 1964 10 Degree Standard Observer"].update( CCS_LIGHT_SOURCES_NIST_PHILIPS_STANDARD_OBSERVER_10_DEGREE_CIE1964 ) CCS_LIGHT_SOURCES["CIE 1931 2 Degree Standard Observer"].update( CCS_LIGHT_SOURCES_COMMON_STANDARD_OBSERVER_2_DEGREE_CIE1931 ) CCS_LIGHT_SOURCES["CIE 1964 10 Degree Standard Observer"].update( CCS_LIGHT_SOURCES_COMMON_STANDARD_OBSERVER_10_DEGREE_CIE1964 )
bsd-3-clause
41f91cc2abbc56ea8fdf30dbb809c673
37.926247
79
0.649986
2.585362
false
false
false
false
colour-science/colour
colour/geometry/intersection.py
1
6945
""" Intersection Utilities ====================== Defines the geometry intersection utilities objects. References ---------- - :cite:`Bourkea` : Bourke, P. (n.d.). Intersection point of two line segments in 2 dimensions. Retrieved January 15, 2016, from http://paulbourke.net/geometry/pointlineplane/ - :cite:`Erdema` : Erdem, U. M. (n.d.). Fast Line Segment Intersection. Retrieved January 15, 2016, from http://www.mathworks.com/matlabcentral/fileexchange/\ 27205-fast-line-segment-intersection - :cite:`Saeedna` : Saeedn. (n.d.). Extend a line segment a specific distance. Retrieved January 16, 2016, from http://stackoverflow.com/questions/7740507/\ extend-a-line-segment-a-specific-distance """ from __future__ import annotations import numpy as np from dataclasses import dataclass from colour.algebra import euclidean_distance, sdiv, sdiv_mode from colour.hints import ( ArrayLike, Floating, NDArray, cast, ) from colour.utilities import ( tsplit, tstack, ) __author__ = "Colour Developers" __copyright__ = "Copyright 2013 Colour Developers" __license__ = "New BSD License - https://opensource.org/licenses/BSD-3-Clause" __maintainer__ = "Colour Developers" __email__ = "colour-developers@colour-science.org" __status__ = "Production" __all__ = [ "extend_line_segment", "LineSegmentsIntersections_Specification", "intersect_line_segments", ] def extend_line_segment( a: ArrayLike, b: ArrayLike, distance: Floating = 1 ) -> NDArray: """ Extend the line segment defined by point arrays :math:`a` and :math:`b` by given distance and return the new end point. Parameters ---------- a Point array :math:`a`. b Point array :math:`b`. distance Distance to extend the line segment. Returns ------- :class:`numpy.ndarray` New end point. References ---------- :cite:`Saeedna` Notes ----- - Input line segment points coordinates are 2d coordinates. Examples -------- >>> a = np.array([0.95694934, 0.13720932]) >>> b = np.array([0.28382835, 0.60608318]) >>> extend_line_segment(a, b) # doctest: +ELLIPSIS array([-0.5367248..., 1.1776534...]) """ x_a, y_a = tsplit(a) x_b, y_b = tsplit(b) d = euclidean_distance(a, b) with sdiv_mode(): x_c = x_b + sdiv(x_b - x_a, d) * distance y_c = y_b + sdiv(y_b - y_a, d) * distance xy_c = tstack([x_c, y_c]) return xy_c @dataclass class LineSegmentsIntersections_Specification: """ Define the specification for intersection of line segments :math:`l_1` and :math:`l_2` returned by :func:`colour.algebra.intersect_line_segments` definition. Parameters ---------- xy Array of :math:`l_1` and :math:`l_2` line segments intersections coordinates. Non existing segments intersections coordinates are set with `np.nan`. intersect Array of *bool* indicating if line segments :math:`l_1` and :math:`l_2` intersect. parallel Array of :class:`bool` indicating if line segments :math:`l_1` and :math:`l_2` are parallel. coincident Array of :class:`bool` indicating if line segments :math:`l_1` and :math:`l_2` are coincident. """ xy: NDArray intersect: NDArray parallel: NDArray coincident: NDArray def intersect_line_segments( l_1: ArrayLike, l_2: ArrayLike ) -> LineSegmentsIntersections_Specification: """ Compute :math:`l_1` line segments intersections with :math:`l_2` line segments. Parameters ---------- l_1 :math:`l_1` line segments array, each row is a line segment such as (:math:`x_1`, :math:`y_1`, :math:`x_2`, :math:`y_2`) where (:math:`x_1`, :math:`y_1`) and (:math:`x_2`, :math:`y_2`) are respectively the start and end points of :math:`l_1` line segments. l_2 :math:`l_2` line segments array, each row is a line segment such as (:math:`x_3`, :math:`y_3`, :math:`x_4`, :math:`y_4`) where (:math:`x_3`, :math:`y_3`) and (:math:`x_4`, :math:`y_4`) are respectively the start and end points of :math:`l_2` line segments. Returns ------- :class:`colour.algebra.LineSegmentsIntersections_Specification` Line segments intersections specification. References ---------- :cite:`Bourkea`, :cite:`Erdema` Notes ----- - Input line segments points coordinates are 2d coordinates. Examples -------- >>> l_1 = np.array( ... [ ... [[0.15416284, 0.7400497], [0.26331502, 0.53373939]], ... [[0.01457496, 0.91874701], [0.90071485, 0.03342143]], ... ] ... ) >>> l_2 = np.array( ... [ ... [[0.95694934, 0.13720932], [0.28382835, 0.60608318]], ... [[0.94422514, 0.85273554], [0.00225923, 0.52122603]], ... [[0.55203763, 0.48537741], [0.76813415, 0.16071675]], ... ] ... ) >>> s = intersect_line_segments(l_1, l_2) >>> s.xy # doctest: +ELLIPSIS array([[[ nan, nan], [ 0.2279184..., 0.6006430...], [ nan, nan]], <BLANKLINE> [[ 0.4281451..., 0.5055568...], [ 0.3056055..., 0.6279838...], [ 0.7578749..., 0.1761301...]]]) >>> s.intersect array([[False, True, False], [ True, True, True]], dtype=bool) >>> s.parallel array([[False, False, False], [False, False, False]], dtype=bool) >>> s.coincident array([[False, False, False], [False, False, False]], dtype=bool) """ l_1 = np.reshape(l_1, (-1, 4)) l_2 = np.reshape(l_2, (-1, 4)) r_1, c_1 = l_1.shape[0], l_1.shape[1] r_2, c_2 = l_2.shape[0], l_2.shape[1] x_1, y_1, x_2, y_2 = ( np.tile(l_1[:, i, None], (1, r_2)) for i in range(c_1) ) l_2 = np.transpose(l_2) x_3, y_3, x_4, y_4 = (np.tile(l_2[i, :], (r_1, 1)) for i in range(c_2)) x_4_x_3 = x_4 - x_3 y_1_y_3 = y_1 - y_3 y_4_y_3 = y_4 - y_3 x_1_x_3 = x_1 - x_3 x_2_x_1 = x_2 - x_1 y_2_y_1 = y_2 - y_1 numerator_a = x_4_x_3 * y_1_y_3 - y_4_y_3 * x_1_x_3 numerator_b = x_2_x_1 * y_1_y_3 - y_2_y_1 * x_1_x_3 denominator = y_4_y_3 * x_2_x_1 - x_4_x_3 * y_2_y_1 with sdiv_mode("Ignore"): u_a = cast(NDArray, sdiv(numerator_a, denominator)) u_b = cast(NDArray, sdiv(numerator_b, denominator)) intersect = np.logical_and.reduce((u_a >= 0, u_a <= 1, u_b >= 0, u_b <= 1)) xy = tstack([x_1 + x_2_x_1 * u_a, y_1 + y_2_y_1 * u_a]) xy[~intersect] = np.nan parallel = denominator == 0 coincident = np.logical_and.reduce( (numerator_a == 0, numerator_b == 0, parallel) ) return LineSegmentsIntersections_Specification( xy, intersect, parallel, coincident )
bsd-3-clause
38b8563359dee03b7eb37ad616fd8b0e
27.817427
79
0.564579
3.011709
false
false
false
false