Closed opoudjis closed 6 months ago
https://github.com/metanorma/metanorma-iec/issues/154 has been stuck for a very long time; please work on this soon.
@mico You have not populated names: in stages.yaml, therefore id.typed_stage_name is continuing to crash.
I am typing in the names myself from https://www.iec.ch/standards-development/stage-codes
This ticket is NOT YET DONE. The error I highlighted above with 50.20 triggering a floating point error is still there.
@ronaldtse DO NOT CLOSE TICKETS THAT YOU HAVE NO ASSURANCE ARE CLOSED. YOU ARE WASTING MY TIME BY HAVING ME CHECK INTEGRATIONS THAT ARE NOT YET READY.
@mico I am not going to keep telling you what to fix. You can find the PR with the pubid-iec integration at https://github.com/metanorma/metanorma-iec/pull/254 . You make it work.
Over and above the functionality required above, I need the ability to map an arbitrary supplied stage abbreviation to its harmonised code; e.g. given ADTR, recover 40.99
.
Currently, I'm attempting this at:
def iso_id_stage(node)
ret = "#{get_stage(node)}.#{get_substage(node)}"
/[A-Z]/.match?(ret) and
ret = Pubid::Iec::Identifier.config
.stages["abbreviations"][get_stage(node)]
/^\d\d\.\d\d$/.match?(ret) or ret = "10.20" # ret = nil
ret
end
But Pubid::Iec::Identifier.config.stages["abbreviations"]
does not contain all the typed abbreviations of pubid-iec: ATDR for example is hidden in lib/pubid/iec/identifier/technical_report.rb
So you also need to provide me a function mapping any stage abbreviation to its code. FWIW, I will know the document type at the time of lookup; so I can create e.g. Pubid::Iec::Identifier.create(type: :tr, number: 0)
which is_a?
Pubid::Iec::Identifier::TechnicalReport
.
If you then expose a method like Pubid::Iec::Identifier.stage_abbrev_to_code
, which is inherited by Pubid::Iec::Identifier::TechnicalReport
, I can recover the value of ADTR
, and you do not need to move the stage definitions out of each subclass.
stages.yaml needs a subset of the following added:
names:
ACD: Approved for CD
ACDV: Approved for CDV
ADTR: Approved for DTR
ADTS: Approved for DTS
APUB: Approved for publication
BPUB: Being published
CAN: Draft cancelled
CD: Draft circulated as CD
CDM: CD to be discussed at meeting
CCDV: Draft circulated as CDV
CDISH: Draft circulated as DISH
CDVM: Rejected CDV to be discussed at a meeting
CFDIS: Draft circulated as FDIS
CDPAS: Draft circulated as DPAS
CDTR: Draft circulated as DTR
CDTS: Draft circulated as DTS
DTRM: Rejected DTR to be discussed at meeting
DTSM: Rejected DTS to be discussed at meeting
DECDISH: DISH at editing check
DECFDIS: FDIS at editing check
DECPUB: Publication at editing check
DEL: Deleted/abandoned
DELPUB: Deleted publication
MERGED: Merged
NCDV: CDV rejected
NDTR: DTR rejected
NDTS: DTS rejected
NFDIS: FDIS rejected
PCC: Preparation of CC
PNW: New work item proposal
PPUB: Publication issued
PRVC: Preparation of RVC
PRVDISH: Preparation of RVDISH
PRVD: Preparation of RVD
PRVDPAS: Preparation of RVDPAS
PRVDTR: Preparation of RVDTR
PRVDTS: Preparation of RVDTS
PRVN: Preparation of RVN
PWI: Preliminary work item
RDISH: DISH received and registered
RFDIS: FDIS received and registered
RPUB: Publication received and registered
SPLIT: Split
TCDV: Translation of CDV
TDISH: Translation of DISH
TDTR: Translation of DTR
TDTS: Translation of DTS
TPUB: Translation of publication
WPUB: Publication withdrawn
Many of these are already included in the identifier subclass definitions. So you will need to sort through them.
This ticket is NOT YET DONE. The error I highlighted above with 50.20 triggering a floating point error is still there.
@ronaldtse DO NOT CLOSE TICKETS THAT YOU HAVE NO ASSURANCE ARE CLOSED. YOU ARE WASTING MY TIME BY HAVING ME CHECK INTEGRATIONS THAT ARE NOT YET READY.
@mico I am not going to keep telling you what to fix. You can find the PR with the pubid-iec integration at metanorma/metanorma-iec#254 . You make it work.
@opoudjis I was going to make separate tickets from this one. There are too many tasks in one ticket. Don't mix several tasks in one ticket next time, so it will be easier to track progress.
id.amendments&.first&.stage&.name id.corrigendums&.first&.stage&.name
@opoudjis Amendments and corrigendum for IEC don't have types stages, so you will always get nil
for these cases
There's a lot of commotion here, and would be great if we can minimize them in tickets...
In any case I am wondering what are the typed-stages we are missing? Can we make up a list of what's missing and fill them in?
I think all @opoudjis wants is a mapping from the typed-stage-abbrev to the harmonized code.
This is now resolved.
I am using pubid-iec in metanorma-iec pretty much the same way that I am using pubid-iso in metanorma-iso. ISO and IEC have the same specification for identifiers, and the IEC gem inherits heavily from ISO.
I note that I am missing functionality in pubid-iec that is available in pubid-iso.
I need the following to be working in pubid-iec just as it is in pubid-iso
When in doubt, expose the same things in IEC that you do in ISO.
In addition, the stage abbreviations listing in the config YAML, https://github.com/metanorma/pubid-iec/blob/main/stages.yaml , is insufficient: all of the following type-specific stage abbreviations need to be included, since we allow users to enter them in Metanorma. (The metanorma-iec test of that is ADTR.)
For their definitions, see https://www.iec.ch/standards-development/stage-codes
It turns out you have these stages in lib/pubid/iec/renderer/urn.rb , but they need to be in config so I can query them. And for that matter, that list is more full.
Docstages that are not in your list, such as 50.20, are causing errors in URN generation:
stage.to_s is returning "" because there is no abbreviation defined. This is presumably your mechanism for working out whether the stage is defined for IEC, but your list of stages is incomplete, and IEC is very explicit that CFDIS = 5020 is a stage that International Standards go through: hhttps://www.iec.ch/system/files/2023-05/StageCodes_IS_v2.pdf
50.20 is in fact legal (it is included in the list above), and is not triggering abort as an unrecognised state (or at least, should not be!)