Skip to content
Merged

dev #299

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
2e4583d
CLN: cleanup mechanism to keep track of open windows
gdementen Oct 16, 2025
dbaefd5
FEAT/FIX: added usage when using the editor as a command-line program
gdementen Oct 8, 2025
acd9739
FEAT: format large shape sizes using _ as thousands separator
gdementen Oct 16, 2025
a0b5175
FEAT: color compare() max diff label red when != 0
gdementen Oct 15, 2025
accad9b
FEAT: heavily refactored array model, adapter code and widget code
gdementen Oct 16, 2025
66149f2
FEAT: allow plotting mixed type arrays
gdementen Aug 4, 2025
c4189ec
FIX: fixed "Copy to Excel" when an hidden Excel instance exists
gdementen Aug 6, 2025
603ecc2
FEAT: added File Explorer in File menu
gdementen Oct 9, 2025
27c748b
FIX: fixed compare showing all cells white and 0 as maximum diff when…
gdementen Oct 15, 2025
96d34da
ENH/FIX: remember detected column widths & row heights
gdementen Oct 17, 2025
584f007
ENH: made text/csv adapters more robust to decoding errors
gdementen Oct 17, 2025
446c206
CLN: added asserts to make debugging easier
gdementen Oct 20, 2025
05c0a63
FEAT: added adapter for .tsv files
gdementen Oct 20, 2025
8d76c6c
FEAT: add informative error message when trying to activate a file ty…
gdementen Oct 20, 2025
3c43f0b
FEAT: added adapter for .csv.gz files
gdementen Oct 21, 2025
a3670b4
TESTS: added larger test for mixed type Pandas DataFrame
gdementen Oct 22, 2025
0835640
FEAT: added support for mixed types dataframes in H5 files
gdementen Oct 22, 2025
05ccc05
PERF: fixed performance issue on large Pandas DataFrames
gdementen Oct 22, 2025
d320d6d
FEAT: added timings to debug log
gdementen Oct 22, 2025
fb92b83
TESTS: cleaner way to define test dataframes and added test for large…
gdementen Oct 22, 2025
506cf4e
FEAT: finish implementing sort and filters on hlabels
gdementen Oct 23, 2025
211d485
DOC: update release notes
gdementen Oct 23, 2025
8aba711
FEAT: make arraymodel robust to unprintable exceptions messages
gdementen Oct 27, 2025
619ff11
CLN: misc cleanup and debug messages
gdementen Oct 27, 2025
2c9f6e8
FEAT: dispatch parquet paths to different adapters depending on avail…
gdementen Oct 28, 2025
3ec80e8
FIX: fixed CSV files adapter when charset_normalizer package is not i…
gdementen Nov 4, 2025
e9aedc1
CLN: cleanup text file adapter code
gdementen Nov 4, 2025
eeb6b57
CLN: rename for clarity
gdementen Nov 4, 2025
8d35bfc
FEAT: added SQL console when polars is present
gdementen Nov 4, 2025
6395475
FEAT: added adapter for Pandas groupby objects
gdementen Nov 6, 2025
b8ed64b
ENH: consider more extensions as text files
gdementen Nov 6, 2025
33ade6c
FEAT: added adapter for .dta files
gdementen Nov 7, 2025
3a354c9
CLN: moved adapters around for more logical order
gdementen Nov 7, 2025
db67d1e
FIX: fixed assertion in mouse selection code
gdementen Nov 7, 2025
bdc2627
FIX: fixed subtle selection issue after key navigation
gdementen Nov 7, 2025
dff3c92
FIX: fixed several issues with 1D Excel range and sheets
gdementen Nov 7, 2025
70b9ed4
FIX: close adapters when quitting the editor
gdementen Nov 12, 2025
a7d5ce6
CLN: renames for consistency or clarity
gdementen Nov 12, 2025
2ad22fb
DOC: update TODO
gdementen Oct 16, 2025
8f0b96e
FIX: EXAMPLE_EXCEL_TEMPLATES_DIR should not appear in varlist
gdementen Nov 12, 2025
253199b
FIX: updated DirectoryPathAdapter to be more robust to deleted files
gdementen Nov 12, 2025
cba7b6d
FEAT: added Type column in DirectoryPathAdapter
gdementen Nov 12, 2025
cc888b5
FEAT: added line ending detection in text file adapters
gdementen Nov 12, 2025
0256661
FIX: avoid displaying bytes as sequences
gdementen Nov 12, 2025
3d91469
FEAT: detect csv delimiter and quotes
gdementen Nov 12, 2025
3578d2e
DOC: explain why SQL console is always present when polars is available
gdementen Nov 12, 2025
207ac7d
ENH: avoid populating the back bar when going to a directory
gdementen Nov 12, 2025
b313f5e
CLN: removed unused AbstractPathAdapter
gdementen Nov 13, 2025
04b99dc
FEAT: adapters will now return a message explaining why they cannot h…
gdementen Nov 13, 2025
e0c5570
ENH: made error message more consistent with similar messages
gdementen Nov 13, 2025
7a97091
ENH: handle more file extensions using text adapter
gdementen Nov 13, 2025
c0aefa9
ENH: allow registering several suffixes for path adapters in a single…
gdementen Nov 14, 2025
aa232c3
TEST: made polars optional for tests
gdementen Nov 14, 2025
ebd3aa4
ENH: None -> '' in Sheet adapter
gdementen Nov 14, 2025
28fd076
FEAT: warn when trying to save objects we cannot save
gdementen Nov 14, 2025
d19c579
FIX: reset "back" bar when selecting a variable in the list
gdementen Nov 14, 2025
66634f3
CLN: rename for consistency
gdementen Nov 14, 2025
8d58de0
FIX: fixed dispatch_file_suffix_by_available_module requiring submodules
gdementen Nov 17, 2025
543268e
FEAT: added support for pandas index columns in pyarrow.Parquet and m…
gdementen Nov 17, 2025
f2878a5
FIX: fixed adapter for feather files (via pyarrow) with pandas indexes
gdementen Nov 17, 2025
321aee3
DOC: update changelog
gdementen Nov 18, 2025
720e12f
TEST: allow running API tests without xlwings
gdementen Nov 20, 2025
9e2f627
FIX: explicitly import matplotlib.figure
gdementen Nov 20, 2025
06473ce
FEAT: add sort by hlabel to Mapping adapter
gdementen Nov 20, 2025
fe43897
ENH: use real align function from larray 0.35 in compare
gdementen Nov 28, 2025
36ea402
MAINT: added support for Python 3.13
gdementen Dec 1, 2025
73900cc
CLN: moved constant where we use it
gdementen Dec 1, 2025
624c29d
MAINT: update dependencies in setup.py
gdementen Dec 1, 2025
e616d19
FEAT: allow comparing a dict of Arrays or Sessions (closes #230)
gdementen Dec 1, 2025
6313096
FIX: respect nans_equal=False when comparing sessions
gdementen Dec 1, 2025
5e97124
CLN: cleanup ComparatorWidget implementation
gdementen Dec 1, 2025
70b0fd8
FEAT: implemented sas7bdat adapter using Pandas
gdementen Dec 1, 2025
7a24430
FEAT: implemented dta adapter using Pandas
gdementen Dec 2, 2025
303da82
DOC: update changelog for SAS files
gdementen Dec 2, 2025
8cc8768
MAINT: modernize github actions
gdementen Dec 2, 2025
cc0cd6a
FEAT: add drive buttons to File Explorer (closes #296)
gdementen Dec 2, 2025
ab29402
MAINT: added setuptools to host requirements
gdementen Dec 12, 2025
f68f0a8
CLN: only use committed files in tests
gdementen Dec 12, 2025
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
Prev Previous commit
Next Next commit
FEAT: add drive buttons to File Explorer (closes #296)
  • Loading branch information
gdementen committed Dec 12, 2025
commit cc0cd6ab0158433c3e2f0a112b7209cec0b59069
51 changes: 45 additions & 6 deletions larray_editor/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
from qtpy.QtCore import Qt, QUrl, QSettings
from qtpy.QtGui import QDesktopServices, QKeySequence
from qtpy.QtWidgets import (QMainWindow, QWidget, QListWidget, QListWidgetItem, QSplitter, QFileDialog, QPushButton,
QDialogButtonBox, QShortcut, QVBoxLayout, QGridLayout, QLineEdit,
QDialogButtonBox, QShortcut,
QHBoxLayout, QVBoxLayout, QGridLayout, QLineEdit,
QCheckBox, QComboBox, QMessageBox, QDialog,
QInputDialog, QLabel, QGroupBox, QRadioButton,
QTabWidget)
Expand All @@ -60,7 +61,7 @@
get_documentation_url,
URLS,
RecentlyUsedList,
logger)
logger, list_drives)
from larray_editor.arraywidget import ArrayEditorWidget
from larray_editor import arrayadapter
from larray_editor.commands import EditSessionArrayCommand, EditCurrentArrayCommand
Expand Down Expand Up @@ -117,6 +118,9 @@ def __init__(self, data, title=None, readonly=False):
super().__init__(parent=None)
layout = QVBoxLayout()
self.setLayout(layout)
header_layout = self.setup_header_layout()
if header_layout is not None:
layout.addLayout(header_layout)
array_widget = ArrayEditorWidget(self, data=data, readonly=readonly)
self.array_widget = array_widget
layout.addWidget(array_widget)
Expand All @@ -131,6 +135,9 @@ def __init__(self, data, title=None, readonly=False):
# TODO: somehow determine better width
self.resize(self.default_width, self.default_height)

def setup_header_layout(self):
return None

def closeEvent(self, event):
logger.debug('EditorWindow.closeEvent()')
if self in opened_secondary_windows:
Expand All @@ -139,6 +146,37 @@ def closeEvent(self, event):
self.array_widget.close()


class FileExplorerWindow(EditorWindow):
name = "File Explorer"

def create_drive_button_clicked_callback(self, drive):
def callback():
path = Path(drive)
if not path.exists():
msg = f"The {drive} drive is currently unavailable !"
QMessageBox.critical(self, "Error", msg)
return
self.array_widget.set_data(path)
return callback

def setup_header_layout(self):
drives = list_drives()
if not drives:
return None

layout = QHBoxLayout()
for drive in drives:
if drive.endswith('\\'):
drive = drive[:-1]
button = QPushButton(drive)
button.clicked.connect(
self.create_drive_button_clicked_callback(drive)
)
layout.addWidget(button)
layout.addStretch()
return layout


class AbstractEditorWindow(QMainWindow):
"""Abstract Editor Window"""

Expand Down Expand Up @@ -818,10 +856,11 @@ def display_item_in_new_window(self, list_item):
assert isinstance(list_item, QListWidgetItem)
varname = str(list_item.text())
value = self.data[varname]
self.new_editor_window(value, varname)
self.new_editor_window(value, title=varname)

def new_editor_window(self, data, title: str, readonly: bool=False):
window = EditorWindow(data, title=title, readonly=readonly)
def new_editor_window(self, data, title: str=None, readonly: bool=False,
cls=EditorWindow):
window = cls(data, title=title, readonly=readonly)
window.show()
# this is necessary so that the window does not disappear immediately
opened_secondary_windows.append(window)
Expand Down Expand Up @@ -1477,7 +1516,7 @@ def load_example(self):
self._open_file(filepath)

def open_explorer(self):
self.new_editor_window(Path('.'), title="File Explorer", readonly=True)
self.new_editor_window(Path('.'), cls=FileExplorerWindow)


class ArrayEditorWindow(AbstractEditorWindow):
Expand Down
15 changes: 15 additions & 0 deletions larray_editor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,3 +924,18 @@ def new_func(*args, **kwargs):
return func(*args, **kwargs)
return new_func
return decorator


def list_drives():
if PY312:
return os.listdrives()
else:
try:
import win32api
drives_str = win32api.GetLogicalDriveStrings()
return [drivestr for drivestr in drives_str.split('\000')
if drivestr]
except ImportError:
logger.warning("Unable to list drives: on Python < 3.12,"
"this needs the 'win32api' module")
return []