Skip to content

Apply 5.0 deprecation and renaming to neo4j.time module. #635

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

Merged
merged 2 commits into from
Jan 13, 2022
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
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,41 @@
- `trust` has been removed.
Use `trusted_certificates` instead which expects `None` or a `list`. See the
API documentation for more details.
- `neo4j.time` module:
- `Duration`
- The constructor does not accept `subseconds` anymore.
Use `milliseconds`, `microseconds`, or `nanoseconds` instead.
- The property `subseconds` has been removed.
Use `nanoseconds` instead.
- The property `hours_minutes_seconds` has been removed.
Use `hours_minutes_seconds_nanoseconds` instead.
- For all math operations holds: they are element-wise on
(`months`, `days`, `nanoseconds`).
This affects (i.e., changes) the working of `//`, `%`, `/`, and `*`.
- Years are equal to 12 months.
- Weeks are equal to 7 days.
- `seconds`, `milliseconds`, `microseconds`, and `nanoseconds` are
implicitly converted to `nanoseconds` or `seconds` as fit.
- Multiplication and division allow for floats but will always result in
integer values (round to nearest even).
- `Time`
- The constructor does not accept `float`s for `second` anymore.
Use `nanosecond` instead.
- Ticks are now nanoseconds since midnight (`int`).
- The property `ticks_ns` has been renamed to `ticks`.
The old `ticks` is no longer supported.
- The property`from_ticks_ns` has been renamed to `from_ticks`.
The old `from_ticks` is no longer supported.
- The property `second` returns an `int` instead of a `float`.
Use `nanosecond` to get the sub-second information.
- The property `hour_minute_second` has been removed.
Use `hour_minute_second_nanosecond` instead.
- `DateTime`
- The property `hour_minute_second` has been removed.
Use `hour_minute_second_nanosecond` instead.
- The property `second` returns an `int` instead of a `float`.
Use `nanosecond` to get the sub-second information.


## Version 4.4

Expand Down
20 changes: 9 additions & 11 deletions docs/source/temporal_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ Class methods

.. automethod:: neo4j.time.Time.from_ticks

.. automethod:: neo4j.time.Time.from_ticks_ns

.. automethod:: neo4j.time.Time.from_native

.. automethod:: neo4j.time.Time.from_clock_time
Expand All @@ -164,15 +162,13 @@ Instance attributes

.. autoattribute:: neo4j.time.Time.ticks

.. autoattribute:: neo4j.time.Time.ticks_ns

.. autoattribute:: neo4j.time.Time.hour

.. autoattribute:: neo4j.time.Time.minute

.. autoattribute:: neo4j.time.Time.second

.. autoattribute:: neo4j.time.Time.hour_minute_second
.. autoattribute:: neo4j.time.Time.nanosecond

.. autoattribute:: neo4j.time.Time.hour_minute_second_nanosecond

Expand Down Expand Up @@ -290,8 +286,6 @@ Instance attributes

.. autoattribute:: neo4j.time.DateTime.tzinfo

.. autoattribute:: neo4j.time.DateTime.hour_minute_second

.. autoattribute:: neo4j.time.DateTime.hour_minute_second_nanosecond


Expand Down Expand Up @@ -388,14 +382,10 @@ Instance attributes

.. autoattribute:: neo4j.time.Duration.seconds

.. autoattribute:: neo4j.time.Duration.subseconds

.. autoattribute:: neo4j.time.Duration.nanoseconds

.. autoattribute:: neo4j.time.Duration.years_months_days

.. autoattribute:: neo4j.time.Duration.hours_minutes_seconds

.. autoattribute:: neo4j.time.Duration.hours_minutes_seconds_nanoseconds


Expand All @@ -410,6 +400,14 @@ Operations

.. automethod:: neo4j.time.Duration.__mul__

.. automethod:: neo4j.time.Duration.__truediv__

.. automethod:: neo4j.time.Duration.__floordiv__

.. automethod:: neo4j.time.Duration.__mod__

.. automethod:: neo4j.time.Duration.__divmod__

.. automethod:: neo4j.time.Duration.__pos__

.. automethod:: neo4j.time.Duration.__neg__
Expand Down
Loading