Skip to content

Commit

Permalink
Merge branch 'main' of github.com:LMFDB/lmfdb into psycodict
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarcosta committed May 7, 2024
2 parents a730663 + b502ffd commit d483dbd
Show file tree
Hide file tree
Showing 168 changed files with 5,588 additions and 1,991 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/autopep8.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Format python code
on:
push:
branches: [ 'master' ]
branches: [ 'main' ]
jobs:
autopep8:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate-matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"lmfdb/tests/test_dynamic_knowls.py lmfdb/tests/test_root.py lmfdb/hecke_algebras/test_hecke_algebras.py lmfdb/tests/test_homepage.py lmfdb/elliptic_curves/test_ell_curves.py lmfdb/elliptic_curves/test_browse_page.py",
"lmfdb/sato_tate_groups/test_st.py lmfdb/hilbert_modular_forms/test_hmf.py lmfdb/tests/test_spelling.py lmfdb/tests/test_template_namespace.py lmfdb/tests/test_acknowlegments.py lmfdb/tests/test_tensor_products.py",
"lmfdb/cluster_pictures/test_clusterpicture.py lmfdb/local_fields/test_localfields.py lmfdb/ecnf/test_ecnf.py lmfdb/ecnf/test_isog_class.py lmfdb/api/test_api.py lmfdb/characters/test_characters.py",
"lmfdb/users/test_users.py lmfdb/lattice/test_lattice.py lmfdb/maass_forms/test_maass.py lmfdb/higher_genus_w_automorphisms/test_hgcwa.py lmfdb/belyi/test_belyi.py lmfdb/tests/test_utils.py",
"lmfdb/users/test_users.py lmfdb/lattice/test_lattice.py lmfdb/maass_forms/test_maass.py lmfdb/higher_genus_w_automorphisms/test_hgcwa.py lmfdb/belyi/test_belyi.py lmfdb/hypergm/test_hgm.py lmfdb/tests/test_utils.py",
"lmfdb/artin_representations/test_artin_representation.py lmfdb/genus2_curves/test_genus2_curves.py",
"lmfdb/classical_modular_forms/test_cmf.py lmfdb/classical_modular_forms/test_cmf2.py",
"lmfdb/lfunctions/test_lfunctions.py",
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/matrix_includes.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@
"server": "devmirror"
},
{
"files": "lmfdb/users/test_users.py lmfdb/lattice/test_lattice.py lmfdb/maass_forms/test_maass.py lmfdb/higher_genus_w_automorphisms/test_hgcwa.py lmfdb/belyi/test_belyi.py lmfdb/tests/test_utils.py",
"folders": "belyi higher_genus_w_automorphisms lattice maass_forms tests users",
"files": "lmfdb/users/test_users.py lmfdb/lattice/test_lattice.py lmfdb/maass_forms/test_maass.py lmfdb/higher_genus_w_automorphisms/test_hgcwa.py lmfdb/belyi/test_belyi.py lmfdb/hypergm/test_hgm.py lmfdb/tests/test_utils.py",
"folders": "belyi higher_genus_w_automorphisms hypergm lattice maass_forms tests users",
"server": "proddb"
},
{
"files": "lmfdb/users/test_users.py lmfdb/lattice/test_lattice.py lmfdb/maass_forms/test_maass.py lmfdb/higher_genus_w_automorphisms/test_hgcwa.py lmfdb/belyi/test_belyi.py lmfdb/tests/test_utils.py",
"folders": "belyi higher_genus_w_automorphisms lattice maass_forms tests users",
"files": "lmfdb/users/test_users.py lmfdb/lattice/test_lattice.py lmfdb/maass_forms/test_maass.py lmfdb/higher_genus_w_automorphisms/test_hgcwa.py lmfdb/belyi/test_belyi.py lmfdb/hypergm/test_hgm.py lmfdb/tests/test_utils.py",
"folders": "belyi higher_genus_w_automorphisms hypergm lattice maass_forms tests users",
"server": "devmirror"
},
{
Expand Down Expand Up @@ -104,11 +104,6 @@
"folders": "groups/abstract",
"server": "devmirror"
},
{
"files": "lmfdb/modular_curves/test_modular_curves.py",
"folders": "modular_curves",
"server": "proddb"
},
{
"files": "lmfdb/modular_curves/test_modular_curves.py",
"folders": "modular_curves",
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ '**' ]
pull_request:
branches: [ master, dev, web ]
branches: [ main, dev, web ]

jobs:
matrix_prep:
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
- name: checking that we didn't miss any test files
shell: bash -l {0}
# If this fails you need to update the file list above and file count
run: test $(find lmfdb -name 'test_*.py' -or -name '*_test.py' | wc -l) -eq 40
run: test $(find lmfdb -name 'test_*.py' -or -name '*_test.py' | wc -l) -eq 41

- name: Config LMFDB to run tests against proddb
if: matrix.files != 'lint' && matrix.server == 'proddb'
Expand Down
6 changes: 3 additions & 3 deletions Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Setup
=====

