metanorma / pubid-iec

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

Add stages names to stages.yml #129

Closed mico closed 6 months ago

mico commented 10 months ago

related #127

mico commented 6 months ago

@ronaldtse now it's accepting all project stages from list in #131, but still need to work on stages like:

opoudjis commented 6 months ago

You are raising Pubid::Iec::Errors::StageInvalidError . I am inheriting code from metanorma-iso, and I would much rather you raise one of the errors catered for there,

[Pubid::Core::Errors::HarmonizedStageCodeInvalidError, Pubid::Core::Errors::TypeStageParseError, Pubid::Core::Errors::StageInvalidError]

But I will add that error.

opoudjis commented 6 months ago

Still not working:

params = {:number=>"1000", :part=>"1-1", :type=>:ts, :publisher=>"IEC", :copublisher=>["IETF", "ISO"], :year=>"2001", :stage=>"ADTR"}

Pubid::Iec::Identifier.create(**params)

When this looks up the ADTR stage,

@stage = self.class.has_project_stage?(stage) ? self.class.resolve_project_stage(stage) : resolve_stage(stage)

self.class.has_project_stage?(stage) is false, and resolve_stage(stage) raises the error ADTR is not valid stage.

ADTR is a valid stage, and is mapped as such in code.

opoudjis commented 6 months ago

May be because stages are restricted by type, trying again...

But if the issue is that ADTR is not defined for TS, then the error message should be that ADTR is defined in IEC, but not for document type TS.

opoudjis commented 6 months ago
params = {:number=>"1000", :language=>"en", :type=>:is, :publisher=>"IEC", :year=>2023, :stage=>"60.00" }
Pubid::Iec::Identifier.create(**params).urn

Returns "urn:iec:std:iec:1000:2023:stage-:en". Unacceptable: the stage must be returned as "urn:iec:std:iec:1000:2023:stage-60.00:en"

opoudjis commented 6 months ago

stages.yaml names must include all high-level stage names: CDV MUST be included, as "Committee draft for vote". (Properly, CDV is "committee draft for vote", and CD is "committee draft"; those expansions should appear.)

so

params = {:number=>"1000", :language=>"en", :type=>:is, :publisher=>"IEC", :year=>2023, :stage=>"40.20" }
Pubid::Iec::Identifier.create(**params).typed_stage_name

I expect to see "Committee Draft for Vote International Standard". Currently I am only getting the fallback "International Standard".

opoudjis commented 6 months ago

Stage 50 is not represented among either abbreviations or names; @ronaldtse @mico can I confirm that that is intentional, and that stage 50 identifiers are indistinguishable in IEC from stage 60 identifiers?

opoudjis commented 6 months ago

After the requested updates, I can incorporate pubid-iec into metanorma-iec

mico commented 6 months ago

Stage 50 is not represented among either abbreviations or names; @ronaldtse @mico can I confirm that that is intentional, and that stage 50 identifiers are indistinguishable in IEC from stage 60 identifiers?

@opoudjis I didn't find untyped stages for 50.xx, but we have typed stages with 50.xx stage: FDAM, FDCOR, FDGuide, etc.