scicloj / tablecloth.time

Tools for the processing and manipulation of time-series data in Clojure.
Other
18 stars 1 forks source link

Reorganize namespaces to mimic tablecloth's style of providing an api #6

Closed ezmiller closed 3 years ago

ezmiller commented 3 years ago

Goal/Purpose

Briefly discussed in passing with @daslu during last weeks session: it may be a good idea to mimick scicloj/tablecloth's namespace organization. The point being that we hide the implementation and expose only the API that we want.

Tablecloth does this by:

  1. Putting the implementation files in a directory called api. Within the directory functions are organized sensibly by areas of operation, e.g. column operations are in a file called api/columns.clj..
  2. Exporting only those functions from the namespaces in the /api directory files using an exporter function taken from tech.v3.datatype in a single file api.clj in the root namespace.

That way when you do (require 'tablecloth.api), you get just the symbols exported by the api.clj.

Implementation/Solution

This PR mimics the practice described above, applying it to the slice function that we've written.

How to test

The tests in test/slice_test.clj should still run without error. Note that they import the slice function in the new way in the require at the top of the file.

daslu commented 3 years ago

Looks good to me.