datajoint 0.14.4__tar.gz → 0.14.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of datajoint might be problematic. Click here for more details.

Files changed (82) hide show
  1. {datajoint-0.14.4 → datajoint-0.14.6}/PKG-INFO +24 -25
  2. {datajoint-0.14.4 → datajoint-0.14.6}/README.md +20 -21
  3. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/autopopulate.py +74 -11
  4. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/blob.py +2 -2
  5. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/condition.py +1 -1
  6. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/diagram.py +1 -1
  7. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/preview.py +1 -1
  8. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/table.py +11 -10
  9. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/utils.py +2 -0
  10. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/version.py +1 -1
  11. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint.egg-info/PKG-INFO +24 -25
  12. {datajoint-0.14.4 → datajoint-0.14.6}/pyproject.toml +4 -3
  13. {datajoint-0.14.4 → datajoint-0.14.6}/LICENSE.txt +0 -0
  14. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/__init__.py +0 -0
  15. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/admin.py +0 -0
  16. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/attribute_adapter.py +0 -0
  17. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/cli.py +0 -0
  18. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/connection.py +0 -0
  19. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/declare.py +0 -0
  20. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/dependencies.py +0 -0
  21. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/errors.py +0 -0
  22. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/expression.py +0 -0
  23. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/external.py +0 -0
  24. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/fetch.py +0 -0
  25. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/hash.py +0 -0
  26. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/heading.py +0 -0
  27. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/jobs.py +0 -0
  28. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/logging.py +0 -0
  29. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/plugin.py +0 -0
  30. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/s3.py +0 -0
  31. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/schemas.py +0 -0
  32. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/settings.py +0 -0
  33. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint/user_tables.py +0 -0
  34. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint.egg-info/SOURCES.txt +0 -0
  35. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint.egg-info/dependency_links.txt +0 -0
  36. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint.egg-info/entry_points.txt +0 -0
  37. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint.egg-info/requires.txt +0 -0
  38. {datajoint-0.14.4 → datajoint-0.14.6}/datajoint.egg-info/top_level.txt +0 -0
  39. {datajoint-0.14.4 → datajoint-0.14.6}/setup.cfg +0 -0
  40. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_adapted_attributes.py +0 -0
  41. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_admin.py +0 -0
  42. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_aggr_regressions.py +0 -0
  43. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_alter.py +0 -0
  44. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_attach.py +0 -0
  45. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_autopopulate.py +0 -0
  46. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_blob.py +0 -0
  47. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_blob_matlab.py +0 -0
  48. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_bypass_serialization.py +0 -0
  49. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_cascading_delete.py +0 -0
  50. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_cli.py +0 -0
  51. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_connection.py +0 -0
  52. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_declare.py +0 -0
  53. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_dependencies.py +0 -0
  54. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_erd.py +0 -0
  55. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_external.py +0 -0
  56. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_external_class.py +0 -0
  57. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_fetch.py +0 -0
  58. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_fetch_same.py +0 -0
  59. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_filepath.py +0 -0
  60. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_foreign_keys.py +0 -0
  61. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_groupby.py +0 -0
  62. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_hash.py +0 -0
  63. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_jobs.py +0 -0
  64. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_json.py +0 -0
  65. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_log.py +0 -0
  66. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_nan.py +0 -0
  67. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_plugin.py +0 -0
  68. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_privileges.py +0 -0
  69. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_reconnection.py +0 -0
  70. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_relation.py +0 -0
  71. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_relation_u.py +0 -0
  72. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_relational_operand.py +0 -0
  73. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_s3.py +0 -0
  74. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_schema.py +0 -0
  75. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_schema_keywords.py +0 -0
  76. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_settings.py +0 -0
  77. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_tls.py +0 -0
  78. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_university.py +0 -0
  79. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_update1.py +0 -0
  80. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_utils.py +0 -0
  81. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_uuid.py +0 -0
  82. {datajoint-0.14.4 → datajoint-0.14.6}/tests/test_virtual_module.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datajoint
3
- Version: 0.14.4
3
+ Version: 0.14.6
4
4
  Summary: DataJoint for Python is a framework for scientific workflow management based on relational principles. DataJoint is built on the foundation of the relational data model and prescribes a consistent method for organizing, populating, computing, and querying data.
