Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feature_1714_tc_gen
Browse files Browse the repository at this point in the history
  • Loading branch information
John Halley Gotway committed Apr 8, 2021
2 parents 1569668 + acf97fc commit f9457f6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
1 change: 0 additions & 1 deletion met/data/wrappers/read_tmp_dataplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
grid[grid_attr] = attr_val
else:
met_attrs[attr] = attr_val
grid['nx'], grid['ny'] = int(grid['nx']), int(grid['ny'])
met_attrs['grid'] = grid
met_attrs['name'] = met_attrs['name_str']
del met_attrs['name_str']
Expand Down
8 changes: 8 additions & 0 deletions met/src/libcode/vx_python3_utils/python3_dict.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,14 @@ if ( ! a ) {

}

// If not a Long, try interpreting as LongLong for numpy.int64 values

if ( ! PyLong_Check(a) ) {

a = PyLong_FromLongLong(PyLong_AsLongLong(a));

}

if ( ! PyLong_Check(a) ) {

mlog << Error << "\nPython3_Dict::lookup_int(const char *) -> "
Expand Down
8 changes: 5 additions & 3 deletions met/src/tools/tc_utils/tc_pairs/tc_pairs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1740,7 +1740,7 @@ void compute_track_err(const TrackInfo &adeck, const TrackInfo &bdeck,
NumArray &altk_err, NumArray &crtk_err) {
int i, i_adeck, i_bdeck, status;
unixtime ut, ut_min, ut_max;
int ut_inc, n_ut;
int bd_inc, ut_inc, n_ut;
float alat[mxp], alon[mxp], blat[mxp], blon[mxp];
float crtk[mxp], altk[mxp];
double x, y, tk, lon_min, lon_max;
Expand All @@ -1760,8 +1760,10 @@ void compute_track_err(const TrackInfo &adeck, const TrackInfo &bdeck,
// Determine the valid increment
// For BEST tracks, use a constant time step
// For non-BEST tracks, select the most common BDECK time step
if(bdeck.is_best_track()) ut_inc = best_track_time_step;
else ut_inc = bdeck.valid_inc();
// Check for 0 and bad data
bd_inc = bdeck.valid_inc();
ut_inc = (bdeck.is_best_track() || bd_inc == 0 || is_bad_data(bd_inc) ?
best_track_time_step : bd_inc);

// Round the valid times to the nearest valid increment
if(ut_min%ut_inc != 0) ut_min = (ut_min/ut_inc + 1)*ut_inc;
Expand Down
2 changes: 1 addition & 1 deletion scripts/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ RUN yum -y update \
&& yum -y install gv ncview wgrib wgrib2 ImageMagick ps2pdf \
&& yum -y install python3 python3-devel python3-pip \
&& pip3 install --upgrade pip \
&& python3 -m pip install numpy xarray
&& python3 -m pip install numpy xarray netCDF4

#
# Set the working directory.
Expand Down
4 changes: 1 addition & 3 deletions test/xml/unit_python.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<!ENTITY INPUT_DIR "${MET_TEST_INPUT}">
<!ENTITY OUTPUT_DIR "${MET_TEST_OUTPUT}">
<!ENTITY MET_PYTHON_EXE "/usr/local/python3/bin/python3">
<!ENTITY ANACONDA_BIN "/usr/local/anaconda3-20190923/bin">

<!ENTITY CONFIG_DIR "&TEST_DIR;/config">
<!ENTITY DATA_DIR_PYTHON "&INPUT_DIR;/python">
Expand Down Expand Up @@ -392,8 +391,7 @@

<!-- Invokes Python pickle logic to read NUMPY text data -->
<test name="python_numpy_plot_data_plane_pickle">
<exec>export PATH='&ANACONDA_BIN;:${PATH}'; \
&MET_BIN;/plot_data_plane</exec>
<exec>&MET_BIN;/plot_data_plane</exec>
<env>
<pair><name>MET_PYTHON_EXE</name> <value>&MET_PYTHON_EXE;</value></pair>
</env>
Expand Down

0 comments on commit f9457f6

Please sign in to comment.