Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use an object to represent lookup results: Atmospheric::Result #43

Open
ronaldtse opened this issue Feb 7, 2025 · 0 comments
Open

Use an object to represent lookup results: Atmospheric::Result #43

ronaldtse opened this issue Feb 7, 2025 · 0 comments

Comments

@ronaldtse
Copy link
Contributor

The ideal approach should be like this.

Each "row" is a separate Atmospheric::Result object. You can use geometric altitude or geopotential altitude (with unit) to build the object.

The different tables will obtain their data from this object. Then we don't have to work with Hashes anymore.

class Atmospheric
  def self.values_at(parameter_name, unit, value)
    Atmospheric::Result.new(
      # ... geopotential_altitude ... unit ...
      # ... geometric_altitude ... unit ...
    )
  end
end
class Atmospheric::Result < Lutaml::Model::Serialization
  attribute :geopotential_altitude, :decimal
  attribute :geopotential_altitude_unit, :string
  attribute :geometric_altitude, :decimal
  attribute :geometric_altitude_unit, :string
  attribute :temperature, :float
  attribute :temperature_unit, :string
  attribute :ppn, :float
  attribute :ppn_unit, :string
  attribute :speed_of_sound, :float
  attribute :speed_of_sound_unit, :string
  # ... other result attributes
end

Originally posted by @ronaldtse in #42 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant