-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding experiment settings to folder
Added a src module because I was needing to strip suffixes in both files so it made sense to create a file for folder handling functions
- Loading branch information
Showing
6 changed files
with
75 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD | ||
|
||
from distutils.core import setup | ||
from catkin_pkg.python_setup import generate_distutils_setup | ||
|
||
# fetch values from package.xml | ||
setup_args = generate_distutils_setup( | ||
packages=['atom_batch_execution'], | ||
package_dir={'': 'src'}, | ||
) | ||
|
||
setup(**setup_args) |
Empty file.
40 changes: 40 additions & 0 deletions
40
atom_batch_execution/src/atom_batch_execution/folder_io.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import copy | ||
|
||
# Standard imports | ||
import json | ||
import os | ||
from os.path import exists | ||
|
||
import numpy as np | ||
|
||
# Opencv imports | ||
import cv2 | ||
from atom_core.joint_models import getTransformationFromJoint | ||
from atom_core.utilities import atomError, atomWarn | ||
|
||
# Ros imports | ||
import rospy | ||
import tf | ||
|
||
def stripAutomaticSuffixes(folders,args): | ||
fold_suffix_size = len(args['fold_suffix']) + 3 # because the suffix is complemented by the run number as in 001 | ||
run_suffix_size = len(args['run_suffix']) + 3 # because the suffix is complemented by the run number as in 001 | ||
suffix_size = 0 | ||
|
||
if isinstance(folders,list): | ||
|
||
if args['fold_suffix'] in folders[0]: | ||
suffix_size += fold_suffix_size | ||
if args['run_suffix'] in folders[0]: | ||
suffix_size += run_suffix_size | ||
experiments = list(set([x[:-suffix_size] for x in folders])) # Remove the "_foldXX" suffix | ||
|
||
elif isinstance(folders,str): | ||
|
||
if args['fold_suffix'] in folders: | ||
suffix_size += fold_suffix_size | ||
if args['run_suffix'] in folders: | ||
suffix_size += run_suffix_size | ||
experiments = folders[:-suffix_size] # Remove the "_foldXX" suffix | ||
|
||
return experiments |