Open alex-rakowski opened 1 year ago
save func alterations:
def write(
filepath,
data,
mode = 'w',
emdpath = None,
tree = True,
):
would need to be rewritten as:
def write(
data,
filepath = None,
mode = 'w',
emdpath = None,
tree = True,
):
...
if filepath is None:
Tk().withdraw()
filepath = asksavefilename()
...
read func alterations:
filepath: Union[str,Path],
datapath: Optional[str] = None,
tree: Optional[Union[bool,str]] = True,
verbose: Optional[bool] = False,
**kwargs,
):
would need to be rewritten as:
filepath: Union[str,Path] = None,
datapath: Optional[str] = None,
tree: Optional[Union[bool,str]] = True,
verbose: Optional[bool] = False,
**kwargs,
):
...
if filepath is None:
Tk().withdraw()
filepath = askopenfilename()
...
@bsavitzky do you this would have any weird knock on effects? Particularly on the emdfile side.
Summarizing dev team discussion:
The main concern folks have it adding tkinter as a dependency, and whether this will cause distribution issues. Some additional clarification about possible issues here would help.
This feature likely would not work under some configurations - e.g. running py4DSTEM through an ssh tunnel. If we move forward with this, let's make sure to use a try/except statement and throw a sensible error in cases where this fails.
Is your feature request related to a problem? Please describe. Loading/saving files could be easier for some users if they had a GUI to handle paths Describe the solution you'd like
Pop up window that allows file navigation through system menu
Additional context Basic code is something like
I think the
py4DSTEM.read()
andpy4DSTEM.save()
functions should be altered so if called with no file path arguments it defaults to this method, rather than having an additional methods like ~py4DSTEM.read_gui()