Skip to content
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
dec40f1
Stylized parallel coordinate plot
sayefsakin Mar 24, 2026
c5094a5
Version control first demo
sayefsakin Mar 26, 2026
0ac7cdb
Fixed acl in versioning
sayefsakin Mar 27, 2026
138b674
VCS: Fix permission str and cli usage.
andrewreisner Apr 23, 2026
94f7db2
VCS: create complete snapshots.
andrewreisner Apr 23, 2026
69ea3fb
VCS: track directory metadata.
andrewreisner Apr 23, 2026
e5fdadc
VCS: add delete command for staging path deletion.
andrewreisner Apr 23, 2026
c7ed643
VCS: move dsi_vcs utility under dsi, begin tests.
andrewreisner Apr 23, 2026
93a00d2
VCS: begin stubbing vcs interface in core.
andrewreisner Apr 24, 2026
10e377f
VCS:update diff and modifeid version class
sayefsakin Apr 29, 2026
7802959
VCS: update versioning tests
sayefsakin Apr 29, 2026
492ebc3
VCS: add readme file
sayefsakin Apr 29, 2026
66273cb
VCS: merged main with versioning
sayefsakin Apr 29, 2026
f6ded58
VCS: fix linter errors
sayefsakin Apr 30, 2026
495904f
VCS: fix version testers
sayefsakin Apr 30, 2026
80ad9c0
VCS: remvoed unused import
sayefsakin Apr 30, 2026
9ed208e
VCS: readme user text update
sayefsakin May 14, 2026
8093eea
VCS: remove redundant table columns
sayefsakin May 21, 2026
6a2741e
Stylized parallel coordinate plot
sayefsakin Mar 24, 2026
255c67c
Version control first demo
sayefsakin Mar 26, 2026
9f5c3cb
Fixed acl in versioning
sayefsakin Mar 27, 2026
21b915e
VCS: Fix permission str and cli usage.
andrewreisner Apr 23, 2026
51d8013
VCS: create complete snapshots.
andrewreisner Apr 23, 2026
62cc1de
VCS: track directory metadata.
andrewreisner Apr 23, 2026
e956f11
VCS: add delete command for staging path deletion.
andrewreisner Apr 23, 2026
b14e501
VCS: move dsi_vcs utility under dsi, begin tests.
andrewreisner Apr 23, 2026
da9b15f
VCS: begin stubbing vcs interface in core.
andrewreisner Apr 24, 2026
e702115
VCS:update diff and modifeid version class
sayefsakin Apr 29, 2026
870c099
VCS: update versioning tests
sayefsakin Apr 29, 2026
53e30ff
VCS: add readme file
sayefsakin Apr 29, 2026
0b5ed72
VCS: fix linter errors
sayefsakin Apr 30, 2026
1cf9181
VCS: fix version testers
sayefsakin Apr 30, 2026
4f12c2a
VCS: remvoed unused import
sayefsakin Apr 30, 2026
5d8e85f
VCS: readme user text update
sayefsakin May 14, 2026
665bd14
VCS: remove redundant table columns
sayefsakin May 21, 2026
5cb4d0d
VCS: Use Merkle tree for commits.
andrewreisner Jul 8, 2026
1b39034
Version control first demo
sayefsakin Mar 26, 2026
3455edb
Fixed acl in versioning
sayefsakin Mar 27, 2026
b8fb3d3
VCS: Fix permission str and cli usage.
andrewreisner Apr 23, 2026
5275adf
VCS: create complete snapshots.
andrewreisner Apr 23, 2026
e945c5c
VCS: track directory metadata.
andrewreisner Apr 23, 2026
f2ff6b5
VCS: add delete command for staging path deletion.
andrewreisner Apr 23, 2026
9e03619
VCS: move dsi_vcs utility under dsi, begin tests.
andrewreisner Apr 23, 2026
19eda26
VCS: begin stubbing vcs interface in core.
andrewreisner Apr 24, 2026
8257ffe
VCS:update diff and modifeid version class
sayefsakin Apr 29, 2026
f7b3e77
VCS: update versioning tests
sayefsakin Apr 29, 2026
900fa76
VCS: add readme file
sayefsakin Apr 29, 2026
d77cd54
changes to query
Apr 16, 2026
b0dccd0
refactor: changed init, query, process, and load to use two tier data…
Apr 16, 2026
1d6bb3e
refactor: updated ndp for table change
Apr 16, 2026
a0af276
refactor: minor issue fix
Apr 16, 2026
3850d5c
refactor: upgraded tests
Apr 16, 2026
101d345
refactor: updated tests for ndp dev
Apr 16, 2026
e02d641
refactor: updaated tests
Apr 16, 2026
649211d
refactor: added todos
Apr 16, 2026
7873f50
when list(collection=True) for ndp, return table name list
Vedant1 Apr 16, 2026
47ef97c
refactor: update todo
Apr 16, 2026
7934821
features: added dataset id to queries and displays + id map
Apr 17, 2026
ddb3647
feat: updated test ndp
Apr 17, 2026
1df112b
fix: linter changes
Apr 17, 2026
9387573
feat: added tests updates
Apr 17, 2026
0567bfa
fixed: improved tests and demo for dev
Apr 17, 2026
ce1aa43
fix: test core library
Apr 17, 2026
eb7c55e
fix: linter
Apr 17, 2026
aa64ff4
fix: linter
Apr 17, 2026
d970946
fix: linter
Apr 17, 2026
fbec562
refactor: add dsi errors
Apr 17, 2026
2d02291
feat: adding user tests and dsi changes
Apr 17, 2026
d09bd89
feat: added user tests
Apr 17, 2026
9c043c0
fix: added dsi test
Apr 17, 2026
af54ca5
fix: dsi test
Apr 17, 2026
74a1894
fix: dsi test errors
Apr 17, 2026
00f5295
fix: dsi test
Apr 17, 2026
c6ffbe7
staging next version
jpulidojr Apr 17, 2026
12a4b4e
cleaned up test ndp pip
jpulidojr Apr 17, 2026
5ca139a
dot fix
jpulidojr Apr 17, 2026
b530eb2
ndp future implement
jpulidojr Apr 17, 2026
649d392
added checks to list valid backends
jpulidojr Apr 17, 2026
e611e03
bypass linter
jpulidojr Apr 17, 2026
c43b8f3
fixed api access location
jpulidojr Apr 21, 2026
fa12c4a
staging intermediate changes
jpulidojr Apr 28, 2026
4d09ab1
minor update to raising error in core.ingest artifacts
Vedant1 Apr 29, 2026
582a415
updated raise errors in core to use 'from None' for exceptions
Vedant1 Apr 29, 2026
3a924b4
feat: added ndp cli changes
Apr 22, 2026
9e4e383
fix: printing issue, tested with summary, list, display, and search
Apr 22, 2026
c8f8864
added ndp to cli -b flag help
Vedant1 Apr 22, 2026
7913fad
added process() to dsi.py that converts data from one format to another
Vedant1 Apr 24, 2026
a53ac78
catch stale mount error when creating remote dir in sync.copy()
Vedant1 Apr 27, 2026
a205163
Improve error handling for remote directory creation
Vedant1 Apr 27, 2026
ec5a0f8
Add OSTI backend
Apr 28, 2026
abcbe76
fixed print spacing
jpulidojr Apr 28, 2026
42b2e1a
updated file creation skip for osti and ndp backends in user api
Vedant1 Apr 28, 2026
4ad68f4
updated sync package load in diana tutorial
Vedant1 Apr 28, 2026
7580261
updated cli startup print message
Vedant1 Apr 29, 2026
e75073d
changed clover3d dc to dublin core
jpulidojr Apr 29, 2026
ded0969
updated diana tutorial with new dc
jpulidojr Apr 29, 2026
f6bb0be
cleared outputs
jpulidojr Apr 29, 2026
4047ed1
fix: printing issue, tested with summary, list, display, and search
Apr 22, 2026
cb9df1e
added ndp to cli -b flag help
Vedant1 Apr 22, 2026
e50024f
Add OSTI backend
Apr 28, 2026
5bd7bb3
fixed print spacing
jpulidojr Apr 28, 2026
d1087f6
updated file creation skip for osti and ndp backends in user api
Vedant1 Apr 28, 2026
89baa2f
VCS: fix linter errors
sayefsakin Apr 30, 2026
c393d59
VCS: fix version testers
sayefsakin Apr 30, 2026
70a62f0
VCS: remvoed unused import
sayefsakin Apr 30, 2026
36aa787
VCS: readme user text update
sayefsakin May 14, 2026
257f729
VCS: remove redundant table columns
sayefsakin May 21, 2026
dfe822f
Merge remote-tracking branch 'upstream/versioning' into uversioning
sayefsakin Jul 15, 2026
89ec567
VCS: remove perf analyzer example
sayefsakin Jul 15, 2026
fef69ca
VCS: pyproject conflict fix
sayefsakin Jul 15, 2026
0ec125e
Merge remote-tracking branch 'upstream/versioning-update' into uversi…
sayefsakin Jul 15, 2026
0429821
VCS: merge versioning-update
sayefsakin Jul 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 69 additions & 1 deletion dsi/dsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import ast

