From 9d9edf5ff16cf7888ca1944fe2a0e7331e71d7e4 Mon Sep 17 00:00:00 2001 From: Alex Lancaster Date: Sun, 10 Sep 2023 16:22:48 -0400 Subject: [PATCH] End-user warning that undocumented module `[Haplostats]` is not yet supported (#118) * remove deprecated from `[Emhaplofreq]` config move unsupported warning to `[Haplostats]`. cleanup some of the LOG messages and line-feeds * remove release notes about Haplostats from NEWS, put in DEV_NOTES for the time being * add Changelog link to `NEWS.rst`: add to project_urls --- DEV_NOTES.md | 11 +++++++++-- NEWS.rst | 3 --- setup.py | 1 + src/PyPop/Main.py | 18 +++++++++--------- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/DEV_NOTES.md b/DEV_NOTES.md index acb179866..a61ea27f1 100644 --- a/DEV_NOTES.md +++ b/DEV_NOTES.md @@ -1,5 +1,12 @@ # Developer notes +## Release notes for in-progress features not yet officially documented or supported + +* New wrapper module `Haplostats`. This wraps a portion of the + `haplo.stats` R package `haplo-stats` for haplotype + estimation. [Implementation in alpha-phase]. + + ## External dependencies * ```swig``` (Simple Wrapper Interface Generator) (build-time only) @@ -40,8 +47,8 @@ the) it then runs the specified modules (outlined below). "wxPython":http://www.wxpython.org GUI toolkit. wxPython is a set of Python bindings to "wxWindows":http://www.wxwindows.org, which is an open-source cross-platform GUI widget toolkit which has a native look -under GNU/Linux (GTK), Windows (MFC) and MacOS X (Aqua). [as of 2017, -this is deprecated] +under GNU/Linux (GTK), Windows (MFC) and MacOS X (Aqua). [as of 2023, +this was removed] * 'ParseFile' is a base class which has most of the common functionality for reading files. diff --git a/NEWS.rst b/NEWS.rst index 5d40bb2c8..da9f00ef8 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -11,9 +11,6 @@ New features ^^^^^^^^^^^^^^ * Updated to Python 3 * Implement new assymetric LD (ALD) measure -* New wrapper module ``Haplostats``. This wraps a portion of the - ``haplo.stats`` R package ``haplo-stats`` for haplotype - estimation. [Implementation in alpha-phase]. * ``popmeta``: now accepts the ``-o``/``--outputdir`` option for saving generated files. * ``pypop``: renamed ``--generate-tsv`` to ``--enable-tsv`` diff --git a/setup.py b/setup.py index 85dca4c89..690afe290 100755 --- a/setup.py +++ b/setup.py @@ -230,6 +230,7 @@ def path_to_src(source_path_list): url = "http://www.pypop.org/", project_urls={ 'Documentation': 'http://pypop.org/docs/', + 'Changelog': 'https://github.com/alexlancaster/pypop/blob/main/NEWS.rst', 'Source': 'https://github.com/alexlancaster/pypop/', 'Tracker': 'https://github.com/alexlancaster/pypop/issues', }, diff --git a/src/PyPop/Main.py b/src/PyPop/Main.py index 528bf173e..249255100 100644 --- a/src/PyPop/Main.py +++ b/src/PyPop/Main.py @@ -1017,6 +1017,9 @@ def _doGenotypeFile(self): if self.config.has_section("Haplostats"): + print ("WARNING: The [Haplostats] module is still currently in ALPHA-MODE ONLY and and should not be used in production.") + print ("Please use the [Emhaplofreq] module in the meantime.") + try: numInitCond = self.config.getint("Haplostats", "numInitCond") @@ -1076,9 +1079,6 @@ def _doGenotypeFile(self): if self.config.has_section("Emhaplofreq"): - print ("WARNING: The [Emhaplofreq] module is officially DEPRECATED and may be removed in coming releases.") - print ("Please transition to using the new [Haplostats] module.") - # create object to generate haplotype and LD statistics # a wrapper around the emhaplofreq module haplo = Emhaplofreq(self.input.getIndividualsData(), @@ -1148,11 +1148,11 @@ def _doGenotypeFile(self): if allPairwiseLD: - print("LOG: estimating all pairwise LD:"), + print("LOG: estimating all pairwise LD:", end=" "), if allPairwiseLDWithPermu: - print("with %d permutations and %d initial conditions for each permutation" % (allPairwiseLDWithPermu, numPermuInitCond)), + print("with %d permutations and %d initial conditions for each permutation" % (allPairwiseLDWithPermu, numPermuInitCond), end=" "), if permutationPrintFlag: - print("and each permutation output will be logged to XML") + print("and each permutation output will be logged to XML", end=" ") else: print() else: @@ -1166,15 +1166,15 @@ def _doGenotypeFile(self): locusKeys=self.config.get("Emhaplofreq", "lociToEstHaplo") if locusKeys == '*': - print("wildcard '*' given for lociToEstHaplo, assume entire data set") + print("LOG: wildcard '*' given for lociToEstHaplo, assume entire data set") locusKeys=":".join(self.input.getIndividualsData().colList) - print("LOG: estimating haplotype frequencies for"), + print("LOG: estimating haplotype frequencies for", end=" "), # if we will be running allPairwise*, then exclude any two-locus # haplotypes, since we will estimate them as part of 'all pairwise' if allPairwiseLD: - print("all two locus haplotypes,"), + print("all two locus haplotypes,", end=" "), modLocusKeys = [] for group in locusKeys.split(','):