Orange-OpenSource / Orange-OpenSource/its-client

manage etsi magic values

Open
#477 0 comments 0 reactions 1 assignee View on GitHub

@ymorin-orange is already working on this.

Since Dec 2, 2025.

Python
Dominant language
Java
Stars
19
Forks
12
Avg merge
6d 8h
Merged PRs (30d)
3

Description

Yeah, I don't like all those magic values either; that's indeed ugly... :-(

But I don't really want to introduce constants for each such values either: given each variable may have its own special value to define it is unavailable, that would make for a lot of contants, which would not be much better...

The ETSI.si2etsi() prototype is:

class ETSI:
    def si2etsi(
        value: float | None,
        scale: float,
        undef: Optional[int] = None,
        validity_range: Optional[dict] = None,
        out_of_range: Optional[int] = None,
    ) -> int:

In retrospect, I see two issues there:

  1. the undef parameter should have been named unavailable (or undefined)
  2. the parameters should have been keyword-only, so when called, it would be obvious that the value being passed as undefined (or unavailable) was exactly that: undefined (or unavailable).

So, I would like to address this in a followup change, if that's OK for you?

Originally posted by @ymorin-orange in https://github.com/Orange-OpenSource/its-client/pull/459#discussion_r2533118386

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.