To set up your system for development see [Code development and sharing your
work](https://github.com/LMFDB/lmfdb/blob/master/GettingStarted.md#running).
work](https://github.com/LMFDB/lmfdb/blob/main/GettingStarted.md#running).


Adding material to the LMFDB
Expand All @@ -40,7 +40,7 @@ Structural Conventions
Below, we describe several of the structural conventions used in the LMFDB. Note
that we also have styling conventions for the content of individual pages. These
styling conventions are described in
[StyleSheet.md](https://github.com/LMFDB/lmfdb/blob/master/StyleSheet.md).
[StyleSheet.md](https://github.com/LMFDB/lmfdb/blob/main/StyleSheet.md).

Pages in the LMFDB
------------------
Expand Down Expand Up @@ -343,7 +343,7 @@ who are mainly involved in coding this particular python file. In practice,
Testing
-------

- Any contribution to the master LMFDB branch must *pass all the tests*. From the lmfdb folder:
- Any contribution to the main LMFDB branch must *pass all the tests*. From the lmfdb folder:
```
./test.sh
```
Expand Down
34 changes: 17 additions & 17 deletions GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Installation
============

* To develop and contribute new code, see below on
[Sharing Your Work](https://github.com/LMFDB/lmfdb/blob/master/GettingStarted.md#code-development-and-sharing-your-work).
[Sharing Your Work](https://github.com/LMFDB/lmfdb/blob/main/GettingStarted.md#code-development-and-sharing-your-work).
If you **only** want to run a copy of the site, move into a new directory and
type

Expand Down Expand Up @@ -210,17 +210,17 @@ Code development and sharing your work
git remote add upstream git@github.com:LMFDB/lmfdb.git
```
* To run LMFDB, go through the rest of the instructions in
[Installation](https://github.com/LMFDB/lmfdb/blob/master/GettingStarted.md#installation) and
[Running](https://github.com/LMFDB/lmfdb/blob/master/GettingStarted.md#running).
[Installation](https://github.com/LMFDB/lmfdb/blob/main/GettingStarted.md#installation) and
[Running](https://github.com/LMFDB/lmfdb/blob/main/GettingStarted.md#running).
* You should make a new branch if you want to work on a new feature.
The following command creates a new branch named `new_feature` and
switches to that branch, after first switching to the master branch
switches to that branch, after first switching to the main branch
and making sure that it is up-to-date:
```
git checkout master
git pull upstream master
git checkout main
git pull upstream main
git checkout -b new_feature
```
Expand All @@ -237,42 +237,42 @@ Code development and sharing your work
* You should make sure from time to time that you pull the latest
changes from the official LMFDB repository. There are three
branches upstream to be aware of: `web`, `dev` and `master`:
branches upstream to be aware of: `web`, `dev` and `main`:
- `web` is changed rarely and contains the code currently running at
[www.lmfdb.org](www.lmfdb.org)
- `dev` is changed more often and contains the code currently running at
[beta.lmfdb.org](beta.lmfdb.org)
- `master` is the development branch.
- `main` is the development branch.
Normal developers only need to be aware of the master
Normal developers only need to be aware of the main
(=development) branch.
* To pull in the most recent changes there to your own master
* To pull in the most recent changes there to your own main
branch locally and update your github repository too:
```
git checkout master
git pull upstream master
git push origin master
git checkout main
git pull upstream main
git push origin main
```
* To rebase your current working branch on the latest master:
* To rebase your current working branch on the latest main:
```
git pull --rebase upstream master
git pull --rebase upstream main
```
* Tell the [lmdb mailing list](https://groups.google.com/forum/#!forum/lmdb)
that you have some new code!
You should also issue a pull request at github
(from your feature branch `new_feature`) at the same time. Make
sure that your pull request is to the lmfdb `master` branch,
sure that your pull request is to the lmfdb `main` branch,
whatever your own development or feature branch is called.
Others will review your code, and release managers will
(eventually, if all is well) merge it into the master branch.
(eventually, if all is well) merge it into the main branch.
LMFDB On Windows
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Wiki
Development
-----------

* [Getting Started](https://github.com/LMFDB/lmfdb/blob/master/GettingStarted.md) -- cheat sheet for setting up lmfdb
* [Development Guide](https://github.com/LMFDB/lmfdb/blob/master/Development.md) -- organizing development
* [Style Guide](https://github.com/LMFDB/lmfdb/blob/master/StyleGuide.md) -- how things on LMFDB pages should be styled to give the web site a coherent look
* [Getting Started](https://github.com/LMFDB/lmfdb/blob/main/GettingStarted.md) -- cheat sheet for setting up lmfdb
* [Development Guide](https://github.com/LMFDB/lmfdb/blob/main/Development.md) -- organizing development
* [Style Guide](https://github.com/LMFDB/lmfdb/blob/main/StyleGuide.md) -- how things on LMFDB pages should be styled to give the web site a coherent look

Guidelines
----------
Expand Down Expand Up @@ -42,5 +42,5 @@ in a browser without scrolling the browse-and-search page.
of both experts and non-experts in the subject, in order to ensure
that the pages are useful to a broad mathematical audience.

[logo]: https://github.com/LMFDB/lmfdb/raw/master/lmfdb/static/images/lmfdb-logo.png "LMFDB"
[logo]: https://github.com/LMFDB/lmfdb/raw/main/lmfdb/static/images/lmfdb-logo.png "LMFDB"

2 changes: 1 addition & 1 deletion StyleGuide.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Style guide

Below, we describe several styling conventions for the LMFDB. See also the
[Developer's Guide](https://github.com/LMFDB/lmfdb/blob/master/Development.md)
[Developer's Guide](https://github.com/LMFDB/lmfdb/blob/main/Development.md)
contains other conventions and information for the development process.

## General style conventions
Expand Down
3 changes: 1 addition & 2 deletions lmfdb/abvar/fq/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ def get_bread(*breads):
("Abelian varieties", url_for(".abelian_varieties")),
("Fq", url_for(".abelian_varieties")),
]
for z in breads:
bc.append(z)
bc.extend(z for z in breads)
return bc

def learnmore_list():
Expand Down
4 changes: 2 additions & 2 deletions lmfdb/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ def mb(x):
info={}
info['minsizes'] = ['0','1','10','100','1000','10000','100000']
info['minsize'] = request.args.get('minsize','1').strip()
if not info['minsize'] in info['minsizes']:
if info['minsize'] not in info['minsizes']:
info['minsizes'] = '1'
info['groupby'] = 'db' if request.args.get('groupby','').strip().lower() == 'db' else ''
info['sortby'] = request.args.get('sortby','size').strip().lower()
if not info['sortby'] in ['size', 'objects', 'name']:
if info['sortby'] not in ['size', 'objects', 'name']:
info['sortby'] = 'size'
nobjects = size = dataSize = indexSize = 0
dbSize = defaultdict(int)
Expand Down
19 changes: 5 additions & 14 deletions lmfdb/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def git_infos():
_url_source = 'https://github.com/LMFDB/lmfdb/tree/'
_current_source = '<a href="%s%s">%s</a>' % (_url_source, git_rev, "Source")

# Creates link to the list of revisions on the master, where the most recent commit is on top.
# Creates link to the list of revisions on the main, where the most recent commit is on top.
_url_changeset = 'https://github.com/LMFDB/lmfdb/commits/%s' % branch
_latest_changeset = '<a href="%s">%s</a>' % (_url_changeset, git_date)

Expand Down Expand Up @@ -317,15 +317,9 @@ def bad_bots_list():
"The Knowledge AI",
"Wolfram",
"petalbot",
]
]


@cached_function
def very_bad_bots_list():
return [
elt.lower()
for elt in [
"Bytespider",
"Sogou",
"MJ12bot",
"Amazonbot",
]
]
Expand All @@ -334,12 +328,9 @@ def very_bad_bots_list():
@app.before_request
def badbot():
ua = request.user_agent.string.lower()
for elt in very_bad_bots_list():
if elt in ua:
return render_template("404.html", title='Too many requests'), 429
for elt in bad_bots_list():
if elt in ua:
time.sleep(10)
return render_template("404.html", title='Too many requests'), 429


def timestamp():
Expand Down
3 changes: 1 addition & 2 deletions lmfdb/artin_representations/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ def cycle_string(lis):

def get_bread(breads=[]):
bc = [("Artin representations", url_for(".index"))]
for b in breads:
bc.append(b)
bc.extend(b for b in breads)
return bc

def learnmore_list():
Expand Down
12 changes: 5 additions & 7 deletions lmfdb/artin_representations/math_classes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from lmfdb import db
from lmfdb.utils import (url_for, pol_to_html,
from lmfdb.utils import (url_for,
web_latex, coeff_to_poly, letters2num, num2letters, raw_typeset,
raw_typeset_poly, pos_int_and_factor)
from sage.all import PolynomialRing, QQ, ComplexField, exp, pi, Integer, valuation, CyclotomicField, RealField, log, I, factor, crt, euler_phi, primitive_root, mod, next_prime, PowerSeriesRing, ZZ
Expand Down Expand Up @@ -572,9 +572,10 @@ def from_conjugacy_class_index_to_polynomial(self, index):
field = ComplexField()
root_of_unity = exp((field.gen()) * 2 * field.pi() / int(self.character_field()))
local_factor_processed_pols = [0] # dummy to account for the shift in indices
for pol in local_factors:
local_factor_processed_pols.append(
process_polynomial_over_algebraic_integer(pol, field, root_of_unity))
local_factor_processed_pols.extend(
process_polynomial_over_algebraic_integer(pol, field,
root_of_unity)
for pol in local_factors)

def tmp(conjugacy_class_index_start_1):
return local_factor_processed_pols[conjugacy_class_index_start_1]
Expand Down Expand Up @@ -749,9 +750,6 @@ def polredabs(self):
def polredabslatex(self):
return self.polredabs()._latex_()

def polredabshtml(self):
return pol_to_html(self.polredabs())

def label(self):
if "label" in self._data:
return self._data["label"]
Expand Down
Loading

0 comments on commit d483dbd

Please sign in to comment.