astropy / astropy/astropy

Add an option to frame_transform_graph.lookup_name to raise error

Open
#6,740 0 comments 0 reactions 0 assignees View on GitHub
coordinates Feature Request
Dominant language
Python
Stars
5.3k
Forks
2.2k
Avg merge
1d 18h
Merged PRs (30d)
74

Description

The ``frame_transform_graph.lookup_name`` function is very helpful, but it would be nice to raise an exception if the frame is not known. At the moment it simply returns ``None``:

```python
In [18]: frame_transform_graph.lookup_name('banana')

In [19]:
```

If it would likely break too many use cases to raise an exception by default, it would be nice to at least add a keyword argument to control this.

cc @cdeil

Contributor guide

Open the contributing guide

Research direction

Start by locating frame_transform_graph.lookup_name and its existing tests, then verify how an unknown frame such as 'banana' is handled. Done means callers can request an exception for unknown frames through an option, with the existing default behavior considered and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend-api-design
Issue type
Feature
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.