after_merge
stringlengths
28
79.6k
before_merge
stringlengths
20
79.6k
url
stringlengths
38
71
full_traceback
stringlengths
43
922k
traceback_type
stringclasses
555 values
def _create_dag_runs(self, dag_models: Iterable[DagModel], session: Session) -> None: """ Unconditionally create a DAG run for the given DAG, and update the dag_model's fields to control if/when the next DAGRun should be created """ # Bulk Fetch DagRuns with dag_id and execution_date same # as D...
def _create_dag_runs(self, dag_models: Iterable[DagModel], session: Session) -> None: """ Unconditionally create a DAG run for the given DAG, and update the dag_model's fields to control if/when the next DAGRun should be created """ for dag_model in dag_models: try: dag = self.da...
https://github.com/apache/airflow/issues/13685
{2021-01-15 09:06:22,636} {{scheduler_job.py:1293}} ERROR - Exception when executing SchedulerJob._run_scheduler_loop Traceback (most recent call last): File "/home/app/.pyenv/versions/3.8.1/envs/airflow-py381/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context self.dialect.do_execute...
MySQLdb._exceptions.IntegrityError
def upgrade(): # noqa: D103 # We previously had a KnownEvent's table, but we deleted the table without # a down migration to remove it (so we didn't delete anyone's data if they # were happing to use the feature. # # But before we can delete the users table we need to drop the FK conn = op.get...
def upgrade(): # noqa: D103 # We previously had a KnownEvent's table, but we deleted the table without # a down migration to remove it (so we didn't delete anyone's data if they # were happing to use the feature. # # But before we can delete the users table we need to drop the FK conn = op.get...
https://github.com/apache/airflow/issues/13877
[2021-01-24 08:38:42,015] {db.py:678} INFO - Creating tables INFO [alembic.runtime.migration] Context impl SQLiteImpl. INFO [alembic.runtime.migration] Will assume non-transactional DDL. INFO [alembic.runtime.migration] Running upgrade 03afc6b6f902 -> cf5dc11e79ad, drop_user_and_chart Traceback (most recent call las...
NotImplementedError
def __init__( self, *, trigger_dag_id: str, conf: Optional[Dict] = None, execution_date: Optional[Union[str, datetime.datetime]] = None, reset_dag_run: bool = False, wait_for_completion: bool = False, poke_interval: int = 60, allowed_states: Optional[List] = None, failed_states: ...
def __init__( self, *, trigger_dag_id: str, conf: Optional[Dict] = None, execution_date: Optional[Union[str, datetime.datetime]] = None, reset_dag_run: bool = False, wait_for_completion: bool = False, poke_interval: int = 60, allowed_states: Optional[List] = None, failed_states: ...
https://github.com/apache/airflow/issues/13414
Ooops! Something bad has happened. Please consider letting us know by creating a bug report using GitHub. Python version: 3.6.9 Airflow version: 2.0.0 Node: henry-Inspiron-5566 ------------------------------------------------------------------------------- Traceback (most recent call last): File "/home/henry/Envs2/air...
TypeError
def get_dag(self, dag_id, session: Session = None): """ Gets the DAG out of the dictionary, and refreshes it if expired :param dag_id: DAG Id :type dag_id: str """ # Avoid circular import from airflow.models.dag import DagModel if self.read_dags_from_db: # Import here so that s...
def get_dag(self, dag_id, session: Session = None): """ Gets the DAG out of the dictionary, and refreshes it if expired :param dag_id: DAG Id :type dag_id: str """ # Avoid circular import from airflow.models.dag import DagModel if self.read_dags_from_db: # Import here so that s...
https://github.com/apache/airflow/issues/13667
2021-01-14 14:07:44,429} {{scheduler_job.py:1754}} INFO - Resetting orphaned tasks for active dag runs {2021-01-14 14:08:14,470} {{scheduler_job.py:1754}} INFO - Resetting orphaned tasks for active dag runs {2021-01-14 14:08:16,968} {{scheduler_job.py:1293}} ERROR - Exception when executing SchedulerJob._run_scheduler_...
TypeError
def shell(args): """Run a shell that allows to access metadata database""" url = settings.engine.url print("DB: " + repr(url)) if url.get_backend_name() == "mysql": with NamedTemporaryFile(suffix="my.cnf") as f: content = textwrap.dedent( f""" [client...
def shell(args): """Run a shell that allows to access metadata database""" url = settings.engine.url print("DB: " + repr(url)) if url.get_backend_name() == "mysql": with NamedTemporaryFile(suffix="my.cnf") as f: content = textwrap.dedent( f""" [client...
https://github.com/apache/airflow/issues/12806
[2020-12-04 07:31:28,506] {process_utils.py:149} INFO - Executing cmd: sqlite3 /home/airflow/airflow/airflow.db SQLite version 3.31.1 2020-01-27 19:55:54 Enter ".help" for usage hints. sqlite> ; sqlite> .quit Traceback (most recent call last): File "/home/airflow/sandbox/bin/airflow", line 8, in <module> sys.exit(main(...
AttributeError
def _do_scheduling(self, session) -> int: """ This function is where the main scheduling decisions take places. It: - Creates any necessary DAG runs by examining the next_dagrun_create_after column of DagModel Since creating Dag Runs is a relatively time consuming process, we select only 10 dags by ...
def _do_scheduling(self, session) -> int: """ This function is where the main scheduling decisions take places. It: - Creates any necessary DAG runs by examining the next_dagrun_create_after column of DagModel Since creating Dag Runs is a relatively time consuming process, we select only 10 dags by ...
https://github.com/apache/airflow/issues/13504
[2021-01-06 10:09:38,742] {scheduler_job.py:1293} ERROR - Exception when executing SchedulerJob._run_scheduler_loop Traceback (most recent call last): File "/global/packages/python/lib/python3.7/site-packages/airflow/jobs/scheduler_job.py", line 1275, in _execute self._run_scheduler_loop() File "/global/packages/python...
airflow.exceptions.SerializedDagNotFound
def _create_dag_runs(self, dag_models: Iterable[DagModel], session: Session) -> None: """ Unconditionally create a DAG run for the given DAG, and update the dag_model's fields to control if/when the next DAGRun should be created """ for dag_model in dag_models: try: dag = self.da...
def _create_dag_runs(self, dag_models: Iterable[DagModel], session: Session) -> None: """ Unconditionally create a DAG run for the given DAG, and update the dag_model's fields to control if/when the next DAGRun should be created """ for dag_model in dag_models: dag = self.dagbag.get_dag(dag_...
https://github.com/apache/airflow/issues/13504
[2021-01-06 10:09:38,742] {scheduler_job.py:1293} ERROR - Exception when executing SchedulerJob._run_scheduler_loop Traceback (most recent call last): File "/global/packages/python/lib/python3.7/site-packages/airflow/jobs/scheduler_job.py", line 1275, in _execute self._run_scheduler_loop() File "/global/packages/python...
airflow.exceptions.SerializedDagNotFound
def _update_dag_next_dagruns( self, dag_models: Iterable[DagModel], session: Session ) -> None: """ Bulk update the next_dagrun and next_dagrun_create_after for all the dags. We batch the select queries to get info about all the dags at once """ # Check max_active_runs, to see if we are _now_ a...
def _update_dag_next_dagruns( self, dag_models: Iterable[DagModel], session: Session ) -> None: """ Bulk update the next_dagrun and next_dagrun_create_after for all the dags. We batch the select queries to get info about all the dags at once """ # Check max_active_runs, to see if we are _now_ a...
https://github.com/apache/airflow/issues/13504
[2021-01-06 10:09:38,742] {scheduler_job.py:1293} ERROR - Exception when executing SchedulerJob._run_scheduler_loop Traceback (most recent call last): File "/global/packages/python/lib/python3.7/site-packages/airflow/jobs/scheduler_job.py", line 1275, in _execute self._run_scheduler_loop() File "/global/packages/python...
airflow.exceptions.SerializedDagNotFound
def sync_to_db(self, session: Optional[Session] = None): """Save attributes about list of DAG to the DB.""" # To avoid circular import - airflow.models.dagbag -> airflow.models.dag -> airflow.models.dagbag from airflow.models.dag import DAG from airflow.models.serialized_dag import SerializedDagModel ...
def sync_to_db(self, session: Optional[Session] = None): """Save attributes about list of DAG to the DB.""" # To avoid circular import - airflow.models.dagbag -> airflow.models.dag -> airflow.models.dagbag from airflow.models.dag import DAG from airflow.models.serialized_dag import SerializedDagModel ...
https://github.com/apache/airflow/issues/13504
[2021-01-06 10:09:38,742] {scheduler_job.py:1293} ERROR - Exception when executing SchedulerJob._run_scheduler_loop Traceback (most recent call last): File "/global/packages/python/lib/python3.7/site-packages/airflow/jobs/scheduler_job.py", line 1275, in _execute self._run_scheduler_loop() File "/global/packages/python...
airflow.exceptions.SerializedDagNotFound
def _check_file(self, file_path): problems = [] class_name_to_check = self.MACRO_PLUGIN_CLASS.split(".")[-1] with open(file_path, "r") as file_pointer: try: for line_number, line in enumerate(file_pointer, 1): if class_name_to_check in line: problems.a...
def _check_file(self, file_path): problems = [] class_name_to_check = self.MACRO_PLUGIN_CLASS.split(".")[-1] with open(file_path, "r") as file_pointer: for line_number, line in enumerate(file_pointer, 1): if class_name_to_check in line: problems.append(self._change_info(f...
https://github.com/apache/airflow/issues/13349
========================================================================================================================================================== STATUS ========================================================================================================================================================== Ch...
UnicodeDecodeError
def check(self): dag_folder = conf.get("core", "dags_folder") file_paths = list_py_file_paths(directory=dag_folder, include_examples=False) problems = [] for file_path in file_paths: if not file_path.endswith(".py"): continue problems.extend(self._check_file(file_path)) r...
def check(self): dag_folder = conf.get("core", "dags_folder") file_paths = list_py_file_paths(directory=dag_folder, include_examples=False) problems = [] for file_path in file_paths: problems.extend(self._check_file(file_path)) return problems
https://github.com/apache/airflow/issues/13349
========================================================================================================================================================== STATUS ========================================================================================================================================================== Ch...
UnicodeDecodeError
def _add_callback_to_queue(self, request: CallbackRequest): self._callback_to_execute[request.full_filepath].append(request) # Callback has a higher priority over DAG Run scheduling if request.full_filepath in self._file_path_queue: # Remove file paths matching request.full_filepath from self._file_...
def _add_callback_to_queue(self, request: CallbackRequest): self._callback_to_execute[request.full_filepath].append(request) # Callback has a higher priority over DAG Run scheduling if request.full_filepath in self._file_path_queue: self._file_path_queue.remove(request.full_filepath) self._file_...
https://github.com/apache/airflow/issues/13047
[2020-12-13 19:35:33,752] {dagbag.py:440} INFO - Filling up the DagBag from /usr/local/lib/python3.8/site-packages/airflow/example_dags/example_bash_operator.py Running <TaskInstance: example_bash_operator.run_after_loop 2020-12-13T19:35:30.648020+00:00 [queued]> on host 6611da4b1a27 [2020-12-13 19:35:34,517] {dagrun.p...
KeyError
def start_new_processes(self): """Start more processors if we have enough slots and files to process""" while self._parallelism - len(self._processors) > 0 and self._file_path_queue: file_path = self._file_path_queue.pop(0) # Stop creating duplicate processor i.e. processor with the same filepat...
def start_new_processes(self): """Start more processors if we have enough slots and files to process""" while self._parallelism - len(self._processors) > 0 and self._file_path_queue: file_path = self._file_path_queue.pop(0) callback_to_execute_for_file = self._callback_to_execute[file_path] ...
https://github.com/apache/airflow/issues/13047
[2020-12-13 19:35:33,752] {dagbag.py:440} INFO - Filling up the DagBag from /usr/local/lib/python3.8/site-packages/airflow/example_dags/example_bash_operator.py Running <TaskInstance: example_bash_operator.run_after_loop 2020-12-13T19:35:30.648020+00:00 [queued]> on host 6611da4b1a27 [2020-12-13 19:35:34,517] {dagrun.p...
KeyError
def dag_link(attr): """Generates a URL to the Graph View for a Dag.""" dag_id = attr.get("dag_id") execution_date = attr.get("execution_date") url = url_for("Airflow.graph", dag_id=dag_id, execution_date=execution_date) return ( Markup('<a href="{}">{}</a>').format(url, dag_id) if dag_id els...
def dag_link(attr): """Generates a URL to the Graph View for a Dag.""" dag_id = attr.get("dag_id") execution_date = attr.get("execution_date") url = url_for("Airflow.graph", dag_id=dag_id, execution_date=execution_date) return Markup('<a href="{}">{}</a>').format(url, dag_id) # noqa
https://github.com/apache/airflow/issues/13602
Something bad has happened. Please consider letting us know by creating a bug report using GitHub. Python version: 3.6.12 Airflow version: 2.0.0 Node: 9097c882a712 ------------------------------------------------------------------------------- Traceback (most recent call last): File "/home/airflow/.local/lib/python3.6...
airflow.exceptions.SerializedDagNotFound
def __init__( self, *, bucket_name: str, prefix: str, aws_conn_id: str = "aws_default", verify: Optional[Union[bool, str]] = None, inactivity_period: float = 60 * 60, min_objects: int = 1, previous_objects: Optional[Set[str]] = None, allow_delete: bool = True, **kwargs, ) -> ...
def __init__( self, *, bucket_name: str, prefix: str, aws_conn_id: str = "aws_default", verify: Optional[Union[bool, str]] = None, inactivity_period: float = 60 * 60, min_objects: int = 1, previous_objects: Optional[Set[str]] = None, allow_delete: bool = True, **kwargs, ) -> ...
https://github.com/apache/airflow/issues/13481
Traceback (most recent call last): File "/usr/local/lib/airflow/airflow/models/taskinstance.py", line 966, in _run_raw_task self.render_templates(context=context) File "/usr/local/lib/airflow/airflow/models/taskinstance.py", line 1428, in render_templates self.task.render_template_fields(context) File "/usr/local/lib/a...
AttributeError
def is_keys_unchanged(self, current_objects: Set[str]) -> bool: """ Checks whether new objects have been uploaded and the inactivity_period has passed and updates the state of the sensor accordingly. :param current_objects: set of object ids in bucket during last poke. :type current_objects: set[st...
def is_keys_unchanged(self, current_objects: Set[str]) -> bool: """ Checks whether new objects have been uploaded and the inactivity_period has passed and updates the state of the sensor accordingly. :param current_objects: set of object ids in bucket during last poke. :type current_objects: set[st...
https://github.com/apache/airflow/issues/13481
Traceback (most recent call last): File "/usr/local/lib/airflow/airflow/models/taskinstance.py", line 966, in _run_raw_task self.render_templates(context=context) File "/usr/local/lib/airflow/airflow/models/taskinstance.py", line 1428, in render_templates self.task.render_template_fields(context) File "/usr/local/lib/a...
AttributeError
def poke(self, context): return self.is_keys_unchanged( set(self.hook.list_keys(self.bucket_name, prefix=self.prefix)) )
def poke(self, context): return self.is_keys_unchanged( set(self.hook.list_keys(self.bucket, prefix=self.prefix)) )
https://github.com/apache/airflow/issues/13481
Traceback (most recent call last): File "/usr/local/lib/airflow/airflow/models/taskinstance.py", line 966, in _run_raw_task self.render_templates(context=context) File "/usr/local/lib/airflow/airflow/models/taskinstance.py", line 1428, in render_templates self.task.render_template_fields(context) File "/usr/local/lib/a...
AttributeError
def get_user_roles(user=None): """ Get all the roles associated with the user. :param user: the ab_user in FAB model. :return: a list of roles associated with the user. """ if user is None: user = g.user if user.is_anonymous: public_role = current_app.appbuilder.get_app.conf...
def get_user_roles(user=None): """ Get all the roles associated with the user. :param user: the ab_user in FAB model. :return: a list of roles associated with the user. """ if user is None: user = g.user if user.is_anonymous: public_role = current_app.appbuilder.config.get("...
https://github.com/apache/airflow/issues/8815
------------------------------------------------------------------------------- Node: 11af45a15833 ------------------------------------------------------------------------------- Traceback (most recent call last): File "/home/airflow/.local/lib/python3.6/site-packages/flask/app.py", line 2446, in wsgi_app response = se...
AttributeError
def read(self, filenames, encoding=None): super().read(filenames=filenames, encoding=encoding)
def read(self, filenames, encoding=None): super().read(filenames=filenames, encoding=encoding) self._validate()
https://github.com/apache/airflow/issues/13254
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.6/site-packages/airflow/__init__.py", line 34, in <module> from airflow import settings File "/usr/local/lib/python3.6/site-packages/airflow/settings.py", line 35, in <module> from airflow.configuration import AIRFLOW_HO...
NameError
def read_dict(self, dictionary, source="<dict>"): super().read_dict(dictionary=dictionary, source=source)
def read_dict(self, dictionary, source="<dict>"): super().read_dict(dictionary=dictionary, source=source) self._validate()
https://github.com/apache/airflow/issues/13254
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.6/site-packages/airflow/__init__.py", line 34, in <module> from airflow import settings File "/usr/local/lib/python3.6/site-packages/airflow/settings.py", line 35, in <module> from airflow.configuration import AIRFLOW_HO...
NameError
def upgrade(): # noqa: D103 # We previously had a KnownEvent's table, but we deleted the table without # a down migration to remove it (so we didn't delete anyone's data if they # were happing to use the feature. # # But before we can delete the users table we need to drop the FK conn = op.get...
def upgrade(): # noqa: D103 # We previously had a KnownEvent's table, but we deleted the table without # a down migration to remove it (so we didn't delete anyone's data if they # were happing to use the feature. # # But before we can delete the users table we need to drop the FK conn = op.get...
https://github.com/apache/airflow/issues/13222
initdb_1 | DB: mysql://**:***@x.x.x.x:****/mydb initdb_1 | [2020-12-21 15:32:09,044] {db.py:678} INFO - Creating tables initdb_1 | INFO [alembic.runtime.migration] Context impl MySQLImpl. initdb_1 | INFO [alembic.runtime.migration] Will assume non-transactional DDL. initdb_1 | INFO [alembic.runtime.migration] R...
NotImplementedError
def load_entrypoint_plugins(entry_points, airflow_plugins): """ Load AirflowPlugin subclasses from the entrypoints provided. The entry_point group should be 'airflow.plugins'. :param entry_points: A collection of entrypoints to search for plugins :type entry_points: Generator[setuptools.EntryPoint,...
def load_entrypoint_plugins(entry_points, airflow_plugins): """ Load AirflowPlugin subclasses from the entrypoints provided. The entry_point group should be 'airflow.plugins'. :param entry_points: A collection of entrypoints to search for plugins :type entry_points: Generator[setuptools.EntryPoint,...
https://github.com/apache/airflow/issues/12855
[2020-12-06 15:33:25,513] {plugins_manager.py:159} ERROR - Failed to import plugin AirflowPrometheus worker_1 | Traceback (most recent call last): worker_1 | File "/home/airflow/.local/lib/python3.8/site-packages/airflow/plugins_manager.py", line 150, in load_entrypoint_plugins worker_1 | plugin_obj._...
AttributeError
def execute(self, context: Dict): if isinstance(self.execution_date, datetime.datetime): execution_date = self.execution_date elif isinstance(self.execution_date, str): execution_date = timezone.parse(self.execution_date) self.execution_date = execution_date else: execution_d...
def execute(self, context: Dict): if isinstance(self.execution_date, datetime.datetime): execution_date = self.execution_date elif isinstance(self.execution_date, str): execution_date = timezone.parse(self.execution_date) self.execution_date = execution_date else: execution_d...
https://github.com/apache/airflow/issues/12587
Traceback (most recent call last): File "/usr/lib/python3.7/site-packages/airflow/models/taskinstance.py", line 984, in _run_raw_task result = task_copy.execute(context=context) File "/usr/local/airflow/plugins/custom_trigger_operator.py", line 138, in execute dag_run.execution_date, UnboundLocalError: local variable '...
UnboundLocalError
def _convert_to_airflow_pod(pod): """ Converts a k8s V1Pod object into an `airflow.kubernetes.pod.Pod` object. This function is purely for backwards compatibility """ base_container = pod.spec.containers[0] # type: k8s.V1Container env_vars, secrets = _extract_env_vars_and_secrets(base_container...
def _convert_to_airflow_pod(pod): """ Converts a k8s V1Pod object into an `airflow.kubernetes.pod.Pod` object. This function is purely for backwards compatibility """ base_container = pod.spec.containers[0] # type: k8s.V1Container env_vars, secrets = _extract_env_vars_and_secrets(base_container...
https://github.com/apache/airflow/issues/11731
[2020-10-21 20:55:11,879] {scheduler_job.py:1401} ERROR - Exception when executing execute_helper Traceback (most recent call last): File "/usr/lib/python3.7/site-packages/airflow/kubernetes/pod_launcher.py", line 114, in _mutate_pod_backcompat settings.pod_mutation_hook(dummy_pod) File "/usr/local/airflow/config/airfl...
AttributeError
def init_on_load(self): """ Called by the ORM after the instance has been loaded from the DB or otherwise reconstituted i.e automatically deserialize Xcom value when loading from DB. """ try: self.value = self.orm_deserialize_value() except (UnicodeEncodeError, ValueError): # For...
def init_on_load(self): """ Called by the ORM after the instance has been loaded from the DB or otherwise reconstituted i.e automatically deserialize Xcom value when loading from DB. """ try: self.value = XCom.deserialize_value(self) except (UnicodeEncodeError, ValueError): # For...
https://github.com/apache/airflow/issues/12315
Python version: 3.8.6 Airflow version: 2.0.0b2 Node: 950a17127708 ------------------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/usr/local...
ValueError
def serialize_value(value: Any): """Serialize Xcom value to str or pickled object""" if conf.getboolean("core", "enable_xcom_pickling"): return pickle.dumps(value) try: return json.dumps(value).encode("UTF-8") except (ValueError, TypeError): log.error( "Could not seri...
def serialize_value(value: Any): """Serialize Xcom value to str or pickled object""" if conf.getboolean("core", "enable_xcom_pickling"): return pickle.dumps(value) try: return json.dumps(value).encode("UTF-8") except (ValueError, TypeError): log.error( "Could not seri...
https://github.com/apache/airflow/issues/12315
Python version: 3.8.6 Airflow version: 2.0.0b2 Node: 950a17127708 ------------------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/usr/local...
ValueError
def deserialize_value(result: "XCom") -> Any: """Deserialize XCom value from str or pickle object""" enable_pickling = conf.getboolean("core", "enable_xcom_pickling") if enable_pickling: return pickle.loads(result.value) try: return json.loads(result.value.decode("UTF-8")) except JSO...
def deserialize_value(result) -> Any: """Deserialize Xcom value from str or pickle object""" enable_pickling = conf.getboolean("core", "enable_xcom_pickling") if enable_pickling: return pickle.loads(result.value) try: return json.loads(result.value.decode("UTF-8")) except JSONDecodeE...
https://github.com/apache/airflow/issues/12315
Python version: 3.8.6 Airflow version: 2.0.0b2 Node: 950a17127708 ------------------------------------------------------------------------------- Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/usr/local...
ValueError
def __init__( self, *, python_callable: Callable, task_id: str, op_args: Tuple[Any], op_kwargs: Dict[str, Any], multiple_outputs: bool = False, **kwargs, ) -> None: kwargs["task_id"] = self._get_unique_task_id( task_id, kwargs.get("dag"), kwargs.get("task_group") ) su...
def __init__( self, *, python_callable: Callable, task_id: str, op_args: Tuple[Any], op_kwargs: Dict[str, Any], multiple_outputs: bool = False, **kwargs, ) -> None: kwargs["task_id"] = self._get_unique_task_id(task_id, kwargs.get("dag")) super().__init__(**kwargs) self.python...
https://github.com/apache/airflow/issues/12309
Broken DAG: [/files/dags/test.py] Traceback (most recent call last): File "/opt/airflow/airflow/models/baseoperator.py", line 410, in __init__ task_group.add(self) File "/opt/airflow/airflow/utils/task_group.py", line 140, in add raise DuplicateTaskIdFound(f"Task id '{key}' has already been added to the DAG") airflow.e...
airflow.exceptions.DuplicateTaskIdFound
def _get_unique_task_id( task_id: str, dag: Optional[DAG] = None, task_group: Optional[TaskGroup] = None ) -> str: """ Generate unique task id given a DAG (or if run in a DAG context) Ids are generated by appending a unique number to the end of the original task id. Example: task_id ...
def _get_unique_task_id(task_id: str, dag: Optional[DAG] = None) -> str: """ Generate unique task id given a DAG (or if run in a DAG context) Ids are generated by appending a unique number to the end of the original task id. Example: task_id task_id__1 task_id__2 ... t...
https://github.com/apache/airflow/issues/12309
Broken DAG: [/files/dags/test.py] Traceback (most recent call last): File "/opt/airflow/airflow/models/baseoperator.py", line 410, in __init__ task_group.add(self) File "/opt/airflow/airflow/utils/task_group.py", line 140, in add raise DuplicateTaskIdFound(f"Task id '{key}' has already been added to the DAG") airflow.e...
airflow.exceptions.DuplicateTaskIdFound
def task_run(args, dag=None): """Runs a single task instance""" # Load custom airflow config if args.cfg_path: with open(args.cfg_path, "r") as conf_file: conf_dict = json.load(conf_file) if os.path.exists(args.cfg_path): os.remove(args.cfg_path) conf.read_d...
def task_run(args, dag=None): """Runs a single task instance""" # Load custom airflow config if args.cfg_path: with open(args.cfg_path, "r") as conf_file: conf_dict = json.load(conf_file) if os.path.exists(args.cfg_path): os.remove(args.cfg_path) conf.read_d...
https://github.com/apache/airflow/issues/11717
[...] -------------------------------------------------------------------------------- [2020-10-21 13:29:07,958] {taskinstance.py:1020} INFO - Starting attempt 1 of 2 [2020-10-21 13:29:07,959] {taskinstance.py:1021} INFO - -------------------------------------------------------------------------------- [...] [2020-10-2...
ValueError
def _serialize( cls, var: Any ) -> Any: # Unfortunately there is no support for recursive types in mypy """Helper function of depth first search for serialization. The serialization protocol is: (1) keeping JSON supported types: primitives, dict, list; (2) encoding other types as ``{TYPE: 'foo', ...
def _serialize( cls, var: Any ) -> Any: # Unfortunately there is no support for recursive types in mypy """Helper function of depth first search for serialization. The serialization protocol is: (1) keeping JSON supported types: primitives, dict, list; (2) encoding other types as ``{TYPE: 'foo', ...
https://github.com/apache/airflow/issues/11556
$ airflow db check Traceback (most recent call last): File "/.../bin/airflow", line 8, in <module> sys.exit(main()) File "/.../lib/python3.6/site-packages/airflow/__main__.py", line 40, in main args.func(args) File "/.../lib/python3.6/site-packages/airflow/cli/cli_parser.py", line 52, in command func = import_string(im...
ModuleNotFoundError
def _deserialize(cls, encoded_var: Any) -> Any: # pylint: disable=too-many-return-statements """Helper function of depth first search for deserialization.""" # JSON primitives (except for dict) are not encoded. if cls._is_primitive(encoded_var): return encoded_var elif isinstance(encoded_var, l...
def _deserialize(cls, encoded_var: Any) -> Any: # pylint: disable=too-many-return-statements """Helper function of depth first search for deserialization.""" # JSON primitives (except for dict) are not encoded. if cls._is_primitive(encoded_var): return encoded_var elif isinstance(encoded_var, l...
https://github.com/apache/airflow/issues/11556
$ airflow db check Traceback (most recent call last): File "/.../bin/airflow", line 8, in <module> sys.exit(main()) File "/.../lib/python3.6/site-packages/airflow/__main__.py", line 40, in main args.func(args) File "/.../lib/python3.6/site-packages/airflow/cli/cli_parser.py", line 52, in command func = import_string(im...
ModuleNotFoundError
def wait_for_pipeline_state( self, pipeline_name: str, pipeline_id: str, instance_url: str, namespace: str = "default", success_states: Optional[List[str]] = None, failure_states: Optional[List[str]] = None, timeout: int = 5 * 60, ): """ Polls pipeline state and raises an excepti...
def wait_for_pipeline_state( self, pipeline_name: str, pipeline_id: str, instance_url: str, namespace: str = "default", success_states: Optional[List[str]] = None, failure_states: Optional[List[str]] = None, timeout: int = 5 * 60, ): """ Polls pipeline state and raises an excepti...
https://github.com/apache/airflow/issues/10030
[2020-07-28 08:16:46,390] {taskinstance.py:1059} ERROR - Retrieving a pipeline state failed with code 404 Traceback (most recent call last) File "/usr/local/lib/airflow/airflow/models/taskinstance.py", line 930, in _run_raw_tas result = task_copy.execute(context=context File "/usr/local/lib/airflow/airflow/providers/go...
airflow.exceptions.AirflowException
def execute(self, context): emr_hook = EmrHook(aws_conn_id=self.aws_conn_id) emr = emr_hook.get_conn() job_flow_id = self.job_flow_id or emr_hook.get_cluster_id_by_name( self.job_flow_name, self.cluster_states ) if not job_flow_id: raise AirflowException("No cluster found for name:...
def execute(self, context): emr = EmrHook(aws_conn_id=self.aws_conn_id).get_conn() job_flow_id = self.job_flow_id if not job_flow_id: job_flow_id = emr.get_cluster_id_by_name( self.job_flow_name, self.cluster_states ) if self.do_xcom_push: context["ti"].xcom_push(k...
https://github.com/apache/airflow/issues/9127
[2020-06-03 18:05:06,862] {taskinstance.py:1145} ERROR - 'EMR' object has no attribute 'get_cluster_id_by_name' Traceback (most recent call last): File "/home/ubuntu/.pyenv/versions/3.7.7/envs/.venv_python377/lib/python3.7/site-packages/airflow/models/taskinstance.py", line 983, in _run_raw_task result = task_copy.exec...
AttributeError
def trigger(self, session=None): dag_id = request.values.get("dag_id") origin = request.values.get("origin") or "/admin/" if request.method == "GET": return self.render( "airflow/trigger.html", dag_id=dag_id, origin=origin, conf="" ) dag = ( session.query(models.Dag...
def trigger(self, session=None): dag_id = request.values.get("dag_id") origin = request.values.get("origin") or "/admin/" if request.method == "GET": return self.render( "airflow/trigger.html", dag_id=dag_id, origin=origin, conf="" ) dag = ( session.query(models.Dag...
https://github.com/apache/airflow/issues/8247
Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.7/...
AttributeError
def trigger(self, session=None): dag_id = request.values.get("dag_id") origin = request.values.get("origin") or url_for("Airflow.index") if request.method == "GET": return self.render_template( "airflow/trigger.html", dag_id=dag_id, origin=origin, conf="" ) dag = ( ...
def trigger(self, session=None): dag_id = request.values.get("dag_id") origin = request.values.get("origin") or url_for("Airflow.index") if request.method == "GET": return self.render_template( "airflow/trigger.html", dag_id=dag_id, origin=origin, conf="" ) dag = ( ...
https://github.com/apache/airflow/issues/8247
Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.7/...
AttributeError
def classify_ode(eq, func=None, dict=False, ics=None, **kwargs): r""" Returns a tuple of possible :py:meth:`~sympy.solvers.ode.dsolve` classifications for an ODE. The tuple is ordered so that first item is the classification that :py:meth:`~sympy.solvers.ode.dsolve` uses to solve the ODE by default...
def classify_ode(eq, func=None, dict=False, ics=None, **kwargs): r""" Returns a tuple of possible :py:meth:`~sympy.solvers.ode.dsolve` classifications for an ODE. The tuple is ordered so that first item is the classification that :py:meth:`~sympy.solvers.ode.dsolve` uses to solve the ODE by default...
https://github.com/sympy/sympy/issues/5096
dsolve(f(x).diff(x, x) + f(x) - x*sin(x - 2), f(x), hint='nth_linear_constant_coeff_undetermined_coefficients') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "sympy/solvers/ode.py", line 457, in dsolve match=hints[hint]), func, hints['order'], hint) File "sympy/solvers/ode.py", line 2370, ...
NotImplementedError
def ode_nth_linear_euler_eq_nonhomogeneous_undetermined_coefficients( eq, func, order, match, returns="sol" ): r""" Solves an `n`\th order linear non homogeneous Cauchy-Euler equidimensional ordinary differential equation using undetermined coefficients. This is an equation with form `g(x) = a_0 f(...
def ode_nth_linear_euler_eq_nonhomogeneous_undetermined_coefficients( eq, func, order, match, returns="sol" ): r""" Solves an `n`\th order linear non homogeneous Cauchy-Euler equidimensional ordinary differential equation using undetermined coefficients. This is an equation with form `g(x) = a_0 f(...
https://github.com/sympy/sympy/issues/5096
dsolve(f(x).diff(x, x) + f(x) - x*sin(x - 2), f(x), hint='nth_linear_constant_coeff_undetermined_coefficients') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "sympy/solvers/ode.py", line 457, in dsolve match=hints[hint]), func, hints['order'], hint) File "sympy/solvers/ode.py", line 2370, ...
NotImplementedError
def _solve_undetermined_coefficients(eq, func, order, match): r""" Helper function for the method of undetermined coefficients. See the :py:meth:`~sympy.solvers.ode.ode_nth_linear_constant_coeff_undetermined_coefficients` docstring for more information on this method. The parameter ``match`` s...
def _solve_undetermined_coefficients(eq, func, order, match): r""" Helper function for the method of undetermined coefficients. See the :py:meth:`~sympy.solvers.ode.ode_nth_linear_constant_coeff_undetermined_coefficients` docstring for more information on this method. The parameter ``match`` s...
https://github.com/sympy/sympy/issues/5096
dsolve(f(x).diff(x, x) + f(x) - x*sin(x - 2), f(x), hint='nth_linear_constant_coeff_undetermined_coefficients') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "sympy/solvers/ode.py", line 457, in dsolve match=hints[hint]), func, hints['order'], hint) File "sympy/solvers/ode.py", line 2370, ...
NotImplementedError
def _undetermined_coefficients_match(expr, x, func=None, eq_homogeneous=S.Zero): r""" Returns a trial function match if undetermined coefficients can be applied to ``expr``, and ``None`` otherwise. A trial expression can be found for an expression for use with the method of undetermined coefficient...
def _undetermined_coefficients_match(expr, x): r""" Returns a trial function match if undetermined coefficients can be applied to ``expr``, and ``None`` otherwise. A trial expression can be found for an expression for use with the method of undetermined coefficients if the expression is an addi...
https://github.com/sympy/sympy/issues/5096
dsolve(f(x).diff(x, x) + f(x) - x*sin(x - 2), f(x), hint='nth_linear_constant_coeff_undetermined_coefficients') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "sympy/solvers/ode.py", line 457, in dsolve match=hints[hint]), func, hints['order'], hint) File "sympy/solvers/ode.py", line 2370, ...
NotImplementedError
def _minpoly_compose(ex, x, dom): """ Computes the minimal polynomial of an algebraic element using operations on minimal polynomials Examples ======== >>> from sympy import minimal_polynomial, sqrt, Rational >>> from sympy.abc import x, y >>> minimal_polynomial(sqrt(2) + 3*Rational(1,...
def _minpoly_compose(ex, x, dom): """ Computes the minimal polynomial of an algebraic element using operations on minimal polynomials Examples ======== >>> from sympy import minimal_polynomial, sqrt, Rational >>> from sympy.abc import x, y >>> minimal_polynomial(sqrt(2) + 3*Rational(1,...
https://github.com/sympy/sympy/issues/5934
I found this from the expression from issue 5933 : In [50]: [minpoly(i) for i in x.as_numer_denom()] --------------------------------------------------------------------------- PolynomialError Traceback (most recent call last) /Users/aaronmeurer/Documents/python/sympy/sympy/<ipython-input-50-...
PolynomialError
def _eval_evalf(self, prec): # Lookup mpmath function based on name try: if isinstance(self.func, UndefinedFunction): # Shouldn't lookup in mpmath but might have ._imp_ raise AttributeError fname = self.func.__name__ if not hasattr(mpmath, fname): from...
def _eval_evalf(self, prec): # Lookup mpmath function based on name fname = self.func.__name__ try: if not hasattr(mpmath, fname): from sympy.utilities.lambdify import MPMATH_TRANSLATIONS fname = MPMATH_TRANSLATIONS[fname] func = getattr(mpmath, fname) except (At...
https://github.com/sympy/sympy/issues/6938
If I run sympy.S("ceil(2.3)").evalf() with sympy 0.7.1 then I get 3. However, if I run the same using sympy 0.7.2 then I get an AttributeError (see below). I discovered that switching to use ceiling() instead of ceil() works, but I have no idea why ceil() disappeared in the first place. Someone in IRC told me that t...
AttributeError
def factorial_notation(tokens, local_dict, global_dict): """Allows standard notation for factorial.""" result = [] nfactorial = 0 for toknum, tokval in tokens: if toknum == ERRORTOKEN: op = tokval if op == "!": nfactorial += 1 else: ...
def factorial_notation(tokens, local_dict, global_dict): """Allows standard notation for factorial.""" result = [] prevtoken = "" for toknum, tokval in tokens: if toknum == OP: op = tokval if op == "!!": if prevtoken == "!" or prevtoken == "!!": ...
https://github.com/sympy/sympy/issues/4862
In [37]: S("α") -------------------------------------------------------------------------- - SympifyError Traceback (most recent call last) /Users/aaronmeurer/Documents/Python/sympy/sympy/<ipython console> in <module>() /Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/sympify.py...
SympifyError
def auto_number(tokens, local_dict, global_dict): """ Converts numeric literals to use SymPy equivalents. Complex numbers use ``I``, integer literals use ``Integer``, and float literals use ``Float``. """ result = [] for toknum, tokval in tokens: if toknum == NUMBER: n...
def auto_number(tokens, local_dict, global_dict): """Converts numeric literals to use SymPy equivalents. Complex numbers use ``I``; integer literals use ``Integer``, float literals use ``Float``, and repeating decimals use ``Rational``. """ result = [] prevtoken = "" for toknum, tokval in...
https://github.com/sympy/sympy/issues/4862
In [37]: S("α") -------------------------------------------------------------------------- - SympifyError Traceback (most recent call last) /Users/aaronmeurer/Documents/Python/sympy/sympy/<ipython console> in <module>() /Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/sympify.py...
SympifyError
def poly(expr, *gens, **args): """ Efficiently transform an expression into a polynomial. Examples ======== >>> from sympy import poly >>> from sympy.abc import x >>> poly(x*(x**2 + x - 1)**2) Poly(x**5 + 2*x**4 - x**3 - 2*x**2 + x, x, domain='ZZ') """ options.allowed_flags(a...
def poly(expr, *gens, **args): """ Efficiently transform an expression into a polynomial. Examples ======== >>> from sympy import poly >>> from sympy.abc import x >>> poly(x*(x**2 + x - 1)**2) Poly(x**5 + 2*x**4 - x**3 - 2*x**2 + x, x, domain='ZZ') """ options.allowed_flags(a...
https://github.com/sympy/sympy/issues/12400
Traceback (most recent call last): File "Temp.py", line 2, in <module> print(sympy.polys.polytools.poly(1 / (1 + sympy.sqrt(2)), sympy.Dummy('x'))) File "sympy\polys\polytools.py", line 6855, in poly return _poly(expr, opt) File "sympy\polys\polytools.py", line 6805, in _poly _poly(factor.base, opt).pow(factor.exp)) Fi...
ValueError
def _poly(expr, opt): terms, poly_terms = [], [] for term in Add.make_args(expr): factors, poly_factors = [], [] for factor in Mul.make_args(term): if factor.is_Add: poly_factors.append(_poly(factor, opt)) elif ( factor.is_Pow ...
def _poly(expr, opt): terms, poly_terms = [], [] for term in Add.make_args(expr): factors, poly_factors = [], [] for factor in Mul.make_args(term): if factor.is_Add: poly_factors.append(_poly(factor, opt)) elif factor.is_Pow and factor.base.is_Add and fa...
https://github.com/sympy/sympy/issues/12400
Traceback (most recent call last): File "Temp.py", line 2, in <module> print(sympy.polys.polytools.poly(1 / (1 + sympy.sqrt(2)), sympy.Dummy('x'))) File "sympy\polys\polytools.py", line 6855, in poly return _poly(expr, opt) File "sympy\polys\polytools.py", line 6805, in _poly _poly(factor.base, opt).pow(factor.exp)) Fi...
ValueError
def __pow__(self, other, mod=None): if mod is None: return self._pow(other) try: _self, other, mod = as_int(self), as_int(other), as_int(mod) if other >= 0: return pow(_self, other, mod) else: from sympy.core.numbers import mod_inverse return ...
def __pow__(self, other): return Pow(self, other)
https://github.com/sympy/sympy/issues/5715
According to http://docs.python.org/release/2.5.2/ref/numeric-types.html , __pow__ should define a third, optional argument to work with ternary pow(). We should do that for at least Integer, though it would be cool to do it for arbitrary expressions (this will require Mod from issue 5589 , and also some care to make ...
TypeError
def make_args(cls, expr): """ Return a sequence of elements `args` such that cls(*args) == expr >>> from sympy import Symbol, Mul, Add >>> x, y = map(Symbol, 'xy') >>> Mul.make_args(x*y) (x, y) >>> Add.make_args(x*y) (x*y,) >>> set(Add.make_args(x*y + y)) == set([y, x*y]) True ...
def make_args(cls, expr): """ Return a sequence of elements `args` such that cls(*args) == expr >>> from sympy import Symbol, Mul, Add >>> x, y = map(Symbol, 'xy') >>> Mul.make_args(x*y) (x, y) >>> Add.make_args(x*y) (x*y,) >>> set(Add.make_args(x*y + y)) == set([y, x*y]) True ...
https://github.com/sympy/sympy/issues/7067
Following function call generate an error in Python3 but work well in Python2. factor_list(x*(x+y)) Traceback (most recent call last): File "<console>", line 1, in <module> File "/home/thilinarmtb/GSoC/sympy/sympy/polys/polytools.py", line 5675, in factor_list return _generic_factor_list(f, gens, args, method='factor...
TypeError
def make_args(cls, expr): """ Return a set of args such that cls(*arg_set) == expr. """ if isinstance(expr, cls): return expr._argset else: return frozenset([sympify(expr)])
def make_args(cls, expr): """ Return a sequence of elements `args` such that cls(*args) == expr >>> from sympy import Symbol, Mul, Add >>> x, y = map(Symbol, 'xy') >>> Mul.make_args(x*y) (x, y) >>> Add.make_args(x*y) (x*y,) >>> set(Add.make_args(x*y + y)) == set([y, x*y]) True ...
https://github.com/sympy/sympy/issues/7067
Following function call generate an error in Python3 but work well in Python2. factor_list(x*(x+y)) Traceback (most recent call last): File "<console>", line 1, in <module> File "/home/thilinarmtb/GSoC/sympy/sympy/polys/polytools.py", line 5675, in factor_list return _generic_factor_list(f, gens, args, method='factor...
TypeError
def _sorted_factors(factors, method): """Sort a list of ``(expr, exp)`` pairs.""" if method == "sqf": def key(obj): poly, exp = obj rep = poly.rep.rep return (exp, len(rep), len(poly.gens), rep) else: def key(obj): poly, exp = obj ...
def _sorted_factors(factors, method): """Sort a list of ``(expr, exp)`` pairs.""" if method == "sqf": def key(obj): poly, exp = obj rep = poly.rep.rep return (exp, len(rep), rep) else: def key(obj): poly, exp = obj rep = poly.rep....
https://github.com/sympy/sympy/issues/7067
Following function call generate an error in Python3 but work well in Python2. factor_list(x*(x+y)) Traceback (most recent call last): File "<console>", line 1, in <module> File "/home/thilinarmtb/GSoC/sympy/sympy/polys/polytools.py", line 5675, in factor_list return _generic_factor_list(f, gens, args, method='factor...
TypeError
def key(obj): poly, exp = obj rep = poly.rep.rep return (len(rep), len(poly.gens), exp, rep)
def key(obj): poly, exp = obj rep = poly.rep.rep return (len(rep), exp, rep)
https://github.com/sympy/sympy/issues/7067
Following function call generate an error in Python3 but work well in Python2. factor_list(x*(x+y)) Traceback (most recent call last): File "<console>", line 1, in <module> File "/home/thilinarmtb/GSoC/sympy/sympy/polys/polytools.py", line 5675, in factor_list return _generic_factor_list(f, gens, args, method='factor...
TypeError
def _eval_imageset(self, f): expr = f.expr if not isinstance(expr, Expr): return if len(f.variables) > 1: return n = f.variables[0] # f(x) + c and f(-x) + c cover the same integers # so choose the form that has the fewest negatives c = f(0) fx = f(n) - c f_x = f(-n...
def _eval_imageset(self, f): expr = f.expr if len(f.variables) > 1: return n = f.variables[0] a = Wild("a") b = Wild("b") match = expr.match(a * n + b) if match[a].is_negative: expr = -expr match = expr.match(a * n + b) if match[a] is S.One and match[b].is_integer:...
https://github.com/sympy/sympy/issues/7067
Following function call generate an error in Python3 but work well in Python2. factor_list(x*(x+y)) Traceback (most recent call last): File "<console>", line 1, in <module> File "/home/thilinarmtb/GSoC/sympy/sympy/polys/polytools.py", line 5675, in factor_list return _generic_factor_list(f, gens, args, method='factor...
TypeError
def _contains(self, other): from sympy.matrices import Matrix from sympy.solvers.solveset import solveset, linsolve from sympy.utilities.iterables import is_sequence, iterable, cartes L = self.lamda if is_sequence(other): if not is_sequence(L.expr): return S.false if len...
def _contains(self, other): from sympy.matrices import Matrix from sympy.solvers.solveset import solveset, linsolve from sympy.utilities.iterables import iterable, cartes L = self.lamda if self._is_multivariate(): if not iterable(L.expr): if iterable(other): retu...
https://github.com/sympy/sympy/issues/7067
Following function call generate an error in Python3 but work well in Python2. factor_list(x*(x+y)) Traceback (most recent call last): File "<console>", line 1, in <module> File "/home/thilinarmtb/GSoC/sympy/sympy/polys/polytools.py", line 5675, in factor_list return _generic_factor_list(f, gens, args, method='factor...
TypeError
def _intersect(self, other): from sympy.solvers.diophantine import diophantine if self.base_set is S.Integers: g = None if isinstance(other, ImageSet) and other.base_set is S.Integers: g = other.lamda.expr m = other.lamda.variables[0] elif other is S.Integers: ...
def _intersect(self, other): from sympy.solvers.diophantine import diophantine if self.base_set is S.Integers: if isinstance(other, ImageSet) and other.base_set is S.Integers: f, g = self.lamda.expr, other.lamda.expr n, m = self.lamda.variables[0], other.lamda.variables[0] ...
https://github.com/sympy/sympy/issues/7067
Following function call generate an error in Python3 but work well in Python2. factor_list(x*(x+y)) Traceback (most recent call last): File "<console>", line 1, in <module> File "/home/thilinarmtb/GSoC/sympy/sympy/polys/polytools.py", line 5675, in factor_list return _generic_factor_list(f, gens, args, method='factor...
TypeError
def _intersect(self, other): from sympy.functions.elementary.integers import ceiling, floor from sympy.functions.elementary.complexes import sign if other is S.Naturals: return self._intersect(Interval(1, S.Infinity)) if other is S.Integers: return self if other.is_Interval: ...
def _intersect(self, other): from sympy.functions.elementary.integers import ceiling, floor from sympy.functions.elementary.complexes import sign if other is S.Naturals: return self._intersect(Interval(1, S.Infinity)) if other is S.Integers: return self if other.is_Interval: ...
https://github.com/sympy/sympy/issues/7067
Following function call generate an error in Python3 but work well in Python2. factor_list(x*(x+y)) Traceback (most recent call last): File "<console>", line 1, in <module> File "/home/thilinarmtb/GSoC/sympy/sympy/polys/polytools.py", line 5675, in factor_list return _generic_factor_list(f, gens, args, method='factor...
TypeError
def imageset(*args): r""" Return an image of the set under transformation ``f``. If this function can't compute the image, it returns an unevaluated ImageSet object. .. math:: { f(x) | x \in self } Examples ======== >>> from sympy import S, Interval, Symbol, imageset, sin, La...
def imageset(*args): r""" Return an image of the set under transformation ``f``. If this function can't compute the image, it returns an unevaluated ImageSet object. .. math:: { f(x) | x \in self } Examples ======== >>> from sympy import Interval, Symbol, imageset, sin, Lambd...
https://github.com/sympy/sympy/issues/7067
Following function call generate an error in Python3 but work well in Python2. factor_list(x*(x+y)) Traceback (most recent call last): File "<console>", line 1, in <module> File "/home/thilinarmtb/GSoC/sympy/sympy/polys/polytools.py", line 5675, in factor_list return _generic_factor_list(f, gens, args, method='factor...
TypeError
def diophantine(eq, param=symbols("t", integer=True)): """ Simplify the solution procedure of diophantine equation ``eq`` by converting it into a product of terms which should equal zero. For example, when solving, `x^2 - y^2 = 0` this is treated as `(x + y)(x - y) = 0` and `x+y = 0` and `x-y = 0` ...
def diophantine(eq, param=symbols("t", integer=True)): """ Simplify the solution procedure of diophantine equation ``eq`` by converting it into a product of terms which should equal zero. For example, when solving, `x^2 - y^2 = 0` this is treated as `(x + y)(x - y) = 0` and `x+y = 0` and `x-y = 0` ...
https://github.com/sympy/sympy/issues/7067
Following function call generate an error in Python3 but work well in Python2. factor_list(x*(x+y)) Traceback (most recent call last): File "<console>", line 1, in <module> File "/home/thilinarmtb/GSoC/sympy/sympy/polys/polytools.py", line 5675, in factor_list return _generic_factor_list(f, gens, args, method='factor...
TypeError
def doit(self, **hints): if self.args[0].is_zero is False: return self.args[0] / Abs(self.args[0]) return self
def doit(self): if self.args[0].is_zero is False: return self.args[0] / Abs(self.args[0]) return self
https://github.com/sympy/sympy/issues/7163
In [63]: integrate((sign(x - 1) - sign(x - 2))*cos(x), x) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-63-4e67770ec27d> in <module>() ----> 1 integrate((sign(x - 1) - sign(x - 2))*cos(x), x) /home/...
TypeError
def __new__(cls, *args): """ Construct a new instance of Diagram. If no arguments are supplied, an empty diagram is created. If at least an argument is supplied, ``args[0]`` is interpreted as the premises of the diagram. If ``args[0]`` is a list, it is interpreted as a list of :class:`Morphis...
def __new__(cls, *args): """ Construct a new instance of Diagram. If no arguments are supplied, an empty diagram is created. If at least an argument is supplied, ``args[0]`` is interpreted as the premises of the diagram. If ``args[0]`` is a list, it is interpreted as a list of :class:`Morphis...
https://github.com/sympy/sympy/issues/8197
In [5]: b in FiniteSet(-a) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-5-66c50e010c80> in <module>() ----> 1 b in FiniteSet(-a) /home/hargup/210fs/sympy/sympy/sets/sets.py in __contains__(self, ot...
TypeError
def subdiagram_from_objects(self, objects): """ If ``objects`` is a subset of the objects of ``self``, returns a diagram which has as premises all those premises of ``self`` which have a domains and codomains in ``objects``, likewise for conclusions. Properties are preserved. Examples ====...
def subdiagram_from_objects(self, objects): """ If ``objects`` is a subset of the objects of ``self``, returns a diagram which has as premises all those premises of ``self`` which have a domains and codomains in ``objects``, likewise for conclusions. Properties are preserved. Examples ====...
https://github.com/sympy/sympy/issues/8197
In [5]: b in FiniteSet(-a) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-5-66c50e010c80> in <module>() ----> 1 b in FiniteSet(-a) /home/hargup/210fs/sympy/sympy/sets/sets.py in __contains__(self, ot...
TypeError
def _complement(self, other): # this behaves as other - self if isinstance(other, ProductSet): # For each set consider it or it's complement # We need at least one of the sets to be complemented # Consider all 2^n combinations. # We can conveniently represent these options easily...
def _complement(self, other): # this behaves as other - self if isinstance(other, ProductSet): # For each set consider it or it's complement # We need at least one of the sets to be complemented # Consider all 2^n combinations. # We can conveniently represent these options easily...
https://github.com/sympy/sympy/issues/8197
In [5]: b in FiniteSet(-a) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-5-66c50e010c80> in <module>() ----> 1 b in FiniteSet(-a) /home/hargup/210fs/sympy/sympy/sets/sets.py in __contains__(self, ot...
TypeError
def _eval_Eq(self, other): if not other.is_FiniteSet: if ( other.is_Union or other.is_Complement or other.is_Intersection or other.is_ProductSet ): return return false if len(self) != len(other): return false retu...
def _eval_Eq(self, other): if not other.is_FiniteSet: if ( other.is_Union or other.is_Complement or other.is_Intersection or other.is_ProductSet ): return return false return And(*map(lambda x, y: Eq(x, y), self.args, other.ar...
https://github.com/sympy/sympy/issues/8197
In [5]: b in FiniteSet(-a) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-5-66c50e010c80> in <module>() ----> 1 b in FiniteSet(-a) /home/hargup/210fs/sympy/sympy/sets/sets.py in __contains__(self, ot...
TypeError
def _contains(self, other): """ Tests whether an element, other, is in the set. Relies on Python's set class. This tests for object equality All inputs are sympified Examples ======== >>> from sympy import FiniteSet >>> 1 in FiniteSet(1, 2) True >>> 5 in FiniteSet(1, 2) Fa...
def _contains(self, other): """ Tests whether an element, other, is in the set. Relies on Python's set class. This tests for object equality All inputs are sympified Examples ======== >>> from sympy import FiniteSet >>> 1 in FiniteSet(1, 2) True >>> 5 in FiniteSet(1, 2) Fa...
https://github.com/sympy/sympy/issues/8197
In [5]: b in FiniteSet(-a) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-5-66c50e010c80> in <module>() ----> 1 b in FiniteSet(-a) /home/hargup/210fs/sympy/sympy/sets/sets.py in __contains__(self, ot...
TypeError
def __contains__(self, other): # Split event into each subdomain for domain in self.domains: # Collect the parts of this event which associate to this domain elem = frozenset( [item for item in other if domain.symbols.contains(item[0]) == S.true] ) # Test this sub-eve...
def __contains__(self, other): # Split event into each subdomain for domain in self.domains: # Collect the parts of this event which associate to this domain elem = frozenset([item for item in other if item[0] in domain.symbols]) # Test this sub-event if elem not in domain: ...
https://github.com/sympy/sympy/issues/8197
In [5]: b in FiniteSet(-a) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-5-66c50e010c80> in <module>() ----> 1 b in FiniteSet(-a) /home/hargup/210fs/sympy/sympy/sets/sets.py in __contains__(self, ot...
TypeError
def __init__(self, settings={}): CodePrinter.__init__(self, settings) self.known_functions = dict(known_functions) userfuncs = settings.get("user_functions", {}) self.known_functions.update(userfuncs)
def __init__(self, settings={}): CodePrinter.__init__(self, settings) self.known_functions = dict(known_functions) userfuncs = settings.get("user_functions", {}) for k, v in userfuncs.items(): if not isinstance(v, list): userfuncs[k] = [(lambda *x: True, v)] self.known_functions....
https://github.com/sympy/sympy/issues/6814
ufuncify(x, x*log(10)) produces the following exception --------------------------------------------------------------------------- CodeWrapError Traceback (most recent call last) <ipython-input-12-f6cc06919001> in <module>() ----> 1 ufuncify(x, x*log(10)) /home/thomas/gitrepos/sympy/symp...
CodeWrapError
def ccode(expr, assign_to=None, **settings): """Converts an expr to a string of c code Parameters ========== expr : Expr A sympy expression to be converted. assign_to : optional When given, the argument is used as the name of the variable to which the expression is assigned...
def ccode(expr, assign_to=None, **settings): r"""Converts an expr to a string of c code Parameters ========== expr : sympy.core.Expr a sympy expression to be converted assign_to : optional When given, the argument is used as the name of the variable to which the Fortran exp...
https://github.com/sympy/sympy/issues/6814
ufuncify(x, x*log(10)) produces the following exception --------------------------------------------------------------------------- CodeWrapError Traceback (most recent call last) <ipython-input-12-f6cc06919001> in <module>() ----> 1 ufuncify(x, x*log(10)) /home/thomas/gitrepos/sympy/symp...
CodeWrapError
def __init__(self, settings={}): CodePrinter.__init__(self, settings) self.known_functions = dict(known_functions) userfuncs = settings.get("user_functions", {}) self.known_functions.update(userfuncs) # leading columns depend on fixed or free format if self._settings["source_format"] == "fixed":...
def __init__(self, settings=None): CodePrinter.__init__(self, settings) # leading columns depend on fixed or free format if self._settings["source_format"] == "fixed": self._lead_code = " " self._lead_cont = " @ " self._lead_comment = "C " elif self._settings["source...
https://github.com/sympy/sympy/issues/6814
ufuncify(x, x*log(10)) produces the following exception --------------------------------------------------------------------------- CodeWrapError Traceback (most recent call last) <ipython-input-12-f6cc06919001> in <module>() ----> 1 ufuncify(x, x*log(10)) /home/thomas/gitrepos/sympy/symp...
CodeWrapError
def _print_Function(self, expr): # All constant function args are evaluated as floats prec = self._settings["precision"] args = [N(a, prec) for a in expr.args] eval_expr = expr.func(*args) if not isinstance(eval_expr, C.Function): return self._print(eval_expr) else: return CodePr...
def _print_Function(self, expr): name = self._settings["user_functions"].get(expr.__class__) eargs = expr.args if name is None: from sympy.functions import conjugate if expr.func == conjugate: name = "conjg" else: name = expr.func.__name__ if hasattr(...
https://github.com/sympy/sympy/issues/6814
ufuncify(x, x*log(10)) produces the following exception --------------------------------------------------------------------------- CodeWrapError Traceback (most recent call last) <ipython-input-12-f6cc06919001> in <module>() ----> 1 ufuncify(x, x*log(10)) /home/thomas/gitrepos/sympy/symp...
CodeWrapError
def fcode(expr, assign_to=None, **settings): """Converts an expr to a string of c code Parameters ========== expr : Expr A sympy expression to be converted. assign_to : optional When given, the argument is used as the name of the variable to which the expression is assigned...
def fcode(expr, assign_to=None, **settings): """Converts an expr to a string of Fortran 77 code Parameters ========== expr : sympy.core.Expr a sympy expression to be converted assign_to : optional When given, the argument is used as the name of the variable to which the For...
https://github.com/sympy/sympy/issues/6814
ufuncify(x, x*log(10)) produces the following exception --------------------------------------------------------------------------- CodeWrapError Traceback (most recent call last) <ipython-input-12-f6cc06919001> in <module>() ----> 1 ufuncify(x, x*log(10)) /home/thomas/gitrepos/sympy/symp...
CodeWrapError
def __init__(self, settings={}): CodePrinter.__init__(self, settings) self.known_functions = dict(known_functions) userfuncs = settings.get("user_functions", {}) self.known_functions.update(userfuncs)
def __init__(self, settings={}): CodePrinter.__init__(self, settings) self.known_functions = dict(known_functions) userfuncs = settings.get("user_functions", {}) for k, v in userfuncs.items(): if not isinstance(v, tuple): userfuncs[k] = (lambda *x: True, v) self.known_functions.u...
https://github.com/sympy/sympy/issues/6814
ufuncify(x, x*log(10)) produces the following exception --------------------------------------------------------------------------- CodeWrapError Traceback (most recent call last) <ipython-input-12-f6cc06919001> in <module>() ----> 1 ufuncify(x, x*log(10)) /home/thomas/gitrepos/sympy/symp...
CodeWrapError
def _print_Indexed(self, expr): # calculate index for 1d array dims = expr.shape elem = S.Zero offset = S.One for i in reversed(range(expr.rank)): elem += expr.indices[i] * offset offset *= dims[i] return "%s[%s]" % (self._print(expr.base.label), self._print(elem))
def _print_Indexed(self, expr): # calculate index for 1d array dims = expr.shape inds = [i.label for i in expr.indices] elem = S.Zero offset = S.One for i in reversed(range(expr.rank)): elem += offset * inds[i] offset *= dims[i] return "%s[%s]" % (self._print(expr.base.label)...
https://github.com/sympy/sympy/issues/6814
ufuncify(x, x*log(10)) produces the following exception --------------------------------------------------------------------------- CodeWrapError Traceback (most recent call last) <ipython-input-12-f6cc06919001> in <module>() ----> 1 ufuncify(x, x*log(10)) /home/thomas/gitrepos/sympy/symp...
CodeWrapError
def jscode(expr, assign_to=None, **settings): """Converts an expr to a string of javascript code Parameters ========== expr : Expr A sympy expression to be converted. assign_to : optional When given, the argument is used as the name of the variable to which the expression i...
def jscode(expr, assign_to=None, **settings): """Converts an expr to a string of javascript code Parameters ========== expr : sympy.core.Expr a sympy expression to be converted assign_to : optional When given, the argument is used as the name of the variable to which the Fo...
https://github.com/sympy/sympy/issues/6814
ufuncify(x, x*log(10)) produces the following exception --------------------------------------------------------------------------- CodeWrapError Traceback (most recent call last) <ipython-input-12-f6cc06919001> in <module>() ----> 1 ufuncify(x, x*log(10)) /home/thomas/gitrepos/sympy/symp...
CodeWrapError
def load_ipython_extension(ip): """Load the extension in IPython.""" init_printing(ip=ip)
def load_ipython_extension(ip): """Load the extension in IPython.""" import IPython global _loaded # Use extension manager to track loaded status if available # This is currently in IPython 0.14.dev if hasattr(ip.extension_manager, "loaded"): loaded = "sympy.interactive.ipythonprinting"...
https://github.com/sympy/sympy/issues/3619
Traceback (most recent call last): File "./setup.py", line 34, in ? import sympy File "/tmp/sympy/sympy/**init**.py", line 29, in ? from printing import pretty, pretty_print, pprint, pprint_use_unicode, \ File "/tmp/sympy/sympy/printing/**init**.py", line 8, in ? from preview import preview, view, pngview, pdfview, dvi...
ImportError
def forward(self, x1, x2, diag=False, **params): batch_shape = x1.shape[:-2] n_batch_dims = len(batch_shape) n1, d = x1.shape[-2:] n2 = x2.shape[-2] K = torch.zeros( *batch_shape, n1 * (d + 1), n2 * (d + 1), device=x1.device, dtype=x1.dtype ) if not diag: # Scale the inputs...
def forward(self, x1, x2, diag=False, **params): batch_shape = x1.shape[:-2] n_batch_dims = len(batch_shape) n1, d = x1.shape[-2:] n2 = x2.shape[-2] K = torch.zeros( *batch_shape, n1 * (d + 1), n2 * (d + 1), device=x1.device, dtype=x1.dtype ) if not diag: # Scale the inputs...
https://github.com/cornellius-gp/gpytorch/issues/1389
--------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) <ipython-input-17-ecb6525006fe> in <module> 1 z = k(train_x, train_x, diag=True) ----> 2 z[0].backward() 3 print(k.raw_lengthscale.grad) /mnt/xarfuse/uid-66331/be3771a...
RuntimeError
def __init__( self, lower_bound, upper_bound, transform=sigmoid, inv_transform=inv_sigmoid, initial_value=None, ): """ Defines an interval constraint for GP model parameters, specified by a lower bound and upper bound. For usage details, see the documentation for :meth:`~gpytorch.mod...
def __init__( self, lower_bound, upper_bound, transform=sigmoid, inv_transform=inv_sigmoid, initial_value=None, ): """ Defines an interval constraint for GP model parameters, specified by a lower bound and upper bound. For usage details, see the documentation for :meth:`~gpytorch.mod...
https://github.com/cornellius-gp/gpytorch/issues/1305
--------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) <ipython-input-1-068518c8dae8> in <module> 33 mll = ExactMarginalLogLikelihood(likelihood, model) 34 ---> 35 loss = mll(model(X), y) ~/github/gpytorch/gpytorch/module....
RuntimeError
def _preconditioner(self): r""" Here we use a partial pivoted Cholesky preconditioner: K \approx L L^T + D where L L^T is a low rank approximation, and D is a diagonal. We can compute the preconditioner's inverse using Woodbury (L L^T + D)^{-1} = D^{-1} - D^{-1} L (I + L D^{-1} L^T)^{-1} L^T ...
def _preconditioner(self): if self.preconditioner_override is not None: return self.preconditioner_override(self) if ( settings.max_preconditioner_size.value() == 0 or self.size(-1) < settings.min_preconditioning_size.value() ): return None, None, None if self._q_cache ...
https://github.com/cornellius-gp/gpytorch/issues/1298
RuntimeError Traceback (most recent call last) <ipython-input-4-9e151e2de37a> in <module> 24 with gpytorch.settings.max_cholesky_size(100), gpytorch.settings.min_preconditioning_size(100): 25 train_dist = gp(train_x) ---> 26 loss = -mll(train_dist, train_y).sum() ~/Code/gpytorch/gp...
RuntimeError
def precondition_closure(tensor): # This makes it fast to compute solves with it qqt = self._q_cache.matmul(self._q_cache.transpose(-2, -1).matmul(tensor)) if self._constant_diag: return (1 / self._noise) * (tensor - qqt) return (tensor / self._noise) - qqt
def precondition_closure(tensor): qqt = self._q_cache.matmul(self._q_cache.transpose(-2, -1).matmul(tensor)) if self._constant_diag: return (1 / self._noise) * (tensor - qqt) return (tensor / self._noise) - qqt
https://github.com/cornellius-gp/gpytorch/issues/1298
RuntimeError Traceback (most recent call last) <ipython-input-4-9e151e2de37a> in <module> 24 with gpytorch.settings.max_cholesky_size(100), gpytorch.settings.min_preconditioning_size(100): 25 train_dist = gp(train_x) ---> 26 loss = -mll(train_dist, train_y).sum() ~/Code/gpytorch/gp...
RuntimeError
def _init_cache(self): *batch_shape, n, k = self._piv_chol_self.shape self._noise = self._diag_tensor.diag().unsqueeze(-1) # the check for constant diag needs to be done carefully for batches. noise_first_element = self._noise[..., :1, :] self._constant_diag = torch.equal( self._noise, nois...
def _init_cache(self): *batch_shape, n, k = self._piv_chol_self.shape self._noise = self._diag_tensor.diag().unsqueeze(-1) # the check for constant diag needs to be done carefully for batches. noise_first_element = self._noise[..., :1, :] self._constant_diag = torch.equal( self._noise, nois...
https://github.com/cornellius-gp/gpytorch/issues/1298
RuntimeError Traceback (most recent call last) <ipython-input-4-9e151e2de37a> in <module> 24 with gpytorch.settings.max_cholesky_size(100), gpytorch.settings.min_preconditioning_size(100): 25 train_dist = gp(train_x) ---> 26 loss = -mll(train_dist, train_y).sum() ~/Code/gpytorch/gp...
RuntimeError
def _init_cache_for_non_constant_diag(self, eye, batch_shape, n): # With non-constant diagonals, we cant factor out the noise as easily self._q_cache, self._r_cache = torch.qr( torch.cat((self._piv_chol_self / self._noise.sqrt(), eye), dim=-2) ) self._q_cache = self._q_cache[..., :n, :] / self._...
def _init_cache_for_non_constant_diag(self, eye, batch_shape, n): # With non-constant diagonals, we cant factor out the noise as easily self._q_cache, self._r_cache = torch.qr( torch.cat((self._piv_chol_self / self._noise.sqrt(), eye)) ) self._q_cache = self._q_cache[..., :n, :] / self._noise.sq...
https://github.com/cornellius-gp/gpytorch/issues/1298
RuntimeError Traceback (most recent call last) <ipython-input-4-9e151e2de37a> in <module> 24 with gpytorch.settings.max_cholesky_size(100), gpytorch.settings.min_preconditioning_size(100): 25 train_dist = gp(train_x) ---> 26 loss = -mll(train_dist, train_y).sum() ~/Code/gpytorch/gp...
RuntimeError
def __init__(self, a, b, sigma=0.01, validate_args=False, transform=None): TModule.__init__(self) _a = torch.tensor(float(a)) if isinstance(a, Number) else a _a = _a.view(-1) if _a.dim() < 1 else _a _a, _b, _sigma = broadcast_all(_a, b, sigma) if not torch.all(constraints.less_than(_b).check(_a)): ...
def __init__(self, a, b, sigma=0.01, validate_args=False, transform=None): TModule.__init__(self) _a = torch.tensor(float(a)) if isinstance(a, Number) else a _a = _a.view(-1) if _a.dim() < 1 else _a _a, _b, _sigma = broadcast_all(_a, b, sigma) if not torch.all(constraints.less_than(_b).check(_a)): ...
https://github.com/cornellius-gp/gpytorch/issues/1164
--------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) <ipython-input-5-6b4b2e881beb> in <module> 2 import gpytorch 3 pr = gpytorch.priors.SmoothedBoxPrior(torch.zeros(2), torch.ones(2)) ----> 4 pr.load_state_dict(pr.state_...
RuntimeError
def _expand_batch(self, batch_shape): batch_dim = self.cat_dim + 2 if batch_dim < 0: if batch_shape[batch_dim] != self.batch_shape[batch_dim]: raise RuntimeError( f"Trying to expand a CatLazyTensor in dimension {self.cat_dim}, but this is the concatenated " f"...
def _expand_batch(self, batch_shape): lazy_tensors = [ lazy_tensor._expand_batch(batch_shape) for lazy_tensor in self.lazy_tensors ] res = self.__class__( *lazy_tensors, dim=self.cat_dim, output_device=self.output_device ) return res
https://github.com/cornellius-gp/gpytorch/issues/1133
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-16-0d626e17adaf> in <module> ----> 1 cmtlt + torch.randn(100, 100) ~/Documents/GitHub/gpytorch/gpytorch/lazy/lazy_tensor.py in __add__(self, other) 1625...
TypeError
def _expand_batch(self, batch_shape): return self.__class__( self.base_lazy_tensor._expand_batch(batch_shape), self._constant.expand(*batch_shape) if len(batch_shape) else self._constant, )
def _expand_batch(self, batch_shape): return self.__class__( self.base_lazy_tensor._expand_batch(batch_shape), self._constant.expand(*batch_shape), )
https://github.com/cornellius-gp/gpytorch/issues/1133
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-16-0d626e17adaf> in <module> ----> 1 cmtlt + torch.randn(100, 100) ~/Documents/GitHub/gpytorch/gpytorch/lazy/lazy_tensor.py in __add__(self, other) 1625...
TypeError
def __add__(self, other): """ Return a :obj:`gpytorch.lazy.LazyTensor` that represents the sum of this lazy tensor and another matrix or lazy tensor. Args: :attr:`other` (:obj:`torch.tensor` or :obj:`gpytorch.lazy.LazyTensor`): Matrix to add to this one. Returns: :obj:`...
def __add__(self, other): """ Return a :obj:`gpytorch.lazy.LazyTensor` that represents the sum of this lazy tensor and another matrix or lazy tensor. Args: :attr:`other` (:obj:`torch.tensor` or :obj:`gpytorch.lazy.LazyTensor`): Matrix to add to this one. Returns: :obj:`...
https://github.com/cornellius-gp/gpytorch/issues/1133
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-16-0d626e17adaf> in <module> ----> 1 cmtlt + torch.randn(100, 100) ~/Documents/GitHub/gpytorch/gpytorch/lazy/lazy_tensor.py in __add__(self, other) 1625...
TypeError
def __add__(self, other): from .diag_lazy_tensor import DiagLazyTensor from .added_diag_lazy_tensor import AddedDiagLazyTensor if isinstance(other, ZeroLazyTensor): return self elif isinstance(other, DiagLazyTensor): return AddedDiagLazyTensor(self, other) elif isinstance(other, Sum...
def __add__(self, other): from .diag_lazy_tensor import DiagLazyTensor from .added_diag_lazy_tensor import AddedDiagLazyTensor if isinstance(other, ZeroLazyTensor): return self elif isinstance(other, DiagLazyTensor): return AddedDiagLazyTensor(self, other) elif isinstance(other, Sum...
https://github.com/cornellius-gp/gpytorch/issues/1133
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-16-0d626e17adaf> in <module> ----> 1 cmtlt + torch.randn(100, 100) ~/Documents/GitHub/gpytorch/gpytorch/lazy/lazy_tensor.py in __add__(self, other) 1625...
TypeError
def initialize_from_data_empspect(self, train_x, train_y): """ Initialize mixture components based on the empirical spectrum of the data. This will often be better than the standard initialize_from_data method. """ import numpy as np from scipy.fftpack import fft from scipy.integrate import...
def initialize_from_data_empspect(self, train_x, train_y): """ Initialize mixture components based on the empirical spectrum of the data. This will often be better than the standard initialize_from_data method. """ import numpy as np from scipy.fftpack import fft from scipy.integrate import...
https://github.com/cornellius-gp/gpytorch/issues/1166
--------------------------------------------------------------------------- IndexError Traceback (most recent call last) <ipython-input-18-3796fe5ce2f5> in <module> 19 20 likelihood = gpytorch.likelihoods.GaussianLikelihood() ---> 21 model = ExactGPModel(train_x, train_y, likeliho...
IndexError
def _getitem(self, row_index, col_index, *batch_indices): """ Supports subindexing of the matrix this LazyTensor represents. The indices passed into this method will either be: Tensor indices Slices ..note:: LazyTensor.__getitem__ uses this as a helper method. If you are writin...
def _getitem(self, row_index, col_index, *batch_indices): """ Supports subindexing of the matrix this LazyTensor represents. The indices passed into this method will either be: Tensor indices Slices ..note:: LazyTensor.__getitem__ uses this as a helper method. If you are writin...
https://github.com/cornellius-gp/gpytorch/issues/1065
Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/gpytorch/lazy/lazy_evaluated_kernel_tensor.py", line 88, in _getitem x1 = x1[(*batch_indices, row_index, dim_index)] IndexError: too many indices for tensor of dimension 2 During handling of the above...
IndexError
def _shaped_noise_covar(self, base_shape: torch.Size, *params: Any, **kwargs: Any): return self.noise_covar(*params, shape=base_shape, **kwargs)
def _shaped_noise_covar(self, base_shape: torch.Size, *params: Any, **kwargs: Any): if len(params) > 0: # we can infer the shape from the params shape = None else: # here shape[:-1] is the batch shape requested, and shape[-1] is `n`, the number of points shape = base_shape re...
https://github.com/cornellius-gp/gpytorch/issues/1084
Traceback (most recent call last): File "<ipython-input-1-88b9df752e72>", line 1, in <module> runfile('/home/user/Desktop/dl-dev python/gp_examples/test.py', wdir='/home/user/Desktop/dl-dev python/gp_examples') File "/home/user/anaconda3/envs/dkl/lib/python3.6/site-packages/spyder_kernels/customize/spydercustomize.py...
RuntimeError
def forward(self, x1, x2, diag=False, **params): x1_ = x1.div(self.period_length) x2_ = x2.div(self.period_length) diff = self.covar_dist(x1_, x2_, diag=diag, **params) res = torch.sin(diff.mul(math.pi)).pow(2).mul(-2 / self.lengthscale).exp_() if diag: res = res.squeeze(0) return res
def forward(self, x1, x2, diag=False, **params): x1_ = x1.div(self.period_length) x2_ = x2.div(self.period_length) diff = self.covar_dist(x1_, x2_, diag=diag, **params) res = torch.sin(diff.mul(math.pi)).pow(2).mul(-2 / self.lengthscale).exp_() if diff.ndimension() == 2 or diag: res = res.sq...
https://github.com/cornellius-gp/gpytorch/issues/1011
Traceback (most recent call last): File "<ipython-input-13-effc04c4ab77>", line 61, in <module> loss = -mll(output, train_y) ## NOTE fails here. File "/Users/val/opt/anaconda3/lib/python3.7/site-packages/gpytorch/module.py", line 24, in __call__ outputs = self.forward(*inputs, **kwargs) File "/Users/val/opt/anaconda...
IndexError
def expand(self, expand_shape, _instance=None): batch_shape = torch.Size(expand_shape) return HorseshoePrior(self.scale.expand(batch_shape))
def expand(self, expand_shape, _instance=None): new = self._get_checked_instance(HorseshoePrior) batch_shape = torch.Size(expand_shape) new.scale = self.scale.expand(batch_shape) super(Distribution, new).__init__(batch_shape) new._validate_args = self._validate_args return new
https://github.com/cornellius-gp/gpytorch/issues/976
Warmup: 0%| | 0/300 [00:00, ?it/s] --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-22-1dcdc695642b> in <module> 9 nuts_kernel = pyro.infer.mcmc.NUTS(pyro_model, adapt_step_size=True) 10 mcmc...
AttributeError
def expand(self, batch_shape): batch_shape = torch.Size(batch_shape) return NormalPrior(self.loc.expand(batch_shape), self.scale.expand(batch_shape))
def expand(self, batch_shape): return Normal.expand(self, batch_shape, _instance=self)
https://github.com/cornellius-gp/gpytorch/issues/976
Warmup: 0%| | 0/300 [00:00, ?it/s] --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-22-1dcdc695642b> in <module> 9 nuts_kernel = pyro.infer.mcmc.NUTS(pyro_model, adapt_step_size=True) 10 mcmc...
AttributeError
def expand(self, batch_shape): batch_shape = torch.Size(batch_shape) return LogNormalPrior(self.loc.expand(batch_shape), self.scale.expand(batch_shape))
def expand(self, batch_shape): return LogNormal.expand(self, batch_shape, _instance=self)
https://github.com/cornellius-gp/gpytorch/issues/976
Warmup: 0%| | 0/300 [00:00, ?it/s] --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-22-1dcdc695642b> in <module> 9 nuts_kernel = pyro.infer.mcmc.NUTS(pyro_model, adapt_step_size=True) 10 mcmc...
AttributeError
def expand(self, batch_shape): batch_shape = torch.Size(batch_shape) return UniformPrior(self.low.expand(batch_shape), self.high.expand(batch_shape))
def expand(self, batch_shape): return Uniform.expand(self, batch_shape, _instance=self)
https://github.com/cornellius-gp/gpytorch/issues/976
Warmup: 0%| | 0/300 [00:00, ?it/s] --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-22-1dcdc695642b> in <module> 9 nuts_kernel = pyro.infer.mcmc.NUTS(pyro_model, adapt_step_size=True) 10 mcmc...
AttributeError
def expand(self, batch_shape): batch_shape = torch.Size(batch_shape) return GammaPrior( self.concentration.expand(batch_shape), self.rate.expand(batch_shape) )
def expand(self, batch_shape): return Gamma.expand(self, batch_shape, _instance=self)
https://github.com/cornellius-gp/gpytorch/issues/976
Warmup: 0%| | 0/300 [00:00, ?it/s] --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-22-1dcdc695642b> in <module> 9 nuts_kernel = pyro.infer.mcmc.NUTS(pyro_model, adapt_step_size=True) 10 mcmc...
AttributeError
def interpolate( self, x_grid: List[torch.Tensor], x_target: torch.Tensor, interp_points=range(-2, 2), eps=1e-10, ): if torch.is_tensor(x_grid): x_grid = convert_legacy_grid(x_grid) num_target_points = x_target.size(0) num_dim = x_target.size(-1) assert num_dim == len(x_grid)...
def interpolate( self, x_grid: List[torch.Tensor], x_target: torch.Tensor, interp_points=range(-2, 2) ): if torch.is_tensor(x_grid): x_grid = convert_legacy_grid(x_grid) num_target_points = x_target.size(0) num_dim = x_target.size(-1) assert num_dim == len(x_grid) grid_sizes = [len(x_gr...
https://github.com/cornellius-gp/gpytorch/issues/955
Traceback (most recent call last): File "gp.py", line 24, in <module> exact.train() File "/st2/jeff/real_estate/models/gaussian_processes/exact.py", line 102, in train loss = -mll(output, train_y).sum() File "/st2/jeff/anaconda3/envs/jeff/lib/python3.7/site-packages/gpytorch/module.py", line 22, in __call__ outputs = s...
RuntimeError
def __init__(self, mean, covariance_matrix, validate_args=False, interleaved=True): if not torch.is_tensor(mean) and not isinstance(mean, LazyTensor): raise RuntimeError( "The mean of a MultitaskMultivariateNormal must be a Tensor or LazyTensor" ) if not torch.is_tensor(covariance_m...
def __init__(self, mean, covariance_matrix, validate_args=False, interleaved=True): """ Constructs a multi-output multivariate Normal random variable, based on mean and covariance Can be multi-output multivariate, or a batch of multi-output multivariate Normal Passing a matrix mean corresponds to a mul...
https://github.com/cornellius-gp/gpytorch/issues/905
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-6-c955f39ee560> in <module> 4 with torch.no_grad(): 5 for x_batch, y_batch in test_loader: ----> 6 preds = model(x_batch) 7 means = t...
AttributeError
def from_independent_mvns(cls, mvns): """ Convert an iterable of MVNs into a :obj:`~gpytorch.distributions.MultitaskMultivariateNormal`. The resulting distribution will have :attr:`len(mvns)` tasks, and the tasks will be independent. :param ~gpytorch.distributions.MultitaskNormal mvn: The base MVN dist...
def from_independent_mvns(cls, mvns): if len(mvns) < 2: raise ValueError( "Must provide at least 2 MVNs to form a MultitaskMultivariateNormal" ) if any(isinstance(mvn, MultitaskMultivariateNormal) for mvn in mvns): raise ValueError("Cannot accept MultitaskMultivariateNormals"...
https://github.com/cornellius-gp/gpytorch/issues/905
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-6-c955f39ee560> in <module> 4 with torch.no_grad(): 5 for x_batch, y_batch in test_loader: ----> 6 preds = model(x_batch) 7 means = t...
AttributeError
def get_base_samples(self, sample_shape=torch.Size()): base_samples = super().get_base_samples(sample_shape) if not self._interleaved: # flip shape of last two dimensions new_shape = sample_shape + self._output_shape[:-2] + self._output_shape[:-3:-1] return base_samples.view(new_shape).t...
def get_base_samples(self, sample_shape=torch.Size()): """Get i.i.d. standard Normal samples (to be used with rsample(base_samples=base_samples))""" base_samples = super().get_base_samples(sample_shape) if not self._interleaved: # flip shape of last two dimensions new_shape = sample_shape + ...
https://github.com/cornellius-gp/gpytorch/issues/905
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-6-c955f39ee560> in <module> 4 with torch.no_grad(): 5 for x_batch, y_batch in test_loader: ----> 6 preds = model(x_batch) 7 means = t...
AttributeError
def __init__(self, mean, covariance_matrix, validate_args=False): self._islazy = isinstance(mean, LazyTensor) or isinstance( covariance_matrix, LazyTensor ) if self._islazy: if validate_args: # TODO: add argument validation raise NotImplementedError() self.loc...
def __init__(self, mean, covariance_matrix, validate_args=False): self._islazy = isinstance(mean, LazyTensor) or isinstance( covariance_matrix, LazyTensor ) if self._islazy: if validate_args: # TODO: add argument validation raise NotImplementedError() self.loc...
https://github.com/cornellius-gp/gpytorch/issues/905
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-6-c955f39ee560> in <module> 4 with torch.no_grad(): 5 for x_batch, y_batch in test_loader: ----> 6 preds = model(x_batch) 7 means = t...
AttributeError
def confidence_region(self): """ Returns 2 standard deviations above and below the mean. :rtype: (torch.Tensor, torch.Tensor) :return: pair of tensors of size (b x d) or (d), where b is the batch size and d is the dimensionality of the random variable. The first (second) Tensor is the l...
def confidence_region(self): """ Returns 2 standard deviations above and below the mean. Returns: Tuple[Tensor, Tensor]: pair of tensors of size (b x d) or (d), where b is the batch size and d is the dimensionality of the random variable. The first (second) Tensor is the low...
https://github.com/cornellius-gp/gpytorch/issues/905
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-6-c955f39ee560> in <module> 4 with torch.no_grad(): 5 for x_batch, y_batch in test_loader: ----> 6 preds = model(x_batch) 7 means = t...
AttributeError
def get_base_samples(self, sample_shape=torch.Size()): """Get i.i.d. standard Normal samples (to be used with rsample(base_samples=base_samples))""" return super().get_base_samples(sample_shape=sample_shape)
def get_base_samples(self, sample_shape=torch.Size()): """Get i.i.d. standard Normal samples (to be used with rsample(base_samples=base_samples))""" with torch.no_grad(): shape = self._extended_shape(sample_shape) base_samples = _standard_normal( shape, dtype=self.loc.dtype, device=s...
https://github.com/cornellius-gp/gpytorch/issues/905
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-6-c955f39ee560> in <module> 4 with torch.no_grad(): 5 for x_batch, y_batch in test_loader: ----> 6 preds = model(x_batch) 7 means = t...
AttributeError