Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

Commit

Permalink
fix expt. path sep (Win)
Browse files Browse the repository at this point in the history
* CI: test push
* lazy logging
  • Loading branch information
Borda committed Jul 23, 2021
1 parent 01fddd7 commit 6603ca6
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 27 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/ci-experiment.yml
Expand Up @@ -29,16 +29,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

# Note: This uses an internal pip API and may not always work
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-py${{ matrix.python-version }}-
- name: install ImSegm
run: |
python --version
Expand Down Expand Up @@ -75,10 +65,3 @@ jobs:
DISPLAY: ""
run: |
bash experiments_ovary_detect/test_ovary_detect.sh
- name: remove ImSegm
env:
DISPLAY: ""
run: |
# just to not being cached
pip uninstall -y imsegm
2 changes: 1 addition & 1 deletion .github/workflows/ci-install-pkg.yml
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: Install dependenies
run: |
pip install --upgrade cython setuptools wheel check-manifest twine==3.2
pip install --upgrade cython setuptools wheel check-manifest "twine==3.2"
- name: Check package
run: |
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ci-testing.yml
Expand Up @@ -2,8 +2,7 @@ name: CI testing

# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the master branch
push:
branches: [ master ]
push: {}
pull_request: {}

jobs:
Expand All @@ -13,7 +12,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04, macOS-10.15, windows-2019]
python-version: [3.6, 3.8, 3.9]
python-version: [3.7, 3.9]
requires: ['latest']
include:
- os: ubuntu-18.04
Expand Down
2 changes: 1 addition & 1 deletion experiments_ovary_detect/run_egg_swap_orientation.py
Expand Up @@ -106,7 +106,7 @@ def main(params):
logging.info(tl_expt.string_dict(params, desc='PARAMETERS'))

list_img_paths = sorted([p for p in glob.glob(params['path_images']) if os.path.isfile(p)])
logging.info('found images: %i' % len(list_img_paths))
logging.info('found images: %i', len(list_img_paths))

if not os.path.isdir(params['path_output']):
os.mkdir(params['path_output'])
Expand Down
4 changes: 2 additions & 2 deletions experiments_ovary_detect/run_ellipse_annot_match.py
Expand Up @@ -147,7 +147,7 @@ def filter_table(df_info, path_pattern):
:return DF: filterd dataframe
"""
list_name = [os.path.splitext(os.path.basename(p))[0] for p in glob.glob(path_pattern) if os.path.isfile(p)]
logging.info('loaded item in table %i and found %i in dir' % (len(df_info), len(list_name)))
logging.info('loaded item in table %i and found %i in dir', len(df_info), len(list_name))

df_info['image_name'] = [os.path.splitext(p)[0] for p in df_info['image_path']]
df_info = df_info[df_info['image_name'].isin(list_name)]
Expand All @@ -164,7 +164,7 @@ def main(params):

df_info = pd.read_csv(params['path_infofile'], sep='\t', index_col=0)
df_info = filter_table(df_info, params['path_ellipses'])
logging.info('filtered %i item in table' % len(df_info))
logging.info('filtered %i item in table', len(df_info))
path_csv = os.path.join(params['path_output'], NAME_CSV_RESULTS)

list_evals = []
Expand Down
2 changes: 1 addition & 1 deletion experiments_ovary_detect/run_ellipse_cut_scale.py
Expand Up @@ -81,7 +81,7 @@ def perform_stage(df_group, stage, path_images, path_out, nb_workers=1):
:param str path_images: path to the image folder
:param str path_out: path to the output folder
"""
logging.info('stage %i listing %i items' % (stage, len(df_group)))
logging.info('stage %i listing %i items', stage, len(df_group))
stat_a = NORM_FUNC(df_group['ellipse_a'])
stat_b = NORM_FUNC(df_group['ellipse_b'])
norm_size = (int(stat_b), int(stat_a))
Expand Down
2 changes: 1 addition & 1 deletion imsegm/utilities/data_io.py
Expand Up @@ -236,7 +236,7 @@ def save_landmarks_csv(path_file, landmarks, dtype=float):
if not os.path.isdir(os.path.dirname(path_file)):
raise FileNotFoundError('missing "%s"' % os.path.dirname(path_file))
path_file = os.path.splitext(path_file)[0] + '.csv'
logging.debug(' save_landmarks_csv: -> creating CSV file: %s' % path_file)
logging.debug(' save_landmarks_csv: -> creating CSV file: %s', path_file)
# create the results file in CSV
landmarks = np.array(landmarks, dtype=dtype)
if not landmarks.size:
Expand Down
2 changes: 1 addition & 1 deletion imsegm/utilities/experiments.py
Expand Up @@ -172,7 +172,7 @@ def create_experiment_folder(params, dir_name, stamp_unique=True, skip_load=True
path_expt += '_' + time.strftime(FORMAT_DT, date)
if os.path.isdir(path_expt):
logging.warning('particular out folder already exists')
path_expt += ':' + str(uuid.uuid4().hex)
path_expt += '+' + str(uuid.uuid4().hex)

logging.info('creating experiment folder "{}"'.format(path_expt))
if not os.path.exists(path_expt):
Expand Down

0 comments on commit 6603ca6

Please sign in to comment.