Units can have non-integer Dimension

Open
#256 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
java

Research direction

Start by reviewing the Unit.getBaseDimensions(), Dimension.getBaseDimensions(), Dimension.pow(), and Unit.pow() API contracts. The issue establishes the need for non-integer dimensions but does not choose a representation or specify compatibility requirements, so clarify that design before identifying affected implementations and tests. Done should include a defined API that supports the stated spectral-density use case.

Written by the indexing model from the issue text.

Description

deferred design

Actual physical units can have dimensions that are non-integer (most of the time square-root). This often happens with spectral densities (square root of Hertz), but also in many other domains.

This cannot be defined with the current Unit API because (1) Unit.getBaseDimensions() returns a Map<Unit, Integer>; (2) Dimsension.getBaseDimensions() returns a Map<Unit,Integer>; (3) Dimension.pow() and Unit.pow() accept only int as argument.

Dominant language
Java
Stars
195
Forks
41
PR merge metrics
No merged PRs in 30d

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.

More from unitsofmeasurement/unit-api

All issues in unitsofmeasurement/unit-api

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.