Skip to content
Snippets Groups Projects
Verified Commit e945112a authored by David Hoese's avatar David Hoese
Browse files

Fix some deprecated package usage

parent 76d75d12
No related branches found
No related tags found
No related merge requests found
[bandit]
skips: B506
exclude: aossceilo/tests
exclude: aossceilo/tests,aossceilo/nc.py
......@@ -155,9 +155,8 @@ class Message2(object):
@raises MessageError: If this instance cannot be created due to an error
parsing.
"""
assert len(lines) == self.NUM_LINES, (
"A Message2 must contain %s lines" % self.NUM_LINES
)
if len(lines) != self.NUM_LINES:
raise ValueError(f"A Message2 must contain {self.NUM_LINES} lines")
self._epoch = timegm(stamp.timetuple())
......
......@@ -4,7 +4,7 @@ import importlib.resources
import os
import sys
from calendar import timegm
from xml.etree.ElementTree import XML
from defusedxml.cElementTree import fromstring
import numpy
from netCDF4 import Dataset
......@@ -29,7 +29,7 @@ def create_nc(input_files, out_files, site=None):
messages = message.load_messages(map(os.path.realpath, input_files))
# raise FileNotFoundError(f"{messages} No messages were found in the input files")
ncml = XML(
ncml = fromstring(
importlib.resources.files(__name__)
.joinpath("ceilo.ncml")
.open("r", encoding="utf-8")
......
......@@ -9,3 +9,4 @@ dependencies:
- netcdf4
- matplotlib-base
- pytest
- defusedxml
......@@ -13,6 +13,7 @@ dependencies = [
"netCDF4",
"matplotib",
"pytest",
"defusedxml",
# "metobscommon", # manually installed
]
readme = "README.rst"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment