Commit Graph

243 Commits

Author SHA1 Message Date
Erik Arvidsson 9cb7596409 NomDL: Make NomsValue a Value
This means that when we ReadValue we can now return a NomsValue

Towards #281
2015-10-06 16:38:11 -07:00
Erik Arvidsson 2dec53453e NomDL: Add new serialization format
The new serialization format use "t " as in typed. The rest of the
message is a JSON array describing the typed data. The type is
described by types.TypeRef

Fixes #384
Issues #281, #304
2015-10-06 15:56:10 -07:00
Erik Arvidsson 72f4cd3a7a NomDL Codegen: Make the TypeRef return a package ref
The TypeRef function for a Noms Struct should be the (Name, PkgRef) and
not the description of the struct fields. This is important because
when serializing we need to write the package ref.

Towards #281 #304
2015-10-05 14:24:25 -07:00
Dan Willhite b3ae2f89a9 Issue #379 - Add IterAllP function to types.go. 2015-10-02 11:29:08 -07:00
Erik Arvidsson 096ac4a224 Add index to List Iter, IterAll, Map, MapP
Fixes #376
2015-10-01 17:53:21 -04:00
Aaron Boodman 8160817ee7 Merge pull request #375 from aboodman/delete
explore: say buh-bye
2015-09-30 20:24:35 -07:00
Aaron Boodman 9189479adf Merge pull request #373 from aboodman/progress
sfcrime_search: print out progress in slow mode
2015-09-30 17:36:58 -07:00
Aaron Boodman a6f7a2b63f Merge pull request #374 from aboodman/fix
sfcrime_importer: sometimes we would close before importing everything
2015-09-30 16:57:34 -07:00
Aaron Boodman 00108f1ec2 explore: say buh-bye 2015-09-30 16:43:38 -07:00
Aaron Boodman 65310bef12 sfcrime_importer: sometimes we would close before importing everything 2015-09-30 16:32:49 -07:00
Aaron Boodman 3096214158 sfcrime_search: print out progress in slow mode 2015-09-30 16:31:23 -07:00
Aaron Boodman a3850bec1a splore: add ability to get full ref 2015-09-30 16:31:02 -07:00
Erik Arvidsson 8c2caa3b27 NomDL Codegen: Add TypeRef method to typed objects 2015-09-30 17:48:32 -04:00
Dan Willhite 09a775a985 Naive crime search against flat list.
Add ability to search using the list of incident objects created by sfcrime_importer py passing in incidient-list-ref argument.
Also added better checks to ensure that a suitable ref was given as argument.
2015-09-29 16:11:19 -07:00
Chris Masone 9168a902f9 Modify codegen to include pacakge refs for unresolved types
Also, switch to using a ref.Ref when getting/setting the package
ref in a TypeRef. Using a types.Ref just led to lots of manual
boxing and unboxing every time I wanted to use the reference.

Toward issue #294
2015-09-29 12:58:56 -07:00
cmasone-attic 557b7ae608 Merge pull request #360 from cmasone-attic/issue353
Beginning of import support in NomDL

Fixes issue #353, towards issue #294
2015-09-29 10:38:19 -07:00
Erik Arvidsson df0c7159f8 Merge pull request #354 from arv/explorer-fix-ref
decode.js: Remove Ref wrapping
2015-09-29 13:30:19 -04:00
Erik Arvidsson 283dae5f32 Update demos 2015-09-29 13:12:26 -04:00
Erik Arvidsson 301edfe7b3 Update README.md
Fix md link
2015-09-29 12:32:31 -04:00
Dan Willhite 0f88cc001f sfcrime_search utility. 2015-09-28 17:30:51 -07:00
Dan Willhite ff5627f5b5 Peformance enhancements. 2015-09-28 16:34:29 -07:00
Rafael Weinstein 447774a4da Make order of crime data deterministic 2015-09-28 16:16:57 -07:00
Chris Masone 5ce93dad2e Beginning of import support in NomDL
This patch mostly merges parse.Package and types.Package, though it
can't quite go all the way. A types.Package doesn't have 'using'
declarations, while the parsed representation of a .noms file needs to
have that information. Hence, the parse package is moved to the 'pkg'
package, and pkg.Parsed is introduced. This type embeds types.Package
and adds the necessary additional information.

To make inroads on handling imports, I enhanced ParsePackage() (now
called ParseNomDL()) to actually process the 'alias' and 'import'
statements in the input and go replace namespaced type names in the
package with refs of imported packages. For example, the TypeRef for
'Bar' generated in the following package

alias Foo = import "sha1-ffffffff"

struct Bar {
  f: Foo.RockinStruct
}

will actually return types.Ref{sha1-ffffffff} when you call PackageRef()
on it.

In addition, I've added a function to the new 'pkg' package,
which allows the caller to get the dependencies of a type package
from a chunk store.

