From 6c0a05d59801fa6b95c54925b2e8a6fc4a720e89 Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Fri, 30 Oct 2026 16:48:51 +0800 Subject: [PATCH] Release 2.2.13: pin data v2.2.0 with primary references and equivalence classes Submodule to unitsdb v2.2.0 (#135 #136 #130 #134 chain): primary quantity references, L1 equivalence classes, 121 generated canonical conversions, the IEC 62720 coverage report, and the schema-validation PR gate. Models gain the two new optional attributes (QuantityReference primary, Quantity equivalence_class) so round-trip specs hold; specs track UNITS_DATA_VERSION 2.2.0 and the 2.2.0 fixture version. UNITS_DATA_VERSION = 2.2.0. --- data | 2 +- lib/unitsdb/quantity.rb | 1 + lib/unitsdb/quantity_reference.rb | 1 + lib/unitsdb/version.rb | 4 ++-- spec/unitsdb/bundled_data_spec.rb | 4 ++-- spec/unitsdb/database/loader_currencies_spec.rb | 4 ++-- spec/unitsdb/database_currency_finders_spec.rb | 2 +- 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/data b/data index 5c3d143..c2c7d18 160000 --- a/data +++ b/data @@ -1 +1 @@ -Subproject commit 5c3d143b13c72a26eea94cbf152e4c8f274db4d8 +Subproject commit c2c7d181f07f414520d91fafa831922e56db6469 diff --git a/lib/unitsdb/quantity.rb b/lib/unitsdb/quantity.rb index 01c0852..5b63e64 100644 --- a/lib/unitsdb/quantity.rb +++ b/lib/unitsdb/quantity.rb @@ -6,6 +6,7 @@ class Quantity < Lutaml::Model::Serializable attribute :quantity_type, :string attribute :names, LocalizedString, collection: true attribute :short, :string + attribute :equivalence_class, :string attribute :unit_references, UnitReference, collection: true attribute :dimension_reference, DimensionReference attribute :references, ExternalReference, collection: true diff --git a/lib/unitsdb/quantity_reference.rb b/lib/unitsdb/quantity_reference.rb index 1fb782f..9ca9cc0 100644 --- a/lib/unitsdb/quantity_reference.rb +++ b/lib/unitsdb/quantity_reference.rb @@ -4,6 +4,7 @@ module Unitsdb class QuantityReference < Identifier attribute :id, :string attribute :type, :string + attribute :primary, :boolean end Config.register_model(QuantityReference, id: :quantity_reference) diff --git a/lib/unitsdb/version.rb b/lib/unitsdb/version.rb index e6506d1..37f1ada 100644 --- a/lib/unitsdb/version.rb +++ b/lib/unitsdb/version.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true module Unitsdb - VERSION = "2.2.12" + VERSION = "2.2.13" # The version of the bundled UnitsDB data (from the data/ submodule). # This version corresponds to a tag/commit in https://github.com/unitsml/unitsdb. - UNITS_DATA_VERSION = "2.1.1" + UNITS_DATA_VERSION = "2.2.0" end diff --git a/spec/unitsdb/bundled_data_spec.rb b/spec/unitsdb/bundled_data_spec.rb index 5edd21a..246b6de 100644 --- a/spec/unitsdb/bundled_data_spec.rb +++ b/spec/unitsdb/bundled_data_spec.rb @@ -46,7 +46,7 @@ db = described_class.database expect(db).to be_a(Unitsdb::Database) - expect(db.schema_version).to eq("2.1.0") + expect(db.schema_version).to eq("2.2.0") expect(described_class.database).to equal(db) end @@ -70,7 +70,7 @@ %w[prefixes dimensions units quantities unit_systems].each do |entity| file_path = File.join(data_dir, "#{entity}.yaml") hash = YAML.safe_load_file(file_path) - expect(hash["schema_version"]).to eq("2.1.0"), + expect(hash["schema_version"]).to eq("2.2.0"), "Expected #{entity}.yaml to have schema_version 2.0.0, got #{hash['schema_version']}" end end diff --git a/spec/unitsdb/database/loader_currencies_spec.rb b/spec/unitsdb/database/loader_currencies_spec.rb index c7b588c..9333771 100644 --- a/spec/unitsdb/database/loader_currencies_spec.rb +++ b/spec/unitsdb/database/loader_currencies_spec.rb @@ -19,7 +19,7 @@ it "loads a directory without currencies.yaml with an empty collection" do database = described_class.load(legacy_dir) - expect(database["schema_version"]).to eq("2.1.0") + expect(database["schema_version"]).to eq("2.2.0") expect(database["currencies"]).to eq([]) end @@ -44,7 +44,7 @@ it "accepts a present currencies.yaml at the supported version" do File.write(File.join(legacy_dir, "currencies.yaml"), <<~YAML) - schema_version: "2.1.0" + schema_version: "2.2.0" currencies: [] YAML diff --git a/spec/unitsdb/database_currency_finders_spec.rb b/spec/unitsdb/database_currency_finders_spec.rb index 527bf7d..4997da8 100644 --- a/spec/unitsdb/database_currency_finders_spec.rb +++ b/spec/unitsdb/database_currency_finders_spec.rb @@ -21,7 +21,7 @@ end let(:fixture_currencies) do <<~YAML - schema_version: "2.1.0" + schema_version: "2.2.0" currencies: - identifiers: - type: iso4217