Skip to content

implement unimplemented functions & make new types #252

Description

@derekmorr

We have several undefined types and partial functions in squants. We should fix these for the next release:

~/squants/shared/src/main/scala/squants % grep -r "???" .
./electro/Capacitance.scala:  def /(that: Length) = ??? // returns Permittivity
./electro/ElectricCharge.scala:  def /(that: Length) = ??? // returns LinearElectricChargeDensity
./electro/ElectricCharge.scala:  def /(that: Area) = ??? // returns AreaElectricChargeDensity
./electro/ElectricCharge.scala:  def /(that: Volume) = ??? // returns ElectricChargeDensity
./electro/ElectricCharge.scala:  def /(that: Mass) = ??? // returns ElectricChargeMassRatio
./electro/ElectricCurrent.scala:  def /(that: Length) = ??? // returns MagneticFieldStrength
./electro/ElectricCurrent.scala:  def /(that: Area) = ??? // returns ElectricCurrentDensity
./electro/ElectricPotential.scala:  def /(that: Length) = ??? // returns ElectricFieldStrength
./electro/Inductance.scala:  def /(that: Length) = ??? // returns Permeability
./energy/Energy.scala:  def /(that: ChemicalAmount) = ??? // return MolarEnergy
./energy/Energy.scala:  def /(that: Area) = ??? // Insolation, Energy Area Density
./energy/Power.scala:  def /(that: Volume) = ??? // Power Density
./energy/SpecificEnergy.scala:  def /(that: Time) = ??? // returns AbsorbedEnergyRate
./market/Money.scala:  def primaryUnit = ??? // Should not be used with Money - drawn from MoneyContext instead
./market/Money.scala:  def siUnit = ??? // Should not be used with Money - drawn from MoneyContext instead
./market/Money.scala:  def units = ??? // Should not be used with Money - drawn from MoneyContext instead
./market/Money.scala:  protected def converterFrom: Double ⇒ Double = ???
./market/Money.scala:  protected def converterTo: Double ⇒ Double = ???
./mass/ChemicalAmount.scala:  def /(that: Volume) = ??? // returns SubstanceConcentration
./motion/Force.scala:  def /(that: Length) = ??? // return SurfaceTension
./motion/Pressure.scala:  def *(that: Time) = ??? // returns DynamicViscosity
./space/Volume.scala:  def /(that: Mass) = ??? // returns SpecificVolume (inverse of Density)
./space/Volume.scala:  def /(that: ChemicalAmount) = ??? // return MolarVolume

Not all of these can be implemented (the ones in Money for example), but for many of the rest we should just get it done. This can be spread across multiple maintainers so the burden doesn't fall on one person.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions