cadu-leite / networkdays Goto Github PK
View Code? Open in Web Editor NEWNetworkdays functions ... including `networkdays` excel like function with no dependencies (no NumPy)
License: Other
Networkdays functions ... including `networkdays` excel like function with no dependencies (no NumPy)
License: Other
Suppose to initiate Networkdays class withou date_end
parameter...
Its works but raise exception when call :method:Networkdays.networkdays()
method.
trace ...
---> 44 date_diff = self.date_end - self.date_start
45 dates = {
46 self.date_start + datetime.timedelta(days=days)
TypeError: unsupported operand type(s) for -: 'NoneType' and 'datetime.date'
The file readme_code.ipynb
was used to build the first tests for the docs.
Now we have doc tests ... see #8
this file has no need
hey cadu, how are u doing?
im starting using ur library and just noticed that the code is not being covered by type hintings.
what do u think about we start adding types for the abstraction we already implemented?
im going to open a PR rn adding those type hints
Networkdays return a llist of datetime objects
For some cases, a nested list of month days number list per month would be desirable.
[[<month days 1>],[<month days 2>],....[<month days 12>]]
Actually its a nested list of month days, grouped by month ;)
[
[3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31],
[1, 2, 3, 4, 7, 8, 9, 10, 11, 14, 15, 16, 17, 18, 21, 22, 23, 24, 25, 28],
[1, 2, 3, 4, 7, 8, 9, 10, 11, 14, 15, 16, 17, 18, 21, 22, 23, 24, 25, 28, 29, 30, 31],
[1, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 18, 19, 20, 21, 22, 25, 26, 27, 28, 29,]
[2, 3, 4, 5, 6, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 23, 24, 25, 26, 27, 30, 31],
[1, 2, 3, 6, 7, 8, 9, 10, 13, 14, 15, 16, 17, 20, 21, 22, 23, 24, 27, 28, 29, 30],
[1, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 18, 19, 20, 21, 22, 25, 26, 27, 28, 29],
[1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 15, 16, 17, 18, 19, 22, 23, 24, 25, 26, 29, 30, 31],
[1, 2, 5, 6, 7, 8, 9, 12, 13, 14, 15, 16, 19, 20, 21, 22, 23, 26, 27, 28, 29, 30,]
[3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31],
[1, 2, 3, 4, 7, 8, 9, 10, 11, 14, 15, 16, 17, 18, 21, 22, 23, 24, 25, 28, 29, 30],
[1, 2, 5, 6, 7, 8, 9, 12, 13, 14, 15, 16, 19, 20, 21, 22, 23, 26, 27, 28, 29, 30]
]
File "python3.9/site-packages/networkdays/networkdays.py", line 82, in
lambda d: self.date_end >= d >= self.date_start,
TypeError: can't compare datetime.datetime to datetime.date
like Python calendar function ... but only "networdays"
$>python -m calendar
2020
January February March
Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su
1 2 3 4 5 1 2 1
6 7 8 9 10 11 12 3 4 5 6 7 8 9 2 3 4 5 6 7 8
13 14 15 16 17 18 19 10 11 12 13 14 15 16 9 10 11 12 13 14 15
20 21 22 23 24 25 26 17 18 19 20 21 22 23 16 17 18 19 20 21 22
27 28 29 30 31 24 25 26 27 28 29 23 24 25 26 27 28 29
30 31
It may be easily used on text files ;) .. sphinx, restructuredtext ...
Add code below do the readme
.. image:: https://codecov.io/gh/cadu-leite/networkdays/branch/master/graph/badge.svg
:target: https://codecov.io/gh/cadu-leite/networkdays
There are unnecessary dependencies on requirements.txt
requests ??
I've installed this on my linux machines and it works well but when i trying it on my Mac it doesn't. Even if its already installed it will always return: ModuleNotFoundError: No module named 'networkdays'.
For this one I need @cadu-leite to register this repo in https://codecov.io/ and provide the code to include on CI.
For a better namespace or "dot path"...
I believe would be a good idea
take both classes of the networkdays file
and put each one in his own file ...
networkdays
├── networkdays
│ ├── __init__.py
│ ├── networkdays.py
to be ...
├── networkdays
│ ├── __init__.py
│ ├── networkdays.py
│ └── jobschedule.py
and expose both on init.py , to have one less level on namespaces.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.