Skip to content

Commit

Permalink
Try to fully resolve the NumPy format string issues. (#337)
Browse files Browse the repository at this point in the history
* Test 32-bit and 64-bit Windows format strings.

* Restore buildtest.

* Added util::dtype enum and converters.

* NumpyArray and NumpyForm take a util::dtype argument.

* Replaced one #ifdef _MSC_VER.

* Centralized 'dtype_name'.

* Replaced PrimitiveType::Dtype with the new util::dtype.

* Reducer.preferred_type and Reducer.return_type are no longer used.

* Removed 'format' dependence from reducers, considerably simplifying them.

* Removed 'format_' from 'tostring_part'.

* Put Windows/32-bit integer promotion rules back in.

* Removed '#ifdef' from 'tojson_part'.

* Removed '#ifdef' from 'mergeable'.

* Removed '#ifdef' from 'merge', but its behavior does not match np.concatenate.

* Merge (ak.concatenate) follows the same type-promotion rules as np.concatenate.

* Removed '#ifdef' from 'sort' and 'argsort'.

* Removed '#ifdef' from 'copy_to'.

* All compiler '#if' checks for interpreting 'format' are replaced by 'dtype' now.

* Fixed #333.

* Form.from_numpy now exists.
  • Loading branch information
jpivarski authored Jul 16, 2020
1 parent 5f1a068 commit b6a1bac
Show file tree
Hide file tree
Showing 29 changed files with 4,015 additions and 2,261 deletions.
1 change: 1 addition & 0 deletions .ci/azure-buildtest-awkward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ trigger:
exclude:
- README.md
- VERSION_INFO
- .ci/azure-doctest-awkward.yml
- .ci/azure-deploy-awkward.yml
- .ci/linux-build.sh
- .readthedocs.yml
Expand Down
7 changes: 6 additions & 1 deletion include/awkward/Content.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ namespace awkward {
/// type. There is a one-to-many relationship from Type to Form.
class EXPORT_SYMBOL Form {
public:
static FormPtr fromjson(const std::string& data);
static FormPtr
fromnumpy(char kind,
int64_t itemsize,
const std::vector<int64_t>& inner_shape);
static FormPtr
fromjson(const std::string& data);

/// @brief Called by subclass constructors; assigns #has_identities
/// and #parameters upon construction.
Expand Down
Loading

0 comments on commit b6a1bac

Please sign in to comment.