import warnings

from dsi.utils.version_control.dsi_vcs import Version
warnings.filterwarnings("ignore", category=FutureWarning)

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -229,7 +231,7 @@ def __init__(self, filename = ".temp_dsi.db", backend_name = "Sqlite", **kwargs)
msg = f"Created an instance of DSI with the {backend_name} backend: {filename}"
else:
msg = "Created an instance of DSI"

self.vcs = None
logger.log(logging.INFO, msg) if self.silence_messages else print(msg)

def list_backends(self):
Expand Down Expand Up @@ -1257,3 +1259,69 @@ def move(self, filepath):

def fetch(self, fname):
pass

def version(self, command: str, args: str = None):
"""
Internal DSI Versioning.

`command` : str
- init # initialize a versioning repository in a root folder
- add # add file(s) to the staging area for the next commit
- remove # remove file(s) from the staging area without touching the actual files
- delete # delete file(s) from the staging area for the next commit
- commit # commit a new version with the staged file(s) and an optional message describing the version
- log # list versions
- diff # diff between two versions. If no version is provided, diff the current version with the previous version
- restore # restore a version with commit hash

`args` : str
- init: A required argument with the name of the root folder for the versioning repository.
- add: A required argument with the file(s) to add to the staging area for the next commit, specified as a space-separated string or list of file paths.
- remove: A required argument with the file(s) to remove from the staging area without touching the actual files, specified as a space-separated string or list of file paths.
- delete: A required argument with the file(s) to delete from the staging area for the next commit, specified as a space-separated string or list of file paths.
- commit: An optional message describing the version being committed, specified as a string.
- log: An optional argument to specify the number of recent versions to display, specified as an integer. If not provided, recent 5 versions are displayed.
- diff: An optional argument to specify the versions to compare, specified as a space-separated string or list of commit hashes.
- restore: A required argument to specify the version to restore, specified by its commit hash.
"""
print("hello from versioning")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest removing this print.

