Skip to content

Commit

Permalink
Merge pull request #83 from rasbt/v2.3setup
Browse files Browse the repository at this point in the history
version 2.3.0
  • Loading branch information
rasbt committed Jan 4, 2022
2 parents 70f83cb + 25e07a6 commit 0eb56e9
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 59 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
New BSD License

Copyright (c) 2014-2018, Sebastian Raschka.
Copyright (c) 2014-2022, Sebastian Raschka.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ To get an overview of all available commands, type:
<br>

```raw
%watermark [-a AUTHOR] [-gu GITHUB_USERNAME] [-e EMAIL] [-ws WEBSITE]
%watermark [-a AUTHOR] [-gu GITHUB_USERNAME] [-e EMAIL] [-ws WEBSITE]
[-d] [-n] [-t] [-i] [-z] [-u] [-c CUSTOM_TIME] [-v]
[-p PACKAGES] [-h] [-m] [-g] [-r] [-b] [-w] [-iv]
[-p PACKAGES] [-co] [-h] [-m] [-g] [-r] [-b] [-w] [-iv]
IPython magic function to print date/time stamps
and various system information.
options:
optional arguments:
-a AUTHOR, --author AUTHOR
prints author name
-gu GITHUB_USERNAME, --github_username GITHUB_USERNAME
Expand All @@ -105,6 +105,7 @@ options:
-p PACKAGES, --packages PACKAGES
prints versions of specified Python modules and
packages
-co, --conda prints name of current conda environment
-h, --hostname prints the host name
-m, --machine prints system and machine info
-g, --githash prints current Git commit hash
Expand Down Expand Up @@ -132,9 +133,20 @@ In line with [NEP 29][nep-29], this project supports:

[[top](#sections)]

#### v. 2.3.0 (February 17, 2021)
#### v. 2.3.0 (January 3, 2022)

- Added the following arguments: `--github_username` - for prints author github username, `--email` - for prints author email, `--website` - for prints author or project website.
- Added the following arguments: `--github_username` - for prints author github username, `--email` - for prints author email, `--website` - for prints author or project website. ([#82](https://github.com/rasbt/watermark/pull/82), via contribution by [joschkazj](https://github.com/joschkazj))
- Added a `--conda` option to print the name of the current conda environment. ([#79](https://github.com/rasbt/watermark/pull/79), via contribution by [Alexander Krasnikov](https://github.com/askras))
- It is now possible to inject globals when used outside IPython ([#80](https://github.com/rasbt/watermark/pull/80), via contribution by [
Hugo Lapré](https://github.com/Hugovdberg)). For example, version numbers of imported packages can now be obtained as follows:

```python
import numpy
import watermark.watermark as watermark


