Skip to content

Commit 54c064f

Browse files
committed
exclude for rsync
1 parent 27b0855 commit 54c064f

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

lecilab_behavior_analysis/plots.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,10 @@ def performance_by_decision_plot(df: pd.DataFrame, ax: plt.Axes = None, **kwargs
769769
ax.spines["right"].set_visible(False)
770770

771771
# start the x axis at min value
772-
ax.set_xlim(left=df["trial_group"].min())
772+
try:
773+
ax.set_xlim(left=df["trial_group"].min())
774+
except Exception as e:
775+
print(f"Error setting x-axis limits: {e}")
773776

774777
return ax
775778

lecilab_behavior_analysis/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,12 +390,17 @@ def rsync_cluster_data(
390390
file_path: str,
391391
credentials: dict,
392392
local_path: str,
393+
exclude: List[str] = None,
393394
) -> bool:
394395
"""
395396
This method syncs the session data from the server to the local machine.
396397
"""
397398
remote_path = f"{credentials['username']}@{credentials['host']}:{IDIBAPS_TV_PROJECTS}{project_name}/{file_path}"
398-
rsync_command = f"rsync -avz {remote_path} {local_path}"
399+
rsync_command = "rsync -avz"
400+
if exclude:
401+
for pattern in exclude:
402+
rsync_command += f" --exclude='{pattern}'"
403+
rsync_command += f" {remote_path} {local_path}"
399404
result = subprocess.run(rsync_command, shell=True)
400405
if result.returncode != 0:
401406
print(f"Error syncing data for {file_path}: {result.stderr.decode('utf-8')}")

0 commit comments

Comments
 (0)