Repository: cogent3/cogent3
Pull request #2142 (2024-11-29 03:19:28)

REL: prep for major release
## Summary by Sourcery

Prepare for a major release by introducing new features such as automatic handling of compressed files and a unified alignment class, enhancing performance with faster fasta formatting and pairwise distance calculations, and updating documentation and build configurations to reflect these changes.

New Features:
- Introduce automatic handling of .xz and .lzma compressed files in cogent3.open_().
- Add recognition of .phy as phylip format in sequence/alignment loading functions.
- Implement a new unified alignment class that combines the capabilities of Alignment and AlignmentArray classes.

Enhancements:
- Improve formatting speed of fasta records.
- Refactor pairwise distance calculation to demonstrate performance benefits of new alignment classes, including support for parallel execution.

Build:
- Update noxfile.py to drop support for Python 3.9 and support Python 3.10 to 3.12.

Documentation:
- Update README.md to announce new core data types and faster pairwise genetic distance calculations.


Patch:
diff --git a/README.md b/README.md
index 85e26356c..e972ab3e1 100644
--- a/README.md
+++ b/README.md
@@ -19,6 +19,24 @@
 
 ## 📣 Feature Announcements 📣
 
+<details>
+  <summary> New core data types improve efficiency and flexibility </summary>
+
+The cogent3 development team 👾 have been hard at work modernising the core internals 💪🛠.
+
+The grand rewrite of alignment classes is ready for use! The new approach gives us the foundation for major performance improvements in the future. As with the moltype, alphabet, genetic code and `SequenceCollection`, you can select the new class via `make_aligned_seqs()` or `load_aligned_seqs()` by specifying `new_type=True`.
+These are not yet the default and are not fully integrated into the existing code. They can also differ in their API relative to the classes they replace. 
+
+We encourage experimentation in cases where integration with old objects is NOT required and [look forward to any feedback](https://github.com/cogent3/cogent3/discussions)!
+
+</details>
+
+<details>
+    <summary> Faster pairwise genetic distance calculations 🚀 </summary>
+
+We have completely rewritten a subset of the genetic distance calculators. These are now only available using the new type `Alignment.distance_matrix()` method. Single CPU performance is faster and we now also support parallel execution.
+
+</details>
 <details>
     <summary> Faster sequence coevolution measures 🚀 </summary>
 
@@ -49,18 +67,7 @@ Speaking of plugins, our first major third-party plugin is [piqtree2](https://py
 
 </details>
 
-<details>
-  <summary> New core data types improve efficiency and flexibility </summary>
-
-The cogent3 development team 👾 are hard at work modernising the core internals 💪🛠.
 
-In this release the `Sequence`, `SequenceCollection`, `MolType`, `GeneticCode`, and alphabet classes have all been rewritten from scratch with an eye to simplifying the code while improving its flexibility and performance. (We're working on alignments for the next release.)
-
-The "new-style" objects enhance performance by supporting the access of the underlying data in various formats (i.e. numpy arrays, bytes or strings). You can create "new-style" objects by setting the `new_type=True` argument in top-level functions (`make_seq`, `load_seq`, `make_unaligned_seqs`, `get_moltype`, `get_code`). These are not yet the default and are not fully integrated into the existing code. They can also differ in their API relative to the classes they replace. 
-
-We encourage experimentation in cases where integration with old objects is NOT required and [look forward to any feedback](https://github.com/cogent3/cogent3/discussions)!
-
-</details>
 
 ## Who is it for?
 
diff --git a/changelog.d/20241025_082035_Gavin.Huttley.md b/changelog.d/20241025_082035_Gavin.Huttley.md
deleted file mode 100644
index 37f7dce7b..000000000
--- a/changelog.d/20241025_082035_Gavin.Huttley.md
+++ /dev/null
@@ -1,42 +0,0 @@
-<!--
-A new scriv changelog fragment.
-
-Uncomment the section that is right (remove the HTML comment wrapper).
--->
-
-<!--
-### Contributors
-
-- A bullet item for the Contributors category.
-
--->
-
-### ENH
-
-- `cogent3.open_()` now automatically handles .xz and .lzma compressed files.
-- sequence / alignment loading functions recognise .phy as phylip format.
-
-<!--
-### BUG
-
-- A bullet item for the BUG category.
-
--->
-<!--
-### DOC
-
-- A bullet item for the DOC category.
-
--->
-<!--
-### Deprecations
-
-- A bullet item for the Deprecations category.
-
--->
-<!--
-### Discontinued
-
-- A bullet item for the Discontinued category.
-
--->
diff --git a/changelog.d/20241026_143333_Gavin.Huttley.md b/changelog.d/20241026_143333_Gavin.Huttley.md
deleted file mode 100644
index ef0f390a5..000000000
--- a/changelog.d/20241026_143333_Gavin.Huttley.md
+++ /dev/null
@@ -1,42 +0,0 @@
-<!--
-A new scriv changelog fragment.
-
-Uncomment the section that is right (remove the HTML comment wrapper).
--->
-
-<!--
-### Contributors
-
-- A bullet item for the Contributors category.
-
--->
-
-### ENH
-
-- Formatting of fasta records is now much quicker.
-
-
-<!--
-### BUG
-
-- A bullet item for the BUG category.
-
--->
-<!--
-### DOC
-
-- A bullet item for the DOC category.
-
--->
-<!--
-### Deprecations
-
-- A bullet item for the Deprecations category.
-
--->
-<!--
-### Discontinued
-
-- A bullet item for the Discontinued category.
-
--->
diff --git a/changelog.d/20241121_100849_Gavin.Huttley.md b/changelog.d/20241121_100849_Gavin.Huttley.md
deleted file mode 100644
index a615940a5..000000000
--- a/changelog.d/20241121_100849_Gavin.Huttley.md
+++ /dev/null
@@ -1,41 +0,0 @@
-<!--
-A new scriv changelog fragment.
-
-Uncomment the section that is right (remove the HTML comment wrapper).
--->
-
-<!--
-### Contributors
-
-- A bullet item for the Contributors category.
-
--->
-<!--
-### ENH
-
-- A bullet item for the ENH category.
-
--->
-<!--
-### BUG
-
-- A bullet item for the BUG category.
-
--->
-<!--
-### DOC
-
-- A bullet item for the DOC category.
-
--->
-<!--
-### Deprecations
-
-- A bullet item for the Deprecations category.
-
--->
-### Discontinued
-
-- We no longer support python 3.9.
-
--->
diff --git a/changelog.d/20241125_084555_Gavin.Huttley.md b/changelog.d/20241125_084555_Gavin.Huttley.md
deleted file mode 100644
index d4e15f6d6..000000000
--- a/changelog.d/20241125_084555_Gavin.Huttley.md
+++ /dev/null
@@ -1,47 +0,0 @@
-<!--
-A new scriv changelog fragment.
-
-Uncomment the section that is right (remove the HTML comment wrapper).
--->
-
-### Contributors
-
-- Many thousand lines of code --- @KatherineCaley 🚀
-
-
-### ENH
-
-- The grand rewrite of alignment classes is ready for use! This is a major effort,
-  unifying the capabilities of the `Alignment` and `AlignmentArray` classes into a
-  single class. The logic is cleaner, the performance is better, and the API is
-  largely (but not entirely) backwards compatible. The new approach gives us the
-  foundation for major performance improvements in the future. As with the
-  moltype, alphabet, genetic code and SequenceCollection, you can select the new
-  class via `make_aligned_seqs()` or `load_aligned_seqs()` by specifying new_type=True.
-  Please post any bugs or issues to the issue tracker.
-
-
-<!--
-### BUG
-
-- A bullet item for the BUG category.
-
--->
-<!--
-### DOC
-
-- A bullet item for the DOC category.
-
--->
-<!--
-### Deprecations
-
-- A bullet item for the Deprecations category.
-
--->
-<!--
-### Discontinued
-
-- A bullet item for the Discontinued category.
-
--->
diff --git a/changelog.md b/changelog.md
index 79813052a..40ca65a13 100755
--- a/changelog.md
+++ b/changelog.md
@@ -1,4 +1,34 @@
 
+<a id='changelog-2024.11.29a1'></a>
+# Changes in release "2024.11.29a1"
+
+## Contributors
+
+- Many thousand lines of code --- @KatherineCaley 🚀
+- @YapengLang contributed bug reports and bug fixes 👏
+
+## ENH
+
+- `cogent3.open_()` now automatically handles .xz and .lzma compressed files.
+- sequence / alignment loading functions recognise .phy as phylip format.
+- Formatting of fasta records is now much quicker.
+- The grand rewrite of alignment classes is ready for use! This is a major effort,
+  unifying the capabilities of the `Alignment` and `AlignmentArray` classes into a
+  single class. The logic is cleaner, the performance is better, and the API is
+  largely (but not entirely) backwards compatible. The new approach gives us the
+  foundation for major performance improvements in the future. As with the
+  moltype, alphabet, genetic code and SequenceCollection, you can select the new
+  class via `make_aligned_seqs()` or `load_aligned_seqs()` by specifying `new_type=True`.
+  Please post any bugs or issues to the issue tracker.
+- Refactored a subset of the pairwise distance calculation demonstrating the performance
+  benefits of the new alignment classes. These are accessible via the Alignment.distance_matrix()
+  method, and also include support for parallel execution. They are wicked fast 🚀🚀🚀!
+
+## Discontinued
+
+- We no longer support python 3.9.
+
+
 <a id='changelog-2024.7.19a9'></a>
 # Changes in release "2024.7.19a9"
 
diff --git a/noxfile.py b/noxfile.py
index 5d73d09dd..dee8cf032 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -2,7 +2,7 @@ import pathlib
 
 import nox
 
-_py_versions = range(9, 13)
+_py_versions = range(10, 13)
 
 
 @nox.session(python=[f"3.{v}" for v in _py_versions])
diff --git a/src/cogent3/__init__.py b/src/cogent3/__init__.py
index d68965a42..d40168ada 100644
--- a/src/cogent3/__init__.py
+++ b/src/cogent3/__init__.py
@@ -41,7 +41,7 @@ from cogent3.parse.sequence import get_parser, is_genbank
 from cogent3.parse.table import load_delimited
 from cogent3.parse.tree_xml import parse_string as tree_xml_parse_string
 from cogent3.util import warning as c3warn
-from cogent3.util.io import get_format_suffixes, open_
+from cogent3.util.io import get_format_suffixes, is_url, open_
 from cogent3.util.progress_display import display_wrap
 from cogent3.util.table import Table as _Table
 from cogent3.util.table import cast_str_to_array
@@ -306,7 +306,8 @@ def _load_files_to_unaligned_seqs(
 
 def _load_seqs(file_format, filename, fmt, parser_kw):
     """utility function for loading sequences"""
-    filename = pathlib.Path(filename).expanduser()
+    if not is_url(filename):
+        filename = pathlib.Path(filename).expanduser()
     fmt = fmt or file_format
     if not fmt:
         msg = "could not determined file format, set using the format argument"
diff --git a/src/cogent3/_version.py b/src/cogent3/_version.py
index 3d3862aef..8501e6708 100644
--- a/src/cogent3/_version.py
+++ b/src/cogent3/_version.py
@@ -1,1 +1,1 @@
-__version__ = "2024.7.19a9"
+__version__ = "2024.11.29a1"


Test patch:
diff --git a/tests/test_core/test_new_alignment.py b/tests/test_core/test_new_alignment.py
index 015e15f85..276f6f2a1 100644
--- a/tests/test_core/test_new_alignment.py
+++ b/tests/test_core/test_new_alignment.py
@@ -5257,3 +5257,14 @@ def test_load_with_pathlib(mk_cls, home_seqs):
     path = home_seqs
     got = mk_cls(path, moltype="dna")
     assert "Human" in got.names
+
+
+def test_load_from_url():
+    import cogent3
+
+    aln = cogent3.load_aligned_seqs(
+        "https://raw.githubusercontent.com/cogent3/cogent3/develop/doc/data/long_testseqs.fasta",
+        moltype="dna",
+        new_type=True,
+    )
+    assert isinstance(aln, new_alignment.Alignment)