datajoint 2.3.0__tar.gz → 2.3.2__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.
- {datajoint-2.3.0 → datajoint-2.3.2}/.github/release_drafter.yaml +1 -1
- {datajoint-2.3.0 → datajoint-2.3.2}/.github/workflows/post_draft_release_published.yaml +9 -53
- {datajoint-2.3.0 → datajoint-2.3.2}/.github/workflows/test.yaml +16 -1
- {datajoint-2.3.0 → datajoint-2.3.2}/.gitignore +3 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/.pre-commit-config.yaml +3 -1
- {datajoint-2.3.0 → datajoint-2.3.2}/PKG-INFO +8 -3
- {datajoint-2.3.0 → datajoint-2.3.2}/README.md +1 -1
- {datajoint-2.3.0 → datajoint-2.3.2}/RELEASE_MEMO.md +27 -23
- {datajoint-2.3.0 → datajoint-2.3.2}/pyproject.toml +28 -4
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/__init__.py +1 -1
- datajoint-2.3.2/src/datajoint/_version.py +24 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/autopopulate.py +48 -54
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/builtin_codecs/filepath.py +9 -5
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/builtin_codecs/hash.py +7 -5
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/builtin_codecs/npy.py +5 -3
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/builtin_codecs/object.py +5 -3
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/builtin_codecs/schema.py +3 -1
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/codecs.py +40 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/dependencies.py +57 -40
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/diagram.py +198 -224
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/expression.py +0 -6
- datajoint-2.3.2/src/datajoint/gc.py +413 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/hash_registry.py +26 -9
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/heading.py +47 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/jobs.py +7 -2
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/logging.py +18 -13
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/settings.py +16 -14
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/staged_insert.py +1 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/storage.py +10 -1
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/table.py +11 -41
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/user_tables.py +1 -9
- datajoint-2.3.2/src/datajoint/version.py +16 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/conftest.py +5 -1
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_autopopulate.py +14 -10
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_cascade_delete.py +100 -0
- datajoint-2.3.2/tests/integration/test_cascade_integrity.py +157 -0
- datajoint-2.3.2/tests/integration/test_dependencies.py +109 -0
- datajoint-2.3.2/tests/integration/test_foreign_keys.py +91 -0
- datajoint-2.3.2/tests/integration/test_gc.py +950 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_hash_storage.py +30 -17
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_jobs.py +24 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_object.py +55 -1
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_tls.py +15 -3
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_trace.py +58 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/schema_uuid.py +12 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/unit/test_codecs.py +38 -0
- datajoint-2.3.2/tests/unit/test_logging.py +70 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/unit/test_settings.py +26 -0
- datajoint-2.3.0/src/datajoint/gc.py +0 -710
- datajoint-2.3.0/src/datajoint/provenance.py +0 -206
- datajoint-2.3.0/src/datajoint/version.py +0 -4
- datajoint-2.3.0/tests/integration/test_dependencies.py +0 -52
- datajoint-2.3.0/tests/integration/test_foreign_keys.py +0 -53
- datajoint-2.3.0/tests/integration/test_gc.py +0 -467
- datajoint-2.3.0/tests/integration/test_strict_provenance.py +0 -322
- {datajoint-2.3.0 → datajoint-2.3.2}/.coveragerc +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/.dockerignore +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/.gitattributes +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/.github/DISCUSSION_TEMPLATE/rfc.yml +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/.github/ISSUE_TEMPLATE/improvement_request.md +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/.github/dependabot.yml +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/.github/workflows/close_inactive_issues_prs.yaml +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/.github/workflows/draft_release.yaml +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/.github/workflows/lint.yaml +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/CHANGELOG-archive.md +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/CONTRIBUTING.md +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/Dockerfile +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/LICENSE +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/activate.sh +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/docker-compose.yaml +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/images/pipeline.png +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/images/pipeline.svg +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/pixi.lock +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/adapters/__init__.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/adapters/base.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/adapters/mysql.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/adapters/postgres.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/blob.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/builtin_codecs/__init__.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/builtin_codecs/attach.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/builtin_codecs/blob.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/cli.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/condition.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/connection.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/declare.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/deploy.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/errors.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/instance.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/lineage.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/migrate.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/objectref.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/preview.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/schemas.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/spark.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/storage_adapter.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/types.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/src/datajoint/utils.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/__init__.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/__init__.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/data/Course.csv +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/data/CurrentTerm.csv +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/data/Department.csv +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/data/Enroll.csv +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/data/Grade.csv +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/data/Section.csv +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/data/Student.csv +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/data/StudentMajor.csv +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/data/Term.csv +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_aggr_regressions.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_alter.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_attach.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_blob.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_blob_matlab.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_cascading_delete.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_cli.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_codec_chaining.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_codecs.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_connection.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_declare.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_erd.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_fetch.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_fetch_same.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_groupby.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_hidden_job_metadata.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_insert.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_json.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_multi_backend.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_nan.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_npy_codec.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_privileges.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_reconnection.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_relation.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_relation_u.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_relational_operand.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_schema.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_schema_keywords.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_semantic_matching.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_skip_duplicates.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_type_aliases.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_university.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_update1.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_utils.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_uuid.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/integration/test_virtual_module.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/schema.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/schema_advanced.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/schema_aggr_regress.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/schema_alter.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/schema_codecs.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/schema_external.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/schema_object.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/schema_privileges.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/schema_simple.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/schema_type_aliases.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/schema_university.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/test_package.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/unit/__init__.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/unit/test_adapters.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/unit/test_condition.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/unit/test_connection_warning.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/unit/test_declare_hidden_attribute.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/unit/test_deploy.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/unit/test_fetch_compat.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/unit/test_lazy_imports.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/unit/test_pk_rules.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/unit/test_spark.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/unit/test_storage_adapter.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/unit/test_storage_urls.py +0 -0
- {datajoint-2.3.0 → datajoint-2.3.2}/tests/unit/test_thread_safe.py +0 -0
|
@@ -28,7 +28,7 @@ categories:
|
|
|
28
28
|
- title: '📝 Documentation'
|
|
29
29
|
label: 'documentation'
|
|
30
30
|
change-template: '- $TITLE(#$NUMBER)@$AUTHOR'
|
|
31
|
-
change-title-escapes: '\<*_
|
|
31
|
+
change-title-escapes: '\<*_&@#' # escape @ and # so decorator/issue refs in PR titles (e.g. `@schema`) don't render as spurious mentions/links in release notes.
|
|
32
32
|
template: |
|
|
33
33
|
$CHANGES
|
|
34
34
|
|
|
@@ -12,9 +12,8 @@ run-name: Post ${{ github.event.release.name }}
|
|
|
12
12
|
jobs:
|
|
13
13
|
pypi-release:
|
|
14
14
|
permissions:
|
|
15
|
-
# write permission is required to
|
|
15
|
+
# write permission is required to upload build artifacts as release assets
|
|
16
16
|
contents: write
|
|
17
|
-
pull-requests: write
|
|
18
17
|
# Use the oldest supported version to build, just in case there are issues
|
|
19
18
|
# for our case, this doesn't matter that much, since the build is for 3.x
|
|
20
19
|
strategy:
|
|
@@ -33,32 +32,10 @@ jobs:
|
|
|
33
32
|
uses: actions/checkout@v4
|
|
34
33
|
with:
|
|
35
34
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
sed -i "s/^__version__ = .*/__version__ = \"$VERSION\"/" src/datajoint/version.py
|
|
41
|
-
cat src/datajoint/version.py
|
|
42
|
-
# Commit the changes
|
|
43
|
-
BRANCH_NAME="update-version-$VERSION"
|
|
44
|
-
git switch -c $BRANCH_NAME
|
|
45
|
-
git config --global user.name "github-actions"
|
|
46
|
-
git config --global user.email "github-actions@github.com"
|
|
47
|
-
git add src/datajoint/version.py
|
|
48
|
-
git commit -m "Update version.py to $VERSION"
|
|
49
|
-
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
|
|
50
|
-
- name: Update README.md badge
|
|
51
|
-
run: |
|
|
52
|
-
# commits since the last release
|
|
53
|
-
NEW_HREF="https://github.com/datajoint/datajoint-python/compare/${{ github.event.release.tag_name }}...master"
|
|
54
|
-
NEW_SRC="https://img.shields.io/github/commits-since/datajoint/datajoint-python/${{ github.event.release.tag_name }}?color=red"
|
|
55
|
-
# Update href in the <a> tag
|
|
56
|
-
sed -i 's|\(<a id="commit-since-release-link"[^>]*href="\)[^"]*\(".*\)|\1'"$NEW_HREF"'\2|' README.md
|
|
57
|
-
# Update src in the <img> tag
|
|
58
|
-
sed -i 's|\(<img id="commit-since-release-img"[^>]*src="\)[^"]*\(".*\)|\1'"$NEW_SRC"'\2|' README.md
|
|
59
|
-
git add README.md
|
|
60
|
-
# Only commit if there are changes (handles re-runs gracefully)
|
|
61
|
-
git diff --cached --quiet README.md || git commit -m "Update README.md badge to ${{ github.event.release.tag_name }}"
|
|
35
|
+
# Full history + tags so hatch-vcs can derive the version from the
|
|
36
|
+
# release tag. The checked-out ref is the tag itself, so the build
|
|
37
|
+
# reports exactly X.Y.Z — no version.py bump or follow-up PR needed.
|
|
38
|
+
fetch-depth: 0
|
|
62
39
|
- name: Set up Python ${{matrix.py_ver}}
|
|
63
40
|
uses: actions/setup-python@v5
|
|
64
41
|
with:
|
|
@@ -73,34 +50,24 @@ jobs:
|
|
|
73
50
|
python -m build .
|
|
74
51
|
echo "DJ_WHEEL_PATH=$(ls dist/datajoint-*.whl)" >> $GITHUB_ENV
|
|
75
52
|
echo "DJ_SDIST_PATH=$(ls dist/datajoint-*.tar.gz)" >> $GITHUB_ENV
|
|
76
|
-
echo "NEW_VERSION=${{github.event.release.resolved_version}}" >> $GITHUB_ENV
|
|
77
53
|
- name: Publish package
|
|
78
54
|
id: publish
|
|
79
55
|
env:
|
|
80
56
|
RELEASE_NAME: ${{ github.event.release.name }}
|
|
81
57
|
run: |
|
|
82
|
-
|
|
58
|
+
python -m pip install --upgrade twine
|
|
83
59
|
if [[ "$RELEASE_NAME" =~ ^Test ]]; then
|
|
84
|
-
LATEST_PYPI=$(curl -s https://test.pypi.org/pypi/datajoint/json | jq -r '.info.version')
|
|
85
60
|
echo "TEST_PYPI=true" >> $GITHUB_ENV
|
|
86
61
|
export TWINE_REPOSITORY="testpypi"
|
|
87
62
|
export TWINE_USERNAME=${TWINE_TEST_USERNAME}
|
|
88
63
|
export TWINE_PASSWORD=${TWINE_TEST_PASSWORD}
|
|
89
64
|
else
|
|
90
|
-
LATEST_PYPI=$(curl -s https://pypi.org/pypi/datajoint/json | jq -r '.info.version')
|
|
91
65
|
echo "TEST_PYPI=false" >> $GITHUB_ENV
|
|
92
66
|
export TWINE_REPOSITORY="pypi"
|
|
93
67
|
fi
|
|
94
|
-
#
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
-e TWINE_USERNAME=${TWINE_USERNAME} \
|
|
98
|
-
-e TWINE_PASSWORD=${TWINE_PASSWORD} \
|
|
99
|
-
-e TWINE_REPOSITORY=${TWINE_REPOSITORY} \
|
|
100
|
-
app sh -c "pip install twine && python -m twine upload dist/*"
|
|
101
|
-
else
|
|
102
|
-
echo "::warning::Latest version $LATEST_PYPI on $TWINE_REPOSITORY is the new version $NEW_VERSION"
|
|
103
|
-
fi
|
|
68
|
+
# Upload the artifacts built in the previous step. --skip-existing
|
|
69
|
+
# keeps re-runs idempotent (no error if the version already exists).
|
|
70
|
+
python -m twine upload --skip-existing dist/*
|
|
104
71
|
# Upload package as release assets
|
|
105
72
|
- name: Upload pip wheel asset to release
|
|
106
73
|
uses: actions/upload-release-asset@v1
|
|
@@ -120,17 +87,6 @@ jobs:
|
|
|
120
87
|
asset_path: ${{env.DJ_SDIST_PATH}}
|
|
121
88
|
asset_name: pip-datajoint-${{ github.event.release.tag_name }}.tar.gz
|
|
122
89
|
asset_content_type: application/gzip
|
|
123
|
-
- name: Create Pull Request
|
|
124
|
-
env:
|
|
125
|
-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
126
|
-
run: |
|
|
127
|
-
git push origin ${{ env.BRANCH_NAME }}
|
|
128
|
-
gh pr create \
|
|
129
|
-
--title "[github-actions]Update version.py to ${{ github.event.release.name }}" \
|
|
130
|
-
--body "This PR updates \`version.py\` to match the latest release: ${{ github.event.release.name }}" \
|
|
131
|
-
--base master \
|
|
132
|
-
--head ${{ env.BRANCH_NAME }} \
|
|
133
|
-
--reviewer dimitri-yatsenko,drewyangdev,ttngu207
|
|
134
90
|
- name: Post release notification to Slack
|
|
135
91
|
if: ${{ env.TEST_PYPI == 'false' }}
|
|
136
92
|
uses: slackapi/slack-github-action@v2.0.0
|
|
@@ -27,6 +27,18 @@ on:
|
|
|
27
27
|
jobs:
|
|
28
28
|
test:
|
|
29
29
|
runs-on: ubuntu-latest
|
|
30
|
+
strategy:
|
|
31
|
+
fail-fast: false
|
|
32
|
+
matrix:
|
|
33
|
+
# Python: exercise both ends of the supported range (requires-python
|
|
34
|
+
# >=3.10,<3.15); version-pinned pixi environments live in pyproject.toml
|
|
35
|
+
# under [tool.pixi.environments].
|
|
36
|
+
environment: [test-py310, test-py314]
|
|
37
|
+
# MySQL: exercise both LTS lines we support / that AWS RDS runs. 8.0 uses
|
|
38
|
+
# the datajoint image (SSL configured); 8.4 uses the official image (TLS
|
|
39
|
+
# tests already skip outside external containers). See #1497.
|
|
40
|
+
mysql-image: ["datajoint/mysql:8.0", "mysql:8.4"]
|
|
41
|
+
name: test (${{ matrix.environment }}, mysql=${{ matrix.mysql-image }})
|
|
30
42
|
steps:
|
|
31
43
|
- uses: actions/checkout@v4
|
|
32
44
|
|
|
@@ -35,9 +47,12 @@ jobs:
|
|
|
35
47
|
with:
|
|
36
48
|
cache: true
|
|
37
49
|
locked: false
|
|
50
|
+
environments: ${{ matrix.environment }}
|
|
38
51
|
|
|
39
52
|
- name: Run tests
|
|
40
|
-
|
|
53
|
+
env:
|
|
54
|
+
DJ_TEST_MYSQL_IMAGE: ${{ matrix.mysql-image }}
|
|
55
|
+
run: pixi run -e ${{ matrix.environment }} test-cov
|
|
41
56
|
|
|
42
57
|
# Unit tests run without containers (faster feedback)
|
|
43
58
|
unit-tests:
|
|
@@ -28,6 +28,9 @@ share/python-wheels/
|
|
|
28
28
|
*.egg
|
|
29
29
|
MANIFEST
|
|
30
30
|
|
|
31
|
+
# Version file generated at build time by hatch-vcs (see pyproject.toml)
|
|
32
|
+
src/datajoint/_version.py
|
|
33
|
+
|
|
31
34
|
# PyInstaller
|
|
32
35
|
# Usually these files are written by a python script from a template
|
|
33
36
|
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: datajoint
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.2
|
|
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
|
Project-URL: Homepage, https://docs.datajoint.com/
|
|
6
6
|
Project-URL: Documentation, https://docs.datajoint.com/
|
|
@@ -207,11 +207,16 @@ Classifier: Intended Audience :: Healthcare Industry
|
|
|
207
207
|
Classifier: Intended Audience :: Science/Research
|
|
208
208
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
209
209
|
Classifier: Programming Language :: Python
|
|
210
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
211
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
212
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
213
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
214
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
210
215
|
Classifier: Topic :: Scientific/Engineering
|
|
211
216
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
212
217
|
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
213
218
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
214
|
-
Requires-Python: <3.
|
|
219
|
+
Requires-Python: <3.15,>=3.10
|
|
215
220
|
Requires-Dist: deepdiff
|
|
216
221
|
Requires-Dist: fsspec>=2023.1.0
|
|
217
222
|
Requires-Dist: networkx
|
|
@@ -267,7 +272,7 @@ DataJoint is a framework for scientific data pipelines based on the **Relational
|
|
|
267
272
|
- **Tables represent workflow steps** — Each table is a step in your pipeline
|
|
268
273
|
- **Foreign keys encode dependencies** — Parent tables must be populated before child tables
|
|
269
274
|
- **Computations are declarative** — Define *what* to compute; DataJoint handles *when*
|
|
270
|
-
- **Results are immutable** — Full
|
|
275
|
+
- **Results are immutable** — Full lineage and reproducibility
|
|
271
276
|
|
|
272
277
|
**Documentation:** https://docs.datajoint.com
|
|
273
278
|
|
|
@@ -5,7 +5,7 @@ DataJoint is a framework for scientific data pipelines based on the **Relational
|
|
|
5
5
|
- **Tables represent workflow steps** — Each table is a step in your pipeline
|
|
6
6
|
- **Foreign keys encode dependencies** — Parent tables must be populated before child tables
|
|
7
7
|
- **Computations are declarative** — Define *what* to compute; DataJoint handles *when*
|
|
8
|
-
- **Results are immutable** — Full
|
|
8
|
+
- **Results are immutable** — Full lineage and reproducibility
|
|
9
9
|
|
|
10
10
|
**Documentation:** https://docs.datajoint.com
|
|
11
11
|
|
|
@@ -4,13 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
| Branch | Purpose | Version |
|
|
6
6
|
|--------|---------|---------|
|
|
7
|
-
| `master` | Main development | 2.
|
|
8
|
-
| `maint/2.0` | Maintenance releases | 2.0.x |
|
|
9
|
-
|
|
10
|
-
For 2.0.x bugfixes:
|
|
11
|
-
1. Commit to `maint/2.0`
|
|
12
|
-
2. Tag and release as v2.0.x
|
|
13
|
-
3. Cherry-pick to master if applicable
|
|
7
|
+
| `master` | Main development | 2.3.x |
|
|
14
8
|
|
|
15
9
|
---
|
|
16
10
|
|
|
@@ -68,10 +62,11 @@ The release drafter uses PR labels to categorize changes:
|
|
|
68
62
|
|
|
69
63
|
| Label | Category |
|
|
70
64
|
|-------|----------|
|
|
71
|
-
| `breaking` |
|
|
72
|
-
| `
|
|
73
|
-
| `
|
|
74
|
-
| `
|
|
65
|
+
| `breaking` | 💥 Breaking Changes |
|
|
66
|
+
| `feature` | 🚀 Features |
|
|
67
|
+
| `enhancement` | ⚡️ Enhancements |
|
|
68
|
+
| `bug` | 🐛 Bug Fixes |
|
|
69
|
+
| `documentation` | 📝 Documentation |
|
|
75
70
|
|
|
76
71
|
Ensure PRs have appropriate labels before merging.
|
|
77
72
|
|
|
@@ -87,20 +82,23 @@ Ensure PRs have appropriate labels before merging.
|
|
|
87
82
|
- Set release name to `Release X.Y.Z`
|
|
88
83
|
- Set tag to `vX.Y.Z`
|
|
89
84
|
- Review and edit release notes
|
|
90
|
-
4. **Publish the release**
|
|
85
|
+
4. **Publish the release** — this creates the `vX.Y.Z` tag.
|
|
91
86
|
5. Automation will:
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
- Create PR to merge version update back to master
|
|
87
|
+
- Build from the tag and publish to PyPI
|
|
88
|
+
- Attach the wheel/sdist as release assets
|
|
95
89
|
|
|
96
90
|
### Version Note
|
|
97
91
|
|
|
98
|
-
The release drafter computes version from the previous tag. You may need to
|
|
92
|
+
The release drafter computes the version from the previous tag. You may need to
|
|
93
|
+
**manually edit** the release name/tag for major version changes.
|
|
99
94
|
|
|
100
|
-
The
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
95
|
+
The package version is **derived from the git tag** at build time by
|
|
96
|
+
[hatch-vcs](https://github.com/ofek/hatch-vcs) (see `[tool.hatch.version]` in
|
|
97
|
+
`pyproject.toml`) — the tag is the single source of truth. There is **no
|
|
98
|
+
`version.py` value to bump** and **no follow-up version PR**: publishing the
|
|
99
|
+
`vX.Y.Z` tag is what sets the version everywhere (`pip install`, `pip show`, and
|
|
100
|
+
`datajoint.__version__`). Do not hand-edit `src/datajoint/version.py`; it only
|
|
101
|
+
re-exports the build-generated `_version.py`.
|
|
104
102
|
|
|
105
103
|
---
|
|
106
104
|
|
|
@@ -155,11 +153,16 @@ If the bot doesn't create a PR, manually update the feedstock:
|
|
|
155
153
|
run:
|
|
156
154
|
- python >={{ python_min }}
|
|
157
155
|
- numpy
|
|
156
|
+
- pymysql >=0.7.2
|
|
157
|
+
- deepdiff
|
|
158
|
+
- pyparsing
|
|
158
159
|
- pandas
|
|
159
|
-
-
|
|
160
|
-
-
|
|
160
|
+
- tqdm
|
|
161
|
+
- networkx
|
|
162
|
+
- pydot
|
|
163
|
+
- fsspec >=2023.1.0
|
|
164
|
+
- pydantic-settings >=2.0.0
|
|
161
165
|
- packaging
|
|
162
|
-
# ... etc
|
|
163
166
|
```
|
|
164
167
|
|
|
165
168
|
5. **Submit PR** to the feedstock
|
|
@@ -215,6 +218,7 @@ After build completes:
|
|
|
215
218
|
|
|
216
219
|
- @datajointbot
|
|
217
220
|
- @dimitri-yatsenko
|
|
221
|
+
- @MilagrosMarin
|
|
218
222
|
- @ttngu207
|
|
219
223
|
|
|
220
224
|
## Links
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["hatchling"]
|
|
2
|
+
requires = ["hatchling", "hatch-vcs"]
|
|
3
3
|
build-backend = "hatchling.build"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
@@ -19,7 +19,7 @@ dependencies = [
|
|
|
19
19
|
"packaging",
|
|
20
20
|
]
|
|
21
21
|
|
|
22
|
-
requires-python = ">=3.10,<3.
|
|
22
|
+
requires-python = ">=3.10,<3.15"
|
|
23
23
|
authors = [
|
|
24
24
|
{name = "Dimitri Yatsenko", email = "dimitri@datajoint.com"},
|
|
25
25
|
{name = "Thinh Nguyen", email = "thinh@datajoint.com"},
|
|
@@ -57,6 +57,11 @@ keywords = [
|
|
|
57
57
|
# https://pypi.org/classifiers/
|
|
58
58
|
classifiers = [
|
|
59
59
|
"Programming Language :: Python",
|
|
60
|
+
"Programming Language :: Python :: 3.10",
|
|
61
|
+
"Programming Language :: Python :: 3.11",
|
|
62
|
+
"Programming Language :: Python :: 3.12",
|
|
63
|
+
"Programming Language :: Python :: 3.13",
|
|
64
|
+
"Programming Language :: Python :: 3.14",
|
|
60
65
|
"Development Status :: 5 - Production/Stable",
|
|
61
66
|
"Intended Audience :: Science/Research",
|
|
62
67
|
"Intended Audience :: Healthcare Industry",
|
|
@@ -214,7 +219,14 @@ module = [
|
|
|
214
219
|
ignore_errors = true
|
|
215
220
|
|
|
216
221
|
[tool.hatch.version]
|
|
217
|
-
|
|
222
|
+
# Version is derived from the git tag at build time (hatch-vcs), so the tag is
|
|
223
|
+
# the single source of truth: `pip install git+...@vX.Y.Z` reports X.Y.Z. The
|
|
224
|
+
# resolved version is written to the generated (git-ignored) src/datajoint/_version.py
|
|
225
|
+
# by the build hook below; src/datajoint/version.py reads it back at runtime.
|
|
226
|
+
source = "vcs"
|
|
227
|
+
|
|
228
|
+
[tool.hatch.build.hooks.vcs]
|
|
229
|
+
version-file = "src/datajoint/_version.py"
|
|
218
230
|
|
|
219
231
|
[tool.hatch.build.targets.wheel]
|
|
220
232
|
packages = ["src/datajoint"]
|
|
@@ -250,10 +262,22 @@ datajoint = { path = ".", editable = true, extras = ["test"] }
|
|
|
250
262
|
[tool.pixi.feature.dev.pypi-dependencies]
|
|
251
263
|
datajoint = { path = ".", editable = true, extras = ["dev", "test"] }
|
|
252
264
|
|
|
265
|
+
# Pin the interpreter for the min/max supported versions so CI can exercise
|
|
266
|
+
# both ends of the requires-python range (see .github/workflows/test.yaml).
|
|
267
|
+
[tool.pixi.feature.py310.dependencies]
|
|
268
|
+
python = "3.10.*"
|
|
269
|
+
|
|
270
|
+
[tool.pixi.feature.py314.dependencies]
|
|
271
|
+
python = "3.14.*"
|
|
272
|
+
|
|
253
273
|
[tool.pixi.environments]
|
|
254
274
|
default = { solve-group = "default" }
|
|
255
275
|
dev = { features = ["dev"], solve-group = "default" }
|
|
256
276
|
test = { features = ["test"], solve-group = "default" }
|
|
277
|
+
# Version-pinned test environments (each solves independently — a solve-group
|
|
278
|
+
# cannot span different Python versions).
|
|
279
|
+
test-py310 = { features = ["test", "py310"] }
|
|
280
|
+
test-py314 = { features = ["test", "py314"] }
|
|
257
281
|
|
|
258
282
|
[tool.pixi.tasks]
|
|
259
283
|
# Tests use testcontainers - no manual setup required
|
|
@@ -265,7 +289,7 @@ services-down = "docker compose down"
|
|
|
265
289
|
test-external = { cmd = "DJ_USE_EXTERNAL_CONTAINERS=1 pytest tests/", depends-on = ["services-up"] }
|
|
266
290
|
|
|
267
291
|
[tool.pixi.dependencies]
|
|
268
|
-
python = ">=3.10,<3.
|
|
292
|
+
python = ">=3.10,<3.15"
|
|
269
293
|
graphviz = ">=13.1.2,<14"
|
|
270
294
|
|
|
271
295
|
[tool.pixi.activation]
|
|
@@ -284,7 +284,7 @@ _lazy_modules = {
|
|
|
284
284
|
"diagram": (".diagram", None), # Return the module itself
|
|
285
285
|
# cli imports click
|
|
286
286
|
"cli": (".cli", "cli"),
|
|
287
|
-
# gc — exposed lazily so `dj.gc.
|
|
287
|
+
# gc — exposed lazily so `dj.gc.GarbageCollector(...)` works as documented in gc.py
|
|
288
288
|
# and in the user docs (how-to/garbage-collection.md).
|
|
289
289
|
"gc": (".gc", None), # Return the module itself
|
|
290
290
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# file generated by vcs-versioning
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"__version__",
|
|
7
|
+
"__version_tuple__",
|
|
8
|
+
"version",
|
|
9
|
+
"version_tuple",
|
|
10
|
+
"__commit_id__",
|
|
11
|
+
"commit_id",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
version: str
|
|
15
|
+
__version__: str
|
|
16
|
+
__version_tuple__: tuple[int | str, ...]
|
|
17
|
+
version_tuple: tuple[int | str, ...]
|
|
18
|
+
commit_id: str | None
|
|
19
|
+
__commit_id__: str | None
|
|
20
|
+
|
|
21
|
+
__version__ = version = '2.3.2'
|
|
22
|
+
__version_tuple__ = version_tuple = (2, 3, 2)
|
|
23
|
+
|
|
24
|
+
__commit_id__ = commit_id = None
|
|
@@ -22,6 +22,14 @@ if TYPE_CHECKING:
|
|
|
22
22
|
|
|
23
23
|
logger = logging.getLogger(__name__.split(".")[0])
|
|
24
24
|
|
|
25
|
+
# Parallel populate hands the live table and its open connection to workers by
|
|
26
|
+
# process inheritance, so it requires the `fork` start method. Python 3.14
|
|
27
|
+
# changed the default from `fork` to `forkserver`, which pickles the payload
|
|
28
|
+
# instead — that neither carries a live DB connection nor the table's internal
|
|
29
|
+
# state, and it deadlocks. Pin to `fork` where available (all POSIX platforms);
|
|
30
|
+
# fall back to the platform default elsewhere.
|
|
31
|
+
_MP_START_METHOD = "fork" if "fork" in mp.get_all_start_methods() else None
|
|
32
|
+
|
|
25
33
|
|
|
26
34
|
# --- helper functions for multiprocessing --
|
|
27
35
|
|
|
@@ -30,7 +38,8 @@ def _initialize_populate(table: Table, jobs: Job | None, populate_kwargs: dict[s
|
|
|
30
38
|
"""
|
|
31
39
|
Initialize a worker process for multiprocessing.
|
|
32
40
|
|
|
33
|
-
|
|
41
|
+
Stores the inherited table on the worker process and reconnects to database
|
|
42
|
+
(the parent closes its connection before forking; each worker reopens one).
|
|
34
43
|
|
|
35
44
|
Parameters
|
|
36
45
|
----------
|
|
@@ -80,6 +89,11 @@ class AutoPopulate:
|
|
|
80
89
|
Query yielding keys to be populated. Default is join of FK parents.
|
|
81
90
|
jobs : Job
|
|
82
91
|
Job table (``~~table_name``) for distributed processing.
|
|
92
|
+
upstream : Diagram
|
|
93
|
+
Pre-restricted ancestor view for the current ``make(self, key)`` call
|
|
94
|
+
(property). Available only inside ``make()``; built lazily on first
|
|
95
|
+
access and memoized for the call. See the property docstring for
|
|
96
|
+
details.
|
|
83
97
|
|
|
84
98
|
Notes
|
|
85
99
|
-----
|
|
@@ -89,7 +103,8 @@ class AutoPopulate:
|
|
|
89
103
|
_key_source = None
|
|
90
104
|
_allow_insert = False
|
|
91
105
|
_jobs = None
|
|
92
|
-
_upstream = None #
|
|
106
|
+
_upstream = None # memoized upstream trace for the current make(); built lazily on first use
|
|
107
|
+
_upstream_key = None # current make() key; not None iff executing inside make()
|
|
93
108
|
|
|
94
109
|
@property
|
|
95
110
|
def upstream(self):
|
|
@@ -102,10 +117,11 @@ class AutoPopulate:
|
|
|
102
117
|
(or ``FreeTable``, when indexed by a string) for any ancestor of
|
|
103
118
|
``self``.
|
|
104
119
|
|
|
105
|
-
Reading via ``self.upstream`` is the
|
|
106
|
-
|
|
107
|
-
and indexing a non-ancestor
|
|
108
|
-
|
|
120
|
+
Reading via ``self.upstream`` is the recommended pattern for the
|
|
121
|
+
make() reproducibility contract: the framework guarantees the
|
|
122
|
+
restriction matches the current ``key``, and indexing a non-ancestor
|
|
123
|
+
table raises ``DataJointError``. See
|
|
124
|
+
:doc:`reference/specs/autopopulate` for the contract.
|
|
109
125
|
|
|
110
126
|
Raises
|
|
111
127
|
------
|
|
@@ -122,12 +138,19 @@ class AutoPopulate:
|
|
|
122
138
|
traces = self.upstream[ExtractTraces].to_arrays("trace")
|
|
123
139
|
self.insert1({**key, "summary": compute(traces, date)})
|
|
124
140
|
"""
|
|
125
|
-
if self.
|
|
141
|
+
if self._upstream_key is None:
|
|
126
142
|
raise DataJointError(
|
|
127
143
|
"self.upstream is only available inside make(). "
|
|
128
144
|
"Outside make(), construct a trace explicitly: "
|
|
129
145
|
"dj.Diagram.trace(self & key)."
|
|
130
146
|
)
|
|
147
|
+
if self._upstream is None:
|
|
148
|
+
# Build the trace lazily on first access and memoize it for this
|
|
149
|
+
# make() call, so make() calls that never read self.upstream pay
|
|
150
|
+
# nothing. See #1493.
|
|
151
|
+
from .diagram import Diagram
|
|
152
|
+
|
|
153
|
+
self._upstream = Diagram.trace(self & self._upstream_key)
|
|
131
154
|
return self._upstream
|
|
132
155
|
|
|
133
156
|
class _JobsDescriptor:
|
|
@@ -476,7 +499,9 @@ class AutoPopulate:
|
|
|
476
499
|
if hasattr(self.connection._conn, "ctx"):
|
|
477
500
|
del self.connection._conn.ctx
|
|
478
501
|
with (
|
|
479
|
-
mp.Pool(
|
|
502
|
+
mp.get_context(_MP_START_METHOD).Pool(
|
|
503
|
+
processes, _initialize_populate, (self, None, populate_kwargs)
|
|
504
|
+
) as pool,
|
|
480
505
|
tqdm(desc="Processes: ", total=nkeys) if display_progress else contextlib.nullcontext() as progress_bar,
|
|
481
506
|
):
|
|
482
507
|
for status in pool.imap(_call_populate1, keys, chunksize=1):
|
|
@@ -572,7 +597,9 @@ class AutoPopulate:
|
|
|
572
597
|
if hasattr(self.connection._conn, "ctx"):
|
|
573
598
|
del self.connection._conn.ctx # SSLContext is not pickleable
|
|
574
599
|
with (
|
|
575
|
-
mp.Pool(
|
|
600
|
+
mp.get_context(_MP_START_METHOD).Pool(
|
|
601
|
+
processes, _initialize_populate, (self, self.jobs, populate_kwargs)
|
|
602
|
+
) as pool,
|
|
576
603
|
tqdm(desc="Processes: ", total=nkeys)
|
|
577
604
|
if display_progress
|
|
578
605
|
else contextlib.nullcontext() as progress_bar,
|
|
@@ -651,40 +678,11 @@ class AutoPopulate:
|
|
|
651
678
|
logger.jobs(f"Making {key} -> {self.full_table_name}")
|
|
652
679
|
self.__class__._allow_insert = True
|
|
653
680
|
|
|
654
|
-
#
|
|
655
|
-
# `
|
|
656
|
-
#
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
self._upstream = Diagram.trace(self & dict(key))
|
|
660
|
-
|
|
661
|
-
# If strict_provenance is on, push the active-make context so the
|
|
662
|
-
# runtime gates in expression.cursor / table.insert can check this
|
|
663
|
-
# make()'s reads and writes. The context is popped in the finally
|
|
664
|
-
# block below.
|
|
665
|
-
strict_token = None
|
|
666
|
-
if self.connection._config.get("strict_provenance", False):
|
|
667
|
-
from .provenance import push_strict_make_context
|
|
668
|
-
from .user_tables import Part
|
|
669
|
-
|
|
670
|
-
allowed_tables = set(self._upstream._cascade_restrictions.keys()) | {self.full_table_name}
|
|
671
|
-
# Add Part tables of self to the allowed set. Use class __dict__
|
|
672
|
-
# (not dir/getattr) to avoid triggering descriptors like the
|
|
673
|
-
# _JobsDescriptor that lazy-declares the ~~ job table.
|
|
674
|
-
for cls in type(self).__mro__:
|
|
675
|
-
for attr_name, attr in cls.__dict__.items():
|
|
676
|
-
if attr_name.startswith("_"):
|
|
677
|
-
continue
|
|
678
|
-
if isinstance(attr, type) and issubclass(attr, Part):
|
|
679
|
-
# Instantiate to get full_table_name resolved against
|
|
680
|
-
# this schema. The Part class is already attached via
|
|
681
|
-
# @schema decoration of the master.
|
|
682
|
-
try:
|
|
683
|
-
part_ftn = attr().full_table_name
|
|
684
|
-
allowed_tables.add(part_ftn)
|
|
685
|
-
except Exception:
|
|
686
|
-
pass
|
|
687
|
-
strict_token = push_strict_make_context(self, frozenset(allowed_tables), dict(key))
|
|
681
|
+
# Record the key for a lazily-constructed upstream view. The trace is
|
|
682
|
+
# built on first `self.upstream` access (see the `upstream` property),
|
|
683
|
+
# so make() calls that never read upstream pay nothing. See #1493.
|
|
684
|
+
self._upstream_key = dict(key)
|
|
685
|
+
self._upstream = None
|
|
688
686
|
|
|
689
687
|
try:
|
|
690
688
|
if not is_generator:
|
|
@@ -743,15 +741,13 @@ class AutoPopulate:
|
|
|
743
741
|
return True
|
|
744
742
|
finally:
|
|
745
743
|
self.__class__._allow_insert = False
|
|
746
|
-
# Clear the per-make() upstream
|
|
747
|
-
#
|
|
748
|
-
#
|
|
744
|
+
# Clear the per-make() upstream state: `_upstream = None` invalidates
|
|
745
|
+
# the memoized Diagram; `_upstream_key = None` restores the "outside
|
|
746
|
+
# make()" state so subsequent `self.upstream` access raises a clear
|
|
747
|
+
# error via the property guard rather than silently returning a stale
|
|
748
|
+
# trace from the previous call.
|
|
749
749
|
self._upstream = None
|
|
750
|
-
|
|
751
|
-
if strict_token is not None:
|
|
752
|
-
from .provenance import pop_strict_make_context
|
|
753
|
-
|
|
754
|
-
pop_strict_make_context(strict_token)
|
|
750
|
+
self._upstream_key = None
|
|
755
751
|
|
|
756
752
|
def progress(self, *restrictions: Any, display: bool = False) -> tuple[int, int]:
|
|
757
753
|
"""
|
|
@@ -866,8 +862,6 @@ class AutoPopulate:
|
|
|
866
862
|
|
|
867
863
|
pk_condition = make_condition(self, key, set())
|
|
868
864
|
self.connection.query(
|
|
869
|
-
f"UPDATE {self.full_table_name} SET "
|
|
870
|
-
"_job_start_time=%s, _job_duration=%s, _job_version=%s "
|
|
871
|
-
f"WHERE {pk_condition}",
|
|
865
|
+
f"UPDATE {self.full_table_name} SET _job_start_time=%s, _job_duration=%s, _job_version=%s WHERE {pk_condition}",
|
|
872
866
|
args=(start_time, duration, version[:64] if version else ""),
|
|
873
867
|
)
|
|
@@ -22,8 +22,10 @@ class FilepathCodec(Codec):
|
|
|
22
22
|
|
|
23
23
|
This codec gives users maximum freedom in organizing their files while
|
|
24
24
|
reusing DataJoint's store configuration. Files can be placed anywhere
|
|
25
|
-
in the store EXCEPT the reserved
|
|
26
|
-
|
|
25
|
+
in the store EXCEPT the reserved sections managed by DataJoint (the
|
|
26
|
+
hash-addressed and schema-addressed sections — from each store's
|
|
27
|
+
``hash_prefix`` and ``schema_prefix`` settings, defaults ``_hash`` and
|
|
28
|
+
``_schema``).
|
|
27
29
|
|
|
28
30
|
This is useful when:
|
|
29
31
|
- Files are managed externally (e.g., by acquisition software)
|
|
@@ -54,7 +56,8 @@ class FilepathCodec(Codec):
|
|
|
54
56
|
JSON metadata: ``{path, store, size, timestamp}``
|
|
55
57
|
|
|
56
58
|
Reserved Sections:
|
|
57
|
-
Paths cannot start with
|
|
59
|
+
Paths cannot start with the store's reserved ``hash_prefix`` or
|
|
60
|
+
``schema_prefix`` sections (defaults ``_hash/`` and ``_schema/``).
|
|
58
61
|
|
|
59
62
|
Warning:
|
|
60
63
|
The file must exist in the store at the specified path.
|
|
@@ -78,7 +81,8 @@ class FilepathCodec(Codec):
|
|
|
78
81
|
Parameters
|
|
79
82
|
----------
|
|
80
83
|
value : str
|
|
81
|
-
Relative path within the store. Cannot use
|
|
84
|
+
Relative path within the store. Cannot use the store's reserved
|
|
85
|
+
hash/schema sections.
|
|
82
86
|
key : dict, optional
|
|
83
87
|
Primary key values (unused).
|
|
84
88
|
store_name : str, optional
|
|
@@ -92,7 +96,7 @@ class FilepathCodec(Codec):
|
|
|
92
96
|
Raises
|
|
93
97
|
------
|
|
94
98
|
ValueError
|
|
95
|
-
If path uses reserved
|
|
99
|
+
If path uses the store's reserved hash/schema sections.
|
|
96
100
|
FileNotFoundError
|
|
97
101
|
If file does not exist in the store.
|
|
98
102
|
"""
|