Struct NpyFormat.FormatVersion
A .npy format version. Only (1,0), (2,0) and (3,0) exist.
public readonly struct NpyFormat.FormatVersion : IEquatable<NpyFormat.FormatVersion>
- Implements
- Inherited Members
- Extension Methods
Constructors
FormatVersion(byte, byte)
public FormatVersion(byte major, byte minor)
Parameters
Fields
Major
public readonly byte Major
Field Value
Minor
public readonly byte Minor
Field Value
Properties
HeaderEncoding
The header's text encoding: UTF-8 from v3.0, latin-1 before it.
public Encoding HeaderEncoding { get; }
Property Value
HeaderLengthSize
Size of the header-length field: 2 bytes for v1.0, 4 for v2.0 and v3.0.
public int HeaderLengthSize { get; }
Property Value
IsSupported
public bool IsSupported { get; }
Property Value
MaxHeaderLength
Largest value the header-length field can hold.
public uint MaxHeaderLength { get; }
Property Value
V1_0
Version 1.0 — 2-byte header length, latin-1. The default and most portable.
public static NpyFormat.FormatVersion V1_0 { get; }
Property Value
V2_0
Version 2.0 (NumPy 1.9) — 4-byte header length, for headers above 64 KB.
public static NpyFormat.FormatVersion V2_0 { get; }
Property Value
V3_0
Version 3.0 (NumPy 1.17) — 4-byte header length, UTF-8, for Unicode field names.
public static NpyFormat.FormatVersion V3_0 { get; }
Property Value
Methods
Equals(FormatVersion)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(NpyFormat.FormatVersion other)
Parameters
otherNpyFormat.FormatVersionAn object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToString()
Formatted as Python's tuple repr, e.g. (1, 0), so it can go verbatim into messages.
public override string ToString()
Returns
Operators
operator ==(FormatVersion, FormatVersion)
public static bool operator ==(NpyFormat.FormatVersion l, NpyFormat.FormatVersion r)
Parameters
Returns
operator >=(FormatVersion, FormatVersion)
public static bool operator >=(NpyFormat.FormatVersion l, NpyFormat.FormatVersion r)
Parameters
Returns
operator !=(FormatVersion, FormatVersion)
public static bool operator !=(NpyFormat.FormatVersion l, NpyFormat.FormatVersion r)
Parameters
Returns
operator <=(FormatVersion, FormatVersion)
public static bool operator <=(NpyFormat.FormatVersion l, NpyFormat.FormatVersion r)