Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs, connect to travis CI, pyPI and readthedocs #13

Merged
merged 55 commits into from
May 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
d381476
Updated tab replacement: now follows description in MCNP5 manual -- t…
travleev Dec 27, 2019
7813d0b
Added flag to preserving tabs, --preservetabs. Note that this option …
travleev Dec 29, 2019
01570d2
Documentation with mkdocs
travleev Jan 1, 2020
32b9526
Specify custom place for mkdocs.yml
travleev Jan 1, 2020
f179c28
Changed folder names for docs to comply with readthedocs
travleev Jan 1, 2020
b1077ea
update readthedocs config
travleev Jan 1, 2020
10b9583
Format limitations
travleev Jan 1, 2020
daa69ad
Interprete map entries in cdens as multiplication coeffs
travleev Jan 1, 2020
0c25614
Merge pull request #1 from inr-kit/master
travleev Jan 1, 2020
3c8ab44
Added link to github repo
travleev Jan 2, 2020
50dd906
Added link to documentation sources on github
travleev Jan 2, 2020
d486c15
show that there are more modes
travleev Jan 2, 2020
65137cc
Update index.md
travleev Jan 2, 2020
42a103b
Update renum.md
travleev Jan 3, 2020
e7c3a8b
Added complete list of modes
travleev Jan 8, 2020
295b81a
Ensure Python 2.7
travleev Jan 8, 2020
dfae9fe
Merge pull request #2 from inr-kit/master
travleev Jan 9, 2020
11213c6
Update cdens.md
travleev Jan 9, 2020
22e76a8
Added TOC
travleev Jan 9, 2020
9f57cb2
Merge branch 'docs' of github.com:travleev/numjuggler into docs
travleev Jan 9, 2020
0c202e3
Update index.md
travleev Jan 9, 2020
7f1dd1e
Framework for travis CI
travleev Jan 9, 2020
d478058
Merge branch 'travis' of github.com:travleev/numjuggler into travis
travleev Jan 9, 2020
c5ac07c
Fixed custom folder errro
travleev Jan 9, 2020
20c6d7e
Path to travis script
travleev Jan 9, 2020
2a75d01
Merge branch 'master' into docs
travleev Jan 10, 2020
182cfb1
Merge branch 'optional-tab'
travleev Jan 10, 2020
d63df73
Add subfolders in travis_tests for each mode
travleev Jan 10, 2020
91fb534
Put test files for renum to correspondent folder
travleev Jan 10, 2020
4c305a0
Fixed inr-kit/numjuggler#12, example provided by @Radiation-Transport…
travleev Jan 10, 2020
1b86181
Add travis status icon
travleev Jan 10, 2020
f88c222
Comment out information that should be in numjuggler.readthedocs.io
travleev Jan 10, 2020
706031f
Note about --debug option
travleev Jan 12, 2020
ab405f7
Note about --map
travleev Jan 12, 2020
550bac7
Added travis-CI icon
travleev Jan 12, 2020
2921d40
Update index.md
travleev Jan 13, 2020
7e2e366
Files necessary to use setuptools_scm for versioning
travleev Jan 26, 2020
976d01a
Old source for version number is removed
travleev Jan 26, 2020
8d0fa37
Fixed classifier name
travleev Jan 26, 2020
ce6176d
Add link to PyPI
travleev Jan 26, 2020
4ab9f19
link to numjuggler.docs
travleev Jan 26, 2020
82eade2
Pass README.md to PyPI
travleev Jan 26, 2020
686a749
the url appears on PyPI as Homepage. Should link to description.
travleev Jan 26, 2020
ef18b39
Badge for PyPI
travleev Jan 28, 2020
0e94858
Readthedocs badge
travleev Jan 28, 2020
4254874
Merge branch 'docs' of github.com:travleev/numjuggler into docs
travleev Jan 28, 2020
e8a67fc
Merge branch 'master' into docs
travleev Jan 28, 2020
993cbca
fix bug with apmersand after the dollar-sign
travleev Feb 9, 2020
8b64206
bug in nofill: now the space efore the opening ( is optional
travleev Feb 9, 2020
f02cc82
Additional output in matinfo mode
travleev Mar 24, 2020
be782d2
Specified dependencies
travleev Mar 24, 2020
549565c
Test cases for cdens mode
travleev Mar 29, 2020
0d1e094
Range string normalization is moved to proper place
travleev Mar 29, 2020
272c540
Added default rules and fixed issue5
travleev Mar 29, 2020
9a37538
Added script to test cdens mode; test reference cases renamed accordi…
travleev Mar 29, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Python setup folders
build/
*.egg-info
numjuggler/version.py

# Byte-compiled
*.pyc
Expand All @@ -24,3 +25,7 @@ numjuggler.sfood2
*.log
.coverage
htmlcov/

# Travis tests
travis_tests/*.diff
travis_tests/*.res
4 changes: 4 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mkdocs:
configuration: mkdocs.yml
python:
version: 2.7
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
language: python

python:
- 2.7
- 3.7

before_install:
- python --version
- pip install -U pip

install:
- pip install .

script:
./travis_run_all.sh

37 changes: 31 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,40 @@
# WARNING
The versions starting with 2.23a.17 should be considered as untested. Since
version 2.22a.17, there were a lot of modifications toward more functionality,
however, these changes were applied only to a small set of problems and
therefore should be considered as not tested. If you experience any problems,
consider fall back to the version 2.22a.17.
# numjuggler
Tool to rename cells, surfaces, materials and universes in MCNP input files. See https://numjuggler.readthedocs.io


## Current status

[![Build Status](https://travis-ci.org/travleev/numjuggler.svg?branch=master)](https://travis-ci.org/travleev/numjuggler) -- shows status of the tests defined in [travis_tests](travis_tests) folder.

[![PyPI version](https://badge.fury.io/py/numjuggler.svg)](https://badge.fury.io/py/numjuggler) -- available from PyPI.

[![Documentation Status](https://readthedocs.org/projects/badge-demo/badge/?version=latest)](https://badge-demo.readthedocs.io/en/latest/?badge=latest) -- documentation


Information in the help message, returned by ``numjuggler -h mode`` is
outdated. Therefore, the best way to see all current modes is to search for
``args.mode == `` string in ``main.py``, and read comments in the correspondent
sections of code.

## Documentation

https://numjuggler.readthedocs.io should be considered as the main source of information.

There is also a github repo [numjuggler.docs](https://github.com/inr-kit/numjuggler.docs) containing presentations and reports related to numjuggler.

## Install
The numjuggler package is available at PyPI: https://pypi.org/project/numjuggler/. The preffered
way to install it using pip:

>pip install numjuggler

Alternatively, one can clone from github and install in so-called development mode:

>git clone [email protected]:travleev/numjuggler.git
>cd numjuggler
>pip install -e .

<!---

# numjuggler
Tool to rename cells, surfaces, materials and universes in MCNP input files. See https://numjuggler.readthedocs.io
Expand Down Expand Up @@ -54,3 +78,4 @@ instructions:

There is also a github repo, [numjuggler.docs](https://github.com/inr-kit/numjuggler.docs), related to numjuggler documentation.

--->
10 changes: 10 additions & 0 deletions dev_tests/itab.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# Will tab be printed as tab?
echo -e -"\t"- > itab.out
python -c 'print "=\t="' >> itab.out

# --preservetabs flag. The --debug flag turns off the use of dump file (which can also affect the tabs. BTW why?
numjuggler -s 10 itab_ --debug > itab_.tabsno
numjuggler -s 10 itab_ --debug --preservetabs > itab_.tabsyes

13 changes: 13 additions & 0 deletions dev_tests/itab_
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Input file with tabs
1 0 -1 imp:n=1 imp:p=1
2 0 1
imp:n=0
imp:p=0

c surfaces
1 so 10

sdef pos 0 0 0



35 changes: 35 additions & 0 deletions docs/cdens.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Description

Change cell densities according to the map file.

In the map file one can specify coefficients to multiply the original input
file densities. The coefficients can be specified for particular cells and/or
materials (or their ranges -- see descritpion of the map file format).

## Rationale

One of the approaches to get the first guess for the
weight-window mesh through the model geometry is to decrease
material densities for all cells between the source and tally region by several orders of magnitude and
perform particle transport to generate the weight-window mesh. Experience shows that the obtained weight-window mesh
applied to the original (i.e. with nominal densities) model allready helps to improve statistics.


## Invocation example

in the following example, the map file is `densities.txt`, the original input
file is `input.orig` and the new input file is written to `input.new`:

```bash
>numjuggler --mode cdens --map densities.txt input.orig > input.new
```

The content of `densities.txt`:

c 1 -- 10: 0.01 # In cells 1 to 10 multiply density by 0.01
c 12: 0.1 # Multiply cell 12 density by 0.1

m 5: 1e-3 # For all cells filled with material 5 multiply density by 1e-3



File renamed without changes.
5 changes: 5 additions & 0 deletions docs/forjekyll/_data/navigation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- name: Home
link: /

- name: About
link: /about.html
8 changes: 8 additions & 0 deletions docs/forjekyll/_includes/navigation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<nav>
{% for item in site.data.navigation %}
<a href="{{item.link}}" {% if page.url == item.link %}class="current"{% endif %}>
{{item.name}}
</a>
{% endfor %}
</nav>

13 changes: 13 additions & 0 deletions docs/forjekyll/_layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title> {{ page.title }} </title>
<link rel="stylesheet" href="assets/css/styles.css">
</head>

<body>
{% include navigation.html %}
{{content}}
</body>
</html>
3 changes: 3 additions & 0 deletions docs/forjekyll/_sass/main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.current {
color: green;
}
28 changes: 28 additions & 0 deletions docs/forjekyll/_site/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title> About </title>
<link rel="stylesheet" href="assets/css/styles.css">
</head>

<body>
<nav>

<a href="/" >
Home
</a>

<a href="/about.html" class="current">
About
</a>

</nav>


<h1 id="about-page">About page</h1>
<p>Numjuggler is a command line tool to perform specific tasks on the MCNP input files.</p>


</body>
</html>
3 changes: 3 additions & 0 deletions docs/forjekyll/_site/assets/css/styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions docs/forjekyll/_site/assets/css/styles.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions docs/forjekyll/_site/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title> Numjuggler documentation </title>
<link rel="stylesheet" href="assets/css/styles.css">
</head>

<body>
<nav>

<a href="/" class="current">
Home
</a>

<a href="/about.html" >
About
</a>

</nav>


<h1>Hello World 2!</h1>

</body>
</html>
4 changes: 4 additions & 0 deletions docs/forjekyll/_site/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Numjuggler documentation

## Available execution modes

53 changes: 53 additions & 0 deletions docs/forjekyll/_site/note.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Organisation of documentation
==================================

Approach: put the source of documentation in md, and get text messages for
interactive help by converting md to txt. The md can be directly published with
the help of gh-pages. Usage statistics can be collected with e.g. google
analytics.

Task: Organize minimal structure with md files that can be used for publishing
and where information is read for interactive help.


How the command line arguments of numjugller should look like?
=====================================================================================================

I want that each mode has its own set of command line options. General help
should provide the general form of the command line args. And there should be
a way to get particular info about each execution mode. For example::

>numjuggler
>numjuggler -h
>numjuggler --help

# General info,
# general commad line form,
# the list of available modes,
# how to get additional info


>numjuggler -h <mode>
>numjuggler -h <mode> -i

# Synopsis of the <mode>: short description and the list of available
# command line options. How to get additional info.


>numjuggler -h <mode> -e
# Examples for <mode>.


>numjuggler -h <mode> -a
# Detailed description of the arguments

>numjuggler -h <mode> -iea
# Complete information about <mode>. The order of information does not
# depend on the order of command line options, only itspresence.

Usual invocation of numjuggler assumes particular execution mode. Previously,
there was the default mode, assumed if no ``--mode`` was given. This behaviour
should be preserved and one should understand how to distinguish between
the actual execution and asking for help. In the above examples, the command
line arguments always start with the ``-h`` or ``--help`` flag.

8 changes: 8 additions & 0 deletions docs/forjekyll/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
layout: default
title: About
---

# About page
Numjuggler is a command line tool to perform specific tasks on the MCNP input files.

4 changes: 4 additions & 0 deletions docs/forjekyll/assets/css/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
---
@import "main";

7 changes: 7 additions & 0 deletions docs/forjekyll/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
layout: default
title: Numjuggler documentation
---


<h1>Hello World 2!</h1>
4 changes: 4 additions & 0 deletions docs/forjekyll/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Numjuggler documentation

## Available execution modes

Loading