Table of Contents

Struct NpyFormat.FormatVersion

Namespace
NumSharp.IO
Assembly
NumSharp.dll

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

major byte
minor byte

Fields

Major

public readonly byte Major

Field Value

byte

Minor

public readonly byte Minor

Field Value

byte

Properties

HeaderEncoding

The header's text encoding: UTF-8 from v3.0, latin-1 before it.

public Encoding HeaderEncoding { get; }

Property Value

Encoding

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

int

IsSupported

public bool IsSupported { get; }

Property Value

bool

MaxHeaderLength

Largest value the header-length field can hold.

public uint MaxHeaderLength { get; }

Property Value

uint

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

NpyFormat.FormatVersion

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

NpyFormat.FormatVersion

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

NpyFormat.FormatVersion

Methods

Equals(FormatVersion)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(NpyFormat.FormatVersion other)

Parameters

other NpyFormat.FormatVersion

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and 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

string

Operators

operator ==(FormatVersion, FormatVersion)

public static bool operator ==(NpyFormat.FormatVersion l, NpyFormat.FormatVersion r)

Parameters

l NpyFormat.FormatVersion
r NpyFormat.FormatVersion

Returns

bool

operator >=(FormatVersion, FormatVersion)

public static bool operator >=(NpyFormat.FormatVersion l, NpyFormat.FormatVersion r)

Parameters

l NpyFormat.FormatVersion
r NpyFormat.FormatVersion

Returns

bool

operator !=(FormatVersion, FormatVersion)

public static bool operator !=(NpyFormat.FormatVersion l, NpyFormat.FormatVersion r)

Parameters

l NpyFormat.FormatVersion
r NpyFormat.FormatVersion

Returns

bool

operator <=(FormatVersion, FormatVersion)

public static bool operator <=(NpyFormat.FormatVersion l, NpyFormat.FormatVersion r)

Parameters

l NpyFormat.FormatVersion
r NpyFormat.FormatVersion

Returns

bool