Skip to content

Commit

Permalink
Renamed .yaml files to be .yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mollybsmith-noaa committed Apr 25, 2024
1 parent ac7ff1c commit e1daaed
Show file tree
Hide file tree
Showing 28 changed files with 36 additions and 36 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion .readthedocs.yaml → .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# .readthedocs.yaml
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

Expand Down
2 changes: 1 addition & 1 deletion METdbLoad/sql/scripts/db_prep.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'''
Creates the METviewer database to store MET output. Requires a YAML configuration
file (data_loading_config.yaml) with relevant database information (i.e. username,
file (data_loading_config.yml) with relevant database information (i.e. username,
password, etc.).
'''
import os.path
Expand Down
2 changes: 1 addition & 1 deletion METdbLoad/tests/update_schema_6.0_beta4/test_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def setup_db():
Read in the config file to retrieve the database login information.
"""
config_file = 'test_loading.yaml'
config_file = 'test_loading.yml'
with open(config_file, 'r') as stream:
try:
parms: dict = yaml.load(stream, Loader=yaml.FullLoader)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions METreformat/test/run_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ def setup_test(yaml_file, is_tcst=False):

# BENCHMARKING
def test_tcdiag_benchmark(benchmark):
stat_data, config = setup_test('../test/test_reformat_tcdiag.yaml', is_tcst=True)
stat_data, config = setup_test('../test/test_reformat_tcdiag.yml', is_tcst=True)
wsa = WriteStatAscii(config)
# reformatted_df = wsa.process_tcdiag(stat_data)
result = benchmark(wsa.process_tcdiag, stat_data)


def test_ecnt_benchmark(benchmark):
stat_data, config = setup_test('../test/ECNT_for_agg.yaml')
stat_data, config = setup_test('../test/ECNT_for_agg.yml')

wsa = WriteStatAscii(config)

Expand Down
File renamed without changes.
28 changes: 14 additions & 14 deletions METreformat/test/test_reformatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_point_stat_FHO_consistency():
'''

# Subset the input dataframe to include only the FHO linetype
stat_data, parms = setup_test("FHO.yaml")
stat_data, parms = setup_test("FHO.yml")
end = cn.NUM_STAT_FHO_COLS
fho_columns_to_use = np.arange(0, end).tolist()
linetype = cn.FHO
Expand Down Expand Up @@ -138,7 +138,7 @@ def test_point_stat_sl1l2_consistency():
'''

# Original data
stat_data, parms = setup_test('SL1L2.yaml')
stat_data, parms = setup_test('SL1L2.yml')

# Relevant columns for the SL1L2 line type
linetype: str = cn.SL1L2
Expand Down Expand Up @@ -195,7 +195,7 @@ def test_point_stat_vl1l2_consistency():
'''

# Original data
stat_data, parms = setup_test('VL1L2.yaml')
stat_data, parms = setup_test('VL1L2.yml')

# Relevant columns for the VL1L2 line type
linetype: str = cn.VL1L2
Expand Down Expand Up @@ -258,7 +258,7 @@ def test_point_stat_ctc_consistency():
'''

# Original data
stat_data, parms = setup_test('CTC.yaml')
stat_data, parms = setup_test('CTC.yml')

# Relevant columns for the CTC line type
linetype: str = cn.CTC
Expand Down Expand Up @@ -317,7 +317,7 @@ def test_point_stat_cts_consistency():
'''

# Original data
stat_data, parms = setup_test('CTS.yaml')
stat_data, parms = setup_test('CTS.yml')

# Relevant columns for the CTS line type
linetype: str = cn.CTS
Expand Down Expand Up @@ -384,7 +384,7 @@ def test_point_stat_cnt_consistency():
'''

# Original data
stat_data, parms = setup_test('CNT.yaml')
stat_data, parms = setup_test('CNT.yml')

# Relevant columns for the CNT line type
linetype: str = cn.CNT
Expand Down Expand Up @@ -452,7 +452,7 @@ def test_point_stat_vcnt_consistency():
'''

# Original data
stat_data, parms = setup_test('VCNT.yaml')
stat_data, parms = setup_test('VCNT.yml')

# Relevant columns for the VCNT line type
linetype: str = cn.VCNT
Expand Down Expand Up @@ -506,7 +506,7 @@ def test_point_stat_mcts_consistency():
'''

# Original data
stat_data, parms = setup_test('./MCTS.yaml')
stat_data, parms = setup_test('./MCTS.yml')

# Relevant columns for the MCTS line type
linetype: str = cn.MCTS
Expand Down Expand Up @@ -573,7 +573,7 @@ def test_ensemble_stat_ecnt_consistency():
'''

# Original data
stat_data, config = setup_test('ECNT.yaml')
stat_data, config = setup_test('ECNT.yml')

# Relevant columns for the ECNT line type
linetype: str = cn.ECNT
Expand Down Expand Up @@ -653,7 +653,7 @@ def test_pct_consistency():
'''

# Original data
stat_data, config = setup_test('PCT_ROC.yaml')
stat_data, config = setup_test('PCT_ROC.yml')

# Relevant columns for the PCT line type
wsa = WriteStatAscii(config)
Expand Down Expand Up @@ -708,7 +708,7 @@ def test_rhist_consistency():
'''

# Original data
stat_data, config = setup_test('RHIST.yaml')
stat_data, config = setup_test('RHIST.yml')

# Relevant columns for the RHIST line type
linetype: str = cn.RHIST
Expand Down Expand Up @@ -768,7 +768,7 @@ def test_ecnt_reformat_for_agg():
'''

# Original reformatted data
stat_data, config = setup_test('ECNT_for_agg.yaml')
stat_data, config = setup_test('ECNT_for_agg.yml')

wsa = WriteStatAscii(config)
reformatted_df = wsa.process_ecnt_for_agg(stat_data)
Expand Down Expand Up @@ -815,7 +815,7 @@ def test_fho_reformat_for_agg():
:return:
'''

stat_data, parms = setup_test("FHO_for_agg.yaml")
stat_data, parms = setup_test("FHO_for_agg.yml")
wsa = WriteStatAscii(parms)

# Expect error when invoking the process_fho_for_agg directly
Expand All @@ -832,7 +832,7 @@ def test_tcdiag_from_tcpairs():
Test that the reformatting is correct by comparing values in the original data to the reformatted data
'''
stat_data, config = setup_test('test_reformat_tcdiag.yaml', is_tcst=True)
stat_data, config = setup_test('test_reformat_tcdiag.yml', is_tcst=True)
wsa = WriteStatAscii(config)
reformatted_df = wsa.process_tcdiag(stat_data)

Expand Down
24 changes: 12 additions & 12 deletions docs/Users_Guide/load_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,31 @@ In the METdataio/METdbLoad/sql/scripts directory, there are two configuration fi

* db_load_specification.xml

* data_loading_config.yaml
* data_loading_config.yml

The *db_load_specification.xml* is a template XML specification file, and *data_loading_config.yaml*
is a template YAML configuration file. The *data_loading_config.yaml* file contains
The *db_load_specification.xml* is a template XML specification file, and *data_loading_config.yml*
is a template YAML configuration file. The *data_loading_config.yml* file contains
information about the database (username, password, database name, etc.). This information is used by the
*generate_xml_spec.py* script to generate the XML specification file which is then used to load data into the database.

Generate the XML Specification File
===================================

Copy the *data_loading_config.yaml* file to a secure location in your workspace, as this file will contain the username
Copy the *data_loading_config.yml* file to a secure location in your workspace, as this file will contain the username
and password to the database. **Do not put this file where it can be read by anyone who should not have access to this
information.**

.. code-block:: ini
cp data_loading_config.yaml /path-to-your-dir/
cp data_loading_config.yml /path-to-your-dir/
Replace the *path-to-your-dir* with the actual path to where this file is to be saved.

Change directory to the location where the *data_loading_config.yaml* file was copied.
Change directory to the location where the *data_loading_config.yml* file was copied.

Open the data_loading_config.yaml file:
Open the data_loading_config.yml file:

.. literalinclude:: ../../METdbLoad/sql/scripts/data_loading_config.yaml
.. literalinclude:: ../../METdbLoad/sql/scripts/data_loading_config.yml

Update the database information with information relevant to the database you are using:

Expand Down Expand Up @@ -93,9 +93,9 @@ Generate the new XML specification file by running the following:
*Replace path-to-METdataio-source to the location where the METdataio source code is saved.
python generate_xml_spec.py path-to/data_loading_config.yaml
python generate_xml_spec.py path-to/data_loading_config.yml
*Replace the path-to with the path to the directory you created to store the copy of the data_loading_config.yaml
*Replace the path-to with the path to the directory you created to store the copy of the data_loading_config.yml
file as specified earlier.
A new XML specification file *load_met.xml*, will be generated and saved in the
Expand All @@ -116,7 +116,7 @@ directory. The *path-to-METdataio-source* is the directory where the METdataio
python met_db_load.py /path-to/load_met.xml
* Replace the path-to with the location where the load_met.xml file was saved. This is the same directory
you created to save the copy of the data_loading_config.yaml file.
you created to save the copy of the data_loading_config.yml file.
The usage statement:

Expand Down Expand Up @@ -258,7 +258,7 @@ Additional Loading Options
--------------------------

The load_met.xml specification file created above loads the entire dataset specified in the data_dir setting in the
YAML config file, data_loading_config.yaml.
YAML config file, data_loading_config.yml.

A subset of the data can be selected by date and field names (i.e. by model, valid_time, vx_mask, etc.).
The load_met.xml specification file can be further modified to accomplish this by adding the date_list and
Expand Down
10 changes: 5 additions & 5 deletions docs/Users_Guide/reformat_stat_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ The YAML configuration file is also used to indicate the name and
location of the output file, logging information (filename, log level),
and the line type to read in and reformat:

.. literalinclude:: ../../../METdataio/METreformat/reformat_stat.yaml
.. literalinclude:: ../../../METdataio/METreformat/reformat_stat.yml

Copy this custom config file from the directory where the source code
was saved to the working directory.

**Modify the YAML configuration file**

Edit the reformat_stat.yaml config file:
.. literalinclude:: ../../../METdataio/METreformat/reformat_stat.yaml
Edit the reformat_stat.yml config file:
.. literalinclude:: ../../../METdataio/METreformat/reformat_stat.yml

Refer to the following details for each of the mandatory settings in the configuration file.

Expand Down Expand Up @@ -297,14 +297,14 @@ Generate the reformatted file:
* NOTE*: This may require reorganization of data that is distributed over numerous directories into
a single directory.

- modify the **reformat_stat.yaml** file, indicating the *input directory*,
- modify the **reformat_stat.yml** file, indicating the *input directory*,
*output directory*, *output file name*, *line stat to reformat*, and
*logging settings* (log level, log filename, log directory). Refer to the
**Definition of Configuration Settings** above for a description of each setting.


.. code-block:: ini
python $BASE_DIR/METreformat/write_stat_ascii.py $WORKING_DIR/*line_type*_stat.yaml
python $BASE_DIR/METreformat/write_stat_ascii.py $WORKING_DIR/*line_type*_stat.yml
- A text file will be created in the output directory with the file name that was specified in the yaml file.

0 comments on commit e1daaed

Please sign in to comment.