5
5
  Author: Raphael Guzman, Edgar Walker
6
- Author-email: Dimitri Yatsenko <dimitri@datajoint.com>, DataJoint Contributors <support@datajoint.com>
6
+ Author-email: Dimitri Yatsenko <dimitri@datajoint.com>, Thinh Nguyen <thinh@datajoint.com>, DataJoint Contributors <support@datajoint.com>
7
7
  Maintainer-email: Dimitri Yatsenko <dimitri@datajoint.com>, DataJoint Contributors <support@datajoint.com>
8
8
  License: GNU LESSER GENERAL PUBLIC LICENSE
9
9
  Version 2.1, February 1999
@@ -510,8 +510,8 @@ License: GNU LESSER GENERAL PUBLIC LICENSE
510
510
 
511
511
  That's all there is to it!
512
512
 
513
- Project-URL: Homepage, https://datajoint.com/docs
514
- Project-URL: Documentation, https://datajoint.com/docs
513
+ Project-URL: Homepage, https://docs.datajoint.com/
514
+ Project-URL: Documentation, https://docs.datajoint.com/
515
515
  Project-URL: Repository, https://github.com/datajoint/datajoint-python
516
516
  Project-URL: Bug Tracker, https://github.com/datajoint/datajoint-python/issues
517
517
  Project-URL: Release Notes, https://github.com/datajoint/datajoint-python/releases
@@ -589,8 +589,8 @@ Dynamic: license-file
589
589
  <tr>
590
590
  <td>Since Release</td>
591
591
  <td>
592
- <a id="commit-since-release-link" href="https://github.com/datajoint/datajoint-python/compare/v0.14.4...master">
593
- <img id="commit-since-release-img" src="https://img.shields.io/github/commits-since/datajoint/datajoint-python/v0.14.4?color=red" alt="commit since last release" />
592
+ <a id="commit-since-release-link" href="https://github.com/datajoint/datajoint-python/compare/v0.14.6...master">
593
+ <img id="commit-since-release-img" src="https://img.shields.io/github/commits-since/datajoint/datajoint-python/v0.14.6?color=red" alt="commit since last release" />
594
594
  </a>
595
595
  </td>
596
596
  </tr>
@@ -613,7 +613,7 @@ Dynamic: license-file
613
613
  <tr>
614
614
  <td>Doc Status</td>
615
615
  <td>
616
- <a href="https://datajoint.com/docs">
616
+ <a href="https://docs.datajoint.com">
617
617
  <img src="https://github.com/datajoint/datajoint-python/actions/workflows/pages/pages-build-deployment/badge.svg" alt="doc status" />
618
618
  </a>
619
619
  </td>
@@ -627,12 +627,12 @@ Dynamic: license-file
627
627
  </td>
628
628
  </tr>
629
629
  <tr>
630
- <td>Developer Chat</td>
631
- <td>
632
- <a href="https://datajoint.slack.com/">
630
+ <td>Developer Chat</td>
631
+ <td>
632
+ <a href="https://datajoint.slack.com/">
633
633
  <img src="https://img.shields.io/badge/slack-datajoint-purple.svg" alt="datajoint slack"/>
634
- </a>
635
- </td>
634
+ </a>
635
+ </td>
636
636
  </tr>
637
637
  <tr>
638
638
  <td>License</td>
@@ -643,21 +643,20 @@ Dynamic: license-file
643
643
  </td>
644
644
  </tr>
645
645
  <tr>
646
- <td>Citation</td>
647
- <td>
648
- <a href="https://doi.org/10.1101/031658">
649
- <img src="https://img.shields.io/badge/DOI-10.1101/bioRxiv.031658-B31B1B.svg" alt="bioRxiv">
650
- </a>
646
+ <td>Citation</td>
647
+ <td>
648
+ <a href="https://doi.org/10.1101/031658">
649
+ <img src="https://img.shields.io/badge/DOI-10.1101/bioRxiv.031658-B31B1B.svg" alt="bioRxiv">
650
+ </a>
651
651
  <br>
652
652
  <a href="https://doi.org/10.5281/zenodo.6829062">