Fixes issue #353, towards issue #294
2015-09-28 16:08:22 -07:00
Aaron Boodman d1a2724199 Merge pull request #357 from aboodman/splore
Add splore: a new visualization for noms
2015-09-28 14:49:52 -07:00
Dan Willhite 5858b4de6a Run generate and fmt. 2015-09-28 14:19:27 -07:00
Dan Willhite 71d91338f8 Merge pull request #315 from willhite/quadtree
Quadtree
2015-09-28 14:12:33 -07:00
Aaron Boodman 8789aba6e7 more review comments 2015-09-28 13:27:45 -07:00
Rafael Weinstein 82525a205a Add parallelism to csv_importer 2015-09-28 13:22:42 -07:00
Aaron Boodman fd03a0db45 other comments 2015-09-28 13:11:38 -07:00
Aaron Boodman f710840cf6 review comments 2015-09-28 13:07:46 -07:00
Aaron Boodman 834e313e1d Add splore: a new visualization for noms 2015-09-28 10:57:28 -07:00
Chris Masone c80a1c55b3 Merge parse.TypeRef and types.TypeRef
These were two representations of, essentially, the same information.
They were separate because they provided different APIs to similar
information, but the APIs became more similar once we started using
native types (as opposed to Noms types) for the various Make*TypeRef()
functions.

Unifying these is a big step to unifying parse.Package and types.Package,
which is pretty necessary for dealing with imported packages.

Fixes issue #338
2015-09-25 15:17:49 -07:00
Erik Arvidsson bf095dab3c Merge branch 'master' into nomdl-optional-codegen 2015-09-25 17:20:23 -04:00
Erik Arvidsson d17dc67a73 NomDL CodeGen: Rename self 2015-09-25 17:17:12 -04:00
Erik Arvidsson c254a1391a Codegen for optional fields in structs 2015-09-25 17:08:57 -04:00
Erik Arvidsson 5b3f611104 NomDL Codegen: Add optional flag to Field 2015-09-25 14:38:41 -04:00
cmasone-attic 44a5d53f74 Merge pull request #340 from cmasone-attic/apicleanup
Change types.TypeRef creation API to use native types instead of Noms.
Towards issue #338
2015-09-24 13:56:10 -07:00
Chris Masone b12a89c0df Change types.TypeRef creation API to use native types instead of Noms.
These are just easier to work with. The internal representation remains
the same.

Towards issue #338
2015-09-24 12:57:51 -07:00
Rafael Weinstein ec8461e8fd RemoteDataStore / CopyReachableChunksP 2015-09-24 11:06:50 -07:00
Chris Masone b3307b4feb Always generate Package ref and cache it
The initial patch did this lazily, but that's kinda dumb.
People won't compile in generated code they don't use.
2015-09-24 08:45:58 -07:00
Chris Masone 6f8126c741 Only build each Package object once
The initial, naive generated code that adds type info to Noms structs
built a new Package object every time a new struct instance was
created. They always had the same ref, so the result was correct, but
there was a lot of work for nothing. This patch caches Package objects
so that we only build them once.
2015-09-24 08:43:04 -07:00
Dan Willhite 3f6c8aa09b New quad_tree implementation using nomsdl. 2015-09-23 22:22:18 -07:00
Dan Willhite fb3221230e sfcrime-importer improvements.
Add concurrency to sfcrime-importer.
Use new nomsdl functionality.
Save incidents individually for performance.
2015-09-23 21:33:34 -07:00
Dan Willhite 34de57f6f2 Build a quadTree structure in noms using Geoposition information. 2015-09-23 21:21:03 -07:00
Dan Willhite 519c23bad3 Importer for sfcrime data. 2015-09-23 21:21:03 -07:00
cmasone-attic 327ec6e59f Merge pull request #327 from cmasone-attic/union
Add type info to Noms structs with types.TypeRef

Part of issue #281 and #304
2015-09-23 12:21:54 -07:00
Rafael Weinstein adabda61a4 Make DataStore an interface 2015-09-22 17:30:14 -07:00
Chris Masone 63c956a5c5 Add types.TypeRef
We want to explore encoding type information about Noms data in
the Noms database. So, we need some way to describe types. This
takes the shortest path to making a Noms type called "TypeRef" that
is a peer of Set, Map et al and can describe all the types we currently
use.
2015-09-22 16:19:38 -07:00
Erik Arvidsson 6e369b85cd NomDL: Change command line to process all .noms files
The codegen.go command line utility now detects the package name from
the file that it was invoked from if `--package` was not provided.

It also processes all `.noms` files in the current directory in case
the `--in` flag was not provided.
2015-09-21 12:19:14 -04:00
Erik Arvidsson 19787fee2a pitchmap/index: Use nomdl/codegen instead of nomgen 2015-09-18 10:39:10 -04:00