Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
W wendelin
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 5
    • Merge requests 5
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • nexedi
  • wendelin
  • Merge requests
  • !10

Merged
Created Mar 03, 2016 by Douglas@CamataContributor

Pandas-based Inventory API Protoype

  • Overview 23
  • Commits 2
  • Changes 168

Please, review @Tyagov, @kirr and @tatuya.

All the information of this merge request is in the commit message, I'm pasting here for convenience.

Pandas-based Inventory API Protoype

The implementation relies on the Data Array Module. It imports data from the stocks table through a zSQL Method. Category information is added later in a column-wise way, so it can be easily done in parallel and query Portal Catalog once for each category column in the array. This category processing needs to be done only once, when the array is created, and to new data as it is added.

But there is a catch: each entity that belongs to the movement can have many categories. So the row can be duplicated for each entity's categories and searched by equality, or they can be stored as comma-separated values and searched using a regular expression. Regular expression seems faster for datasets up to 1M rows.

Some unit tests were also added.

These are the external methods created and their purposes:

  • Base_filterInventoryDataFrame is there just to parse keyword arguments and forward them to Base_getInventoryDataFrame. This is used for the non-programmer interface of Pandas-based getMovementHistoryList implementation and can be used as an external method in other scripts too.

  • Base_convertResultsToBigArray will convert results of Portal Catalog and ZSQL Method to a Data Array with a proer transformation of the schema to a compatible NumPy data type.

  • Base_extendBigArray will extend a Data Array with a Portal Catalog query or ZSQL Method result. Raise errors when the extension data type doesn't match the source.

  • Base_fillPandasInventoryCategoryList will fill category infomration in a Data Array which has stock movements information.

  • Base_zGetStockByResource is used in a test case as source to create a Data Array with stock data.

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: pandas_inventory
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7