Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update aliases #191

Merged
merged 3 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[bumpversion]
current_version = 0.1.188
current_version = 0.1.189
126 changes: 105 additions & 21 deletions ipython/startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,16 @@
from enum import Enum, IntEnum, auto
from functools import lru_cache, partial, reduce, wraps
from hashlib import md5
from inspect import signature
from inspect import (
isasyncgen,
isasyncgenfunction,
iscoroutine,
iscoroutinefunction,
isfunction,
isgenerator,
isgeneratorfunction,
signature,
)
from itertools import (
chain,
count,
Expand Down Expand Up @@ -246,6 +255,13 @@
inspect,
io,
is_dataclass,
isasyncgen,
isasyncgenfunction,
iscoroutine,
iscoroutinefunction,
isfunction,
isgenerator,
isgeneratorfunction,
islice,
it,
itertools,
Expand Down Expand Up @@ -288,7 +304,6 @@
sleep_sync,
smtplib,
socket,
socket,
starmap,
stat,
statistics,
Expand Down Expand Up @@ -430,6 +445,15 @@
_ = [cp, cvxpy]


try:
import dacite
from dacite import from_dict
except ModuleNotFoundError:
pass
else:
_ = [dacite, from_dict]


try:
from frozendict import frozendict
except ModuleNotFoundError:
Expand Down Expand Up @@ -518,15 +542,23 @@
try:
from utilities.loguru import (
LogLevel,
get_logging_level,
get_logging_level_name,
get_logging_level_number,
log,
logged_sleep_async,
logged_sleep_sync,
)
except ModuleNotFoundError:
from utilities.logging import LogLevel, get_logging_level
pass
else:
_ = [LogLevel, get_logging_level, log, logged_sleep_async, logged_sleep_sync]
_ = [
LogLevel,
get_logging_level_number,
get_logging_level_name,
log,
logged_sleep_async,
logged_sleep_sync,
]


try:
Expand Down Expand Up @@ -585,11 +617,19 @@
_ = [mi, more_itertools, partition, split_at]

try:
from utilities.iterables import always_iterable, one
from utilities.iterables import (
OneEmptyError,
OneError,
OneNonUniqueError,
always_iterable,
one,
)
except ModuleNotFoundError:
from more_itertools import always_iterable, one

_ = [always_iterable, one]
else:
_ = [one, always_iterable]
_ = [OneEmptyError, OneError, OneNonUniqueError, always_iterable, one]
try:
from utilities.more_itertools import partition_typeguard, peekable
except ModuleNotFoundError:
Expand Down Expand Up @@ -739,6 +779,21 @@
]


try:
import orjson
except ModuleNotFoundError:
pass
else:
_ = [orjson]

try:
from utilities.orjson import deserialize, serialize
except ModuleNotFoundError:
pass
else:
_ = [deserialize, serialize]


try:
import pandas # noqa: ICN001
import pandas as pd
Expand Down Expand Up @@ -992,11 +1047,27 @@
when,
]
try:
from utilities.polars import check_polars_dataframe, zoned_datetime
from utilities.polars import (
DatetimeHongKong,
DatetimeTokyo,
DatetimeUSCentral,
DatetimeUSEastern,
DatetimeUTC,
check_polars_dataframe,
zoned_datetime,
)
except ModuleNotFoundError:
pass
else:
_ = [check_polars_dataframe, zoned_datetime]
_ = [
DatetimeHongKong,
DatetimeTokyo,
DatetimeUSCentral,
DatetimeUSEastern,
DatetimeUTC,
check_polars_dataframe,
zoned_datetime,
]

try:
from pqdm.processes import pqdm
Expand Down Expand Up @@ -1029,6 +1100,7 @@
else:
_ = [throttle]


try:
import requests
except ModuleNotFoundError:
Expand Down Expand Up @@ -1142,13 +1214,18 @@