if command == "init":
if args is None:
raise RuntimeError("version() ERROR: 'init' command requires a 'root_folder' argument specifying the name of the root folder for the versioning repository.")

self.vcs = Version(args)
elif command == "add" and self.vcs is not None:
if args is None:
raise RuntimeError("version() ERROR: 'add' command requires a 'files' argument specifying the file(s) to add to the staging area for the next commit.")
print("-->" + self.vcs.root_folder)
self.vcs.cmd_add(args.split())
elif command == "remove" and self.vcs is not None:
if args is None:
raise RuntimeError("version() ERROR: 'remove' command requires a 'files' argument specifying the file(s) to remove from the staging area for the next commit.")
self.vcs.cmd_remove(args.split())
elif command == "delete" and self.vcs is not None:
if args is None:
raise RuntimeError("version() ERROR: 'delete' command requires a 'files' argument specifying the file(s) to delete from the repository.")
self.vcs.cmd_delete(args.split())
elif command == "commit" and self.vcs is not None:
self.vcs.cmd_commit(args)
elif command == "diff" and self.vcs is not None:
c1 = None
c2 = None
if args is not None:
arg_list = args.split()
if len(arg_list) == 1:
c1 = arg_list[0]
elif len(arg_list) == 2:
c1, c2 = arg_list
elif len(arg_list) > 2:
raise RuntimeError("version() ERROR: 'diff' command requires zero, one, or two commit hashes as arguments.")
self.vcs.cmd_diff(c1, c2)
elif command == "log" and self.vcs is not None:
self.vcs.cmd_log()
elif command == "restore" and self.vcs is not None:
if args is None:
raise RuntimeError("version() ERROR: 'restore' command requires a 'commit_hash' argument specifying the version to restore.")
self.vcs.cmd_restore(args)
else:
raise RuntimeError("version() ERROR: Invalid command or versioning repository not initialized. Please check the command and ensure 'init' has been called with a root folder argument.")
2 changes: 1 addition & 1 deletion dsi/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1396,4 +1396,4 @@ def test_terminal_ndp_close():

# After close
assert backend._loaded is False
assert len(backend._cache) == 0
assert len(backend._cache) == 0
36 changes: 35 additions & 1 deletion dsi/tests/test_dsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from pandas import DataFrame
from collections import OrderedDict
import hashlib
import random

def test_list_functions():
test = DSI()
Expand Down Expand Up @@ -1797,6 +1798,39 @@ def test_fail_overwrite_schema_duckdb_backend():
except Exception as e:
expected = "schema() ERROR: A complex schema with a circular dependency cannot be ingested into a DuckDB backend."
assert str(e) == expected

def test_versioning():
test = DSI()
wpath = os.getcwd()
test.version("init", wpath)
assert os.path.exists(wpath + "/.dsi_vcs_snapshots/.dsi_vcs.db")

# Create a file with ten random integers
dummy_file_path = os.path.join(wpath, "a_dummy_file")
with open(dummy_file_path, 'w') as f:
for _ in range(10):
f.write(str(random.randint(0, 100)) + '\n')
test.version("add", os.path.join(wpath, "a_dummy_file"))

dummy_file_path = os.path.join(wpath, "second_dummy_file")
with open(dummy_file_path, 'w') as f:
for _ in range(10):
f.write(str(random.randint(0, 100)) + '\n')
test.version("add", os.path.join(wpath, "second_dummy_file"))

dummy_file_path = os.path.join(wpath, "third_dummy_file")
with open(dummy_file_path, 'w') as f:
for _ in range(10):
f.write(str(random.randint(0, 100)) + '\n')
test.version("add", os.path.join(wpath, "third_dummy_file"))

test.version("remove", os.path.join(wpath, "second_dummy_file"))
test.version("delete", os.path.join(wpath, "third_dummy_file"))

test.version("commit", "Tester Commits")
test.version("log")
test.version("diff")
assert True


# NDP
Expand Down Expand Up @@ -1867,4 +1901,4 @@ def test_close_ndp_backend():
assert df is not None
dsi.close()

assert True
assert True
Loading