<commit_before>#!/usr/bin/env python
# * coding: utf8 *
'''
Pallet.py

A module that contains a pallet to update the parcels for the parcel app
'''

from os import makedirs
from os.path import basename, exists, join
from random import choice
from time import clock

import arcpy
from forklift import seat
from forklift.models import Pallet


class ParcelPallet(Pallet):

    def __init__(self):
        super(ParcelPallet, self).__init__()

        self.arcgis_services = [('Parcels', 'MapServer')]
        self.temporary_workspace = join(self.staging_rack, 'cadastre.gdb')
        self.destination_workspace = join(self.staging_rack, 'parcels.gdb')
        self.destination_fc_name = 'StateWideParcels'
        self.copy_data = [self.destination_workspace]

        self._fields = [
            ['PARCEL_ID', 'Parcel Id', 'TEXT', 'NULLABLE', 50], ['PARCEL_ADD', 'Address', 'TEXT', 'NULLABLE', 60],
            ['PARCEL_CITY', 'City', 'TEXT', 'NULLABLE', 30], ['PARCEL_ZIP', 'Zip Code', 'TEXT', 'NULLABLE', 10],
            ['OWN_TYPE', 'Generalized Ownership Type', 'TEXT', 'NULLABLE', 20], ['RECORDER', 'Recorder Contact', 'TEXT', 'NULLABLE', 50],
            ['ParcelsCur', 'Current as of', 'DATE', 'NULLABLE'], ['ParcelNotes', 'Notes', 'TEXT', 'NULLABLE', 50],
            ['County', 'County', 'TEXT', 'NON_NULLABLE', 50], ['CoParcel_URL', 'County Parcel Website', 'TEXT', 'NULLABLE', 150]
        ]

    def build(self, target):
        self._create_workspace(self.temporary_workspace)
        self._create_workspace(self.destination_workspace)

        self.add_crates(['Parcels_Beaver', 'Parcels_BoxElder', 'Parcels_Cache', 'Parcels_Carbon', 'Parcels_Daggett', 'Parcels_Davis', 'Parcels_Duchesne',
                         'Parcels_Emery', 'Parcels_Garfield', 'Parcels_Grand', 'Parcels_Iron', 'Parcels_Juab', 'Parcels_Kane', 'Parcels_Millard',
                         'Parcels_Morgan', 'Parcels_Piute', 'Parcels_Rich', 'Parcels_SaltLake', 'Parcels_SanJuan', 'Parcels_Sanpete', 'Parcels_Sevier',
                         'Parcels_Summit', 'Parcels_Tooele', 'Parcels_Uintah', 'Parcels_Utah', 'Parcels_Wasatch', 'Parcels_Washington', 'Parcels_Wayne',
                         'Parcels_Weber'], {'source_workspace': join(self.garage, 'SGID10.sde'),
                                            'destination_workspace': self.temporary_workspace})

    def process(self):
        #: squash 29 county layers into 1 with 9 attributes used by the app
        start_seconds = clock()

        workspace = arcpy.env.workspace<commit_msg>fix: SGID10 -> SGID<commit_after>#!/usr/bin/env python
# * coding: utf8 *
'''
Pallet.py

A module that contains a pallet to update the parcels for the parcel app
'''

from os import makedirs
from os.path import basename, exists, join
from random import choice
from time import clock

import arcpy
from forklift import seat
from forklift.models import Pallet


class ParcelPallet(Pallet):

    def __init__(self):
        super(ParcelPallet, self).__init__()

        self.arcgis_services = [('Parcels', 'MapServer')]
        self.temporary_workspace = join(self.staging_rack, 'cadastre.gdb')
        self.destination_workspace = join(self.staging_rack, 'parcels.gdb')
        self.destination_fc_name = 'StateWideParcels'
        self.copy_data = [self.destination_workspace]

        self._fields = [
            ['PARCEL_ID', 'Parcel Id', 'TEXT', 'NULLABLE', 50], ['PARCEL_ADD', 'Address', 'TEXT', 'NULLABLE', 60],
            ['PARCEL_CITY', 'City', 'TEXT', 'NULLABLE', 30], ['PARCEL_ZIP', 'Zip Code', 'TEXT', 'NULLABLE', 10],
            ['OWN_TYPE', 'Generalized Ownership Type', 'TEXT', 'NULLABLE', 20], ['RECORDER', 'Recorder Contact', 'TEXT', 'NULLABLE', 50],
            ['ParcelsCur', 'Current as of', 'DATE', 'NULLABLE'], ['ParcelNotes', 'Notes', 'TEXT', 'NULLABLE', 50],
            ['County', 'County', 'TEXT', 'NON_NULLABLE', 50], ['CoParcel_URL', 'County Parcel Website', 'TEXT', 'NULLABLE', 150]
        ]

    def build(self, target):
        self._create_workspace(self.temporary_workspace)
        self._create_workspace(self.destination_workspace)

        self.add_crates(['Parcels_Beaver', 'Parcels_BoxElder', 'Parcels_Cache', 'Parcels_Carbon', 'Parcels_Daggett', 'Parcels_Davis', 'Parcels_Duchesne',
                         'Parcels_Emery', 'Parcels_Garfield', 'Parcels_Grand', 'Parcels_Iron', 'Parcels_Juab', 'Parcels_Kane', 'Parcels_Millard',
                         'Parcels_Morgan', 'Parcels_Piute', 'Parcels_Rich', 'Parcels_SaltLake', 'Parcels_SanJuan', 'Parcels_Sanpete', 'Parcels_Sevier',
                         'Parcels_Summit', 'Parcels_Tooele', 'Parcels_Uintah', 'Parcels_Utah', 'Parcels_Wasatch', 'Parcels_Washington', 'Parcels_Wayne',
                         'Parcels_Weber'], {'source_workspace': join(self.garage, 'SGID.sde'),
                                            'destination_workspace': self.temporary_workspace})

    def process(self):
        #: squash 29 county layers into 1 with 9 attributes used by the app
        start_seconds = clock()

        workspace = arcpy.env.workspace
{'fraction_non_alphanumeric': 0.14142011834319526, 'fraction_numerical': 0.010256410256410256, 'mean_word_length': 3.459982409850484, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4085347', 'n_tokens_mistral': 1787, 'n_tokens_neox': 1666, 'n_words': 367}