try:
from utilities.asyncio import send_and_next_async, start_async_generator_coroutine
from utilities.datetime import (
DAY,
EPOCH_UTC,
HALF_YEAR,
HOUR,
MINUTE,
MONTH,
QUARTER,
SECOND,
WEEK,
YEAR,
Month,
date_to_datetime,
ensure_month,
Expand All @@ -1166,9 +1243,10 @@
serialize_month,
)
from utilities.functions import get_class, get_class_name
from utilities.functools import partial
from utilities.functools import ensure_not_none, partial
from utilities.git import get_repo_root
from utilities.iterables import groupby_lists, one
from utilities.math import is_integral
from utilities.pathlib import list_dir
from utilities.pickle import read_pickle, write_pickle
from utilities.random import SYSTEM_RANDOM
Expand All @@ -1182,15 +1260,14 @@
ensure_datetime,
ensure_float,
ensure_int,
ensure_not_none,
make_isinstance,
)
from utilities.zoneinfo import (
HONG_KONG,
TOKYO,
US_CENTRAL,
US_EASTERN,
UTC,
HongKong,
Tokyo,
USCentral,
USEastern,
get_time_zone_name,
)
except ModuleNotFoundError:
Expand All @@ -1200,26 +1277,32 @@
BackgroundTask,
DAY,
EPOCH_UTC,
HONG_KONG,
HALF_YEAR,
HOUR,
HongKong,
MINUTE,
MONTH,
Month,
QUARTER,
SECOND,
SYSTEM_RANDOM,
TOKYO,
Timer,
US_CENTRAL,
US_EASTERN,
Tokyo,
USCentral,
USEastern,
UTC,
WEEK,
YEAR,
custom_print,
custom_repr,
date_to_datetime,
date_to_datetime,
ensure_class,
ensure_datetime,
ensure_float,
ensure_int,
ensure_month,
ensure_month,
ensure_not_none,
ensure_str,
extract_group,
Expand All @@ -1239,16 +1322,17 @@
get_today_tokyo,
get_years,
groupby_lists,
is_integral,
list_dir,
make_isinstance,
one,
parse_month,
parse_month,
partial,
read_pickle,
run_in_background,
send_and_next_async,
serialize_month,
serialize_month,
start_async_generator_coroutine,
write_pickle,
]
try:
Expand Down
26 changes: 13 additions & 13 deletions nvim/lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"conform.nvim": {
"branch": "master",
"commit": "0ebe875d9c306f5fc829db38492ffff2a70d8e9d"
"commit": "1a99fdc1d3aa9ccdf3021e67982a679a8c5c740c"
},
"dial.nvim": {
"branch": "master",
Expand All @@ -53,7 +53,7 @@
},
"fzf-lua": {
"branch": "main",
"commit": "db41613292b88b5306d65caf6ae8996db5498ccb"
"commit": "985e1002b5dc70f8196ea0605bbfffc8c8407e31"
},
"gitsigns.nvim": {
"branch": "main",
Expand Down Expand Up @@ -93,15 +93,15 @@
},
"luasnip": {
"branch": "master",
"commit": "45db5addf8d0a201e1cf247cae4cdce605ad3768"
"commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071"
},
"marks.nvim": {
"branch": "master",
"commit": "bb25ae3f65f504379e3d08c8a02560b76eaf91e8"
},
"mason-lspconfig.nvim": {
"branch": "main",
"commit": "482350b050bd413931c2cdd4857443c3da7d57cb"
"commit": "25c11854aa25558ee6c03432edfa0df0217324be"
},
"mason-tool-installer.nvim": {
"branch": "main",
Expand All @@ -117,7 +117,7 @@
},
"neoscroll.nvim": {
"branch": "master",
"commit": "6dfce64589e8e685d21f2dbd2df15a2473fa1d41"
"commit": "4e0428a41c6ec191df543fc95349f6e1c598e53f"
},
"nvim-autopairs": {
"branch": "master",
Expand Down Expand Up @@ -145,15 +145,15 @@
},
"nvim-lint": {
"branch": "master",
"commit": "a7ce9c78a7c710c28bee56dfab10a5c0c80b7fb5"
"commit": "2bb7cc049d129d7fdbf31db0bc34fad5dd216f0d"
},
"nvim-lspconfig": {
"branch": "master",
"commit": "bdbc65aadc708ce528efb22bca5f82a7cca6b54d"
"commit": "bb682c167a0878338b4313b55538953d1c039085"
},
"nvim-neoclip.lua": {
"branch": "main",
"commit": "709c97fabec9da7d04f7d2f5e207423af8c02871"
"commit": "32e05f2d23dc5b6a284a688c0535a83d1bfc633f"
},
"nvim-spectre": {
"branch": "master",
Expand All @@ -169,27 +169,27 @@
},
"nvim-tree.lua": {
"branch": "master",
"commit": "ea55ef12036897fdc4476b115a395d2a34965c82"
"commit": "d41b4ca013ed89e41b9c0ecbdae5f1633e42f7fa"
},
"nvim-treesitter": {
"branch": "master",
"commit": "bfe74a4899882a4ef45abb80813f14644a110a34"
"commit": "e0338f2b74fbad808f2569c7d4eadd8796af2118"
},
"nvim-treesitter-context": {
"branch": "master",
"commit": "e6cc783b74606d97ca9eff6494e3f5c2ca603a50"
},
"nvim-treesitter-textobjects": {
"branch": "master",
"commit": "fe3deb7f67ce0cc4ebfe2ea6c1c7ae1c7a939d73"
"commit": "bf8d2ad35d1d1a687eae6c065c3d524f7ab61b23"
},
"nvim-various-textobjs": {
"branch": "main",
"commit": "8dbc655f794202f45ab6a1cac1cb323a218ac6a1"
},
"nvim-web-devicons": {
"branch": "master",
"commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520"
"commit": "9154484705968658e9aab2b894d1b2a64bf9f83d"
},
"plenary.nvim": {
"branch": "master",
Expand Down Expand Up @@ -245,7 +245,7 @@
},
"vim-sleuth": {
"branch": "master",
"commit": "1cc4557420f215d02c4d2645a748a816c220e99b"
"commit": "cd9d382e33bb817abe7f10cdc3a606bf1d491d75"
},
"vim-tmux-navigator": {
"branch": "master",
Expand Down
Loading