forked from SciSharp/Numpy.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnp.datetime.gen.cs
More file actions
254 lines (244 loc) · 11.4 KB
/
np.datetime.gen.cs
File metadata and controls
254 lines (244 loc) · 11.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
// Copyright (c) 2019 by the SciSharp Team
// Code generated by CodeMinion: https://github.com/SciSharp/CodeMinion
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using Python.Runtime;
using Numpy.Models;
using Python.Included;
namespace Numpy
{
public static partial class np
{
/// <summary>
/// Convert an array of datetimes into an array of strings.
/// </summary>
/// <param name="arr">
/// The array of UTC timestamps to format.
/// </param>
/// <param name="unit">
/// One of None, ‘auto’, or a datetime unit.
/// </param>
/// <param name="timezone">
/// Timezone information to use when displaying the datetime.<br></br>
/// If ‘UTC’, end
/// with a Z to indicate UTC time.<br></br>
/// If ‘local’, convert to the local timezone
/// first, and suffix with a +-#### timezone offset.<br></br>
/// If a tzinfo object,
/// then do as with ‘local’, but use the specified timezone.
/// </param>
/// <param name="casting">
/// Casting to allow when changing between datetime units.
/// </param>
/// <returns>
/// An array of strings the same shape as arr.
/// </returns>
public static NDarray datetime_as_string(string[] arr, string unit, string timezone = "naive", string casting = "same_kind")
=> NumPy.Instance.datetime_as_string(arr, unit, timezone:timezone, casting:casting);
/// <summary>
/// Get information about the step size of a date or time type.<br></br>
///
/// The returned tuple can be passed as the second argument of numpy.datetime64 and
/// numpy.timedelta64.
/// </summary>
/// <param name="dtype">
/// The dtype object, which must be a datetime64 or timedelta64 type.
/// </param>
/// <returns>
/// A tuple of:
/// unit
/// The datetime unit on which this dtype
/// is based.
/// count
/// The number of base units in a step.
/// </returns>
public static (string, int) datetime_data(Dtype dtype)
=> NumPy.Instance.datetime_data(dtype);
/*
/// <summary>
/// A business day calendar object that efficiently stores information
/// defining valid days for the busday family of functions.<br></br>
///
/// The default valid days are Monday through Friday (“business days”).<br></br>
///
/// A busdaycalendar object can be specified with any set of weekly
/// valid days, plus an optional “holiday” dates that always will be invalid.<br></br>
///
/// Once a busdaycalendar object is created, the weekmask and holidays
/// cannot be modified.
/// </summary>
/// <param name="weekmask">
/// A seven-element array indicating which of Monday through Sunday are
/// valid days.<br></br>
/// May be specified as a length-seven list or array, like
/// [1,1,1,1,1,0,0]; a length-seven string, like ‘1111100’; or a string
/// like “Mon Tue Wed Thu Fri”, made up of 3-character abbreviations for
/// weekdays, optionally separated by white space.<br></br>
/// Valid abbreviations
/// are: Mon Tue Wed Thu Fri Sat Sun
/// </param>
/// <param name="holidays">
/// An array of dates to consider as invalid dates, no matter which
/// weekday they fall upon.<br></br>
/// Holiday dates may be specified in any
/// order, and NaT (not-a-time) dates are ignored.<br></br>
/// This list is
/// saved in a normalized form that is suited for fast calculations
/// of valid days.
/// </param>
/// <returns>
/// A business day calendar object containing the specified
/// weekmask and holidays values.
/// </returns>
public static busdaycalendar busdaycalendar(string weekmask = null, string[] holidays = null)
=> NumPy.Instance.busdaycalendar(weekmask:weekmask, holidays:holidays);
*/
/*
/// <summary>
/// Calculates which of the given dates are valid days, and which are not.
/// </summary>
/// <param name="dates">
/// The array of dates to process.
/// </param>
/// <param name="weekmask">
/// A seven-element array indicating which of Monday through Sunday are
/// valid days.<br></br>
/// May be specified as a length-seven list or array, like
/// [1,1,1,1,1,0,0]; a length-seven string, like ‘1111100’; or a string
/// like “Mon Tue Wed Thu Fri”, made up of 3-character abbreviations for
/// weekdays, optionally separated by white space.<br></br>
/// Valid abbreviations
/// are: Mon Tue Wed Thu Fri Sat Sun
/// </param>
/// <param name="holidays">
/// An array of dates to consider as invalid dates.<br></br>
/// They may be
/// specified in any order, and NaT (not-a-time) dates are ignored.<br></br>
///
/// This list is saved in a normalized form that is suited for
/// fast calculations of valid days.
/// </param>
/// <param name="busdaycal">
/// A busdaycalendar object which specifies the valid days.<br></br>
/// If this
/// parameter is provided, neither weekmask nor holidays may be
/// provided.
/// </param>
/// <param name="out">
/// If provided, this array is filled with the result.
/// </param>
/// <returns>
/// An array with the same shape as dates, containing True for
/// each valid day, and False for each invalid day.
/// </returns>
public static NDarray<bool> is_busday(string[] dates, string weekmask = "1111100", string[] holidays = null, busdaycalendar busdaycal = null, NDarray<bool> @out = null)
=> NumPy.Instance.is_busday(dates, weekmask:weekmask, holidays:holidays, busdaycal:busdaycal, @out:@out);
*/
/*
/// <summary>
/// First adjusts the date to fall on a valid day according to
/// the roll rule, then applies offsets to the given dates
/// counted in valid days.
/// </summary>
/// <param name="dates">
/// The array of dates to process.
/// </param>
/// <param name="offsets">
/// The array of offsets, which is broadcast with dates.
/// </param>
/// <param name="roll">
/// How to treat dates that do not fall on a valid day.<br></br>
/// The default
/// is ‘raise’.
/// </param>
/// <param name="weekmask">
/// A seven-element array indicating which of Monday through Sunday are
/// valid days.<br></br>
/// May be specified as a length-seven list or array, like
/// [1,1,1,1,1,0,0]; a length-seven string, like ‘1111100’; or a string
/// like “Mon Tue Wed Thu Fri”, made up of 3-character abbreviations for
/// weekdays, optionally separated by white space.<br></br>
/// Valid abbreviations
/// are: Mon Tue Wed Thu Fri Sat Sun
/// </param>
/// <param name="holidays">
/// An array of dates to consider as invalid dates.<br></br>
/// They may be
/// specified in any order, and NaT (not-a-time) dates are ignored.<br></br>
///
/// This list is saved in a normalized form that is suited for
/// fast calculations of valid days.
/// </param>
/// <param name="busdaycal">
/// A busdaycalendar object which specifies the valid days.<br></br>
/// If this
/// parameter is provided, neither weekmask nor holidays may be
/// provided.
/// </param>
/// <param name="out">
/// If provided, this array is filled with the result.
/// </param>
/// <returns>
/// An array with a shape from broadcasting dates and offsets
/// together, containing the dates with offsets applied.
/// </returns>
public static array of datetime64[D] busday_offset(string[] dates, array_like of int offsets, string roll = "raise", string weekmask = "1111100", string[] holidays = null, busdaycalendar busdaycal = null, array of datetime64[D] @out = null)
=> NumPy.Instance.busday_offset(dates, offsets, roll:roll, weekmask:weekmask, holidays:holidays, busdaycal:busdaycal, @out:@out);
*/
/*
/// <summary>
/// Counts the number of valid days between begindates and
/// enddates, not including the day of enddates.<br></br>
///
/// If enddates specifies a date value that is earlier than the
/// corresponding begindates date value, the count will be negative.
/// </summary>
/// <param name="begindates">
/// The array of the first dates for counting.
/// </param>
/// <param name="enddates">
/// The array of the end dates for counting, which are excluded
/// from the count themselves.
/// </param>
/// <param name="weekmask">
/// A seven-element array indicating which of Monday through Sunday are
/// valid days.<br></br>
/// May be specified as a length-seven list or array, like
/// [1,1,1,1,1,0,0]; a length-seven string, like ‘1111100’; or a string
/// like “Mon Tue Wed Thu Fri”, made up of 3-character abbreviations for
/// weekdays, optionally separated by white space.<br></br>
/// Valid abbreviations
/// are: Mon Tue Wed Thu Fri Sat Sun
/// </param>
/// <param name="holidays">
/// An array of dates to consider as invalid dates.<br></br>
/// They may be
/// specified in any order, and NaT (not-a-time) dates are ignored.<br></br>
///
/// This list is saved in a normalized form that is suited for
/// fast calculations of valid days.
/// </param>
/// <param name="busdaycal">
/// A busdaycalendar object which specifies the valid days.<br></br>
/// If this
/// parameter is provided, neither weekmask nor holidays may be
/// provided.
/// </param>
/// <param name="out">
/// If provided, this array is filled with the result.
/// </param>
/// <returns>
/// An array with a shape from broadcasting begindates and enddates
/// together, containing the number of valid days between
/// the begin and end dates.
/// </returns>
public static array of int busday_count(string[] begindates, string[] enddates, string weekmask = "1111100", string[] holidays = [], busdaycalendar busdaycal = null, array of int @out = null)
=> NumPy.Instance.busday_count(begindates, enddates, weekmask:weekmask, holidays:holidays, busdaycal:busdaycal, @out:@out);
*/
}
}