653
653
  <img src="https://zenodo.org/badge/DOI/10.5281/zenodo.6829062.svg" alt="zenodo">
654
- </a>
655
- </td>
654
+ </a>
655
+ </td>
656
656
  </tr>
657
657
 
658
658
  </table>
659
659
 
660
-
661
660
  DataJoint for Python is a framework for scientific workflow management based on
662
661
  relational principles. DataJoint is built on the foundation of the relational data
663
662
  model and prescribes a consistent method for organizing, populating, computing, and
@@ -669,7 +668,7 @@ volumes of data streaming from regular experiments. Starting in 2011, DataJoint
669
668
  been available as an open-source project adopted by other labs and improved through
670
669
  contributions from several developers.
671
670
  Presently, the primary developer of DataJoint open-source software is the company
672
- DataJoint (https://datajoint.com).
671
+ DataJoint (<https://datajoint.com>).
673
672
 
674
673
  ## Data Pipeline Example
675
674
 
@@ -691,13 +690,13 @@ DataJoint (https://datajoint.com).
691
690
  pip install datajoint
692
691
  ```
693
692
 
694
- - [Documentation & Tutorials](https://datajoint.com/docs/core/datajoint-python/)
693
+ - [Documentation & Tutorials](https://docs.datajoint.com/core/datajoint-python/)
695
694
 
696
695
  - [Interactive Tutorials](https://github.com/datajoint/datajoint-tutorials) on GitHub Codespaces
697
696
 
698
- - [DataJoint Elements](https://datajoint.com/docs/elements/) - Catalog of example pipelines for neuroscience experiments
697
+ - [DataJoint Elements](https://docs.datajoint.com/elements/) - Catalog of example pipelines for neuroscience experiments
699
698
 
700
699
  - Contribute
701
- - [Contribution Guidelines](https://datajoint.com/docs/about/contribute/)
700
+ - [Contribution Guidelines](https://docs.datajoint.com/about/contribute/)
702
701
 
703
- - [Developer Guide](https://datajoint.com/docs/core/datajoint-python/latest/develop/)
702
+ - [Developer Guide](https://docs.datajoint.com/core/datajoint-python/latest/develop/)
@@ -30,8 +30,8 @@
30
30
  <tr>
31
31
  <td>Since Release</td>
32
32
  <td>
33
- <a id="commit-since-release-link" href="https://github.com/datajoint/datajoint-python/compare/v0.14.4...master">
34
- <img id="commit-since-release-img" src="https://img.shields.io/github/commits-since/datajoint/datajoint-python/v0.14.4?color=red" alt="commit since last release" />
33
+ <a id="commit-since-release-link" href="https://github.com/datajoint/datajoint-python/compare/v0.14.6...master">
34
+ <img id="commit-since-release-img" src="https://img.shields.io/github/commits-since/datajoint/datajoint-python/v0.14.6?color=red" alt="commit since last release" />
35
35
  </a>
36
36
  </td>
37
37
  </tr>
@@ -54,7 +54,7 @@
54
54
  <tr>
55
55
  <td>Doc Status</td>
56
56
  <td>
57
- <a href="https://datajoint.com/docs">
57
+ <a href="https://docs.datajoint.com">
58
58
  <img src="https://github.com/datajoint/datajoint-python/actions/workflows/pages/pages-build-deployment/badge.svg" alt="doc status" />
59
59
  </a>
60
60
  </td>
@@ -68,12 +68,12 @@
68
68
  </td>
69
69
  </tr>
70
70
  <tr>
71
- <td>Developer Chat</td>
72
- <td>
73
- <a href="https://datajoint.slack.com/">
71
+ <td>Developer Chat</td>
72
+ <td>
73
+ <a href="https://datajoint.slack.com/">
74
74
  <img src="https://img.shields.io/badge/slack-datajoint-purple.svg" alt="datajoint slack"/>
75
- </a>
76
- </td>
75
+ </a>
76
+ </td>
77
77
  </tr>
78
78
  <tr>
79
79
  <td>License</td>
@@ -84,21 +84,20 @@
84
84
  </td>
85
85
  </tr>
86
86
  <tr>
87
- <td>Citation</td>
88
- <td>
89
- <a href="https://doi.org/10.1101/031658">
90
- <img src="https://img.shields.io/badge/DOI-10.1101/bioRxiv.031658-B31B1B.svg" alt="bioRxiv">
91
- </a>
87
+ <td>Citation</td>
88
+ <td>
89
+ <a href="https://doi.org/10.1101/031658">
90
+ <img src="https://img.shields.io/badge/DOI-10.1101/bioRxiv.031658-B31B1B.svg" alt="bioRxiv">
91
+ </a>
92
92
  <br>
93
93
  <a href="https://doi.org/10.5281/zenodo.6829062">
94
94
  <img src="https://zenodo.org/badge/DOI/10.5281/zenodo.6829062.svg" alt="zenodo">
95
- </a>
96
- </td>
95
+ </a>
96
+ </td>
97
97
  </tr>
98
98
 
99
99
  </table>
100
100
 
101
-
102
101
  DataJoint for Python is a framework for scientific workflow management based on
103
102
  relational principles. DataJoint is built on the foundation of the relational data
104
103
  model and prescribes a consistent method for organizing, populating, computing, and
@@ -110,7 +109,7 @@ volumes of data streaming from regular experiments. Starting in 2011, DataJoint
110
109
  been available as an open-source project adopted by other labs and improved through
111
110
  contributions from several developers.
112
111
  Presently, the primary developer of DataJoint open-source software is the company
113
- DataJoint (https://datajoint.com).
112
+ DataJoint (<https://datajoint.com>).
114
113
 
115
114
  ## Data Pipeline Example
116
115
 
@@ -132,13 +131,13 @@ DataJoint (https://datajoint.com).
132
131
  pip install datajoint
133
132
  ```
134
133
 
135
- - [Documentation & Tutorials](https://datajoint.com/docs/core/datajoint-python/)
134
+ - [Documentation & Tutorials](https://docs.datajoint.com/core/datajoint-python/)
136
135
 
137
136
  - [Interactive Tutorials](https://github.com/datajoint/datajoint-tutorials) on GitHub Codespaces
138
137
 
139
- - [DataJoint Elements](https://datajoint.com/docs/elements/) - Catalog of example pipelines for neuroscience experiments
138
+ - [DataJoint Elements](https://docs.datajoint.com/elements/) - Catalog of example pipelines for neuroscience experiments
140
139
 
141
140
  - Contribute
142
- - [Contribution Guidelines](https://datajoint.com/docs/about/contribute/)
141
+ - [Contribution Guidelines](https://docs.datajoint.com/about/contribute/)
143
142
 
144
- - [Developer Guide](https://datajoint.com/docs/core/datajoint-python/latest/develop/)
143
+ - [Developer Guide](https://docs.datajoint.com/core/datajoint-python/latest/develop/)
@@ -95,13 +95,76 @@ class AutoPopulate:
95
95
 
96
96
  def make(self, key):
97
97
  """
98
- Derived classes must implement method `make` that fetches data from tables
99
- above them in the dependency hierarchy, restricting by the given key,
100
- computes secondary attributes, and inserts the new tuples into self.
98
+ This method must be implemented by derived classes to perform automated computation.
99
+ The method must implement the following three steps:
100
+
101
+ 1. Fetch data from tables above in the dependency hierarchy, restricted by the given key.
102
+ 2. Compute secondary attributes based on the fetched data.
103
+ 3. Insert the new tuple(s) into the current table.
104
+
105
+ The method can be implemented either as:
106
+ (a) Regular method: All three steps are performed in a single database transaction.
107
+ The method must return None.
108
+ (b) Generator method:
109
+ The make method is split into three functions:
110
+ - `make_fetch`: Fetches data from the parent tables.
111
+ - `make_compute`: Computes secondary attributes based on the fetched data.
112
+ - `make_insert`: Inserts the computed data into the current table.
113
+
114
+ Then populate logic is executes as follows:
115
+
116
+ <pseudocode>
117
+ fetched_data1 = self.make_fetch(key)
118
+ computed_result = self.make_compute(key, *fetched_data1)
119
+ begin transaction:
120
+ fetched_data2 = self.make_fetch(key)
121
+ if fetched_data1 != fetched_data2:
122
+ cancel transaction
123
+ else:
124
+ self.make_insert(key, *computed_result)
125
+ commit_transaction
126
+ <pseudocode>
127
+
128
+ Importantly, the output of make_fetch is a tuple that serves as the input into `make_compute`.
129
+ The output of `make_compute` is a tuple that serves as the input into `make_insert`.
130
+
131
+ The functionality must be strictly divided between these three methods:
132
+ - All database queries must be completed in `make_fetch`.
133
+ - All computation must be completed in `make_compute`.
134
+ - All database inserts must be completed in `make_insert`.
135
+
136
+ DataJoint may programmatically enforce this separation in the future.
137
+
138
+ :param key: The primary key value used to restrict the data fetching.
139
+ :raises NotImplementedError: If the derived class does not implement the required methods.
101
140
  """
102
- raise NotImplementedError(
103
- "Subclasses of AutoPopulate must implement the method `make`"
104
- )
141
+
142
+ if not (
143
+ hasattr(self, "make_fetch")
144
+ and hasattr(self, "make_insert")
145
+ and hasattr(self, "make_compute")
146
+ ):
147
+ # user must implement `make`
148
+ raise NotImplementedError(
149
+ "Subclasses of AutoPopulate must implement the method `make` "
150
+ "or (`make_fetch` + `make_compute` + `make_insert`)"
151
+ )
152
+
153
+ # User has implemented `_fetch`, `_compute`, and `_insert` methods instead
154
+
155
+ # Step 1: Fetch data from parent tables
156
+ fetched_data = self.make_fetch(key) # fetched_data is a tuple
157
+ computed_result = yield fetched_data # passed as input into make_compute
158
+
159
+ # Step 2: If computed result is not passed in, compute the result
160
+ if computed_result is None:
161
+ # this is only executed in the first invocation
162
+ computed_result = self.make_compute(key, *fetched_data)
163
+ yield computed_result # this is passed to the second invocation of make
164
+
165
+ # Step 3: Insert the computed result into the current table.
166
+ self.make_insert(key, *computed_result)
167
+ yield
105
168
 
106
169
  @property
107
170
  def target(self):
@@ -203,9 +266,8 @@ class AutoPopulate:
203
266
  self.connection.schemas[self.target.database].jobs if reserve_jobs else None
204
267
  )
205
268
 
206
- # define and set up signal handler for SIGTERM:
207
269
  if reserve_jobs:
208
-
270
+ # Define a signal handler for SIGTERM
209
271
  def handler(signum, frame):
210
272
  logger.info("Populate terminated by SIGTERM")
211
273
  raise SystemExit("SIGTERM received")
@@ -350,9 +412,10 @@ class AutoPopulate:
350
412
  != deepdiff.DeepHash(fetched_data, ignore_iterable_order=False)[
351
413
  fetched_data
352
414
  ]
353
- ): # rollback due to referential integrity fail
354
- self.connection.cancel_transaction()
355
- return False
415
+ ): # raise error if fetched data has changed
416
+ raise DataJointError(
417
+ "Referential integrity failed! The `make_fetch` data has changed"
418
+ )
356
419
  gen.send(computed_result) # insert
357
420
 
358
421
  except (KeyboardInterrupt, SystemExit, Exception) as error:
@@ -140,7 +140,7 @@ class Blob:
140
140
  "S": self.read_struct, # matlab struct array
141
141
  "C": self.read_cell_array, # matlab cell array
142
142
  # basic data types
143
- "\xFF": self.read_none, # None
143
+ "\xff": self.read_none, # None
144
144
  "\x01": self.read_tuple, # a Sequence (e.g. tuple)
145
145
  "\x02": self.read_list, # a MutableSequence (e.g. list)
146
146
  "\x03": self.read_set, # a Set
@@ -401,7 +401,7 @@ class Blob:
401
401
 
402
402
  @staticmethod
403
403
  def pack_none():
404
- return b"\xFF"
404
+ return b"\xff"
405
405
 
406
406
  def read_tuple(self):
407
407
  return tuple(
@@ -1,4 +1,4 @@
1
- """ methods for generating SQL WHERE clauses from datajoint restriction conditions """
1
+ """methods for generating SQL WHERE clauses from datajoint restriction conditions"""
2
2
 
3
3
  import collections
4
4
  import datetime
@@ -35,7 +35,7 @@ if not diagram_active:
35
35
  Entity relationship diagram, currently disabled due to the lack of required packages: matplotlib and pygraphviz.
36
36
 
37
37
  To enable Diagram feature, please install both matplotlib and pygraphviz. For instructions on how to install
38
- these two packages, refer to https://datajoint.com/docs/core/datajoint-python/0.14/client/install/
38
+ these two packages, refer to https://docs.datajoint.com/core/datajoint-python/0.14/client/install/
39
39
  """
40
40
 
41
41
  def __init__(self, *args, **kwargs):
@@ -1,4 +1,4 @@
1
- """ methods for generating previews of query expression results in python command line and Jupyter """
1
+ """methods for generating previews of query expression results in python command line and Jupyter"""
2
2
 
3
3
  from .settings import config
4
4
 
@@ -137,7 +137,7 @@ class Table(QueryExpression):
137
137
  sql, external_stores = alter(self.definition, old_definition, context)
138
138
  if not sql:
139
139
  if prompt:
140
- logger.warn("Nothing to alter.")
140
+ logger.warning("Nothing to alter.")
141
141
  else:
142
142
  sql = "ALTER TABLE {tab}\n\t".format(
143
143
  tab=self.full_table_name
@@ -520,7 +520,13 @@ class Table(QueryExpression):
520
520
  try:
521
521
  delete_count = table.delete_quick(get_count=True)
522
522
  except IntegrityError as error:
523
- match = foreign_key_error_regexp.match(error.args[0]).groupdict()
523
+ match = foreign_key_error_regexp.match(error.args[0])
524
+ if match is None:
525
+ raise DataJointError(
526
+ "Cascading deletes failed because the error message is missing foreign key information."
527
+ "Make sure you have REFERENCES privilege to all dependent tables."
528
+ ) from None
529
+ match = match.groupdict()
524
530
  # if schema name missing, use table
525
531
  if "`.`" not in match["child"]:
526
532
  match["child"] = "{}.{}".format(
@@ -643,7 +649,7 @@ class Table(QueryExpression):
643
649
  # Confirm and commit
644
650
  if delete_count == 0:
645
651
  if safemode:
646
- logger.warn("Nothing to delete.")
652
+ logger.warning("Nothing to delete.")
647
653
  if transaction:
648
654
  self.connection.cancel_transaction()
649
655
  elif not transaction:
@@ -653,12 +659,12 @@ class Table(QueryExpression):
653
659
  if transaction:
654
660
  self.connection.commit_transaction()
655
661
  if safemode:
656
- logger.info("Deletes committed.")
662
+ logger.info("Delete committed.")
657
663
  else:
658
664
  if transaction:
659
665
  self.connection.cancel_transaction()
660
666
  if safemode:
661
- logger.warn("Deletes cancelled")
667
+ logger.warning("Delete cancelled")
662
668
  return delete_count
663
669
 
664
670
  def drop_quick(self):
@@ -726,11 +732,6 @@ class Table(QueryExpression):
726
732
  ).fetchone()
727
733
  return ret["Data_length"] + ret["Index_length"]
728
734
 
729
- def show_definition(self):
730
- raise AttributeError(
731
- "show_definition is deprecated. Use the describe method instead."
732
- )
733
-
734
735
  def describe(self, context=None, printout=False):
735
736
  """
736
737
  :return: the definition string for the query using DataJoint DDL.
@@ -147,3 +147,5 @@ def parse_sql(filepath):
147
147
  if line.endswith(delimiter):
148
148
  yield " ".join(statement)
149
149
  statement = []
150
+ if statement:
151
+ yield " ".join(statement)
@@ -1,6 +1,6 @@
1
1
  # version bump auto managed by Github Actions:
2
2
  # label_prs.yaml(prep), release.yaml(bump), post_release.yaml(edit)
3
3
  # manually set this version will be eventually overwritten by the above actions
4
- __version__ = "0.14.4"
4
+ __version__ = "0.14.6"
5
5
 
6
6
  assert len(__version__) <= 10 # The log table limits version to the 10 characters
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datajoint
3
- Version: 0.14.4
3
+ Version: 0.14.6
4
4
  Summary: DataJoint for Python is a framework for scientific workflow management based on relational principles. DataJoint is built on the foundation of the relational data model and prescribes a consistent method for organizing, populating, computing, and querying data.
5
5
  Author: Raphael Guzman, Edgar Walker
6
- Author-email: Dimitri Yatsenko <dimitri@datajoint.com>, DataJoint Contributors <support@datajoint.com>
6
+ Author-email: Dimitri Yatsenko <dimitri@datajoint.com>, Thinh Nguyen <thinh@datajoint.com>, DataJoint Contributors <support@datajoint.com>
7
7
  Maintainer-email: Dimitri Yatsenko <dimitri@datajoint.com>, DataJoint Contributors <support@datajoint.com>
8
8
  License: GNU LESSER GENERAL PUBLIC LICENSE
9
9
  Version 2.1, February 1999
@@ -510,8 +510,8 @@ License: GNU LESSER GENERAL PUBLIC LICENSE
510
510
 
511
511
  That's all there is to it!
512
512
 
513
- Project-URL: Homepage, https://datajoint.com/docs
514
- Project-URL: Documentation, https://datajoint.com/docs
513
+ Project-URL: Homepage, https://docs.datajoint.com/
514
+ Project-URL: Documentation, https://docs.datajoint.com/
515
515
  Project-URL: Repository, https://github.com/datajoint/datajoint-python
516
516
  Project-URL: Bug Tracker, https://github.com/datajoint/datajoint-python/issues
517
517
  Project-URL: Release Notes, https://github.com/datajoint/datajoint-python/releases
@@ -589,8 +589,8 @@ Dynamic: license-file
589
589
  <tr>
590
590
  <td>Since Release</td>
591
591
  <td>
592
- <a id="commit-since-release-link" href="https://github.com/datajoint/datajoint-python/compare/v0.14.4...master">
593
- <img id="commit-since-release-img" src="https://img.shields.io/github/commits-since/datajoint/datajoint-python/v0.14.4?color=red" alt="commit since last release" />
592
+ <a id="commit-since-release-link" href="https://github.com/datajoint/datajoint-python/compare/v0.14.6...master">
593
+ <img id="commit-since-release-img" src="https://img.shields.io/github/commits-since/datajoint/datajoint-python/v0.14.6?color=red" alt="commit since last release" />
594
594
  </a>
595
595
  </td>
596
596
  </tr>
@@ -613,7 +613,7 @@ Dynamic: license-file
613
613
  <tr>
614
614
  <td>Doc Status</td>
615
615
  <td>
616
- <a href="https://datajoint.com/docs">
616
+ <a href="https://docs.datajoint.com">
617
617
  <img src="https://github.com/datajoint/datajoint-python/actions/workflows/pages/pages-build-deployment/badge.svg" alt="doc status" />
618
618
  </a>
619
619
  </td>
@@ -627,12 +627,12 @@ Dynamic: license-file
627
627
  </td>
628
628
  </tr>
629
629
  <tr>
630
- <td>Developer Chat</td>
631
- <td>
632
- <a href="https://datajoint.slack.com/">
630
+ <td>Developer Chat</td>
631
+ <td>
632
+ <a href="https://datajoint.slack.com/">
633
633
  <img src="https://img.shields.io/badge/slack-datajoint-purple.svg" alt="datajoint slack"/>
634
- </a>
635
- </td>
634
+ </a>
635
+ </td>
636
636
  </tr>
637
637
  <tr>
638
638
  <td>License</td>
@@ -643,21 +643,20 @@ Dynamic: license-file
643
643
  </td>
644
644
  </tr>
645
645
  <tr>
646
- <td>Citation</td>
647
- <td>
648
- <a href="https://doi.org/10.1101/031658">
649
- <img src="https://img.shields.io/badge/DOI-10.1101/bioRxiv.031658-B31B1B.svg" alt="bioRxiv">
650
- </a>
646
+ <td>Citation</td>
647
+ <td>
648
+ <a href="https://doi.org/10.1101/031658">
649
+ <img src="https://img.shields.io/badge/DOI-10.1101/bioRxiv.031658-B31B1B.svg" alt="bioRxiv">
650
+ </a>
651
651
  <br>
652
652
  <a href="https://doi.org/10.5281/zenodo.6829062">
653
653
  <img src="https://zenodo.org/badge/DOI/10.5281/zenodo.6829062.svg" alt="zenodo">
654
- </a>
655
- </td>
654
+ </a>
655
+ </td>
656
656
  </tr>
657
657
 
658
658
  </table>
659
659
 
660
-
661
660
  DataJoint for Python is a framework for scientific workflow management based on
662
661
  relational principles. DataJoint is built on the foundation of the relational data
663
662
  model and prescribes a consistent method for organizing, populating, computing, and
@@ -669,7 +668,7 @@ volumes of data streaming from regular experiments. Starting in 2011, DataJoint
669
668
  been available as an open-source project adopted by other labs and improved through
670
669
  contributions from several developers.
671
670
  Presently, the primary developer of DataJoint open-source software is the company
672
- DataJoint (https://datajoint.com).
671
+ DataJoint (<https://datajoint.com>).
673
672
 
674
673
  ## Data Pipeline Example
675
674
 
@@ -691,13 +690,13 @@ DataJoint (https://datajoint.com).
691
690
  pip install datajoint
692
691
  ```
693
692
 
694
- - [Documentation & Tutorials](https://datajoint.com/docs/core/datajoint-python/)
693
+ - [Documentation & Tutorials](https://docs.datajoint.com/core/datajoint-python/)
695
694
 
696
695
  - [Interactive Tutorials](https://github.com/datajoint/datajoint-tutorials) on GitHub Codespaces
697
696
 
698
- - [DataJoint Elements](https://datajoint.com/docs/elements/) - Catalog of example pipelines for neuroscience experiments
697
+ - [DataJoint Elements](https://docs.datajoint.com/elements/) - Catalog of example pipelines for neuroscience experiments
699
698
 
700
699
  - Contribute
701
- - [Contribution Guidelines](https://datajoint.com/docs/about/contribute/)
700
+ - [Contribution Guidelines](https://docs.datajoint.com/about/contribute/)
702
701
 
703
- - [Developer Guide](https://datajoint.com/docs/core/datajoint-python/latest/develop/)
702
+ - [Developer Guide](https://docs.datajoint.com/core/datajoint-python/latest/develop/)
@@ -27,6 +27,7 @@ dependencies = [
27
27
  requires-python = ">=3.9,<4.0"
28
28
  authors = [
29
29
  {name = "Dimitri Yatsenko", email = "dimitri@datajoint.com"},
30
+ {name = "Thinh Nguyen", email = "thinh@datajoint.com"},
30
31
  {name = "Raphael Guzman"},
31
32
  {name = "Edgar Walker"},
32
33
  {name = "DataJoint Contributors", email = "support@datajoint.com"},
@@ -35,7 +36,7 @@ maintainers = [
35
36
  {name = "Dimitri Yatsenko", email = "dimitri@datajoint.com"},
36
37
  {name = "DataJoint Contributors", email = "support@datajoint.com"},
37
38
  ]
38
- # manually sync here: https://datajoint.com/docs/core/datajoint-python/latest/#welcome-to-datajoint-for-python
39
+ # manually sync here: https://docs.datajoint.com/core/datajoint-python/latest/#welcome-to-datajoint-for-python
39
40
  description = "DataJoint for Python is a framework for scientific workflow management based on relational principles. DataJoint is built on the foundation of the relational data model and prescribes a consistent method for organizing, populating, computing, and querying data."
40
41
  readme = "README.md"
41
42
  license = {file = "LICENSE.txt"}
@@ -69,8 +70,8 @@ classifiers = [
69
70
  ]
70
71
 
71
72
  [project.urls]
72
- Homepage = "https://datajoint.com/docs"
73
- Documentation = "https://datajoint.com/docs"
73
+ Homepage = "https://docs.datajoint.com/"
74
+ Documentation = "https://docs.datajoint.com/"
74
75
  Repository = "https://github.com/datajoint/datajoint-python"
75
76
  "Bug Tracker" = "https://github.com/datajoint/datajoint-python/issues"
76
77
  "Release Notes" = "https://github.com/datajoint/datajoint-python/releases"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes