<commit_before>"""
layer.memory module -- Layer in which features are stored in memory.

A memory layer can be created with a name and a list of attribute names:
  
>>> from geoscript import geom
>>> l = MemoryLayer('widgets', [ ('geom',geom.Point), ('name',str)])
>>> l.add( [geom.point(1,1), 'one'] )
>>> l.add( [geom.point(2,2), 'two'] )
>>> l.count()
2
"""

from geoscript.layer import Layer
from geoscript import geom, feature
from org.geotools.data.memory import MemoryDataStore

class MemoryLayer(Layer):

  def __init__(self,name,atts):
    ftype = feature.FeatureType(name,atts) 
    ds = MemoryDataStore(ftype.ft)
    Layer.__init__(self,ds.getFeatureSource(name))
<commit_msg>added default set of attributes for memory layers<commit_after>"""
layer.memory module -- Layer in which features are stored in memory.

A memory layer can be created with a name and a list of attribute names:
  
>>> from geoscript import geom
>>> l = MemoryLayer('widgets', [ ('geom',geom.Point), ('name',str)])
>>> l.add( [geom.point(1,1), 'one'] )
>>> l.add( [geom.point(2,2), 'two'] )
>>> l.count()
2
"""

from geoscript.layer import Layer
from geoscript import geom, feature
from org.geotools.data.memory import MemoryDataStore

class MemoryLayer(Layer):

  def __init__(self,name,atts=[('geom', geom.Geometry)]):
    ftype = feature.FeatureType(name,atts) 
    ds = MemoryDataStore(ftype.ft)
    Layer.__init__(self,ds.getFeatureSource(name))

{'fraction_non_alphanumeric': 0.15250696378830084, 'fraction_numerical': 0.006963788300835654, 'mean_word_length': 4.889344262295082, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6405445', 'n_tokens_mistral': 484, 'n_tokens_neox': 466, 'n_words': 136}