修改为东南天坐标系

This commit is contained in:
2026-01-20 09:49:52 +08:00
parent 9538757047
commit 333fad40ac
7201 changed files with 1030888 additions and 85410 deletions

View File

@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
commit_id: COMMIT_ID
__commit_id__: COMMIT_ID
__version__ = version = '2025.12.0'
__version_tuple__ = version_tuple = (2025, 12, 0)
__version__ = version = '2026.1.0'
__version_tuple__ = version_tuple = (2026, 1, 0)
__commit_id__ = commit_id = None

View File

@@ -1,5 +1,6 @@
"""Helper functions for a standard streaming compression API"""
import sys
from zipfile import ZipFile
import fsspec.utils
@@ -155,26 +156,14 @@ except ImportError:
pass
try:
# zstd in the standard library for python >= 3.14
from compression.zstd import ZstdFile
register_compression("zstd", ZstdFile, "zst")
if sys.version_info >= (3, 14):
from compression import zstd
else:
from backports import zstd
register_compression("zstd", zstd.ZstdFile, "zst")
except ImportError:
try:
import zstandard as zstd
def zstandard_file(infile, mode="rb"):
if "r" in mode:
cctx = zstd.ZstdDecompressor()
return cctx.stream_reader(infile)
else:
cctx = zstd.ZstdCompressor(level=10)
return cctx.stream_writer(infile)
register_compression("zstd", zstandard_file, "zst")
except ImportError:
pass
pass
def available_compressions():

View File

@@ -1,4 +1,5 @@
import os
import ssl
import uuid
from ftplib import FTP, FTP_TLS, Error, error_perm
from typing import Any
@@ -6,6 +7,37 @@ from typing import Any
from ..spec import AbstractBufferedFile, AbstractFileSystem
from ..utils import infer_storage_options, isfilelike
SECURITY_PROTOCOL_MAP = {
"tls": ssl.PROTOCOL_TLS,
"tlsv1": ssl.PROTOCOL_TLSv1,
"tlsv1_1": ssl.PROTOCOL_TLSv1_1,
"tlsv1_2": ssl.PROTOCOL_TLSv1_2,
"sslv23": ssl.PROTOCOL_SSLv23,
}
class ImplicitFTPTLS(FTP_TLS):
"""
FTP_TLS subclass that automatically wraps sockets in SSL
to support implicit FTPS.
"""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._sock = None
@property
def sock(self):
"""Return the socket."""
return self._sock
@sock.setter
def sock(self, value):
"""When modifying the socket, ensure that it is ssl wrapped."""
if value is not None and not isinstance(value, ssl.SSLSocket):
value = self.context.wrap_socket(value)
self._sock = value
class FTPFileSystem(AbstractFileSystem):
"""A filesystem over classic FTP"""
@@ -55,8 +87,14 @@ class FTPFileSystem(AbstractFileSystem):
Timeout of the ftp connection in seconds
encoding: str
Encoding to use for directories and filenames in FTP connection
tls: bool
Use FTP-TLS, by default False
tls: bool or str
Enable FTP-TLS for secure connections:
- False: Plain FTP (default)
- True: Explicit TLS (FTPS with AUTH TLS command)
- "tls": Auto-negotiate highest protocol
- "tlsv1": TLS v1.0
- "tlsv1_1": TLS v1.1
- "tlsv1_2": TLS v1.2
"""
super().__init__(**kwargs)
self.host = host
@@ -71,15 +109,27 @@ class FTPFileSystem(AbstractFileSystem):
self.blocksize = 2**16
self.tls = tls
self._connect()
if self.tls:
if isinstance(self.tls, bool) and self.tls:
self.ftp.prot_p()
def _connect(self):
security = None
if self.tls:
ftp_cls = FTP_TLS
if isinstance(self.tls, str):
ftp_cls = ImplicitFTPTLS
security = SECURITY_PROTOCOL_MAP.get(
self.tls,
f"Not supported {self.tls} protocol",
)
if isinstance(security, str):
raise ValueError(security)
else:
ftp_cls = FTP_TLS
else:
ftp_cls = FTP
self.ftp = ftp_cls(timeout=self.timeout, encoding=self.encoding)
if security:
self.ftp.ssl_version = security
self.ftp.connect(self.host, self.port)
self.ftp.login(*self.cred)

View File

@@ -166,6 +166,10 @@ class LocalFileSystem(AbstractFileSystem):
"""
path1 = self._strip_protocol(path1)
path2 = self._strip_protocol(path2)
if self.auto_mkdir:
self.makedirs(self._parent(path2), exist_ok=True)
shutil.move(path1, path2)
def link(self, src, dst, **kwargs):

View File

@@ -189,7 +189,7 @@ known_implementations = {
},
"pyscript": {
"class": "pyscript_fsspec_client.client.PyscriptFileSystem",
"err": "Install requests (cpython) or run in pyscript",
"err": "This only runs in a pyscript context",
},
"reference": {"class": "fsspec.implementations.reference.ReferenceFileSystem"},
"root": {