diff --git a/ADES_Description.pdf b/ADES_Description.pdf index dcbf64f..7c0f4f0 100644 Binary files a/ADES_Description.pdf and b/ADES_Description.pdf differ diff --git a/Python/ades/maketexfiles b/Python/ades/maketexfiles index f859c62..708de77 100755 --- a/Python/ades/maketexfiles +++ b/Python/ades/maketexfiles @@ -4,5 +4,5 @@ # setenv SRC $argv[1] foreach table ( elementstable simpletypestable grouptypestable ades ) -${SRC}/Python/bin/applyxslt ${SRC}/xml/adesmaster.xml ${SRC}/xslt/latex//doc{$table}.xslt > {$table}.tex +${SRC}/Python/ades/applyxslt ${SRC}/xml/adesmaster.xml ${SRC}/xslt/latex//doc{$table}.xslt > {$table}.tex end diff --git a/Python/ades/valutility.py b/Python/ades/valutility.py index 726c9a1..92a09b9 100644 --- a/Python/ades/valutility.py +++ b/Python/ades/valutility.py @@ -4,14 +4,9 @@ from __future__ import unicode_literals import traceback -import sys -import argparse import re from ades import adesutility -from ades import convertutility -import io - def validate_schema(schema_name, schema, candidate, out): # diff --git a/README.txt b/README.txt index 5cfd1d7..7d9ee57 100644 --- a/README.txt +++ b/README.txt @@ -1,3 +1,7 @@ +22-Dec-2025 - Changed the length of the obssubID field from 25 to 35 chars + # Allow submission of old-style provIDs (e.g. A988 CA) + # Some clean-up + 06-Oct-2025 - Moved python code from Python/bin to Python/ades; release iau-ades package # All python code has been moved from Python/bin to Python/ades to support code packaging # Existing scripts that utilize ADES-Master by modifying the computing environment diff --git a/ades_master.pdf b/ades_master.pdf index a3778a8..23088fb 100644 Binary files a/ades_master.pdf and b/ades_master.pdf differ diff --git a/doc/ADES_Description_02May2024.docx b/attic/ADES_Description_02May2024.docx similarity index 100% rename from doc/ADES_Description_02May2024.docx rename to attic/ADES_Description_02May2024.docx diff --git a/doc/ades_master_02May2024.pdf b/attic/ades_master_02May2024.pdf similarity index 100% rename from doc/ades_master_02May2024.pdf rename to attic/ades_master_02May2024.pdf diff --git a/doc/ADES_Description_22Dec2025.docx b/doc/ADES_Description_22Dec2025.docx new file mode 100644 index 0000000..73052f2 Binary files /dev/null and b/doc/ADES_Description_22Dec2025.docx differ diff --git a/doc/README.docs b/doc/README.docs index 1ea2914..11c4047 100644 --- a/doc/README.docs +++ b/doc/README.docs @@ -6,7 +6,7 @@ steps 2 & 3 can be neglected.) 1) Update MS Word documentation, starting from ./doc directory: a) Copy ADES_Description_.docx to ../attic b) Rename ADES_Description_.docx to show current date - c) Edit and save ADES_Description_].docx, including updates to + c) Edit and save ADES_Description_.docx, including updates to date on cover page and change log in front matter d) Save PDF version of ADES_Description_.docx to ../ADES_Description.pdf e) Close MS Word @@ -28,5 +28,13 @@ steps 2 & 3 can be neglected.) makexsdfiles cd .. -4) You should now be in the repo root. Final step is to commit and +4) Update adesmaster.xml in Python/ades/data/xml + cd xml/ + cp adesmaster.xml ../Python/ades/data/xml/ + cd .. + +5) Be sure you have added the tests to prove that changes you made + to adesmaster.xml still works + +6) You should now be in the repo root. Final step is to commit and push branch. diff --git a/doc/ades_master_22Dec2025.pdf b/doc/ades_master_22Dec2025.pdf new file mode 100644 index 0000000..23088fb Binary files /dev/null and b/doc/ades_master_22Dec2025.pdf differ diff --git a/doc/docsrc/makedoc b/doc/docsrc/makedoc index 9cf54ea..804c00e 100755 --- a/doc/docsrc/makedoc +++ b/doc/docsrc/makedoc @@ -1,9 +1,9 @@ #!/usr/bin/env csh #set tex="/usr/local/texlive/2016/bin/x86_64-darwin/" set tex="/Library/Tex/texbin/" -#set tex="/bin" +#set tex="/ades" ./cleanup -../../Python/bin/maketexfiles "../.." +../../Python/ades/maketexfiles "../.." $tex/latex ades.tex $tex/latex ades.tex $tex/dvips ades.dvi diff --git a/pyproject.toml b/pyproject.toml index 2906017..0636c78 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,6 +2,7 @@ name = "iau-ades" dynamic = ['version'] dependencies = [ + "json5", "lxml", "xmltodict", "pyyaml" diff --git a/tests/input/obssubid_35char.xml b/tests/input/obssubid_35char.xml new file mode 100644 index 0000000..fcd163f --- /dev/null +++ b/tests/input/obssubid_35char.xml @@ -0,0 +1,72 @@ + + + + + + X05 + Vera C. Rubin Observatory + + + V. Rubin PreopsLSSTCam + Vera C. Rubin Observatory + + + P. H. Bernardinelli + A. Heinze + M. Juric + J. Kurlander + J. Moeyens + + + Modified Paul-Baker + 8.4 + CCD + 1.234 + 0.2 + + + astrometry LSST Science Pipelines + LSST Science Pipelines + heliolincx + + National Science Foundation; Department of Energy + + line ADES generated and submitted using B612 Asteroid Institute ADAM mpcq + + + + + cb00090 + LSST-AP-DS-NNNNNNNNNNNNNNNNNNNN + CCD + X05 + 2025-04-22T02:38:05.222Z + 187.572904 + +6.924455 + 0.027 + 0.034 + Gaia3 + 21.209 + 0.029 + Li + Gaia3 + + + cb00090 + LSST-DP1-DS-NNNNNNNNNNNNNNNNNNNN + CCD + X05 + 2025-04-22T02:41:45.334Z + 187.572460 + +6.924549 + 0.027 + 0.034 + Gaia3 + 21.213 + 0.029 + Li + Gaia3 + + + + \ No newline at end of file diff --git a/tests/input/old_style_provid.xml b/tests/input/old_style_provid.xml new file mode 100644 index 0000000..086f9d0 --- /dev/null +++ b/tests/input/old_style_provid.xml @@ -0,0 +1,72 @@ + + + + + + X05 + Vera C. Rubin Observatory + + + V. Rubin PreopsLSSTCam + Vera C. Rubin Observatory + + + P. H. Bernardinelli + A. Heinze + M. Juric + J. Kurlander + J. Moeyens + + + Modified Paul-Baker + 8.4 + CCD + 1.234 + 0.2 + + + astrometry LSST Science Pipelines + LSST Science Pipelines + heliolincx + + National Science Foundation; Department of Energy + + line ADES generated and submitted using B612 Asteroid Institute ADAM mpcq + + + + + A899 CA + LSST-AP-DS-NNNNNNNNNNNNNNNNNNNN + CCD + X05 + 2025-04-22T02:38:05.222Z + 187.572904 + +6.924455 + 0.027 + 0.034 + Gaia3 + 21.209 + 0.029 + Li + Gaia3 + + + A899 CA + LSST-DP1-DS-NNNNNNNNNNNNNNNNNNNN + CCD + X05 + 2025-04-22T02:41:45.334Z + 187.572460 + +6.924549 + 0.027 + 0.034 + Gaia3 + 21.213 + 0.029 + Li + Gaia3 + + + + \ No newline at end of file diff --git a/tests/test_validation.py b/tests/test_validation.py index 2ad417c..fbab8c3 100644 --- a/tests/test_validation.py +++ b/tests/test_validation.py @@ -1,11 +1,13 @@ -''' -Test the validation scripts -''' +""" +General validation, which also includes the files generated by the MPC +that could in principle have additional fields +""" -#Import global -import os +# Import global +import os +import pytest import subprocess -import sys + from ades import valgeneral from ades import valall @@ -14,46 +16,53 @@ from ades import adesutility -''' -General validation, which also includes the files generated by the MPC -that could in principle have additional fields -''' - # ------------------------ # valgeneral -def test_valgeneral(): - xmlfile = "input/obs_v2022.xml" +@pytest.mark.parametrize("xmlfile", ["input/obs_v2022.xml", "input/obssubid_35char.xml", "input/old_style_provid.xml"]) +def test_valgeneral(xmlfile): + """General validation""" + if os.path.exists("validation.file"): os.remove("validation.file") - subprocess.run("valgeneral.py "+xmlfile+"> validation.file",shell=True) - with open("validation.file",'r') as valfile: - val = valfile.readlines()[0].replace("\n","") - if val == 'general is OK': - assert(True) + subprocess.run( + "valgeneral.py " + xmlfile + "> validation.file", shell=True, check=True + ) + with open("validation.file", "r", encoding="utf-8") as valfile: + val = valfile.readlines()[0].replace("\n", "") + if val == "general is OK": + assert True else: - assert(False) - -def test_valgeneral_routine(): - xmlfile = "input/obs_v2022.xml" + assert False + +@pytest.mark.parametrize("xmlfile", ["input/obs_v2022.xml", "input/obssubid_35char.xml", "input/old_style_provid.xml"]) +def test_valgeneral_routine(xmlfile): + """General validation from import""" if os.path.exists("valgeneral.file"): os.remove("valgeneral.file") valgeneral.valgeneral(xmlfile) - with open("valgeneral.file",'r') as valfile: - val = valfile.readlines()[0].replace("\n","") - if val == 'general is OK': - assert(True) + with open("valgeneral.file", "r", encoding="utf-8") as valfile: + val = valfile.readlines()[0].replace("\n", "") + if val == "general is OK": + assert True else: - assert(False) + assert False + + # ------------------------ # valall def test_valall(): xmlfile = "input/obs_v2022.xml" if os.path.exists("valall.file"): os.remove("valall.file") - subprocess.run("valall.py "+xmlfile+"> valall.file",shell=True) - with open("valall.file",'r') as valfile: + subprocess.run("valall.py " + xmlfile + "> valall.file", shell=True) + with open("valall.file", "r") as valfile: lines = [line.strip() for line in valfile.readlines()] - assert(all([f"{schema_name} is OK" in lines for schema_name in sorted(adesutility.schemaxslts.keys())])) + assert all( + [ + f"{schema_name} is OK" in lines + for schema_name in sorted(adesutility.schemaxslts.keys()) + ] + ) # for line in valfile.readlines() # if line.strip() in : @@ -65,95 +74,117 @@ def test_valall(): # else: # assert(False) + def test_valall_routine(): xmlfile = "input/obs_v2022.xml" if os.path.exists("valall.file"): os.remove("valall.file") valall.valall(xmlfile) - with open("valall.file",'r') as valfile: + with open("valall.file", "r") as valfile: lines = [line.strip() for line in valfile.readlines()] - assert(all([f"{schema_name} is OK" in lines for schema_name in adesutility.schemaxslts.keys()])) - + assert all( + [ + f"{schema_name} is OK" in lines + for schema_name in adesutility.schemaxslts.keys() + ] + ) + + # ------------------------ # validate -#Validate v2022 with general.xsd + +# Validate v2022 with general.xsd def test_validate_v2022(): xmlfile = "input/obs_v2022.xml" if os.path.exists("validation.file"): os.remove("validation.file") - subprocess.run("validate.py ../xsd/general.xsd "+xmlfile+"> validation.file",shell=True) - with open("validation.file",'r') as valfile: - val = valfile.readlines()[0].replace("\n","") - if 'is OK' in val: - assert(True) + subprocess.run( + "validate.py ../xsd/general.xsd " + xmlfile + "> validation.file", shell=True + ) + with open("validation.file", "r") as valfile: + val = valfile.readlines()[0].replace("\n", "") + if "is OK" in val: + assert True else: - assert(False) + assert False -#Validate v2022 with general.xsd + +# Validate v2022 with general.xsd def test_validate_v2022_routine(): xmlfile = "input/obs_v2022.xml" if os.path.exists("validate.file"): os.remove("validate.file") validate.validate("../xsd/general.xsd", xmlfile) - with open("validate.file",'r') as valfile: - val = valfile.readlines()[0].replace("\n","") - if 'is OK' in val: - assert(True) + with open("validate.file", "r") as valfile: + val = valfile.readlines()[0].replace("\n", "") + if "is OK" in val: + assert True else: - assert(False) + assert False + -#Validate past version (v2017) with general.xsd +# Validate past version (v2017) with general.xsd def test_validate_v2017(): xmlfile = "input/obs.xml" if os.path.exists("validation.file"): os.remove("validation.file") - subprocess.run("validate.py ../past_versions/v2017/general_v2017.xsd "+xmlfile+"> validation.file",shell=True) - with open("validation.file",'r') as valfile: - val = valfile.readlines()[0].replace("\n","") - if 'is OK' in val: - assert(True) + subprocess.run( + "validate.py ../past_versions/v2017/general_v2017.xsd " + + xmlfile + + "> validation.file", + shell=True, + ) + with open("validation.file", "r") as valfile: + val = valfile.readlines()[0].replace("\n", "") + if "is OK" in val: + assert True else: - assert(False) + assert False -#Validate past version (v2017) with general.xsd + +# Validate past version (v2017) with general.xsd def test_validate_v2017_routine(): xmlfile = "input/obs.xml" if os.path.exists("validate.file"): os.remove("validate.file") - validate.validate('../past_versions/v2017/general_v2017.xsd', xmlfile) - with open("validate.file",'r') as valfile: - val = valfile.readlines()[0].replace("\n","") - if 'is OK' in val: - assert(True) + validate.validate("../past_versions/v2017/general_v2017.xsd", xmlfile) + with open("validate.file", "r") as valfile: + val = valfile.readlines()[0].replace("\n", "") + if "is OK" in val: + assert True else: - assert(False) + assert False + # ------------------------ -''' +""" Validation for the submitters, e.g. some fields cannot be present -''' +""" + + def test_val_submit(): xmlfile = "input/obs_v2022.xml" if os.path.exists("validation.file"): os.remove("validation.file") - subprocess.run("valsubmit.py "+xmlfile+"> validation.file",shell=True) - with open("validation.file",'r') as valfile: - val = valfile.readlines()[0].replace("\n","") - if 'is OK' in val: - assert(True) + subprocess.run("valsubmit.py " + xmlfile + "> validation.file", shell=True) + with open("validation.file", "r") as valfile: + val = valfile.readlines()[0].replace("\n", "") + if "is OK" in val: + assert True else: - assert(False) + assert False + def test_val_submit_routine(): xmlfile = "input/obs_v2022.xml" if os.path.exists("valsubmit.file"): os.remove("valsubmit.file") valsubmit.valsubmit(xmlfile) - with open("valsubmit.file",'r') as valfile: - val = valfile.readlines()[0].replace("\n","") - if 'is OK' in val: - assert(True) + with open("valsubmit.file", "r") as valfile: + val = valfile.readlines()[0].replace("\n", "") + if "is OK" in val: + assert True else: - assert(False) + assert False diff --git a/xml/adesmaster.xml b/xml/adesmaster.xml index 52cec9a..a8e7c1b 100644 --- a/xml/adesmaster.xml +++ b/xml/adesmaster.xml @@ -844,7 +844,7 @@ decimal types must be in a range - + A provID (provisional ID) is may be a minor planet provid, which is a 4-digit year followed by a space followd by two letters followed optinally by digits; or a comet it, which is C/ or P/ or D/ @@ -855,8 +855,7 @@ decimal types must be in a range which is S/ followed by a 4-digit year followed a space followed either (by a minor planet PermID in parentheses or the bare letter M, J, S, N, U) followed by a space followed by digits. For - data before 1926, the OldProvIDType may occur -- this is not allowed - in new submissions + data before 1926, the OldProvIDType may occur. @@ -939,6 +938,13 @@ decimal types must be in a range A StringType limited to 25 characters + + + + + A StringType limited to 35 characters + + @@ -1563,7 +1569,7 @@ decimal types must be in a range - + diff --git a/xsd/general.xsd b/xsd/general.xsd index ea128c3..1baa58e 100644 --- a/xsd/general.xsd +++ b/xsd/general.xsd @@ -270,6 +270,11 @@ + + + + + @@ -715,7 +720,7 @@ - + diff --git a/xsd/makexsdfiles b/xsd/makexsdfiles index d1e1316..a9b3021 100755 --- a/xsd/makexsdfiles +++ b/xsd/makexsdfiles @@ -4,7 +4,7 @@ # apply xlst to adesmaster file to make xsd files in four formats # -../Python/bin/applyxslt ../xml/adesmaster.xml ../xslt/xsd/generalxsd.xslt > general.xsd +../Python/ades/applyxslt ../xml/adesmaster.xml ../xslt/xsd/generalxsd.xslt > general.xsd #../Python/bin/applyxslt ../xml/adesmaster.xml ../xslt/xsd/generalhumanxsd.xslt > generalhuman.xsd -../Python/bin/applyxslt ../xml/adesmaster.xml ../xslt/xsd/submitxsd.xslt > submit.xsd +../Python/ades/applyxslt ../xml/adesmaster.xml ../xslt/xsd/submitxsd.xslt > submit.xsd #../Python/bin/applyxslt ../xml/adesmaster.xml ../xslt/xsd/submithumanxsd.xslt > submithuman.xsd diff --git a/xsd/submit.xsd b/xsd/submit.xsd index 93db72c..c76964b 100644 --- a/xsd/submit.xsd +++ b/xsd/submit.xsd @@ -216,7 +216,7 @@ - + @@ -270,6 +270,11 @@ + + + + + @@ -676,7 +681,7 @@ - +