metanorma / pubid-iec

PubID spec and implementation for IEC deliverables
BSD 2-Clause "Simplified" License
2 stars 0 forks source link

Change "STAGES" mapping to use strings for codes not floating point numbers #93

Closed ronaldtse closed 1 year ago

ronaldtse commented 1 year ago

https://github.com/metanorma/pubid-iec/blob/2985b8a4224899fd80cd42821be0f140c9534e59/lib/pubid/iec/renderer/urn.rb#L3-L53

The stage codes are static values and do not represent real numbers, e.g. "20.99" is not "20.99000", "00.00" is not "0.0". While we can support parsing of real numbers into the stage codes, we cannot support invalid stages like "20.991".

I suggest that we extract a library to work with harmonized stage codes into pubid-core as they are both used in ISO and IEC.

ronaldtse commented 1 year ago

Related to https://github.com/metanorma/pubid-iso/issues/48

mico commented 1 year ago

Because of https://github.com/metanorma/pubid-iso/issues/48 I'm also working on mapping stage codes to letter code, but there are cases when several letter codes could have the same stage and substage codes, e.g.:

 ADTR: "40.99"
 ADTS: "40.99"
 AFDIS: "40.99"
 PRVD: "50.60"
 PRVDISH: "50.60"
 PRVDPAS: "50.60"
 PRVDTR: "50.60"
 PRVDTS: "50.60"

For example when I'm creating identifier using Pubid::Iec::Identifier.new(number: 1234, stage: "40.99") I could get few options, e.g.:

How do we choose?

ronaldtse commented 1 year ago

These abbreviations are combined stage codes with the document type. There is no ambiguation in the list of codes in the previous comment.