From 14dcbeec188294d03c392703aec9c50c528a7155 Mon Sep 17 00:00:00 2001 From: Kyle Westfall Date: Wed, 18 Dec 2024 13:40:56 -0800 Subject: [PATCH] deprecate --- deprecated/qa.py | 20 ++++++++++++++++++++ pypeit/core/qa.py | 13 ------------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/deprecated/qa.py b/deprecated/qa.py index 3eb94ff317..67992554ae 100644 --- a/deprecated/qa.py +++ b/deprecated/qa.py @@ -213,3 +213,23 @@ def match_qa(arc_spec, tcent, line_list, IDs, scores, outfile = None, title=None plt.close() return + + +def gen_timestamp(): + """ Generate a simple time stamp including the current user + + Returns + ------- + timestamp : str + user_datetime + """ + tstamp = datetime.datetime.today().strftime('%Y-%m-%d-T%Hh%Mm%Ss') + try: + import getpass + user = getpass.getuser() + except ModuleNotFoundError: + # there appears to be a bug in getpass in windows systems where the pwd module doesn't load + user = os.getlogin() + # Return + return '{:s}_{:s}'.format(user, tstamp) + diff --git a/pypeit/core/qa.py b/pypeit/core/qa.py index 526ea08fd7..8c8e498e13 100644 --- a/pypeit/core/qa.py +++ b/pypeit/core/qa.py @@ -130,19 +130,6 @@ def get_dimen(x, maxp=25): return pages, npp -# THIS IS ONLY USED BY DEPRECATED FUNCTIONS -#def gen_timestamp(): -# """ Generate a simple time stamp including the current user -# -# Returns -# ------- -# timestamp : str -# user_datetime -# """ -# tstamp = datetime.datetime.today().strftime('%Y-%m-%d-T%Hh%Mm%Ss') -# return '{:s}_{:s}'.format(pypeit_user, tstamp) - - def html_header(title): """ Generate a simple HTML header