genomoncology / related

Nested Object Models in Python with dictionary, YAML, and JSON transformation support
MIT License
198 stars 15 forks source link

DateTime and Time fields added. Example and test using JSON added #11

Closed GabrielDav closed 6 years ago

GabrielDav commented 6 years ago

This improvement suggestion is targeting issue #1 and as a bonus introduces TimeField for issue #10. Since new fields required new tests I have also added test with JSON (answering my own request in issue #3). Unfortunately Python is incapable to parse datetime it can produce (please refer to this post), this is because in real world it is normal for datetime to come in as ISO formatted date string. Because of this, I have added 'python-dateutil'. Since it is a lightweight library that support Py2 it seems to be a good fit. There is also minor confusion about Example05 as it seems that example already exist in the code but it is not documented.

codecov-io commented 6 years ago

Codecov Report

Merging #11 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #11   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           9      9           
  Lines         442    479   +37     
=====================================
+ Hits          442    479   +37
Impacted Files Coverage Δ
src/related/__init__.py 100% <ø> (ø) :arrow_up:
src/related/dispatchers.py 100% <100%> (ø) :arrow_up:
src/related/fields.py 100% <100%> (ø) :arrow_up:
src/related/types.py 100% <100%> (ø) :arrow_up:
src/related/converters.py 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d707a6e...0cabf48. Read the comment docs.

imaurer commented 6 years ago

Thanks @GabrielDav changes look great and thanks for adding an example. Thanks for the reminder about example 5.