dtcenter / METdataio

https://metdataio.readthedocs.io/en/latest/index.html
Apache License 2.0
5 stars 3 forks source link

Bugfix METdataio isn't correctly placing the database in the correct METviewer group #228

Closed bikegeek closed 1 year ago

bikegeek commented 1 year ago

Describe the Problem

Tina has found that when explicitly setting the group to RAL Projects in the XML specification file, the database is loaded in the METviewer mariaDB database, but is placed in the incorrect group.

Expected Behavior

on 'mohawk', using the following script to set up the METviewer database (MAKE MODIFICATIONS TO CREATE A DIFFERENT DATABASE):

#!/bin/sh -v

 dbname="mv_debugging"
 #host="mohawk"
 host="localhost"
 #metv="/d2/projects/METViewer/src/apps/METviewer"
 metv="/d2/personal/mwin/Debug_METdataio_for_METviewer/METdataio/METdbLoad"
 #path2proj="/d2/projects/UAE_tk/metv"
 path2proj="/d2/personal/mwin/Debug_METdataio_for_METviewer/METdataio/METdbLoad/sql"
 mvuser="mvuser"
 #mvuser="mvadmin"
 mvpass="mvuser"
 #mvpass="160GiltVa0D5M"

 # Drop the database before creating
 mysql -h${host} -u${mvuser} -p${mvpass} -e"drop database ${dbname};"
 mysql -h${host} -u${mvuser} -p${mvpass} -e"create database ${dbname};"
 mysql -h${host} -u${mvuser} -p${mvpass} ${dbname} < ${metv}/sql/mv_mysql.sql
 ${metv}/bin/mv_load.sh ${path2proj}/load_${dbname}.xml > ${path2proj}/load_${dbname}.log 2>&1

Next, use the following specification file (MAKE MODIFICATIONS TO MATCH THE DATABASE CREATED ABOVE and point to the correct paths for the schema):

<load_spec>
    <connection>
        <host>mohawk</host>
        <database>mv_uae_2022_upa</database>
        <user>mvuser</user>
        <password>mvuser</password>
    </connection>

        <date_list name="folder_dates">
        <start>2023010100</start>
        <end>2023073018</end>
        <inc>21600</inc>
        <format>yyyyMMddHH</format>
        </date_list>

    <folder_tmpl>/d2/projects/UAE_tk/data/{datadir}/{ltype}/{date}</folder_tmpl>

    <verbose>true</verbose>
    <insert_size>1</insert_size>
    <stat_header_db_check>true</stat_header_db_check>
    <mode_header_db_check>true</mode_header_db_check>
    <drop_indexes>false</drop_indexes>
    <apply_indexes>true</apply_indexes>
    <load_stat>true</load_stat>
    <load_mode>false</load_mode>
    <load_mpr>true</load_mpr>
    <group>RAL Projects</group>

    <load_val>
        <field name="datadir">
            <val>EnVar_G1V_stats</val>
                        <val>EnVar_G2V_stats</val>
        </field>
                <field name="ltype">
                        <val>point_stat_ua</val>
                </field>
                <field name="date">
            <date_list name="folder_dates"/>
                </field>
    </load_val>

    <load_xml>true</load_xml>
</load_spec>

Verify that the new database you created above is NOT in the RAL Projects group via METviewer: http://dtcenter.ucar.edu/met/metviewer/metviewer1.jsp

by looking under the RAL Projects group for the database you created.

Environment

Describe your runtime environment: 1. Machine: (e.g. HPC name, Linux Workstation, Mac Laptop) 2. OS: (e.g. RedHat Linux, MacOS) 3. Software version number(s)

To Reproduce

Describe the steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error Post relevant sample data following these instructions: https://dtcenter.org/community-code/model-evaluation-tools-met/met-help-desk#ftp

Relevant Deadlines

List relevant project deadlines here or state NONE.

Funding Source

Define the source of funding and account keys here or state NONE.

Define the Metadata

Assignee

Labels

Projects and Milestone

Define Related Issue(s)

Consider the impact to the other METplus components.

Bugfix Checklist

See the METplus Workflow for details.

TatianaBurek commented 1 year ago

loading code expects both tags to be present and . Only in this case 'group' data is loaded into the database. In reality, is optional. Need to change the code to load even the is missing

TatianaBurek commented 1 year ago

The initial value of self.description is 'None'. it should be an empty sting. The logic for inserting group and description also needs to be fixed also