Skip to content
Snippets Groups Projects
Commit efe84051 authored by Paolo Veglio's avatar Paolo Veglio
Browse files

code cleanup

parent 6bbd98be
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,7 @@ logger = logging.getLogger(__name__) ...@@ -23,7 +23,7 @@ logger = logging.getLogger(__name__)
LOG_LEVELS = ["CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG"] LOG_LEVELS = ["CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG"]
proc = psutil.Process(os.getpid()) proc = psutil.Process(os.getpid())
_VERSION = "0.0.0" _VERSION = get_distribution("mvcm").version
def main( def main(
...@@ -177,7 +177,7 @@ def main( ...@@ -177,7 +177,7 @@ def main(
logger.info(f"Memory usage #3: {proc.memory_info().rss / 1e6} MB") logger.info(f"Memory usage #3: {proc.memory_info().rss / 1e6} MB")
with xr.open_dataset(file_names["MOD02"]) as vnp02: with xr.open_dataset(file_names["MOD02"]) as vnp02:
time_str = dt.strftime(dt.strptime(vnp02.time_coverage_start, fmt_in), fmt_out) time_str = dt.strftime(dt.strptime(vnp02.time_coverage_start, fmt_in), fmt_out) # noqa
viirs_data.to_netcdf( viirs_data.to_netcdf(
f"{os.path.dirname(out_file)}/input_data_{time_str}.nc", mode="w", format="NETCDF4" f"{os.path.dirname(out_file)}/input_data_{time_str}.nc", mode="w", format="NETCDF4"
......
...@@ -25,7 +25,7 @@ _LOG_FORMAT = "%(message)s" ...@@ -25,7 +25,7 @@ _LOG_FORMAT = "%(message)s"
logging.basicConfig(level="NOTSET", datefmt="[%X]", format=_LOG_FORMAT, handlers=[RichHandler()]) logging.basicConfig(level="NOTSET", datefmt="[%X]", format=_LOG_FORMAT, handlers=[RichHandler()])
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
LOG_LEVELS = ["CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG"] LOG_LEVELS = ["CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG"]
_VERSION = "0.0.0" _VERSION = get_distribution("mvcm").version
proc = psutil.Process(os.getpid()) proc = psutil.Process(os.getpid())
......
...@@ -346,9 +346,9 @@ def create_empty_dataset(lat_shape: tuple) -> xr.Dataset: ...@@ -346,9 +346,9 @@ def create_empty_dataset(lat_shape: tuple) -> xr.Dataset:
def run_mvcm( def run_mvcm(
file_names: dict, file_names: dict,
thresholds_file: str, thresholds_file: str | None,
out_file: str, out_file: str,
exe_path: str, exe_path: str | None,
satellite: str = "VIIRS_NPP", satellite: str = "VIIRS_NPP",
) -> None: ) -> None:
"""Run MVCM.""" """Run MVCM."""
......
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