Guide Video
What this guide video before you start with this theme, it provides basic steps to make everything easier.
Thank you for purchasing my theme. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks so much!
| Author: | RoadThemes |
| Contact: |<EMAIL_ADDRESS>|
| Item: | View Demos |
| Current Version: | 1.1 |
| Documentation Version | 1.1 |
| Created: | 2018-03-29 |
What this guide video before you start with this theme, it provides basic steps to make everything easier.
Once you've downloaded the installation file on ThemeForest, extract it and locate a file called petmark.zip. You can install the theme by using one of two installation methods:
Once installation is complete, your Theme theme will be ready to use. You should now see "petmark" appears in the WordPress themes manager panel.
The installation of plugins will be required once after the theme activation.
***Install and Activate them. In case if automatic plugin installation fails (as a rule it is because of your server settings), you can install them manually via your Dashboard: Plugins > Add New > Upload Plugin > Browse plugins archives. Or via FTP, by uploading and extracting the plugin zip files into wp-content/plugins folder.
- You can find the zip files for plugin installation in the theme folder petmark/Plugins.
Watch the guide above to see in details.
***Automatic plugin installation
***Manual plugin installation
We can import content for pages, posts, menu, projects, contact form, testimonials... like our demo. To import our demo content follow the steps below:
Install and activate required and recommended plugins before you proceed.
Click Import Roadthemes => Click on IMPORT DEMO => Wait some minutes => See The data have imported succesfully => Next, click Import Roadthemes => See the demo with ACTIVATED => Successful
To install other demo, please click IMPORT DEMO at the demo you want. => See The data have imported succesfully -> Successful
To install demo which you have imported but now not "ACTIVATED", please click ACTIVATE at that demo.
To create widgets for this theme quickly, we use a tool to import all widgets from exported files in "sample-data/exported_files" folder.
Login to your WordPress dashboard, navigate to Tools - Widget Importer & Exporter
Click on "Browse..." or "Choose File" button then select "widgets.wie", click on "Import Widgets" to finish.
After importing widgets, if you need to update some widgets like menu, posts... go to Apperances - Widgets
Import sample theme options will help you to configure options for the theme quickly. After that, you change colors, text, menu, images, background...for the theme to make it unique.
Open the package -> /sample-data/exported_files/theme-options.json with Notepad (or Text Edit on Mac). Copy all file content.
Login to your WordPress dashboard, navigate to Theme Options - Import/Export.
Click on "Import from File", paste content into the text box. Click Import button.
You can now enable the Auto-Updating feature for Theme. To do this, please first make sure that you have the Envato WordPress Toolkit plugin installed.
After you have installed and activated the Envato WordPress Toolkit, please go to Envato Toolkit from your dashboard and enter your Marketplace Username and API Key. You can find your API Key by logging into your profile on Themeforest and navigating to Profile > Settings > API Keys.
When you have entered your Marketplace Username and API Key and clicked Save Settings, a new tab will appear at the top of the screen named "Themes". Click on this tab to see all the themes you have purchased. If there is an update available for a theme, you will be notified here. To update your theme, just click on the "Update Automatically" link.
Please note that each time you use the Auto-Update feature to update the theme, a backup file of the old version of the theme will be stored on your server in ".../wp-content/envato-backups".
You can update your theme manually by performing the following steps:
Once you've installed Theme, you can start building your site.
To set a page as home page and posts page (blogs):
****Example: To set Home1 to be your homepage:
Login Dashboard> Settings > Reading :
After that, you must go to Dashboard> Pages > All Pages > Home page (you have set above, Example: Home Shop 1, Home Shop 2 ...) and set Template as Front Page Template:
Login Dashboard> WooCommerce > Settings :
Tab Products: setting Shop page.
Tab Advanced: setting other pages.
Go to Dashboard> YITH > Wishlist tab Settings to set wishlist page:
Once you've installed Theme, you can start building your site.
One of the first things you might want to do is to set up the header area. This section contains the header layout, welcome message, top bar, mobile menu, vertical menu, sticky header and other options.
=> To set it up, go to WPBakery Page Builder=>Templates => Header 1 (Header 2/Header 3/ Header 4)(the header you are using) -> Edit.
=> Go to Theme Options - Header to select a header layout.
***Logo: Now let's add a logo. In WPBakery Page Builder=>Templates=>Header 1 (Header 2/Header 3/ Header 4) (the header you are using)-> you click to shortcode Single Image to edit, then select image from library or upload new logo. Remember to save. Now you have a visible logo in your header area.
***Sticky Logo: In WPBakery Page Builder=>Templates=>Header 1 (Header2/ Header 3/ Header 4) (the header you are using) -> you click to Main Menu to edit, then select image from library or upload new logo. Remember to save. Now you have a sticky logo in your header area when scrolling page.
After importing demo data, slider doesn't show. You need to create/import. We have some sample slider in the slider-sample folder in the package.
- Login to your WordPress dashboard, navigate to Slider Revolution -> Slider Revolution-> Import Slider
- Click Browse to choose sample slider in the slider-sample folder in the package -> Click Import Slider
*** Footer contains Copyright, links, newsletter, payment,..
=> To set it up, go to WPBakery Page Builder=>Templates=> Footer 1 to edit.
=> Go to Theme Options - Footer to select a footer layout.
To create a menu, go to Appearance - Menus from the admin panel. Click on "Create a new menu." Enter a name for your menu, and then click on "Create Menu".
Every page that you've created up until now will be listed in the section on the left called Pages. Simply check the ones that you want added to the menu, and then click on the "Add to Menu" button. Once added, you can click and drag the menu items to rearrange them, or nest them one under the other.
1. Config Horizontal Menu to show columns like demo
Login WordPress admin
Appearance -> Menus
Select Edit Menus : At Select a menu to edit : Choose Horizontal Menu (Primary Menu, Sidebar Menu by Mega Main, Mobile Menu) -> Select
At Menu Structure -> Select item you want to set, ex: Features -> At Submenu Type : Select Multicolumn Submenu , at Submenu Columns (Not For Standard Drops) : Select number of columns
2. Config locations of menus like demo:
Go to Appearance -> Menus -> Manage Locations:
3. Config menu on Header:
After installing theme, to these links on Header, you need to config and save menu.
Login WordPress admin
WPBakery Page Builder -> Templates -> Header 3
At WP Custom Menu -> Edit -> At Menu: Choose Top Menu(to like our demo), or choose other menus -> Save
*** To have icons like demo, please do steps below:
Login WordPress admin
Appearance -> Menus
Select Edit Menus : At Select a menu to edit : Choose Top Menu -> Select
At Menu Structure -> Select item you want to set, ex: Features -> At Navigation Label : Enter html
- Track Your Order: Enter  Track Your Order
- Register or Sign in: Enter  Register or Sign in
- My Account: Enter  My Account
3. Config menus at Footer
After installing theme, to show links above on Footer, you need to config and save menus:
=> Login WordPress admin
WPBakery Page Builder -> Templates -> Footer 1
At WP Custom Menu of titles -> Edit -> At Menu: Select menu you want to show -> Save
To like our demo set:
- With title Information: Select Information menu
- With title Customer Care: Select Customer Care menu
- With part (2): Select Bottom 1 menu
- With part (3): Select Bottom 2 menu
4. How to change links on Horizontal Menu
To change links of items on Horizontal Menu:
Login WordPress admin
Appearance -> Menus
Select Edit Menus : At Select a menu to edit : Choose Horizontal Menu (Primary Menu, Sidebar Menu by Mega Main, Mobile Menu) -> Select
At Menu Structure -> Select item need change url -> At URL: Enter url of that item.
To create a new page, go to Pages - Add New from the admin panel. Enter a title for your page in the text field near the top of your screen. Then choose the "Full Width" template for your page in the section on the right called Page Attributes. This will allow you to have sections on your page that go across full width of the screen.
Now let's start adding elements to your page. Make sure that you're in the backend editor. If the blue button on the top left says BACKEND EDITOR, click it to enable the WPBakery Page Builder. Once you're in backend, the button will say CLASSIC MODE. You can now click on "Add Element" and start building your page.
Finally, click the "Publish" button in the upper right section of the page. (If you made some changes on already published page, "Update" button will appear.
You can access Theme Options from the WordPress admin panel. The settings found here are applied globally and will affect all pages of the site.
This section allows you to set up general settings for your site. We can change body background, content background and show/hide the back to top button.
This is where you can change colors for your website. We can change the primary color, sale label color, link color, text selected color and background. Some elements in special area has different color from this panel, we can use custom css to change colors.
This section allows you to set up the header area. The first choice to change the header layout. Change the header text color and link color.
We can turn on or off the sticky header. Change background for the sticky header, it supports transparent background color.
In this area, we can change text color and link color for top bar.
We can change mobile menu label. The submenu background and submenu color are applied for the main menu (horizontal menu) in desktop view.
We can change categories menu label. The sub categories menu background, number of items are applied for the categories menu (categories menu) in desktop view.
This area allow you to change the footer layout, footer text color, link color.
We can add link for social icon: twitter, facebook, instagram, linked in, rss at footer.
In this area, we can change font for text, heading, menu, price. There are some options to select for each font like font family, back up font family, font weight and style, font size, line height, color. We can use default options or change any font like you need.
If we want to use default options, click on "Reset Section" button.
In this tab, we can select page layout is full width or box, select theme preset and turn off the style switcher.
Preset: There are many presets to select, if we select a presets (example: preset 2) the theme uses pre-defined fonts and colors in that preset. If we select "Use Options" then the theme uses fonts and colors from "Colors" and "Fonts" tab.
This section allows you to upload brands log and configure the options for the brands slider. Click on Add Slide to add more logos.
This section allows you to change position of sidebars to left or right side. We can creat unlimitted sidebars for pages and posts. Go to edit page/post to select custom sidebar.
This section allows you to change the layout for the shop page. We can change how the products appear in grid view or list view. We have products per page, product columns and secondary image. We can upload background image for header of shop page.
This area allows you to change options for the product page. We can upload banner image for product page, number of related products, up-sells title and sharing icons.
For social sharing code, go to http://www.sharethis.com or http://www.addthis.com/ then follow guide on website to create sharing button and get code. Remember to select "website", not "WordPress".
This area allows you to change the text link on the quick view window.
This section allows you to change the text on header of blog page "Blog", select blog layout, change read more text and the excerpt length.
This area allows you to change options for the latest posts carousel on home page.
This area allows you to change options for the testimonials carousel on home page.
This section allows you to upload image, background for the error 404 page.
This section allows you to turn on/off the less compiler. In the theme, I used .less files in the "less" folder to generate .css files.
To create a new blog post, go to Posts - Add New from the admin panel.
Let's go over Post Format :
You can insert shortcode carousel such as Carousel, Gallery ...
You can insert shortcode video such as Youtube, Vimeo ...
You can insert shortcode carousel such as Audio ...
Now that you've set up your blog post, let's go over the custom fields.
Note that most of them are the same custom fields you'll find when creating standard pages.
When creating a new page, one of the first things you might want to do is to assign an appropriate template for it. To do this, go inside the page backend and locate the section on the right called Page Attributes. Theme comes with a variety of templates to choose from:
The default home page is blog, to create a home page with layouts of this theme, we have to create a new page and set it as front page.
Go to Settings - Reading, select "A static page" in "Front page displays" then select your page in dropdown.
****Example: To set Home2 to become your homepage:
=> Login admin -> go to Settings - Reading :
=> Click Save Changes to save your changes
Go to Settings - Reading, select "A static page" in "Front page displays" then select your blog page in "Posts page" dropdown.
- Go to Pages - Add New to create an empty page, enter page title is "Portfolio".
- Create posts in Ess. Grid Posts.
- Create Essential Grid in Ess. Grid then copy shortcode, paste into page content.
+ You also can import Ess. Grid sample data : Go toEss. Grid -> Import/Export -> Import -> Browse to select ess_grid.json file in sample-data\exported_files -> Use Read File to select data need importing or use Import Full Demo Data -> Import
To create pages for WooCommerce, click on "Run the Setup Wizard" button in the back-end. Follow all steps to setup WooCommerce.
Go to Pages - Add New to create a new page, use WPBakery Page Builder to add elements for the pages, change page template to get full width or sidebar page.
Theme comes with WooCommerce integration, which allows you to build an online shop. For more information on installing and configuring WooCommerce, please visit this page:
http://docs.woothemes.com/documentation/plugins/woocommerce/getting-started/
In order to setup WooCommerce with our theme, please perform the following steps:
To create a products carousel slider on home page => Go to Pages -> All Pages -> Select home page -> Add new row in WPBakery Page Builder, insert a Text Block then add a heading 3 for the title, example New Products.
Add shortcode of WooCommerce under the Text Block, click on the pencil icon of the row then add extra class start with "products-carousel"
To create a products tabs slider on home page, add new row in WPBakery Page Builder, insert a Text Blocks with a heading 3 text for the tab title. Add shortcodes of WooCommerce to show products.
Click on the pencil icon of the row then add extra class: home-tabs
Main image width: Single product width (unit: px)
Thumbnail width: The largest width of products (in shop and homepage layouts, not the thumbnail) (unit: px)
Important Note: After changing product sizes, you need to regenerate thumbnails. Read more: http://wordpress.org/plugins/regenerate-thumbnails/
When editing a product, we can upload a cover image and over images.
Note: You need active plugin YITH WooCommerce Zoom Magnifier.
Read more: https://docs.yithemes.com/yith-woocommerce-zoom-magnifier/.
Go to YIT Plugins=>Zoom magnifier to select options for the zoom feature on the product page.
Note: You need active plugin YITH WooCommerce Wishlist.
Read more: https://docs.yithemes.com/yith-woocommerce-compare/.
Go to YIT Plugins=>Wishlist to change settings for the wishlist, we don't require any settings there but we recommend to change text, select social networks.
Note: You need active plugin YITH WooCommerce Compare.
Read more: https://docs.yithemes.com/yith-woocommerce-compare.
Go to YITH Plugins=>Compare then select settings like this
Please read the documentation on Revolution Slider first http://www.themepunch.com/revslider-doc/slider-revolution-documentation/
You can import sample sliders, please view Importing Slider .
To change widgets, go to Appearance - Widgets. Read the Getting Started - Import Widgets in this documentation to know how to import widgets.
In this theme, we use MailChimp plugin to make the newsletter system. Navigate to Mailchimp for WP. First, you need to enter API key and select list.
After that, go to Forms to edit form
This is the sample code:
<input type="email" name="EMAIL" placeholder="Enter your email address..." required>
<button type="submit">Subcribe!</button>
You can change other settings for message, appearance in other tabs
Go to Testimonials - Add New to create a new testimonial. Enter title, description and upload images.
Go to Instagram Feed to config, set ID instagram, can custom number of photos, columns will be shown.
Read this guide to know how to translate theme: http://code.tutsplus.com/tutorials/translating-your-theme--wp-25014
Read this guide to know how to translate WooCommerce https://docs.woothemes.com/document/woocommerce-localization/
If you change the image size settings, you must resize all images that you have uploaded. You can use plugin Regenerate Thumbnails, read more: https://wordpress.org/plugins/regenerate-thumbnails/.
If you modify a theme directly and it is updated, then your modifications may be lost. By using a child theme you will ensure that your modifications are preserved.
Read more: https://codex.wordpress.org/Child_Themes.
Please note that Theme comes with font icon pack: Font Awesome. You can see an overview of all the available icons in this icon packs at the following link:
We hope this manual was useful for you and helped you to install, to edit the template and to resolve your issues.
In this theme, it uses the less compiler function to generate css files from .less file. If your server has small PHP memory, it may show the error. Please try to increase the PHP memory like this:
1. Edit your wp-config.php file and enter something like:
define('WP_MEMORY_LIMIT', '256M');
http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP
2. If you have access to your PHP.ini file, change the line in PHP.ini
If your line shows 32M try 256M:
memory_limit = 256M ; Maximum amount of memory a script may consume (256MB)
3. If you don’t have access to PHP.ini try adding this to an .htaccess file:
php_value memory_limit 256M
4. If none of the above works then talk to your host.
Cause of this problem is small value of the "max_input_vars" option in the configuration of your server (host). You must increase value of the "max_input_vars". You must to set a value that is twice as large of the current value.
php_value max_input_vars 3000
php_value suhosin.post.max_vars 3000
php_value suhosin.request.max_vars 3000
max_input_vars = 3000
In some cases, you uses large images on your page, server run slowly because it's a VPS. Try these methods:
- Reduce images size
- Install cache plugin like W3 Total Cache
- Turn off less compiler in Theme Options=>Less compiler after finished changing colors & fonts.
- Test website with GTMetrix and see its suggestions https://gtmetrix.com/
If you get a white screen or some other error when trying to import our demo content, this probably happens because of the maximum execution time limit. You need to increase the maximum execution time (upload time) setting of your web server. The default maximum execution time on web servers is 30 seconds. Please increase it to 300 seconds. Possible ways of achieving this are:
Ask your hosting provider to take care of this for you.
In this theme, we use Shortcodes Ultimate plugin to make shortcodes. You can go to this page http://gndev.info/kb/ and read the documentation to create your own shortcodes.
I have included these sources with this theme:
jQuery: http://jquery.com/
FlexSlider: http://flexslider.woothemes.com/
Slick: http://plugins.jquery.com/slick/
jQuery Gmap: http://labs.mario.ec/jquery-gmap/
FancyBox: http://fancyapps.com/fancybox/
jQuery Parallax:http://www.ianlunn.co.uk/plugins/jquery-parallax/
jQuery Shuffle: http://vestride.github.io/Shuffle/
Font Awesome: http://fortawesome.github.io/Font-Awesome/
lessphp: http://leafo.net/lessphp
Once again, thank you so much for purchasing this theme. As I said at the beginning, I'd be glad to help you if you have any questions relating to this theme. No guarantees, but I'll do my best to assist. If you have a more general question relating to the themes on ThemeForest, you might consider visiting the forums and asking your question in the "Item Discussion" section.


Gaussian Gradient Filter¶
Construct Gaussian Gradient Filtered images of Chandra data (this is important because we use the fact that each pixel is 0.492”)
Please fill out input file and run python GGF_main.py data.i
This will create GGF images (and fits) for the given sigma values.
Documentation:¶
Construct gaussian gradient filtered images of Chandra data
-
GGF.GGF_main.
combine_ggf
(img_dir, infiles, radius_bins, weight_bins, fits_file)¶ Combine GGF plots. For each radial region, we choose a weight for the image.
Create mask for each image based of weight_bins and radius_bins
Add weighted images together for each bin
Reconstruct complete weighted image by recombining weighted, binned image
The image files all need to be the same size and of the same region!
- Parameters
img_dir (str) – Full path to image files
infiles (str) – List of input files – GGF
radius_bins (str) – List of radii used for binning
weight_bins (str) – List of bin weights corresponding to each GGF image
fits_file (str) – Input Fits Image File for header info
- Returns
Reconstructed weighted-GGF image and fits file
-
GGF.GGF_main.
ggf1
(infile, outfile, sigma)¶ Creates a log-scaled, smoothed, gaussian gradient filtered image (in that order) from a fits file
- Parameters
infile (str) – fits image file to read in
outfile (str) – fits file to create
sigma (int) – sigma value for gaussian used in filtering
- Returns
Both fits file and png image
-
GGF.GGF_main.
make_radial_mask
(img_array, radii, center_pixel)¶ Create mask for image based off weight bins, center pixel, and radial values
- Parameters
img_array (array) – numpy array from reading in image
radii (float,float) – (R_in,R_out) tuple of inner and outer radius WITHIN mask
center_pixel (float,float) – (X,Y) tuple of central pixel from which the radial bins expand
- Returns
radial mask for image as np array of booleans


@* * Copyright 2021 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @import uk.gov.hmrc.eoricommoncomponent.frontend.models.address.AddressLookup @(field: Field, label: String, addresses: List[AddressLookup])(implicit messages: Messages) @fieldNameWithoutSpaces = @{ field.name.replace(" ", "-") } @selectedValue = @{ field.value getOrElse "" }


|
|
int | SEEK_SET = 0 |
| |
|
int | SEEK_CUR = 1 |
| |
|
int | SEEK_END = 2 |
| |
Provides a read-only file-like interface to a blobstore blob.
| def google.appengine.ext.blobstore.blobstore.BlobReader.__init__ |
( |
|
self, |
|
|
|
blob, |
|
|
|
buffer_size = 131072 , |
|
|
|
position = 0 |
|
) |
| |
Constructor.
Args:
blob: The blob key, blob info, or string blob key to read from.
buffer_size: The minimum size to fetch chunks of data from blobstore.
position: The initial position in the file.
Raises:
ValueError if a blob key, blob info or string blob key is not supplied.
| def google.appengine.ext.blobstore.blobstore.BlobReader.__getstate__ |
( |
|
self | ) |
|
Returns the serialized state for this BlobReader.
| def google.appengine.ext.blobstore.blobstore.BlobReader.__iter__ |
( |
|
self | ) |
|
Returns a file iterator for this BlobReader.
| def google.appengine.ext.blobstore.blobstore.BlobReader.__setstate__ |
( |
|
self, |
|
|
|
state |
|
) |
| |
Restores pickled state for this BlobReader.
| def google.appengine.ext.blobstore.blobstore.BlobReader.blob_info |
( |
|
self | ) |
|
Returns the BlobInfo for this file.
| def google.appengine.ext.blobstore.blobstore.BlobReader.close |
( |
|
self | ) |
|
Close the file.
A closed file cannot be read or written any more. Any operation which
requires that the file be open will raise a ValueError after the file has
been closed. Calling close() more than once is allowed.
| def google.appengine.ext.blobstore.blobstore.BlobReader.closed |
( |
|
self | ) |
|
Returns True if this file is closed, False otherwise.
| def google.appengine.ext.blobstore.blobstore.BlobReader.next |
( |
|
self | ) |
|
Returns the next line from the file.
Returns:
A string, terminted by \n. The last line may not be terminated by \n.
If EOF is reached, an empty string will be returned.
| def google.appengine.ext.blobstore.blobstore.BlobReader.read |
( |
|
self, |
|
|
|
size = -1 |
|
) |
| |
Read at most size bytes from the file.
Fewer bytes are read if the read hits EOF before obtaining size bytes.
If the size argument is negative or omitted, read all data until EOF is
reached. The bytes are returned as a string object. An empty string is
returned when EOF is encountered immediately.
Calling read() without a size specified is likely to be dangerous, as it
may read excessive amounts of data.
Args:
size: Optional. The maximum number of bytes to read. When omitted, read()
returns all remaining data in the file.
Returns:
The read data, as a string.
| def google.appengine.ext.blobstore.blobstore.BlobReader.readline |
( |
|
self, |
|
|
|
size = -1 |
|
) |
| |
Read one entire line from the file.
A trailing newline character is kept in the string (but may be absent when a
file ends with an incomplete line). If the size argument is present and
non-negative, it is a maximum byte count (including the trailing newline)
and an incomplete line may be returned. An empty string is returned only
when EOF is encountered immediately.
Args:
size: Optional. The maximum number of bytes to read.
Returns:
The read data, as a string.
| def google.appengine.ext.blobstore.blobstore.BlobReader.readlines |
( |
|
self, |
|
|
|
sizehint = None |
|
) |
| |
Read until EOF using readline() and return a list of lines thus read.
If the optional sizehint argument is present, instead of reading up to EOF,
whole lines totalling approximately sizehint bytes (possibly after rounding
up to an internal buffer size) are read.
Args:
sizehint: A hint as to the maximum number of bytes to read.
Returns:
A list of strings, each being a single line from the file.
| def google.appengine.ext.blobstore.blobstore.BlobReader.seek |
( |
|
self, |
|
|
|
offset, |
|
|
|
whence = SEEK_SET |
|
) |
| |
Set the file's current position, like stdio's fseek().
The whence argument is optional and defaults to os.SEEK_SET or 0 (absolute
file positioning); other values are os.SEEK_CUR or 1 (seek relative to the
current position) and os.SEEK_END or 2 (seek relative to the file's end).
Args:
offset: The relative offset to seek to.
whence: Defines what the offset is relative to. See description for
details.
| def google.appengine.ext.blobstore.blobstore.BlobReader.tell |
( |
|
self | ) |
|
Return the file's current position, like stdio's ftell().
The documentation for this class was generated from the following file:
- code/googleappengine-read-only/python/google/appengine/ext/blobstore/blobstore.py


apache_beam.transforms.util module¶
Simple utility PTransforms.
-
class
apache_beam.transforms.util.
CoGroupByKey
(**kwargs)[source]¶ Bases:
apache_beam.transforms.ptransform.PTransform
Groups results across several PCollections by key.
Given an input dict mapping serializable keys (called “tags”) to 0 or more PCollections of (key, value) tuples, e.g.:
{'pc1': pcoll1, 'pc2': pcoll2, 33333: pcoll3}
creates a single output PCollection of (key, value) tuples whose keys are the unique input keys from all inputs, and whose values are dicts mapping each tag to an iterable of whatever values were under the key in the corresponding PCollection:
('some key', {'pc1': ['value 1 under "some key" in pcoll1', 'value 2 under "some key" in pcoll1'], 'pc2': [], 33333: ['only value under "some key" in pcoll3']})
Note that pcoll2 had no values associated with “some key”.
CoGroupByKey also works for tuples, lists, or other flat iterables of PCollections, in which case the values of the resulting PCollections will be tuples whose nth value is the list of values from the nth PCollection—conceptually, the “tags” are the indices into the input. Thus, for this input:
(pcoll1, pcoll2, pcoll3)
the output PCollection’s value for “some key” is:
('some key', (['value 1 under "some key" in pcoll1', 'value 2 under "some key" in pcoll1'], [], ['only value under "some key" in pcoll3']))
Parameters: - label – name of this transform instance. Useful while monitoring and debugging a pipeline execution.
- **kwargs – Accepts a single named argument “pipeline”, which specifies the pipeline that “owns” this PTransform. Ordinarily CoGroupByKey can obtain this information from one of the input PCollections, but if there are none (or if there’s a chance there may be none), this argument is the only way to provide pipeline information, and should be considered mandatory.
-
apache_beam.transforms.util.
Keys
(label='Keys')[source]¶ Produces a PCollection of first elements of 2-tuples in a PCollection.
-
apache_beam.transforms.util.
Values
(label='Values')[source]¶ Produces a PCollection of second elements of 2-tuples in a PCollection.
-
apache_beam.transforms.util.
KvSwap
(label='KvSwap')[source]¶ Produces a PCollection reversing 2-tuples in a PCollection.
-
apache_beam.transforms.util.
RemoveDuplicates
(*args, **kwargs)¶
-
class
apache_beam.transforms.util.
BatchElements
(min_batch_size=1, max_batch_size=10000, target_batch_overhead=0.05, target_batch_duration_secs=1, clock=<built-in function time>)[source]¶ Bases:
apache_beam.transforms.ptransform.PTransform
A Transform that batches elements for amortized processing.
This transform is designed to precede operations whose processing cost is of the form
time = fixed_cost + num_elements * per_element_costwhere the per element cost is (often significantly) smaller than the fixed cost and could be amortized over multiple elements. It consumes a PCollection of element type T and produces a PCollection of element type List[T].
This transform attempts to find the best batch size between the minimim and maximum parameters by profiling the time taken by (fused) downstream operations. For a fixed batch size, set the min and max to be equal.
Elements are batched per-window and batches emitted in the window corresponding to its contents.
Parameters: - min_batch_size – (optional) the smallest number of elements per batch
- max_batch_size – (optional) the largest number of elements per batch
- target_batch_overhead – (optional) a target for fixed_cost / time, as used in the formula above
- target_batch_duration_secs – (optional) a target for total time per bundle, in seconds
- clock – (optional) an alternative to time.time for measuring the cost of donwstream operations (mostly for testing)
-
class
apache_beam.transforms.util.
Reshuffle
(label=None)[source]¶ Bases:
apache_beam.transforms.ptransform.PTransform
PTransform that returns a PCollection equivalent to its input, but operationally provides some of the side effects of a GroupByKey, in particular preventing fusion of the surrounding transforms, checkpointing, and deduplication by id.
Reshuffle adds a temporary random key to each element, performs a ReshufflePerKey, and finally removes the temporary key.
Reshuffle is experimental. No backwards compatibility guarantees.


Cinematic Orchestra returned to NYC on their first tour in a decade (pics)
07 Nov 2019, 09:47 by BrooklynVegan Staff
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
The Cinematic Orchestra at Brooklyn Steel
photo by P Squared
British electronic vets Cinematic Orchestra released their fifth studio album and first in twelve years, To Believe , earlier this year on Ninja Tune (ft. Moses Sumney, Roots Manuva, and more), and they’ve been out on their first North American tour in over ten years this fall. They stopped in NYC on Tuesday night (11/5) for a show that brought out die hard fans who’d been waiting years to see the band in person. Joined by frequent collaborator, London vocalist Heidi Vogel , Cinematic Orchestra delivered a gorgeous show with beautiful melodies given an almost jazzy vibe by their saxophone player. Check out pictures from the night in the gallery above. —
photos by P Squared


HTMLView.Pas
The THtmlViewer component displays single HTML documents. Documents may be loaded from disk files, memory buffers, StringLists, or streams.


Location Map
Navigation
Home
The House
The Bedrooms
The Garden
Location
Places To Visit
Le Yaudet
What our visitors said
Prices & Availability
Links
Contact Me
Availability Calendar


i am the title
visualizations
upload
No file selected
Select datasets (based on StimuliName):
Toggle All


Mass. lawmakers call on EPA changes to toxic runoff in Merrimack River
by EndPlayBOSTON - Following reports on the toxic chemicals being dumped in the Merrimack River, politicians in Massachusetts are pushing for change.
Massachusetts Senators Edward Markey and Elizabeth Warren, and Representatives Richard Neal (MA-01), Seth Moulton (MA-05), and Lori Trahan (MA-03) are calling on the Environmental Protection Agency (EPA) to reassess a permit that would allow water from the Turnkey landfill in New Hampshire to runoff into the Merrimack.
The water from the landfill contains dangerous levels of hazardous substances, mainly per- and polyfluoroalkyl substances, also known as PFAS. Certain PFAS, often called "forever chemicals" because they accumulate and persist in the environment and food sources, are linked to cancer, thyroid disease, infertility and learning and developmental abnormalities.
The Merrimack River provides the drinking water for about 600,000 people.
On Thursday, in an effort to protect it's citizens' drinking water, the City of Lowell decided to suspend acceptance of runoff water from the Turnkey landfill.
"PFAS already pose a serious health risk to residents across Massachusetts," the state lawmakers wrote in their letter to EPA Administrator Andrew Wheeler. "Efforts to address existing contamination will likely be both lengthy and expensive. Out state does not need additional PFAS pollution to contend with as we work to clean up legacy contamination in our air, soil, and water."
In September, the Trump administration repealed the Clean Water Act, an Obama-era set of protections that limited the amount of pollution and chemicals in streams, rivers, lakes and wetlands across the country. The new rule also limits the number of waterways nationwide the government can protect from pollution.
Experts say the PFAS chemical does not easily break down in the body and it could be in the water of over half a million people.


Packages
Tips for hosts
About the shop
Enchant your guests
Bring your party to them
Choose a package


public final class Util
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
escape(java.lang.String string,
java.lang.StringBuilder builder)
Escapes a string according to the JSON specification.
|
static JSONArray |
getArray(java.lang.Object value)
Tries to parse a value to an instance of JSONArray.
|
static java.lang.Boolean |
getBoolean(java.lang.Object value)
Tries to parse a value to an instance of Boolean.
|
static java.lang.Byte |
getByte(java.lang.Object value)
Tries to parse a value to an instance of Byte.
|
static java.util.Date |
getDate(java.lang.Object value,
java.text.DateFormat format)
Tries to parse a value to an instance of Date.
|
static java.lang.Double |
getDouble(java.lang.Object value)
Tries to parse a value to an instance of Double.
|
static <T extends java.lang.Enum<T>> |
getEnum(java.lang.Object value,
java.lang.Class<T> type)
Tries to parse a value to an enum.
|
static java.lang.Float |
getFloat(java.lang.Object value)
Tries to parse a value to an instance of Float.
|
static java.lang.Integer |
getInteger(java.lang.Object value)
Tries to parse a value to an instance of Integer.
|
static java.lang.Long |
getLong(java.lang.Object value)
Tries to parse a value to an instance of Long.
|
static JSONObject |
getObject(java.lang.Object value)
Tries to parse a value to an instance of JSONObject.
|
static java.lang.Short |
getShort(java.lang.Object value)
Tries to parse a value to an instance of Short.
|
static java.lang.String |
getString(java.lang.Object value)
Tries to parse a value to an instance of String.
|
static void |
write(boolean[] array,
java.io.Writer writer)
Encode an array into JSON text and write it to a Writer.
|
static void |
write(byte[] array,
java.io.Writer writer)
Encode an array into JSON text and write it to a Writer.
|
static void |
write(char[] array,
java.io.Writer writer)
Encode an array into JSON text and write it to a Writer.
|
static void |
write(java.util.Collection<?> collection,
java.io.Writer writer)
Encode a Collection into JSON text and write it to a Writer.
|
static void |
write(double[] array,
java.io.Writer writer)
Encode an array into JSON text and write it to a Writer.
|
static void |
write(float[] array,
java.io.Writer writer)
Encode an array into JSON text and write it to a Writer.
|
static void |
write(int[] array,
java.io.Writer writer)
Encode an array into JSON text and write it to a Writer.
|
static void |
write(long[] array,
java.io.Writer writer)
Encode an array into JSON text and write it to a Writer.
|
static void |
write(java.util.Map<?,?> map,
java.io.Writer writer)
Convert a Map to a JSON string and write it on a Writer.
|
static void |
write(java.lang.Object value,
java.io.Writer writer)
Encode an Object into JSON text and write it to a Writer.
|
static void |
write(short[] array,
java.io.Writer writer)
Encode an array into JSON text and write it to a Writer.
|
static <T> void |
write(T[] array,
java.io.Writer writer)
Encode an array into JSON text and write it to a Writer.
|
public static final void write(byte[] array, java.io.Writer writer) throws java.io.IOException
array
- the array which should be written on the Writerwriter
- the Writer to write tojava.io.IOException
- if an I/O error occurswrite(Object, Writer)
public static final void write(short[] array, java.io.Writer writer) throws java.io.IOException
array
- the array which should be written on the Writerwriter
- the Writer to write tojava.io.IOException
- if an I/O error occurswrite(Object, Writer)
public static final void write(int[] array, java.io.Writer writer) throws java.io.IOException
array
- the array which should be written on the Writerwriter
- the Writer to write tojava.io.IOException
- if an I/O error occurswrite(Object, Writer)
public static final void write(long[] array, java.io.Writer writer) throws java.io.IOException
array
- the array which should be written on the Writerwriter
- the Writer to write tojava.io.IOException
- if an I/O error occurswrite(Object, Writer)
public static final void write(float[] array, java.io.Writer writer) throws java.io.IOException
array
- the array which should be written on the Writerwriter
- the Writer to write tojava.io.IOException
- if an I/O error occurswrite(Object, Writer)
public static final void write(double[] array, java.io.Writer writer) throws java.io.IOException
array
- the array which should be written on the Writerwriter
- the Writer to write tojava.io.IOException
- if an I/O error occurswrite(Object, Writer)
public static final void write(boolean[] array, java.io.Writer writer) throws java.io.IOException
array
- the array which should be written on the Writerwriter
- the Writer to write tojava.io.IOException
- if an I/O error occurswrite(Object, Writer)
public static final void write(char[] array, java.io.Writer writer) throws java.io.IOException
array
- the array which should be written on the Writerwriter
- the Writer to write tojava.io.IOException
- if an I/O error occurswrite(Object, Writer)
public static final <T> void write(T[] array, java.io.Writer writer) throws java.io.IOException
T
- type of the arrayarray
- the array which should be written on the Writerwriter
- the Writer to write tojava.io.IOException
- if an I/O error occurswrite(Object, Writer)
public static final void write(java.util.Collection<?> collection, java.io.Writer writer) throws java.io.IOException
collection
- the Collection which should be written on the Writerwriter
- the Writer to write tojava.io.IOException
- if an I/O error occurspublic static final void write(java.util.Map<?,?> map, java.io.Writer writer) throws java.io.IOException
map
- the Map to writewriter
- the Writer to which the Map should be written tojava.io.IOException
- if an I/O error occurspublic static final void write(java.lang.Object value, java.io.Writer writer) throws java.io.IOException
value
- the Object to write on the Writerwriter
- the Writer to write on.java.io.IOException
- if an I/O error occurspublic static final JSONObject getObject(java.lang.Object value)
value
- the value that should be parsednull
if it could not be parsedpublic static final JSONArray getArray(java.lang.Object value)
value
- the value that should be parsednull
if it could not be parsedpublic static final java.lang.Boolean getBoolean(java.lang.Object value)
value
- the value that should be parsednull
if it could not be parsedpublic static final java.lang.Byte getByte(java.lang.Object value)
value
- the value that should be parsednull
if it could not be parsedpublic static final java.lang.Short getShort(java.lang.Object value)
value
- the value that should be parsednull
if it could not be parsedpublic static final java.lang.Integer getInteger(java.lang.Object value)
value
- the value that should be parsednull
if it could not be parsedpublic static final java.lang.Long getLong(java.lang.Object value)
value
- the value that should be parsednull
if it could not be parsedpublic static final java.lang.Float getFloat(java.lang.Object value)
value
- the value that should be parsednull
if it could not be parsedpublic static final java.lang.Double getDouble(java.lang.Object value)
value
- the value that should be parsednull
if it could not be parsedpublic static final java.lang.String getString(java.lang.Object value)
value
- the value that should be parsednull
if it could not be parsedpublic static final java.util.Date getDate(java.lang.Object value, java.text.DateFormat format) throws java.text.ParseException
value
- the value that should be parsedformat
- the DateFormat that should be used to parse the valuenull
if the input value was already null
java.text.ParseException
- if the value could not be parsed to an instance of Datepublic static final <T extends java.lang.Enum<T>> T getEnum(java.lang.Object value, java.lang.Class<T> type)
T
- the enum typevalue
- the value that should be parsedtype
- the enum classnull
if the value could not be parsedpublic static void escape(java.lang.String string, java.lang.StringBuilder builder)
string
- the string which should be escapedbuilder
- the StringBuilder on which the result will be written


Landing Page
By Hector Dondiego
Assignments
Current
- Sprint 2 Assignments
- Discussion 2: JavaScript vs PHP vs Ruby vs Java
- Quiz 2
- Lab 2
- Reflection 2
- Lab Demo
Future
Click here to play a dice game called 10,000!
Click here to check out the course syllabus for Software Engineering!


Pats Salmon cookies
Sales
Create new store
Location:
Minimum hourly customers
Maximum hourly customers
Average cookies sold per sale


A web visualization for topology based in telemetry
Knowing the topology in real time via telemetry allows to understand how your network really is and it is an starting point to get to the desired network state.


Biggest change is that restyling is optimized through adding some complexity to the styled area of a styling buffer. There may now be a hole that is unstyled within the styled area. When a modification is made to the text within the styled area, a hole is removed from the styling of that line. An attempt is then made to restyle just the hole. If the restyling did not produce any changes that affect styling after the hole then the whole of the styled area is again considered styled and only the hole range is redrawn. This checks not only the styling buffers but ancillary history objects that lexers use to keep track of other state such as the current scripting language in a web page or the stack of here documents in Perl.
Decorations can be translucent on all platforms. A RoundedBox decoration is implemented with alpha and alphaoutline attributes. If only alpha is set then the whole rounded box is drawn and filled with this alpha (0=transparent, 255=opaque). If alphaoutline is set then the box is outlined with this degree of translucency. The graphics code supports drawing arbitrary polygons with translucency. Alpha drawing may be slower than opaque drawing and this depends on the platform.
Some other text widgets can show the selection range by drawing lines around it. This is now implemented in SinkWorld as the 'box' facet that takes a color value. It can be used for any styling that may spread over multiple lines and is drawn with rounded corners. As the implementation depends on information from multiple lines it didn't fit in with some aspects of the drawing code so there can only be one box facet in use at a time. This doesn't yet work well with horizontal scrolling.
A generic prototype registry acts as a source of lexers, folders and decorations that can be retrieved by name. The bin/RegistryGen.py script reads source files, choosing class names that fit naming patterns and generates code that registers all classes. This makes it easy to add a new lexer, folder or decoration, by just adding the implementation files and running the script.
The caret now blinks. Folds can be expanded and contracted by clicking on fold markers in the margin. Text is now aligned on its baseline so doesn't go up and down when different sizes used.
Options files may now contain inline structured values using '{' and '}' so there is less need for multiple line values. The '\' character can be used to quote the next character. The first style in a set (often called 'Default') is used for drawing unstyled regions of the window including line ends and any extra vertical space after the end of the file. This is mostly used to set a background color for the whole window.
Python wrappers are more consistent and simpler. The C++ Python wrappers ensure correct GIL usage. Lexers written in Python work. IronPython improved so workarounds removed.
These include the compiled executables or libraries and the settings files. The settings files are user.options and *.mode and these should be copied into the user's home directory (~ on Linux and %USERPROFILE% on Windows) before running the application.
These require the appropriate Python platform ( Python, Jython, or IronPython) and its prerequisites to be installed and the Windows version also requires ctypes to be installed.
There are Python wrapper libraries for SinkWorld and example applications for each platform. Jython is used in the Java environment and IronPython on .NET and on each of these platforms Python interacts naturally with the Java / C# libraries. For CPython the libraries required explicit wrapping and this was done using Boost Python.
The implementations now read much more of their functionality, such as file filters for the open dialog from the modes files. There is a Mode menu in most of the applications which allow choosing a particular mode rather than the one associated with a file's extension.
There is information on building for each platform.
Modes are the most significant addition in this release. Previous releases contained some ad-hoc explicit code for combining lexers and this release generalizes this so that the configuration can be manipulated at a high level and be defined in options files.
When a file is loaded, its extension is used to find the main mode that Tentacle should use for that file. This may be extended to also allow detection of marker text and user choice of mode. The main mode is then used as the key for selecting properties and submodes.
A complex language like HTML may allow embedded segments in other languages like JavaScript or CSS (Cascading Style Sheets). These embedded segments should be styled according to the rules of their language rather than that of the including file. It is also possible to modify the settings of a mode when it is used as a submode by declaring an extra mode for that embedding.
Each embedded language defines a mode that is incorporated into the HTML mode as a submode. Submodes may fulfil specific roles such as the html role within ASP which is treated specially but others are generic such as the set of client side scripting languages in HTML.
Layers are modes that are orthogonal to the main mode such as spelling checkers and code validators and may depend on the styling information generated by the main mode.
Tentacle behaviour can be defined through text configuration files rather than being hard coded as in previous releases. The file format tries to fix some of the weaknesses in SciTE's properties files.
SinkWorld lexers provide more information to callers than do Scintilla lexers. This include sthe number of lexical states that they produce and the names of these states. This information may be extended in the future to provide some information about how to treat such ststes such as saying that Comment and CommentDoc are both comments. This could be used to determine that a spelling checker should examine text in these states but not in states that are operators.
The project directories have been restructured for this release.
| sinkworld |
| cxx |
| tentacle |
| cxx |
| csharp |
| java |
| csharp |
| java |
| bin |
| doc |
| html |
| test |
| examples |
Source code for generic data structures and lexers are in cxx.
Source code for the Tentacle application, interfacing to GUI libraries (Win32 and GTK+) and data structures related to GUIs are in tentacle/cxx. The application is built on Windows by loading the Tentacle solution file into Visual Studio .NET and performing the Build Solution command. On GTK+, make is run.
The Translate.py script in bin expands templated files in cxx and translates all the source code into C# and Java to produce the contents of the csharp and java directories. It also translates most of the data structure source code in tentacle/cxx into C# and Java placing these files into tentacle/csharp and tentacle/java.
tentacle/csharp contains application code for C# and classes for interfacing to Windows Forms. The application, TentacleN.exe is built by running make.
tentacle/java contains application code for Java and classes for interfacing to Swing. The application, tentacle.jar is built by running make and executed by java -jar tentacle.jar.
The tentacle directory contains configuration files for the tentacle applications. These should be placed in the user's home directory before running any of the application.
Scripts used in building are in bin and documentation in doc. API documentation is is doc/html and the index.html file is the starting point.
Unit tests are in test and example files used in unit tests in test/examples.
Tentacle is implemented for 4 platforms and is available in archives for these executable forms:
Each archive also contains 4 configuration files (user.options, base.mode, cxx.mode, html.mode) that should be copied into the user's home directory.
Source code can be retrieved from the Scintilla CVS under sinkworld/tentacle with tag rel-3-2 and as a zip file. The zip file contains the Java and C# files translated from C++ so can be used by people that don't want to run the Python Translate.py script. CVS only contains the initial files so, to use source from CVS, Translate.py must be run even when only building C++.
A large number of unit tests have been added in test/SimpleTest.cxx. These cover all the implemented public data structure classes and lexers. The C# and Java unit tests have not been maintained and may be dropped unless they can be automatically generated from C++.
The lexer unit tests use and generate .styled text files which show how an example file was styled with "{<number>}" elements showing where each style starts. This should make it easier to determine what impact a change has made and diminish the chance that a change has caused an undiscovered regression. The .styled files start with a key listing all the lexical classes.
| x.cxx.styled |
| 0=CPP.Default |
| 1=CPP.Comment |
| ··· |
| 17=CPP.KeyWord |
| {2}// A demonstration program{0} |
| {17}int{0} {16}main{9}(){0} {9}{{0} |
| {16}printf{9}({5}"hello world %d\n"{9},{0} {4}9{9});{0} |
| {9}}{0} |
Where a modification has changed the set of lexical classes, the ExpandStates.py script can convert .styled files so that the style change elements are shown with style names rather than numbers making it easier to run diff over them.
| x.cxx.styled |
| ··· |
| {CommentLine}// A demonstration program{Default} |
| {KeyWord}int{Default} {Identifier}main{Operator}(){Default} {Operator}{{Default} |
| {Identifier}printf{Operator}({Quoted}"hello world %d\n"{Operator},{Default} {Number}9{Operator});{Default} |
| {Operator}}{Default} |
The new generic modes code is not yet able to provide some of the features of previous releases. Folding does not currently work. The brace count feature considers all brace characters rather than only those that are in the operator style so will get confused by a string constant like "(".
These are demonstration GUI front ends for the current code base.
Below is the GTK+ 2.4 version:
Tentacle is implemented for 4 platforms and is available in these executable forms:
It is also available in source form from the Scintilla CVS under sinkworld/tentacle and as a zip file.
The applications allow command line arguments as
tentacle [path]
or for Java
java -jar tentacle.jar [path]
Release 2 includes a line number margin, line wrapping, and folding. Folding depends on a lexer that measures the nesting level of braces and this lexer can be displayed by choosing Options | Brace Level.
Below is the Windows C# version with line wrapping, brace folding and brace level color coding.
A major feature in Tentacle is style merging. SinkWorld allows multiple styling buffers to be attached to a document. For a HTML document, there may be a styling buffer for the basic HTML features like tags, attributes, text and embedded scripts; an URL recogniser; and a spell checker. This style information is generated automatically from the document text by lexer classes. The application may also wish to display dynamic information over the text, such as the selection; brace matches; search matches; and hotspots and can use styling buffers to hold these elements.
Tentacle's StyleSetCollection class describes the relationship between the document text, document styling buffers and application styling buffers and the resulting display. For example, content text may be black and tags in blue bold text, with URLs underlined, spelling mistakes struck out, the selection in italics with a light blue background and identifiers appearing as buttons.
Tentacle uses a layered drawing model with 5 layers.
The decoration layers allow features such as underlines, boxes, buttons and similar to be drawn either underneath or on top of the text. Decoration drawing is performed by classes that implement the IDecoration interface so new decorations can be added. Other layers are drawn by implementations of the IPaintPhase interface.
Window painting is performed layer by layer with all lines of the background color drawn before any text. This allows some degree of overlap between lines with decorations extending outside the bounds of their text. This is also better for modern antialiased drawing libraries where sub-pixel positioning is used. Tentacle should work well with floating point coordinate systems although it currently truncates positions to integral coordinates.
The Tentacle code includes several source code files that are generally useful in implementing styling and caching data: ChangeFinder, PositionCache, StringAtom, StyleSet, TextPositions, and UniConversion are, like core SinkWorld written in a subset of C++ and automatically converted to Java and C#.
Other code is written for the particular language and platform. Surface provides some abstraction of graphics capabilities and Tentacle implements the application and GUI windows.
The generic code may be made part of core SinkWorld or made into a separate library. The platform-specific code is less likely to be maintained although segments that can be turned into generic components may become part of the core libraries.
At this stage I have no plans to produce or maintain reusable GUI components based on this code.
All the code can be reused according to the MIT license. I hope to make the core libraries available as public domain or as near as can be achieved.
Building the various versions of Tentacle requires several tools depending on how much is being built. The CVS set of files requires running a Windows batch file and a Python based converter for the Java and C# versions but the zip file contains all the copied and generated files so should only require a Java or C# compiler. The C++ version requires Visual Studio .Net on Windows. On Linux it should build with standard compilers and tools.


MIDI Patchbay Bugs
Open
-
MIDI inputs and outputs are sorted alphabetically rather than by
port number.
-
Sometimes virtual endpoints can't be deleted even when no patch is
obviously using them because an old patch can be sitting on the
undo stack. The way to fix this is that patches that are in limbo
should unregister themselves with the endpoints with which they
are talking.
-
Creating a document, creating a virtual input or output then hitting
undo will not reset the document saved flag for some reason. It has
something to do with the undo grouping used by the virtual endpoint
sheet, because if I disable that the problem goes away.
-
Creating a MIDI routing loop will crash the OS! It's really easy to
do on Panther with IAC busses.
-
Select All in the Edit menu is enabled when editing the patch list
despite the fact that only one patch can be selected at a time
-
Running an old version of MIDI Patchbay will show Open Recent menu
items from the new version even if the old version doesn't support
files
-
Start a new document, create a new virtual input, hit undo...the document
is still marked as changed and requiring saving. (Maybe this has to do
with the use of undo groups?)
-
Choosing the "Edit Virtual Inputs/Outputs..." options from the input
or output popup menus will briefly cause this to become the selected item,
and will only flick back to the real selected item after a second or so.
It's very annoying visually.
-
Moving the lowest allowed note or highest allowed note sliders will
cause a lot of undo events to be registered, which is a bit of a
waste of memory.
Closed
-
There may be problems when multiple inputs are patched through
to a single real output. If you see issues in this situation,
please report them. This should not happen under OS X 10.1.5 or later.
$Id: Bugs.html,v <IP_ADDRESS> 2004/11/25 04:38:48 pete Exp $


Toughday 2.0 LiveChart Publisher (POC)
Throughput
Average response time (ms)
Median response time (ms)
Max response time (ms)


Before Change
// check for valid operations: add, rm, mv
valid_ops = ("set", "rm", "mv")
if not all(action[0] in valid_ops for actions in inter_map.itervalues() for action in actions):
raise DeveloperError("Your _serialize_interpolation_map contains invalid operations. "
"Valid ops are: {}".format(valid_ops))
After Change
// check for valid operations: add, rm, mv, map
valid_ops = ("set", "rm", "mv", "map")
for k, v in inter_map.items():
if not is_int(k):
raise DeveloperError("all keys of _serialize_interpolation_map "
"have to be of type int (class version numbers)")
if not isinstance(v, (list, tuple)):
raise DeveloperError("actions per version have to be list or tuple")
for action in v:
if action[0] not in valid_ops:
raise DeveloperError("Your _serialize_interpolation_map contains invalid operations. "
"Valid ops are: {valid_ops}. You provided {provided}"
.format(valid_ops=valid_ops, provided=action[0]))
self._serialize_interpolation_map = inter_map
def __interpolate(self, state):
// Lookup attributes in interpolation map according to version number of the class.


---
title: "EGM 2020"
author: Tudor Finaru
---
CompSoc will be electing new positions in the next EGM (23rd October 2020 at 6PM BST). The positions available are as follows:
- 1st Year Representative:
- Responsible for communication between the Inf1 cohort and the society, and promotes events to the year.
- General involvement with organising society events. One may also choose to get involved with any sub-committees such as InfBall, Hack the Burgh, and more.
- Treasurer:
- Accountable to the committee and members for the finances of the society
- Reimburses society members for expenses
- Writing annual financial report
Running for a position?
- Send<EMAIL_ADDRESS>your manifesto (PDF of max 200 words) by the end of Wednesday 21st October 2020
- Prepare a 1 minute long speech. Record yourself delivering the speech and send it to<EMAIL_ADDRESS>by the same date and time(We are looking for 1-2 minute video clips, 720 or 1080p).
There will also be votes for any proposed constitutional amendments.
CompSoc <3 You


(Route : Settings Menu, Install Addons Command)
The Addons dialog box shows the Ameol addon programs that you currently have installed.
This is a Hot Spot image. Move your mouse pointer over the image
and when the mouse pointer changes to the shape of a hand click
the left mouse button once for extra help.
You can also add new addon programs by clicking the Add button, remove the highlighted addon by clicking the Remove button and see information about the highlighted addon by clicking the Info button.


maps package¶
Overview¶
Imagine the diffculty in driving in a new city without the help of a maps service on your phone or car. Even for experienced cab drivers, it is often diffcult to navigate through city traffic, so let us not even discuss the plight of rookie drivers. It is easy to understand that modeling maps is central to the effectiveness of any simulation software. Self-driving start-ups are investing heavily in developing HD maps that explain the fine details of the environment around the vehicle. Putting it simply, the more realistic the maps look, the better the software.
Similarly, modeling maps is central to the effectiveness of CATS. The most important requirements/features of maps are:
- Maps should represent an urban traffic scenario, along with the landscape of the city
- Maps require a detailed modeling of roads, intersections, lanes, etc
- Maps should encode the topological connections between roads, for routing
- Specific to CATS, maps also store the spatial details of all the vehicles in the simulation.
maps.map module¶
-
class
core.lib.maps.map.
Intersection
(point_x, point_y, osmid=None, traffic_controller=None)¶ Characterizes a traffic junction.
Note
An intersection contains multiple Nodes which are the end points of the roads leading up to the intersection. An intersection is initialized with 0 Nodes. Nodes are added later while initializing a map using add_node method. The present implementation assumes the following.
- Fixed number of nodes. Currently only support a ‘+’ kind of intersection (a four way junction)
- Intersections are axis aligned.
-
__x
¶ float – x coordinate
-
__y
¶ float – y coordinate
-
__grade
¶ float – altitude
-
__osmid
¶ int – unique identifier of the Intersection
-
__traffic_controller
¶ object – TrafficController on the Intersection
-
__nodes
¶ list – list of Node objects
Todo
- Extend to dynamically create an intersection with variable number of roads coming in (different shapes)
-
add_node
(node)¶ Adds node object to an Intersection instance.
Parameters: node (object) – node object
-
get_grade
()¶ Getter method for __grade attribute.
-
get_nodes
()¶ Getter method for __nodes attribute.
-
get_osmid
()¶ Getter method for __osmid attribute.
-
get_x
()¶ Getter method for __x attribute.
-
get_y
()¶ Getter method for __y attribute.
-
class
core.lib.maps.map.
Lane
(lane_no, road, lane_polygon, lane_center, speed_limit=None, _type=None)¶ Characterizes a lane that is a part of a Road.
Note
- Current Implementation (to be deprecated): Provides the bare minimum information such as lane_center (used to calculated distance from lane center), lane_no, speed_limit etc. Has no particularly important role other than the attributes defined.
- Future Implementation (under development): The vehicles are store on the lanes. If a vehicle changes a lane, a method on lanes is called to update the vehicles on the source lane and the destination lane. The vehicles on a lane are stored in a linked list in decreasing order of distance from the end of the road.
-
__vehicles
¶ list – list of vehicle objects
-
__lane_no
¶ int – lane_no is calculated from 0 (center of road, i.e. left most lane)
-
__lane_type
¶ str – type of lane (turn only etc)
-
__road
¶ object – Road of which the lane is a part of
-
__lane_polygon
¶ object – Shapely bounding polygon of the lane
-
__lane_center
¶ object – Shapely LineString object of the lane_center
-
__speed_limit
¶ float – speed limit of the road
-
__name
¶ str – name oft he lane
-
__start_x
¶ float – x coordinate of the start of the lane center
-
__start_y
¶ float – y coordinate of the start of the lane center
-
__end_x
¶ float – x coordinate of the end of the lane center
-
__end_y
¶ float – y coordinate of the end of the lane center
-
remove_vehicle
(vehicle)¶ Note
Not used currently. To be used in the future
Parameters: vehicle (object) – Vehicle that needs to be removed from the lane Raises: ValueError
– Vehicle not found in the lane
-
class
core.lib.maps.map.
Node
(point_x, point_y, incoming, _id=None, parent=None, traffic_signal=None)¶ Class determining the data structure of a Node (end points of a Road).
Note
This class is similar to a (class) SubNode, except that (class) Node is an endpoint of a (class) Road and usually is a bound to (class) Intersection.
-
__x
¶ float – x coordinate
-
__y
¶ float – y coordinate
-
__grade
¶ float – altitude
-
__parent
¶ class – Intersection of which the node is a part of
-
__id
¶ int – identifier of the Node
-
__traffic_signals
¶ object – Traffic Signal on the node (if any)
-
__incoming
¶ bool – If the Node ends at an intersection (it is incoming into the intersection)
-
id
¶ Getter method for __id attribute.
-
parent
¶ Getter method for __parent attribute.
-
traffic_signals
¶ Getter method for __traffic_signals attribute.
-
x
¶ Getter method for __x attribute.
-
y
¶ Getter method for __y attribute.
-
-
class
core.lib.maps.map.
Road
(start_node, end_node, line_string, _type='straight', no_of_lanes=3, name=None, osmid=None, lane_width=5, speed_limit=40)¶ Characterizes the Road in a TrafficGraph.
The Road is determined by a start node, an end node, a RoadString (for the curvature/ linestring). It has attributes like speed limit, number of lanes etc that are specified while constructing the Road, and attributes like width, polygons that are calculated.
Note
There are two types of roads:
- Normal road that connects two nodes (which are on two different intersections),
- Turn road that connects two nodes within the same intersection.
They are simulated on a micro scale within an intersection (traffic junction which is usually at least 20 meters in diameter). By considering two types of roads, there are several edge cases on the vehicle class that need to be taken care of when trying to update the state of the vehicle. Also, the current implementation is only for a plus shaped intersection, but when there are various types of intersections, care must be taken in assigning the turn roads.
-
__start_node
¶ object – start_node
-
__end_node
¶ object – end_node
-
__type
¶ str – _type
-
__speed_limit
¶ float – speed limit of the road
-
__line_string
¶ object – Shapely LineString of the center of the road
-
__name
¶ str – name of the road
-
__osmid
¶ int – unique identifier of the Road
-
__no_of_lanes
¶ int – no_of_lanes
-
__lane_width
¶ float – lane_width
-
__left_line_string
¶ object – Shapely LineString of the left edge of the road.
-
__left_line_string_x
¶ list ? – x coords of the left LineSting
-
__left_line_string_y
¶ list ? – y coords of the left LineString
-
__road_string
¶ object – RoadString that determines the curvature, heading of the road
-
__length
¶ float – length of the road (measured along the line string)
-
__width
¶ float – no_of_lanes* lane_width
-
__lanes
¶ list – list of the Lanes on the Road
-
__heading
¶ list – list of the headings across difference segments in the RoadString
-
__traffic_count
¶ int – number of vehicles on the road
-
__traffic_trace
¶ dict – history of traffic attributes on the road
-
__lane_wise_traffic
¶ dict – traffic attributes
-
__total_traffic
¶ dict – traffic attributes
-
__time
¶ float – estimated travel time along a road (determined by the speed limit)
-
__avg_time
¶ float – estimated travel time along a road (average of the time taken by the traffic on that road)
-
__val
¶ int
-
__min_bounding_box
¶ object – Shapely Polygon of the axis aligned polygon of the Road
-
__bounding_polygon
¶ object – Shapely Polygon of the Road (the actual polygon, which fits the edges)
-
bounding_polygon
¶ It is a Shapely.Polygon object that defines the bounds of the road.
Note
The current implementation only considers straight roads (roads which are not curved). Future implementations must modify this method to take the curvature/turns into consideration. Note that the return type also changes when curved roads are considered.
Returns: a list of the points of the polygon Return type: list
-
get_distance_from_road_center
(x, y)¶ Calculates the distance from the center of the road using the __line_string.
Parameters: - x (float) – x coordinate
- y (float) – y coordinate
Returns: distance from the center of the Road
Return type: float
-
get_lane
(x, y, segment=0)¶ Calculates the lane number of the vehicle by taking its coordinates (x,y). The distance from the left edge of the road is calculated and divided by the lane width to find the lane number.
Note
When curved roads are implemented in the future, this method does not have to change much. If the __left_line_string attribute is modified for curved roads, this method only needs to use the segment number and calculate the distance (by using the line string in that segment).
Parameters: - x (float) – x coordinate of the vehicle
- y (float) – y coordinate of the vehicle
- segment (int) – optional (for now, until this method is updated for curved roads)
Returns: lane number calculated
Return type: int
-
reset_traffic
()¶ Assigns the traffic attributes to the class Attributes at the end of the time interval and resets the traffic attributes.
Note
Future research may include a time series data of the traffic attributes.
-
update_traffic_from_vehicle_data
(velocity)¶ Does the job of a loop detector by updating the attributes of the traffic, like number of vehicles, average velocity etc. This update is done one vehicle at a time. Each vehicle, after updating its states, calls this method to update the attributes of the road on which it is travelling.
Parameters: velocity (float) – velocity of the vehicle calling this method
-
class
core.lib.maps.map.
RoadString
(line_string)¶ Encapsulates all the information about the road.
-
__sub_nodes
¶ list – list of SubNode objects at points on the linestring
-
__no_sub_nodes
¶ int – number of subnodes in the linestring
-
__segment_headings
¶ list – list of heading angle from one SubNode on the line string to the next SubNode
-
__perpendicular_segments
¶ list – list of lines perpendicular to the line joining two adjacent SubNodes
-
__length_segments
¶ list – list of lengths of segments joining two adjacent SubNodes
-
static
get_perpendicular_segment
(theta1, theta2, point)¶ Calculates equation of a line passing through a point with slope as an average of two slopes.
Parameters: - theta1 (float) – angle in radians
- theta2 (float) – angle in radians
- point (tuple) – (x,y) coordinates of the point
Returns: (1, -slope, -intercept) where the equation of line is
y + slope * x + intercept = 0
Return type: tuple
-
line_string
¶ Getter method for __line_string attribute.
-
no_sub_nodes
¶ Getter method for __no_sub_nodes attribute.
-
perpendicular_segments
¶ Getter method for __perpendicular_segments attribute.
-
segment_headings
¶ Getter method for __segment_headings attribute.
-
segment_lengths
¶ Getter method for __length_segments attribute.
-
set_attributes
(line_string)¶ Calculates all the information of the road from the given line string.
Parameters: line_string (shapely LineString) – of the road
-
subnodes
¶ Getter method for __sub_nodes attribute.
-
-
class
core.lib.maps.map.
SubNode
(point_x, point_y)¶ Characterizes points of a line string along a curved road.
-
__x
¶ float – x coordinate
-
__y
¶ float – y coordinate
-
get_grade
()¶ Getter method for __grade attribute.
-
set_grade
(g)¶ Sets the value of __grade attribute.
Parameters: g (float) – value of __grade attribute
-
set_x
(x)¶ Sets the value of __x attribute.
Parameters: x (float) – value of __x attribute
-
set_y
(y)¶ Sets the value of __y attribute.
Parameters: y (float) – value of __y attribute
-
x
¶ Getter method for __x attribute.
-
y
¶ Getter method for __y attribute.
-
-
class
core.lib.maps.map.
TrafficGraph
(simulation)¶ Comprises of and defines the topological connections between the other classes defined in map module.
TrafficGraph defines the landscape, the connections between roads, and everything related to the map used in the simulation. TrafficGraph currently uses a graph data structure to store the topological connections, and an rtree data structure to store the spatial information related to the static objects (nodes, intersections, roads) and mobile objects (such as the vehicles).
-
__graph
¶ object – a networkx graph object
-
_simulation
¶ object – simulation object that uses the trafficgraph
-
__intersections_table
¶ dict – a dictionary of the intersections defined in the trafficgraph
-
__intersections_count
¶ int – len of the __intersections_table
-
__sources
¶ list – list of the nodes in the graph that have 0 incoming edges
-
__sinks
¶ list – list of the nodes in the graph that have 0 outgoing edges
-
__nodes_count
¶ int – number of nodes in the graph
-
__roads_count
¶ int
-
__roads_table
¶ dict()
-
__roads_tree
¶ index.Index()
-
__roads_tree.
interleaved
¶ True
-
__vehicles_count
¶ 0
-
__vehicles_table
¶ {}
-
__vehicles_tree
¶ index.Index()
-
__vehicles_tree.
interleaved
¶ True
-
add_vehicle
(vehicle)¶ Takes a vehicle object and adds it to the traffic graph.
Parameters: vehicle (object) – vehicle object to be added (not the id)
-
create_sample_network
()¶ Creates a default network (or chooses from among a set of default networks).
Note
Must include a GUI support to enable a user to create a network on the fly by dragging and dropping
-
get_all_nodes
(objects=True)¶ Returns all the nodes stored in the graph.
Parameters: objects (bool) – If objects are yielded or object ids Yields: object – Nodes in the graph
-
get_all_vehicles
()¶ Returns a list of all the vehicle objects.
Returns: a list of all the vehicle objects Return type: list
-
get_edge_attributes
(edge)¶ Returns a Road object.
Parameters: edge (tuple) – [start node id, end node id] Returns: Road object Return type: object
-
get_edges
()¶ Returns a EdgeView containing edge. For attributes call getEdgeAttr(edge)
Returns: a list of edge objects Return type: list
-
get_incoming_edges
(node)¶ Returns a list of edges that come into the give node.
Parameters: node (int) – id of the node Returns: list of edges (which is a tuple of nodes) that come into the given node Return type: list
-
get_nearest_nodes
(bounding_box, number, generator=True, objects=False)¶ Returns the give number of nodes closest to a bounding box.
Parameters: - bounding_box (tuple) – axis aligned bounding box coordinates (xmin, ymin, xmax, ymax)
- number (int) – number of required nodes
- generator (bool) – If the output should be a generator
- objects (bool) – If the output should be node ids or objects
Returns: (or generator) of the given number of nodes closest to a bounding box ordered by distance
Return type: list
References
-
get_nearest_vehicles
(bounding_box, number, generator=True, objects=False)¶ Returns the vehicles in a given axis aligned bounding box.
Parameters: - bounding_box (tuple) – axis aligned bounding box coordinates (xmin, ymin, xmax, ymax)
- number (int) – number of required vehicles
- generator (bool) – If the output should be a generator
- objects (bool) – If the output should be vehicle ids or objects
Returns: (or generator) of the given number of vehicles closest to a bounding box ordered by distance
Return type: list
References
-
get_node_attribute
(node)¶ Returns a node object given an id.
Parameters: node (int) – id of the node Returns: Node object Return type: object
-
get_nodes_by_bounding_box
(bounding_box, generator=True, objects=False)¶ Returns the nodes in a given axis aligned bounding box.
Parameters: - bounding_box (tuple) – axis aligned bounding box coordinates (xmin, ymin, xmax, ymax)
- generator (bool) – If the output should be a generator
- objects (bool) – If the output should be node ids or objects
Returns: (or generator) of the nodes closest to a bounding box ordered by distance
Return type: list
References
-
get_out_edges
(node)¶ Returns a list of edges that come out of the given node.
Parameters: node (int) – id of the node Returns: list of edges (which is a tuple of nodes) that come out of the given node Return type: list
-
get_road
(edge)¶ Returns Road object on the given edge.
Parameters: edge (tuple) – [start node id, end node id] Returns: Road object Return type: object
-
get_roads
()¶ Returns a list of Road objects.
Returns: [start node id, end node id, road object] Return type: list
-
get_shortest_path
(source, destination, weight='distance')¶ Returns the shortest path from source to destination.
Parameters: - source (int) – source node id
- destination (int) – destination node id
- weight (str) – parameters based on which the cost is calculated
Returns: a list of the node ids along the shortest path from the source to the destination
Return type: list
-
get_sinks
()¶ Returns: a list of Node objects with zero outgoing edges Return type: list
-
get_sources
()¶ Returns: a list of Node objects with 0 incoming edges Return type: list
-
get_vehicle
(vehicle_id)¶ Returns the vehicle object with the given id in the __vehicles_table.
Parameters: vehicle_id (int) – vehicle id to be retrieved Returns: Vehicle object with the given vehicle_id Return type: object
-
get_vehicles
()¶ Yields the vehicle object from the __vehicles_table.
Yields: object – Vehicle object
-
get_vehicles_by_bounding_box
(bounding_box, generator=False, objects=False)¶ Returns the vehicles in a given axis aligned bounding box.
Parameters: - bounding_box (tuple) – axis aligned bounding box coordinates (xmin, ymin, xmax, ymax)
- generator (bool) – If the output should be a generator
- objects (bool) – If the output should be vehicle ids or objects
Returns: (or generator) of the given number of vehicles closest to a bounding box ordered by distance
Return type: list
References
-
remove_vehicle
(vehicle)¶ Removes the given vehicle id from the __vehicles_table.
Parameters: vehicle (int) – vehicle id to be deleted
-
update_road_attributes
(road)¶ Updates the Road object.
Parameters: road (list) – [start_node_id, end_node_id, road_object] Returns: estimated average time to travel on the road Return type: float
-
update_vehicle_network
()¶ Deletes the rtree and re initializes it using the self.vehicle_generator() method using bulk upload. This method of bulk upload of all the vehicles at the end of a time interval is preferred as compared to updating it after each vehicle’s update.
-
vehicle_generator
()¶ Yields: tuple – (id, (x,y,x,y)) id of vehicle and coordinates of vehicle
-
-
core.lib.maps.map.
add_intersections_to_graph
(graph, intersections_table)¶ Iterates over the intersections and adds nodes to the graph, and create edges (Roads) from nodes that are connected. This piece of code assumes the simple plus shaped intersections, and the turn_links variable is based on this assumption.
Note
Future implementations must consider various shapes of intersections and different combinations of turn roads to be added to the intersection.
Parameters: - graph (object) – Networkx graph object
- intersections_table (dict) – dict containing the intersection objects
Returns: Graph object
Return type: object
-
core.lib.maps.map.
build_sample_network
()¶ Builds a simple grid like network with + shaped intersections.
Returns: graph object, intersections table Return type: tuple
-
core.lib.maps.map.
create_plus_intersection
(point_x, point_y, counter, scale=12, traffic_controller=True)¶ Creates a + shaped intersection and instantiates nodes (in a fixed fashion).
Note
Future implementations must include methods to create arbitrary (shaped/sized) intersections.
Parameters: - point_x (float) – x coordinate
- point_y (float) – y coordinate
- counter (int) – used to number the nodes (node ids)
- scale (int) – scaling factor of the coordinates (since the nodes are placed here wrt distance from intersection)
- traffic_controller (object) – traffic controller on the intersection
Returns: Intersection object, and counter number (used to sync the node ids on the graph)
Return type: tuple
-
core.lib.maps.map.
get_grade
(x, y)¶ Determines the landscape of the region under the map.
This method is determined by a smooth function, and returns the function value evaluated at the input location. The function must have subtle variations in the grade with relative changes in x and y. This function is now external to the map, but later it can be integrated into the TrafficGraph class.
Parameters: - x (float) – x coordinate
- y (float) – y coordinate
Returns: grade of the (x,y) coordinate
Return type: float
Todo
- Determine a 2-D function which maps to the grade (altitude) of a given point.
-
core.lib.maps.map.
polygon_from_linestring
(linestring, width_from_center)¶ Generates a polygon object around the given line string with the given width from center.
Parameters: - linestring (object) – Shapely LineString object
- width_from_center (float) – distance from the center to either sides (Edges) of the polygon
Returns: Shapely Polygon object
Return type: object