imagej / imagej/pyimagej

ImgLabeling conversions use suboptimal tmp directory

Open
#286 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
534
Forks
95
PR merge metrics
No merged PRs in 30d

Description

In the `Labeling <-> ImgLabeling` conversion code in `convert.py`, temporary paths of the form `"./tmp"` and `os.getcwd() + "/tmp"` are used. There are a couple of issues with this:

1. Inconsistency between those two expressions.
2. Use of forward slashes might not work as expected on Windows (testing probably needed).
3. Creation and use of temp folders from the CWD is generally considered bad practice. Better is to use dedicated temp file management functions of the language standard library. In Python this would be the [`tempfile` module](https://docs.python.org/3/library/tempfile.html).

Contributor guide

No contributing guide indexed for this repository

Research direction

Read the Labeling ImgLabeling conversion code in convert.py and compare its two temporary-path expressions. Consult Python's tempfile module documentation, then run the existing conversion tests and add or perform Windows-focused testing to verify temporary paths work consistently and are not created from the current working directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.