watermark(iversions=True, globals_=globals())
```

#### v. 2.2.0 (February 17, 2021)

Expand Down
Binary file modified docs/images/ex1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/ex2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
147 changes: 95 additions & 52 deletions docs/watermark.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,59 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"\u001b[0;31mDocstring:\u001b[0m\n",
"::\n",
"\n",
" %watermark [-a AUTHOR] [-gu GITHUB_USERNAME] [-e EMAIL] [-ws WEBSITE]\n",
" [-d] [-n] [-t] [-i] [-z] [-u] [-c CUSTOM_TIME] [-v]\n",
" [-p PACKAGES] [-co] [-h] [-m] [-g] [-r] [-b] [-w] [-iv]\n",
"\n",
"IPython magic function to print date/time stamps\n",
"and various system information.\n",
"\n",
"optional arguments:\n",
" -a AUTHOR, --author AUTHOR\n",
" prints author name\n",
" -gu GITHUB_USERNAME, --github_username GITHUB_USERNAME\n",
" prints author github username\n",
" -e EMAIL, --email EMAIL\n",
" prints author email\n",
" -ws WEBSITE, --website WEBSITE\n",
" prints author or project website\n",
" -d, --date prints current date as YYYY-mm-dd\n",
" -n, --datename prints date with abbrv. day and month names\n",
" -t, --time prints current time as HH-MM-SS\n",
" -i, --iso8601 prints the combined date and time including the time\n",
" zone in the ISO 8601 standard with UTC offset\n",
" -z, --timezone appends the local time zone\n",
" -u, --updated appends a string \"Last updated: \"\n",
" -c CUSTOM_TIME, --custom_time CUSTOM_TIME\n",
" prints a valid strftime() string\n",
" -v, --python prints Python and IPython version\n",
" -p PACKAGES, --packages PACKAGES\n",
" prints versions of specified Python modules and\n",
" packages\n",
" -co, --conda prints name of current conda environment\n",
" -h, --hostname prints the host name\n",
" -m, --machine prints system and machine info\n",
" -g, --githash prints current Git commit hash\n",
" -r, --gitrepo prints current Git remote address\n",
" -b, --gitbranch prints current Git branch\n",
" -w, --watermark prints the current version of watermark\n",
" -iv, --iversions prints the name/version of all imported modules\n",
"\u001b[0;31mFile:\u001b[0m ~/code/github_rasbt/watermark/watermark/magic.py\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%watermark?"
]
Expand Down Expand Up @@ -176,18 +226,18 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Last updated: 2021-12-04T00:47:46.257735+03:00\n",
"Last updated: 2022-01-03T19:44:42.841436-06:00\n",
"\n",
"Python implementation: CPython\n",
"Python version : 3.10.0\n",
"IPython version : 7.30.0\n",
"Python version : 3.9.6\n",
"IPython version : 7.30.1\n",
"\n",
"Compiler : GCC 11.2.1 20210728 (Red Hat 11.2.1-1)\n",
"OS : Linux\n",
"Release : 5.15.6-200.fc35.x86_64\n",
"Machine : x86_64\n",
"Processor : x86_64\n",
"CPU cores : 4\n",
"Compiler : Clang 11.1.0 \n",
"OS : Darwin\n",
"Release : 21.1.0\n",
"Machine : arm64\n",
"Processor : arm\n",
"CPU cores : 8\n",
"Architecture: 64bit\n",
"\n"
]
Expand All @@ -213,7 +263,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Last updated: 2021-12-04 00:47:46\n",
"Last updated: 2022-01-03 19:44:42\n",
"\n"
]
}
Expand All @@ -231,7 +281,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Last updated: 2021-12-04T00:47:46.329412+03:00\n",
"Last updated: 2022-01-03T19:44:42.855544-06:00\n",
"\n"
]
}
Expand All @@ -249,7 +299,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Last updated: Sat Dec 04 2021 00:47:46MSK\n",
"Last updated: Mon Jan 03 2022 19:44:42CST\n",
"\n"
]
}
Expand All @@ -275,8 +325,8 @@
"output_type": "stream",
"text": [
"Python implementation: CPython\n",
"Python version : 3.10.0\n",
"IPython version : 7.30.0\n",
"Python version : 3.9.6\n",
"IPython version : 7.30.1\n",
"\n"
]
}
Expand All @@ -301,12 +351,12 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Compiler : GCC 11.2.1 20210728 (Red Hat 11.2.1-1)\n",
"OS : Linux\n",
"Release : 5.15.6-200.fc35.x86_64\n",
"Machine : x86_64\n",
"Processor : x86_64\n",
"CPU cores : 4\n",
"Compiler : Clang 11.1.0 \n",
"OS : Darwin\n",
"Release : 21.1.0\n",
"Machine : arm64\n",
"Processor : arm\n",
"CPU cores : 8\n",
"Architecture: 64bit\n",
"\n"
]
Expand All @@ -333,19 +383,19 @@
"output_type": "stream",
"text": [
"Python implementation: CPython\n",
"Python version : 3.10.0\n",
"IPython version : 7.30.0\n",
"Python version : 3.9.6\n",
"IPython version : 7.30.1\n",
"\n",
"numpy : 1.21.4\n",
"numpy : 1.22.0\n",
"scipy : 1.7.3\n",
"sklearn: 1.0.1\n",
"sklearn: 1.0.2\n",
"\n",
"Compiler : GCC 11.2.1 20210728 (Red Hat 11.2.1-1)\n",
"OS : Linux\n",
"Release : 5.15.6-200.fc35.x86_64\n",
"Machine : x86_64\n",
"Processor : x86_64\n",
"CPU cores : 4\n",
"Compiler : Clang 11.1.0 \n",
"OS : Darwin\n",
"Release : 21.1.0\n",
"Machine : arm64\n",
"Processor : arm\n",
"CPU cores : 8\n",
"Architecture: 64bit\n",
"\n"
]
Expand Down Expand Up @@ -373,18 +423,18 @@
"text": [
"Author: John Doe\n",
"\n",
"Last updated: 2021-12-04\n",
"Last updated: 2022-01-03\n",
"\n",
"Python implementation: CPython\n",
"Python version : 3.10.0\n",
"IPython version : 7.30.0\n",
"Python version : 3.9.6\n",
"IPython version : 7.30.1\n",
"\n",
"Compiler : GCC 11.2.1 20210728 (Red Hat 11.2.1-1)\n",
"OS : Linux\n",
"Release : 5.15.6-200.fc35.x86_64\n",
"Machine : x86_64\n",
"Processor : x86_64\n",
"CPU cores : 4\n",
"Compiler : Clang 11.1.0 \n",
"OS : Darwin\n",
"Release : 21.1.0\n",
"Machine : arm64\n",
"Processor : arm\n",
"CPU cores : 8\n",
"Architecture: 64bit\n",
"\n"
]
Expand Down Expand Up @@ -421,23 +471,16 @@
"name": "stdout",
"output_type": "stream",
"text": [
"numpy : 1.21.4\n",
"scipy : 1.7.3\n",
"sklearn: 1.0.1\n",
"numpy : 1.22.0\n",
"sklearn: 1.0.2\n",
"\n"
]
}
],
"source": [
"%watermark --iversions"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -456,7 +499,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.0"
"version": "3.9.6"
},
"toc": {
"base_numbering": 1,
Expand All @@ -474,4 +517,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
2 changes: 1 addition & 1 deletion watermark/magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class WaterMark(Magics):
help='prints Python and IPython version')
@argument('-p', '--packages', type=str,
help='prints versions of specified Python modules and packages')
@argument('-e', '--conda', action='store_true',
@argument('-co', '--conda', action='store_true',
help='prints name of current conda environment')
@argument('-h', '--hostname', action='store_true',
help='prints the host name')
Expand Down

0 comments on commit 0eb56e9

Please sign in to comment.